/* ================================================================
   Upanishad Sharma — Editorial Portfolio
   Typography-first, paper-and-ink editorial aesthetic
   ================================================================ */

:root {
  --paper: #f7f4ee;
  --paper-deep: #efeae0;
  --ink: #191714;
  --ink-soft: #55504a;
  --ink-faint: #8a847b;
  --accent: #c8401f;
  --accent-deep: #a33115;
  --rule: rgba(25, 23, 20, 0.14);
  --rule-strong: rgba(25, 23, 20, 0.55);
  --serif: "Fraunces", "Georgia", serif;
  --sans: "Inter", -apple-system, sans-serif;
  --mono: "Spline Sans Mono", "SF Mono", monospace;
  --max: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2000;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent); color: var(--paper); }

a { color: inherit; text-decoration: none; }

.mono { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em; }

/* ---------------- Reading progress ---------------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 1001;
}

/* ---------------- Masthead ---------------- */
.masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease-out), background 0.4s var(--ease-out);
}
.masthead.is-scrolled { border-bottom-color: var(--rule); }

.masthead-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 76px;
  display: flex;
  align-items: center;
  gap: 32px;
  transition: height 0.4s var(--ease-out);
}
.masthead.is-scrolled .masthead-inner { height: 60px; }

.wordmark { display: flex; align-items: baseline; gap: 12px; }
.wordmark-mark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
}
.wordmark-mark em { color: var(--accent); font-style: normal; }
.wordmark-name {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}

.nav { display: flex; gap: 28px; margin-left: auto; }

/* nav link roll-over micro-interaction */
.nav-link {
  position: relative;
  overflow: hidden;
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: var(--ink-soft);
}
/* animate an inner span, NOT the anchor — keeps the hover target
   stationary so the cursor never "loses" the link (no bounce/stutter) */
.nav-link span {
  display: inline-block;
  position: relative;
  transition: transform 0.35s var(--ease-out);
}
.nav-link span::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 100%;
  color: var(--accent);
}
.nav-link:hover span { transform: translateY(-100%); }
.nav-link.is-active { color: var(--ink); }

.masthead-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 9px 16px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
  white-space: nowrap;
}
.masthead-cta:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cta-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #2c9a4b;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(44, 154, 75, 0.45); }
  55% { box-shadow: 0 0 0 6px rgba(44, 154, 75, 0); }
}

.masthead-resume {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
  transition: background 0.3s var(--ease-out);
}
.masthead-resume:hover { background: var(--accent-deep); }
.resume-arrow { display: inline-block; transition: transform 0.3s var(--ease-out); }
.masthead-resume:hover .resume-arrow { animation: dip 0.5s var(--ease-out); }
@keyframes dip {
  40% { transform: translateY(4px); }
  100% { transform: translateY(0); }
}

.nav-toggle { display: none; }

.mobile-menu[hidden] { display: none; }
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: var(--gutter);
}
.mobile-menu a {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 600;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.mobile-menu-cta { font-family: var(--mono) !important; font-size: 0.95rem !important; color: var(--accent); }

/* ---------------- Hero ---------------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(150px, 22vh, 220px) var(--gutter) 0;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 28px;
}
.kicker-rule { display: inline-block; width: 48px; height: 1px; background: var(--accent); }

.hero-title {
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(2.6rem, 7.2vw, 5.9rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  max-width: 18ch;
}
.hero-title em {
  font-style: italic;
  font-weight: 480;
  color: var(--accent);
}

/* line-by-line mask reveal */
.line-mask { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.line {
  display: block;
  transform: translateY(110%);
  transition: transform 1s var(--ease-out);
}
body.is-loaded .line { transform: translateY(0); }
.line-mask:nth-child(1) .line { transition-delay: 0.10s; }
.line-mask:nth-child(2) .line { transition-delay: 0.20s; }
.line-mask:nth-child(3) .line { transition-delay: 0.30s; }
.line-mask:nth-child(4) .line { transition-delay: 0.40s; }

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-top: 52px;
}
.hero-standfirst {
  max-width: 52ch;
  font-size: 1.06rem;
  line-height: 1.75;
  color: var(--ink-soft);
}
.hero-standfirst strong { color: var(--ink); font-weight: 600; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 14px 26px;
  border-radius: 999px;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--accent); }
.btn-ghost { border: 1px solid var(--rule-strong); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-arrow { transition: transform 0.3s var(--ease-out); }
.btn:hover .btn-arrow { transform: translateY(3px); }
.btn-ghost:hover .btn-arrow { transform: translate(3px, -3px); }

/* stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  margin-top: 84px;
}
.stat {
  padding: 30px 24px 30px 0;
  border-left: 1px solid var(--rule);
}
.stat:first-child { border-left: none; padding-left: 0; }
.stat + .stat { padding-left: 24px; }
.stat-num {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 620;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  display: block;
  margin-top: 8px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-faint);
  max-width: 22ch;
}

/* ---------------- Recruiter fast lane ---------------- */
.recruiter-bar {
  max-width: var(--max);
  margin: clamp(48px, 6vw, 72px) auto 0;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.recruiter-copy {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  padding: 18px 0;
  border-left: 3px solid var(--accent);
  padding-left: 20px;
}
.recruiter-kicker {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  white-space: nowrap;
}
.recruiter-copy p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.08rem;
  color: var(--ink-soft);
}
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-deep); }
.recruiter-btn { flex-shrink: 0; }
.dl-icon { width: 15px; height: 15px; }
.recruiter-btn:hover .dl-icon,
.btn-accent:hover .dl-icon { animation: dip 0.5s var(--ease-out); }

.mobile-menu-resume {
  font-family: var(--sans) !important;
  font-size: 1rem !important;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none !important;
  border-radius: 999px;
  padding: 14px 22px !important;
  text-align: center;
  margin-top: 18px;
}

/* ---------------- Ticker ---------------- */
.ticker {
  margin: clamp(70px, 10vw, 110px) 0 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 16px 0;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 36px;
  animation: ticker 28s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
}
.ticker-track i { font-style: normal; font-size: 0.55rem; color: var(--accent); }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------------- Sections ---------------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(90px, 12vw, 150px) var(--gutter) 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(40px, 6vw, 64px);
  padding-bottom: 24px;
  border-bottom: 2px solid var(--ink);
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.section-title em { font-style: italic; color: var(--accent); font-weight: 480; }
.section-sub {
  max-width: 44ch;
  font-size: 0.94rem;
  color: var(--ink-soft);
}
.section-sub a {
  color: var(--accent);
  border-bottom: 1px solid currentColor;
  transition: color 0.25s;
}
.section-sub a:hover { color: var(--accent-deep); }

/* ---------------- Feature card ---------------- */
.feature-card { margin-bottom: 20px; }
.feature-link {
  display: block;
  position: relative;
  padding: clamp(32px, 5vw, 56px);
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
.feature-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(200, 64, 31, 0.28), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s;
}
.feature-link:hover::before { opacity: 1; }
.feature-link:hover { transform: translateY(-4px); box-shadow: 0 24px 60px -20px rgba(25, 23, 20, 0.5); }

.feature-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  position: relative;
}
.feature-pub {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(247, 244, 238, 0.55);
}
.feature-title {
  position: relative;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.8vw, 2.9rem);
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: -0.01em;
  max-width: 22ch;
}
.feature-desc {
  position: relative;
  margin-top: 20px;
  max-width: 62ch;
  font-size: 0.98rem;
  line-height: 1.7;
  color: rgba(247, 244, 238, 0.72);
}
.feature-link .read-more { position: relative; margin-top: 30px; color: var(--paper); }

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 6px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  color: var(--ink-soft);
}
.tag-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------------- Work grid ---------------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.work-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 28px;
  background: #fdfcf9;
  border: 1px solid var(--rule);
  border-radius: 6px;
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out), border-color 0.45s var(--ease-out);
}
.work-card a:hover {
  transform: translateY(-6px);
  border-color: var(--rule-strong);
  box-shadow: 0 18px 44px -18px rgba(25, 23, 20, 0.28);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.card-index {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  transition: color 0.3s;
}
.work-card a:hover .card-index { color: var(--accent); }

.work-card h3 {
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 580;
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin-bottom: 12px;
  transition: color 0.3s;
}
.work-card a:hover h3 { color: var(--accent-deep); }
.work-card p {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.read-more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.read-more .arrow { transition: transform 0.35s var(--ease-out); }
a:hover .read-more .arrow { transform: translateX(6px); }

.work-foot { margin-top: 44px; text-align: center; }

/* ---------------- Timeline ---------------- */
.timeline { list-style: none; }
.timeline-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  padding: 34px 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.timeline-item::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 0.6s var(--ease-out);
}
.timeline-item:hover::after { width: 100%; }

.timeline-when .mono { color: var(--ink-faint); }
.timeline-body h3 {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 10px;
}
.timeline-org {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}
.timeline-body p {
  max-width: 68ch;
  font-size: 0.94rem;
  line-height: 1.75;
  color: var(--ink-soft);
}
.timeline-body strong { color: var(--ink); font-weight: 600; }

/* ---------------- About ---------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(40px, 7vw, 96px);
}
.about-copy .section-title { margin-bottom: 30px; }
.about-lede {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 480;
  line-height: 1.45;
  margin-bottom: 24px;
}
.about-copy p:not(.about-lede) {
  font-size: 0.97rem;
  line-height: 1.8;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.about-side {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-top: 14px;
}
.side-heading {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-strong);
  margin-bottom: 18px;
}
.side-list { list-style: none; }
.side-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.side-list li:last-child { border-bottom: none; }
.side-list strong { font-size: 0.92rem; font-weight: 600; }
.side-list span { font-size: 0.82rem; color: var(--ink-faint); }

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips li {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 7px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: #fdfcf9;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--ease-out);
  cursor: default;
}
.chips li:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  transform: translateY(-2px);
}

/* ---------------- Contact ---------------- */
.contact {
  margin-top: clamp(100px, 14vw, 170px);
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: clamp(90px, 12vw, 150px) var(--gutter);
}
.kicker-light { justify-content: center; color: var(--accent); }
.kicker-light .kicker-rule { background: var(--accent); }

.contact-title {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6.5vw, 5rem);
  font-weight: 560;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: 48px;
}
.contact-title em { font-style: italic; font-weight: 460; color: rgba(247, 244, 238, 0.65); }

.contact-email {
  position: relative;
  display: inline-block;
  font-family: var(--mono);
  font-size: clamp(1rem, 2.6vw, 1.6rem);
  letter-spacing: 0.01em;
  padding-bottom: 10px;
  transition: color 0.3s;
}
.contact-email:hover { color: #ff8b68; }
.email-underline {
  position: absolute;
  left: 0; bottom: 0;
  height: 1px;
  width: 100%;
  background: currentColor;
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 0.45s var(--ease-out);
}
.contact-email:hover .email-underline {
  transform: scaleX(0);
  transform-origin: right;
  animation: underline-in 0.45s 0.1s var(--ease-out) forwards;
}
@keyframes underline-in {
  from { transform: scaleX(0); transform-origin: left; }
  to { transform: scaleX(1); transform-origin: left; }
}

.contact-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 34px;
  margin-top: 54px;
}
.contact-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(247, 244, 238, 0.65);
  transition: color 0.3s;
}
.contact-links a:hover { color: var(--paper); }
.contact-links span { display: inline-block; transition: transform 0.3s var(--ease-out); }
.contact-links a:hover span { transform: translate(2px, -2px); }

/* ---------------- Footer ---------------- */
.footer {
  background: var(--ink);
  color: rgba(247, 244, 238, 0.45);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 26px var(--gutter);
  border-top: 1px solid rgba(247, 244, 238, 0.12);
  font-size: 0.8rem;
}
.back-top { transition: color 0.3s; }
.back-top:hover { color: var(--paper); }

/* ---------------- Reveal-on-scroll ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

.reveal-group { opacity: 0; transition: opacity 0.8s var(--ease-out); }
.reveal-group.is-visible { opacity: 1; }

/* ---------------- Custom cursor ---------------- */
@media (pointer: fine) {
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }
}
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 3000;
  opacity: 0;
}
.cursor-dot {
  width: 7px; height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--accent);
}
.cursor-ring {
  width: 38px; height: 38px;
  margin: -19px 0 0 -19px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out),
              margin 0.35s var(--ease-out), background 0.3s, border-color 0.3s;
  mix-blend-mode: exclusion;
  border-color: #9c9c9c;
}
body.has-cursor .cursor-dot, body.has-cursor .cursor-ring { opacity: 1; }
.cursor-ring.is-hover {
  width: 58px; height: 58px;
  margin: -29px 0 0 -29px;
  background: rgba(200, 64, 31, 0.12);
  border-color: var(--accent);
}
.cursor-ring.has-label {
  width: 76px; height: 76px;
  margin: -38px 0 0 -38px;
  background: var(--accent);
  border-color: var(--accent);
  mix-blend-mode: normal;
}
.cursor-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s;
}
.cursor-ring.has-label .cursor-label { opacity: 1; }

/* ---------------- Hero decorations ---------------- */
.hero { position: relative; }
.hero-decor { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.glyph {
  position: absolute;
  font-family: var(--serif);
  color: var(--accent);
  opacity: 0.18;
  will-change: transform;
  animation: drift 7s ease-in-out infinite alternate;
}
.g1 { top: 18%; left: 68%; font-size: 2.4rem; animation-delay: 0s; }
.g2 { top: 62%; left: 88%; font-size: 3.4rem; animation-delay: -1.6s; opacity: 0.12; }
.g3 { top: 8%;  left: 88%; font-size: 1.7rem; animation-delay: -3.1s; }
.g4 { top: 74%; left: 4%;  font-size: 2.8rem; animation-delay: -4.4s; opacity: 0.1; }
.g5 { top: 34%; left: 46%; font-size: 1.5rem; animation-delay: -5.5s; opacity: 0.14; }
@keyframes drift {
  from { transform: translate(var(--px, 0), var(--py, 0)) translateY(-12px) rotate(-6deg); }
  to   { transform: translate(var(--px, 0), var(--py, 0)) translateY(14px) rotate(8deg); }
}

/* spinning badge */
.spin-badge {
  position: absolute;
  top: clamp(120px, 16vh, 170px);
  right: var(--gutter);
  width: 120px; height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.spin-badge svg {
  position: absolute;
  inset: 0;
  animation: spin 16s linear infinite;
}
.spin-badge:hover svg { animation-duration: 5s; }
.spin-badge-text {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  fill: var(--ink-soft);
}
.spin-badge-arrow {
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  font-size: 1.1rem;
  transition: background 0.3s, color 0.3s, transform 0.3s var(--ease-out);
}
.spin-badge:hover .spin-badge-arrow {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(4px);
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 960px) { .spin-badge { display: none; } }

/* ---------------- Split-char title reveal ---------------- */
.split .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.65em) rotate(5deg);
  transform-origin: 0 100%;
  transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: calc(var(--i) * 26ms);
}
.split.is-visible .char { opacity: 1; transform: none; }

/* ---------------- Mega marquee ---------------- */
.mega-marquee {
  margin-top: clamp(90px, 12vw, 150px);
  padding: clamp(28px, 4vw, 48px) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  background: var(--paper-deep);
}
.mega-row {
  white-space: nowrap;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  font-weight: 600;
  line-height: 1.15;
  will-change: transform;
}
.mega-row span { display: inline-block; padding-right: 0.5em; }
.mega-row-stroke {
  color: transparent;
  -webkit-text-stroke: 1px var(--ink-faint);
}
.mega-row-fill {
  font-style: italic;
  font-weight: 480;
  color: var(--accent);
  opacity: 0.85;
}

/* ---------------- Timeline spine ---------------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: var(--rule);
}
.timeline-progress {
  position: absolute;
  left: 0; top: 0;
  width: 1px;
  height: 0;
  background: var(--accent);
  z-index: 1;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 42px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.5s 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}
.timeline-item.is-visible::before { transform: scale(1); }

/* ---------------- Pull quote ---------------- */
.quote-section {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(100px, 14vw, 170px) var(--gutter) 0;
  text-align: center;
}
.pullquote { position: relative; }
.quote-mark {
  display: block;
  font-family: var(--serif);
  font-size: clamp(4rem, 9vw, 7rem);
  line-height: 0.6;
  color: var(--accent);
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(20px) scale(0.6);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.pullquote.is-visible .quote-mark { opacity: 1; transform: none; }
.quote-text {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.6vw, 2.7rem);
  font-weight: 520;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.quote-text .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em);
  filter: blur(4px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out), filter 0.6s var(--ease-out);
  transition-delay: calc(var(--i) * 55ms);
}
.pullquote.is-visible .quote-text .word { opacity: 1; transform: none; filter: none; }
.pullquote cite {
  display: inline-block;
  margin-top: 28px;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
}
.pullquote cite::before { content: "— "; color: var(--accent); }

/* ---------------- Work card tilt ---------------- */
.work-grid { perspective: 1200px; }
.work-card { transform-style: preserve-3d; will-change: transform; }

/* ---------------- Back-to-top FAB ---------------- */
.fab-top[hidden] { display: none; }
.fab-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 900;
  width: 52px; height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: none;
  border-radius: 50%;
  box-shadow: 0 10px 30px -8px rgba(25, 23, 20, 0.35);
  font-size: 1.05rem;
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out), background 0.3s, color 0.3s;
}
.fab-top.is-shown { opacity: 1; transform: none; }
.fab-top:hover { background: var(--ink); color: var(--paper); }
.fab-top svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.fab-track, .fab-progress {
  fill: none;
  stroke-width: 2;
}
.fab-track { stroke: var(--rule); }
.fab-progress {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 131.9;
  stroke-dashoffset: 131.9;
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .line { transform: none; }
  .reveal, .reveal-group { opacity: 1; transform: none; }
  .split .char, .quote-text .word, .quote-mark { opacity: 1; transform: none; filter: none; }
  .cursor-dot, .cursor-ring { display: none; }
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: auto; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-left: none; padding-left: 0; }
  .stat:nth-child(even) { padding-left: 24px; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

@media (max-width: 1120px) {
  .masthead-cta { display: none; }
}

@media (max-width: 720px) {
  .nav, .masthead-cta { display: none; }
  .masthead-resume { margin-left: auto; padding: 9px 15px; font-size: 0.74rem; }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px; height: 44px;
    background: none;
    border: none;
    cursor: pointer;
  }
  .nav-toggle span {
    display: block;
    width: 24px; height: 2px;
    margin: 0 auto;
    background: var(--ink);
    transition: transform 0.35s var(--ease-out), opacity 0.35s;
  }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

  .work-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; padding: 28px 0; }
  .hero-foot { margin-top: 40px; }
  .stats { margin-top: 60px; }
  .footer { justify-content: center; text-align: center; }
}
