/* ==========================================================================
   Arjang Mousavi — v2  ·  Editorial dark · Brass accent · Motion-rich
   Evolves v1 identity (onyx + champagne, AM monogram, Instrument Serif).
   ========================================================================== */

:root {
  --bg:        #0F0F0F;
  --surface:   #161514;
  --surface-2: #1c1a18;
  --ink:       #F5F3EE;
  --ink-soft:  #d8d3c8;
  --muted:     #8A857C;
  --muted-2:   #5d594f;
  --hairline:  rgba(138,133,124,0.22);
  --hairline-2:rgba(138,133,124,0.12);
  --accent:    #C8A96A;     /* warm brass */
  --accent-2:  #a98a4e;

  --f-serif: "Instrument Serif", "EB Garamond", Georgia, serif;
  --f-sans:  "Manrope", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --f-mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --pad: clamp(20px, 5vw, 80px);
  --maxw: 1320px;
  --rule: 1px solid var(--hairline);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur:  0.9s;
}

/* Reset -------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16.5px/1.6 var(--f-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: #1a1408; }

/* Film grain + glow -------------------------------------------------------- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: .035; mix-blend-mode: screen;
}
.glow {
  position: fixed; top: -10%; left: 50%; width: 90vw; height: 70vh;
  transform: translateX(-50%); z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--accent) 13%, transparent), transparent 72%);
  filter: blur(20px); opacity: .55;
}

/* Layout primitives -------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); position: relative; z-index: 2; }
main { position: relative; z-index: 2; }

.eyebrow {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent); }

.serif { font-family: var(--f-serif); font-weight: 400; }
.italic { font-family: var(--f-serif); font-style: italic; }
.accent { color: var(--accent); }
.mono { font-family: var(--f-mono); }

/* Section number stamp ----------------------------------------------------- */
.sec-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 56px; }
.sec-num {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .2em; color: var(--accent);
  flex-shrink: 0;
}
.sec-label { font-family: var(--f-mono); font-size: 12px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.sec-title {
  font-family: var(--f-serif); font-weight: 400;
  font-size: clamp(34px, 5vw, 64px); line-height: 1.02; letter-spacing: -0.02em;
  margin: 0; text-wrap: balance;
}
.sec-title em { font-style: italic; color: var(--accent); }

section { padding: clamp(80px, 11vh, 150px) 0; position: relative; }
.rule-top { border-top: var(--rule); }

/* ── Header ───────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .4s, background .4s;
}
.topbar.scrolled { border-bottom-color: var(--hairline); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 14px; }
.brand .mark { width: 38px; height: 25px; color: var(--accent); fill: var(--accent); }
.brand .mark .am-fill { fill: currentColor; }
.brand-rule { width: 1px; height: 30px; background: var(--hairline); }
.brand-wm { display: flex; flex-direction: column; }
.brand-wm b { font-weight: 600; font-size: 13px; letter-spacing: .18em; }
.brand-wm small { font-family: var(--f-mono); font-size: 8.5px; letter-spacing: .22em; color: var(--muted); margin-top: 3px; }

.nav { display: flex; gap: 30px; align-items: center; }
.nav a { font-size: 13.5px; color: var(--ink-soft); position: relative; transition: color .25s; }
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: -5px; width: 0; height: 1px;
  background: var(--accent); transition: width .3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { width: 100%; }
.nav-cta { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; white-space: nowrap;
  padding: 10px 18px; border: 1px solid var(--hairline); border-radius: 999px; transition: border-color .25s, color .25s; }
.nav-cta .ar { width: 14px; height: 11px; flex-shrink: 0; transition: transform .3s var(--ease); }
.nav-cta:hover { border-color: var(--accent); color: var(--accent); }
.nav-cta:hover .ar { transform: translateX(3px); }
@media (max-width: 940px) { .nav { display: none; } .brand-wm small { display: none; } }
@media (max-width: 560px) { .nav-cta { display: none; } }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero { padding: clamp(48px, 8vh, 96px) 0 clamp(60px, 9vh, 110px); }
.hero-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: clamp(36px, 5vw, 80px); align-items: end; }
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; gap: 48px; } }

.hero-eyebrow { margin-bottom: 30px; }
.hero h1 {
  font-family: var(--f-serif); font-weight: 400;
  font-size: clamp(46px, 7.4vw, 110px); line-height: 1.0; letter-spacing: -0.025em;
  margin: 0; text-wrap: balance;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span { display: block; will-change: transform; }
.hero-sub { max-width: 50ch; font-size: 18.5px; line-height: 1.6; color: var(--ink-soft); margin: 34px 0 0; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 40px; }

.btn { display: inline-flex; align-items: center; gap: 11px; padding: 15px 26px;
  font-size: 14px; font-weight: 500; border-radius: 999px; transition: all .25s var(--ease); white-space: nowrap; }
.btn .ar { width: 16px; height: 12px; transition: transform .3s var(--ease); }
.btn:hover .ar { transform: translateX(4px); }
.btn-primary { background: var(--accent); color: #1a1408; border: 1px solid var(--accent); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); }
.btn-ghost { border: 1px solid var(--hairline); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Hero portrait card */
.hero-card { position: relative; }
.hero-portrait {
  aspect-ratio: 4/5; border: var(--rule); border-radius: 3px; overflow: hidden;
  position: relative; background: var(--surface);
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top;
  filter: saturate(.9) contrast(1.03); }
.hero-portrait .tag {
  position: absolute; top: 14px; left: 14px; font-family: var(--f-mono); font-size: 10px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.14); padding: 5px 9px;
  backdrop-filter: blur(4px);
}
.hero-card .sig {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  margin-top: 18px; padding-top: 16px; border-top: var(--rule);
}
.hero-card .sig .nm { font-family: var(--f-serif); font-style: italic; font-size: 22px; }
.hero-card .sig .ti { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); text-align: right; }

/* ── Impact strip ─────────────────────────────────────────────────────── */
.impact { border-block: var(--rule); padding: clamp(40px, 6vh, 64px) 0; }
.impact-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
@media (max-width: 860px) { .impact-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 0; } }
@media (max-width: 460px) { .impact-grid { grid-template-columns: 1fr; gap: 24px; } }
.metric { padding-inline: clamp(8px, 2vw, 28px); border-inline-start: var(--rule); }
.metric:first-child { border-inline-start: 0; padding-inline-start: 0; }
@media (max-width: 860px) { .metric { border-inline-start: 0; padding-inline-start: 0; } }
.metric .n { font-family: var(--f-serif); font-size: clamp(40px, 4.6vw, 60px); line-height: 1;
  color: var(--ink); letter-spacing: -0.02em; display: flex; align-items: baseline; }
.metric .n .suf { color: var(--accent); }
.metric .l { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-top: 14px; line-height: 1.5; }

/* ── About ────────────────────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 260px 1fr; gap: clamp(36px, 5vw, 80px); align-items: start; }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }
.about-lead { font-family: var(--f-serif); font-size: clamp(24px, 3vw, 38px); line-height: 1.28;
  letter-spacing: -0.012em; margin: 0 0 30px; text-wrap: pretty; }
.about-lead em { font-style: italic; color: var(--accent); }
.about-body p { color: var(--ink-soft); font-size: 17px; line-height: 1.75; margin: 0 0 18px; max-width: 62ch; }
.about-body p strong { color: var(--ink); font-weight: 600; }

/* ── Selected Work — pinned timeline ──────────────────────────────────── */
.work-pin { position: relative; }
.pin-stage { position: sticky; top: 76px; height: calc(100vh - 76px); display: grid; align-items: center;
  overflow: hidden; }
.pin-track { position: relative; width: 100%; display: grid; }
.role {
  grid-area: 1 / 1; display: grid; grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(32px, 5vw, 72px); align-items: center;
  opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease);
  pointer-events: none;
}
.role.active { opacity: 1; transform: none; pointer-events: auto; }
@media (max-width: 860px) { .role { grid-template-columns: 1fr; gap: 24px; align-content: center; } }

.role-side { }
.role-idx { font-family: var(--f-mono); font-size: 13px; letter-spacing: .2em; color: var(--muted); }
.role-idx b { color: var(--accent); font-weight: 400; }
.role-co { font-family: var(--f-serif); font-size: clamp(40px, 5.4vw, 76px); line-height: 1; letter-spacing: -0.02em;
  margin: 18px 0 16px; }
.role-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--f-mono); font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.role-meta .dot { color: var(--accent); }
.role-title { font-size: 17px; color: var(--ink-soft); margin-top: 18px; }

.role-main { }
.role-bullets { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 16px; }
.role-bullets li { position: relative; padding-inline-start: 24px; font-size: 16px; line-height: 1.6;
  color: var(--ink-soft); }
.role-bullets li::before { content: ""; position: absolute; left: 0; top: 10px; width: 9px; height: 1px;
  background: var(--accent); }
.role-bullets li strong { color: var(--ink); font-weight: 600; }
.role-chip { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-mono); font-size: 12px;
  letter-spacing: .08em; color: var(--accent); border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  border-radius: 999px; padding: 9px 16px; background: color-mix(in oklab, var(--accent) 8%, transparent); }

/* progress rail */
.pin-rail { position: absolute; top: 50%; right: var(--pad); transform: translateY(-50%); z-index: 3;
  display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 860px) { .pin-rail { display: none; } }
.pin-rail button { width: 28px; height: 2px; background: var(--hairline); position: relative; transition: background .3s; }
.pin-rail button.on { background: var(--accent); }

/* condensed earlier roles */
.earlier { margin-top: 12px; }
.earlier-row { display: grid; grid-template-columns: 200px 1fr auto; gap: 24px; align-items: baseline;
  padding: 22px 0; border-top: var(--rule); }
.earlier-row:last-child { border-bottom: var(--rule); }
@media (max-width: 700px) { .earlier-row { grid-template-columns: 1fr; gap: 6px; } }
.earlier-row .co { font-family: var(--f-serif); font-size: 24px; }
.earlier-row .ti { color: var(--ink-soft); font-size: 15px; }
.earlier-row .yr { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.earlier-row p { grid-column: 2 / 3; color: var(--muted); font-size: 14.5px; margin: 8px 0 0; line-height: 1.55; }
@media (max-width: 700px) { .earlier-row p { grid-column: 1; } }

/* ── Marquee ──────────────────────────────────────────────────────────── */
.marquee { border-block: var(--rule); padding: 26px 0; overflow: hidden; }
.marquee-track { display: flex; gap: 0; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-family: var(--f-serif); font-size: clamp(22px, 2.6vw, 34px); color: var(--ink-soft);
  padding: 0 32px; white-space: nowrap; display: inline-flex; align-items: center; gap: 32px; }
.marquee span::after { content: "·"; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ── Expertise ────────────────────────────────────────────────────────── */
.exp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: var(--rule); }
@media (max-width: 760px) { .exp-grid { grid-template-columns: 1fr; } }
.exp-cell { padding: 30px 0; border-bottom: var(--rule); display: grid; grid-template-columns: 220px 1fr; gap: 28px; }
@media (max-width: 760px) { .exp-cell { grid-template-columns: 1fr; gap: 14px; } }
.exp-cell:nth-child(odd) { padding-inline-end: clamp(20px, 4vw, 56px); border-inline-end: var(--rule); }
.exp-cell:nth-child(even) { padding-inline-start: clamp(20px, 4vw, 56px); }
@media (max-width: 760px) { .exp-cell:nth-child(odd) { border-inline-end: 0; padding-inline-end: 0; } .exp-cell:nth-child(even) { padding-inline-start: 0; } }
.exp-cell h3 { font-family: var(--f-serif); font-size: 24px; font-weight: 400; margin: 0; letter-spacing: -0.01em; }
.exp-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.exp-tags span { font-family: var(--f-mono); font-size: 11px; letter-spacing: .03em; color: var(--ink-soft);
  border: 1px solid var(--hairline); border-radius: 999px; padding: 5px 12px; transition: all .2s; }
.exp-tags span:hover { border-color: var(--accent); color: var(--accent); }

/* ── Speaking ─────────────────────────────────────────────────────────── */
.speak-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: var(--rule); border-left: var(--rule); }
@media (max-width: 760px) { .speak-grid { grid-template-columns: 1fr; } }
.speak-cell { padding: 30px 30px 34px; border-right: var(--rule); border-bottom: var(--rule);
  display: flex; flex-direction: column; gap: 12px; min-height: 180px; }
.speak-cell .role-tag { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); }
.speak-cell h3 { font-family: var(--f-serif); font-size: 22px; font-weight: 400; margin: 0; line-height: 1.2; }
.speak-cell p { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin: auto 0 0; }

/* ── Education ────────────────────────────────────────────────────────── */
.edu-grid { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
@media (max-width: 760px) { .edu-grid { grid-template-columns: 1fr; gap: 28px; } }
.edu-deg { font-family: var(--f-serif); font-size: clamp(28px, 3.4vw, 44px); line-height: 1.1; letter-spacing: -0.015em; }
.edu-deg small { display: block; font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-top: 12px; }
.cert-list { display: grid; gap: 0; }
.cert-list .cert { display: flex; align-items: baseline; gap: 16px; padding: 16px 0; border-top: var(--rule); }
.cert-list .cert:last-child { border-bottom: var(--rule); }
.cert .ix { font-family: var(--f-mono); font-size: 11px; color: var(--accent); flex-shrink: 0; }
.cert .nm { font-size: 16px; color: var(--ink-soft); }
.cert .nm em { font-style: normal; color: var(--muted); font-family: var(--f-mono); font-size: 12px; }

/* ── Contact ──────────────────────────────────────────────────────────── */
.contact { background: var(--surface); border-top: var(--rule); }
.contact-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; gap: 44px; } }
.contact h2 { font-family: var(--f-serif); font-weight: 400; font-size: clamp(40px, 6vw, 92px); line-height: 1;
  letter-spacing: -0.025em; margin: 0 0 26px; text-wrap: balance; }
.contact h2 em { font-style: italic; color: var(--accent); }
.contact-sub { font-size: 18px; color: var(--ink-soft); max-width: 46ch; margin: 0 0 34px; }
.contact-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.contact-meta { display: grid; gap: 0; }
.contact-meta .row { display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  padding: 18px 0; border-top: var(--rule); }
.contact-meta .row:last-child { border-bottom: var(--rule); }
.contact-meta .k { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.contact-meta .v { font-family: var(--f-serif); font-size: 18px; }
.contact-meta a.v:hover { color: var(--accent); }

/* ── Footer ───────────────────────────────────────────────────────────── */
.foot { padding: 56px 0 36px; border-top: var(--rule); }
.foot-inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.foot .tag { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin-top: 18px; max-width: 34ch; }
.foot-nav { display: flex; gap: 26px; flex-wrap: wrap; }
.foot-nav a { font-size: 13.5px; color: var(--ink-soft); transition: color .2s; }
.foot-nav a:hover { color: var(--accent); }
.foot-base { display: flex; justify-content: space-between; align-items: center; margin-top: 44px;
  padding-top: 22px; border-top: var(--rule); font-family: var(--f-mono); font-size: 11px;
  letter-spacing: .1em; color: var(--muted); flex-wrap: wrap; gap: 12px; }
.back-top { display: inline-flex; align-items: center; gap: 8px; transition: color .2s; }
.back-top:hover { color: var(--accent); }

/* ── Motion: reveal + cursor ──────────────────────────────────────────── */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal-line] { overflow: hidden; }
[data-reveal-line] > * { transform: translateY(110%); transition: transform 1s var(--ease); }
[data-reveal-line].in > * { transform: none; }

.hairline-wipe { height: 1px; background: var(--hairline); transform: scaleX(0); transform-origin: left;
  transition: transform 1.1s var(--ease); }
.hairline-wipe.in { transform: scaleX(1); }

.cursor { position: fixed; top: 0; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  pointer-events: none; z-index: 99; transform: translate(-50%, -50%); transition: width .25s, height .25s, background .25s, opacity .3s; mix-blend-mode: difference; }
.cursor.ring { width: 46px; height: 46px; background: transparent; border: 1px solid var(--accent); }
@media (pointer: coarse) { .cursor { display: none; } }

.magnetic { will-change: transform; }

/* Logo draw-on */
.am-mark .am-fill { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .7s var(--ease); }
.am-mark.drawn .am-fill { opacity: 1; transform: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Reduced motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; }
  [data-reveal], [data-reveal-line] > *, .hairline-wipe { opacity: 1 !important; transform: none !important; }
  .am-mark .am-fill { opacity: 1 !important; transform: none !important; }
  .glow, body::before { display: none; }
  .cursor { display: none; }
  .role { grid-area: auto; opacity: 1; transform: none; margin-bottom: clamp(40px, 7vh, 90px); }
  .pin-stage { position: relative; height: auto; display: block; }
  .pin-track { height: auto !important; display: block; }
}
