/* ztariq.com/v2 — "through my eyes". Immersive, dependency-free. */

:root {
  --bg: #120d16;
  --bg-2: #171020;
  --ink: #f1eae2;
  --muted: #c3b7b1;
  --line: #2c2231;
  --amber: #e0a458;
  --amber-soft: #3a2a1c;
  --plum: #2a1c33;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(224, 164, 88, .10), transparent 60%),
    radial-gradient(900px 600px at 0% 30%, rgba(86, 48, 110, .35), transparent 65%),
    var(--bg);
  color: var(--ink);
  font: 18px/1.7 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--amber); text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 3px; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--bg); padding: 10px 16px; z-index: 100; }
.skip:focus { left: 0; }

.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px max(24px, calc((100vw - 760px) / 2));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.mark {
  font-family: var(--serif); font-size: 1.1rem; letter-spacing: .04em;
  color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.mark-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); display: inline-block; }
.masthead nav { display: flex; gap: 20px; }
.masthead nav a { color: var(--muted); text-decoration: none; font-size: .9rem; }
.masthead nav a:hover { color: var(--ink); }

/* ---------- chapter rail ---------- */
.rail { display: none; }
@media (min-width: 1180px) {
  .rail {
    display: block; position: fixed; left: 26px; top: 50%; transform: translateY(-50%); z-index: 30;
  }
  .rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
  .rail a {
    display: grid; grid-template-columns: 44px 1fr; align-items: baseline; gap: 10px;
    color: var(--ink); text-decoration: none; font-size: .84rem; letter-spacing: .08em;
    text-transform: uppercase; opacity: .82; transition: opacity .2s ease, color .2s ease;
    padding-left: 10px; border-left: 2px solid transparent;
  }
  .rail a span { color: var(--amber); font-size: .76rem; }
  .rail a.active { border-left-color: var(--amber); }
  .rail a:hover, .rail a.active { opacity: 1; color: var(--ink); }
}

/* ---------- hero ---------- */
.hero {
  display: block;
  padding: clamp(56px, 9vw, 120px) 0 clamp(40px, 6vw, 80px);
  max-width: 760px; margin: 0 auto; position: relative; z-index: 1;
}
.kicker {
  text-transform: uppercase; letter-spacing: .22em; font-size: .72rem; font-weight: 700;
  color: var(--amber); margin: 0 0 22px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -.015em; line-height: 1.05;
  font-size: clamp(2.5rem, 6.4vw, 4.4rem); margin: 0 0 26px; max-width: 18ch; text-wrap: balance; line-height: 1.1;
}
.hero-lead { max-width: 58ch; font-size: clamp(1.05rem, 1.9vw, 1.25rem); color: var(--ink); margin: 0 0 22px; }
.hero-meta { color: var(--muted); font-size: .95rem; letter-spacing: .02em; margin: 0 0 40px; }
.scroll-cue {
  display: inline-flex; align-items: center; gap: 12px; color: var(--amber);
  text-decoration: none; font-size: .84rem; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid rgba(224, 164, 88, .45); border-radius: 999px; padding: .7em 1.2em;
  transition: background .15s ease, border-color .15s ease;
}
.scroll-cue:hover { background: rgba(224, 164, 88, .10); border-color: var(--amber); }
.scroll-cue .cue-line { width: 18px; height: 1px; background: var(--amber); display: inline-block; }
.scroll-cue .cue-arrow { animation: drip 2.4s ease-in-out infinite; }
@keyframes drip { 0%, 100% { transform: translateY(-2px); opacity: .55; } 50% { transform: translateY(2px); opacity: 1; } }

/* ---------- chapters ---------- */
.chapter {
  position: relative; z-index: 1;
  padding: clamp(70px, 12vw, 150px) max(24px, calc((100vw - 760px) / 2));
  border-top: 1px solid var(--line);
}
.chapter-inner { position: relative; }
.year {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .18em; color: var(--amber);
  margin: 0 0 14px;
}
.chapter h2 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -.015em; line-height: 1.1;
  font-size: clamp(1.9rem, 4.2vw, 3rem); margin: 0 0 18px;
}
.lede { font-size: clamp(1.08rem, 1.8vw, 1.22rem); color: var(--ink); margin: 0 0 18px; }
.chapter p { color: var(--muted); }
.chapter p strong { color: var(--ink); }

/* the "window" — what I was looking at */
.window {
  margin: 30px 0 26px; background: linear-gradient(180deg, #1b1422, #150f1c);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .45);
}
.window-bar {
  display: flex; align-items: center; gap: 7px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: #170f1e;
}
.window-bar span { width: 9px; height: 9px; border-radius: 50%; background: #372a3f; }
.window-bar span:nth-child(1) { background: #4a2a2a; }
.window-bar span:nth-child(2) { background: #4a3d24; }
.window-bar span:nth-child(3) { background: #23402f; }
.window-bar em {
  margin-left: 8px; font-style: normal; font-family: var(--mono); font-size: .72rem; color: var(--muted);
}
.window pre {
  margin: 0; padding: 18px 20px; font-family: var(--mono); font-size: .82rem; line-height: 1.85;
  color: #cdbfc9; white-space: pre-wrap; word-break: break-word;
}
.window pre .warn { color: var(--amber); }

.did { margin: 0; padding-left: 1.15em; display: grid; gap: 8px; }
.did li { color: var(--muted); }
.did li::marker { color: var(--amber); }

/* the alert chapter reads differently on purpose */
.chapter--alert { background: linear-gradient(180deg, rgba(122, 34, 34, .10), transparent 60%); }
.chapter--alert .window { border-color: #4a2a30; }
.chapter--alert .window-bar em { color: #e7b4ae; }

/* ---------- closing ---------- */
.closing {
  padding: clamp(80px, 12vw, 150px) max(24px, calc((100vw - 760px) / 2));
  border-top: 1px solid var(--line); position: relative; z-index: 1;
  background: linear-gradient(180deg, transparent, rgba(224, 164, 88, .05));
}
.closing h2 { font-family: var(--serif); font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.08; margin: 0 0 20px; }
.closing-lead { max-width: 60ch; color: var(--muted); margin: 0 0 30px; }
.closing-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .78em 1.35em; border-radius: 999px; font-weight: 650; font-size: .95rem;
  text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--amber); }
.btn--primary { background: var(--amber); border-color: var(--amber); color: #1b1209; }
.btn--primary:hover { background: #eab26c; }

/* ---------- downloads ---------- */
.downloads { padding: clamp(60px, 9vw, 110px) max(24px, calc((100vw - 760px) / 2)); border-top: 1px solid var(--line); position: relative; z-index: 1; }
.downloads h2 { font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 10px; }
.dl-note { color: var(--muted); margin: 0 0 26px; }
.dl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.dl-list a {
  display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); text-decoration: none; background: rgba(255, 255, 255, .02);
  transition: border-color .15s ease, transform .15s ease;
}
.dl-list a:hover { border-color: var(--amber); transform: translateY(-2px); }
.dl-list strong { display: block; font-family: var(--serif); font-size: 1.15rem; margin-bottom: 4px; }
.dl-list span { color: var(--muted); font-size: .84rem; }
.dl-fallback { color: var(--muted); font-size: .86rem; margin-top: 22px; }

/* ---------- footer ---------- */
.foot {
  padding: 30px max(24px, calc((100vw - 760px) / 2)) 50px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .86rem; position: relative; z-index: 1;
}
.foot p { margin: 0 0 6px; }
.foot-note { opacity: .8; }

/* ---------- motion ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-cue .cue-arrow { animation: none; }
  .btn, .dl-list a { transition: none; }
  .js .reveal { opacity: 1; transform: none; }
}

@media (max-width: 700px) {
  body { font-size: 17px; }
  .hero { min-height: 88vh; }
  .masthead nav a { font-size: .84rem; }
  .window pre { font-size: .74rem; padding: 14px 16px; }
}

/* object walkthrough: metadata + facts table */
.objtag { font-family: var(--mono); font-size: .76rem; letter-spacing: .06em; color: var(--muted); margin: 0 0 16px; }
.objtag .oid { color: var(--amber); margin-right: 10px; }
.facts { margin: 22px 0 26px; padding: 0; display: grid; gap: 16px; }
.facts div { display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: start; }
.facts dt { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); padding-top: 2px; }
.facts dd { margin: 0; color: var(--muted); font-size: .98rem; }
@media (max-width: 700px) {
  .facts div { grid-template-columns: 1fr; gap: 3px; }
}

.annotation {
  margin: -14px 0 26px; padding-left: 2px; color: var(--muted); font-size: .88rem;
  font-style: italic;
}
