/* TADS /v2 — Goldsmith */

:root {
  --canvas-dark: #1B1714;
  --canvas-dark-2: #221C18;
  --bone:        #F5F1E8;
  --ink:         #1B1714;
  --gold-deep:   #7A5A3A;
  --gold:        #BD9245;
  --gold-glow:   #E6C078;
  --gold-light:  #FFEBB8;
  --brass:       #826E4C;
  --stone:       #A89B85;
  --hairline:    rgba(189, 146, 69, 0.18);
  --hairline-strong: rgba(189, 146, 69, 0.35);
  --text-dim:    rgba(245, 241, 232, 0.62);
  --text-mute:   rgba(245, 241, 232, 0.38);

  --font-display: 'Fraunces', ui-serif, Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --pad:  clamp(20px, 3.5vw, 56px);
  --max:  1600px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  background-image:
    radial-gradient(1400px 700px at 80% -10%, rgba(189,146,69,0.05), transparent 60%),
    radial-gradient(1000px 600px at -10% 110%, rgba(122,90,58,0.04), transparent 60%);

  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;

  /* hide native cursor when fine pointer (custom cursor active) */
}
@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body, a, button { cursor: none; }
}

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

.skip {
  position: absolute; left: -9999px;
  width: 1px; height: 1px; overflow: hidden;
}
.skip:focus {
  left: 12px; top: 12px; width: auto; height: auto;
  background: var(--ink); color: var(--bone);
  padding: 8px 12px; z-index: 9999;
}

/* ─────────── grain overlay ─────────── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95  0 0 0 0 0.85  0 0 0 0 0.6  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
  animation: grain-shift 8s steps(8) infinite, grain-in 1800ms ease-out 400ms forwards;
}

/* ─────────── custom cursor ─────────── */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9000;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 300ms ease;
  will-change: transform;
}
.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--gold);
  margin-left: -3px;
  margin-top: -3px;
  mix-blend-mode: multiply;
}
.cursor-ring {
  width: 36px;
  height: 36px;
  margin-left: -18px;
  margin-top: -18px;
  border: 1px solid var(--gold);
  transition: opacity 300ms ease, width 280ms cubic-bezier(.2,.7,.2,1),
              height 280ms cubic-bezier(.2,.7,.2,1),
              margin 280ms cubic-bezier(.2,.7,.2,1),
              border-color 280ms ease;
}
.cursor-on .cursor-dot,
.cursor-on .cursor-ring { opacity: 1; }

.cursor-ring.expanded {
  width: 70px; height: 70px;
  margin-left: -35px; margin-top: -35px;
  border-color: var(--gold-glow);
}
@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor-dot, .cursor-ring { display: none; }
  body, a, button { cursor: auto; }
}

/* ─────────── caps / labels ─────────── */
.cap {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.4;
}
.cap.mute { color: var(--brass); }
.dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-glow);
  vertical-align: middle;
  margin-right: 6px;
  box-shadow: 0 0 8px var(--gold-glow);
  animation: blink 1800ms ease-in-out infinite;
}

/* ─────────── colophon ─────────── */
.colophon {
  position: relative;
  z-index: 5;
  display: grid;
  padding: clamp(20px, 3vw, 36px) var(--pad);
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  gap: clamp(16px, 2vw, 24px);
}
.colophon.top {
  grid-template-columns: 1fr 1fr;
  align-items: start;
  border-bottom: 1px solid var(--hairline-strong);
  opacity: 0;
  animation: fade-down 900ms ease-out 200ms forwards;
}
.colophon.bottom {
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "rule       rule"
    "manifesto  manifesto"
    "bl         br";
  align-items: end;
  padding-top: clamp(16px, 2.4vw, 28px);
  border-top: 1px solid var(--hairline-strong);
  opacity: 0;
  animation: fade-up 900ms ease-out 2400ms forwards;
}
.colophon .rule {
  grid-area: rule;
  border: 0;
  height: 1px;
  background: var(--hairline-strong);
  margin-bottom: clamp(14px, 2vw, 22px);
}
.col.tr, .col.br { text-align: right; }
.col.bl { grid-area: bl; }
.col.br { grid-area: br; }

/* ─────────── stage / logo ─────────── */
.stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vh, 60px) var(--pad);
  width: 100%;
  margin: 0 auto;
  z-index: 3;
}
.logo-stage {
  position: relative;
  width: clamp(220px, 32vw, 420px);
  aspect-ratio: 1 / 1;
  cursor: pointer;
}

.logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
  /* glow removed for light bg */
}

.logo-fills path {
  transition: opacity 380ms cubic-bezier(.2,.7,.2,1);
}
.logo-stage.is-hot .logo-fills path { opacity: 0; }

.logo-strokes path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.logo-strokes .p1 { animation: draw 1100ms cubic-bezier(.7,.05,.2,1) 350ms forwards; }
.logo-strokes .p2 { animation: draw  800ms cubic-bezier(.7,.05,.2,1) 1100ms forwards; }
.logo-strokes { animation: fade-out 400ms ease-out 1900ms forwards; }

.logo-fills {
  opacity: 0;
  animation: fade-in 700ms ease-out 1700ms forwards;
}

.gold-canvas {
  position: absolute;
  /* Fits the logo exactly — molten gold lives INSIDE the A only. */
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  z-index: 3; /* sit ABOVE the static SVG fills */
  transition: opacity 420ms cubic-bezier(.2,.7,.2,1);
  mix-blend-mode: normal;
}
.logo-stage.is-hot .gold-canvas { opacity: 1; }

/* ─────────── manifesto rotator ─────────── */
.manifesto {
  grid-area: manifesto;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "wght" 360, "SOFT" 60, "WONK" 0;
  font-size: clamp(22px, 3.4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 22ch;
  margin-bottom: clamp(12px, 1.8vw, 20px);
  min-height: calc(1.15em + 4px);
}
.manifesto-track {
  display: grid;
  grid-template-rows: 1fr;
  position: relative;
}
.manifesto-track .line {
  grid-row: 1;
  grid-column: 1;
  display: block;
  opacity: 0;
  transform: translateY(20%);
  transition: opacity 600ms ease, transform 700ms cubic-bezier(.2,.7,.2,1);
  font-style: italic;
  font-variation-settings: "opsz" 144, "wght" 360, "SOFT" 90, "WONK" 1;
}
.manifesto-track .line.current { opacity: 1; transform: translateY(0); }
.manifesto-track .line.leaving { opacity: 0; transform: translateY(-20%); }

/* ─────────── social ─────────── */
.social {
  display: flex;
  gap: clamp(16px, 2vw, 28px);
  flex-wrap: wrap;
}
.social a {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  transition: color 200ms ease;
  will-change: transform;
}
.social a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 320ms cubic-bezier(.2,.7,.2,1);
}
.social a:hover {
  color: var(--brass);
}
.social a:hover::after { transform: scaleX(1); }
.social a span {
  display: inline-block;
  transition: transform 220ms cubic-bezier(.2,.7,.2,1);
}
.social a:hover span { transform: translate(3px, -3px); }
.social a:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 6px;
}

/* ─────────── keyframes ─────────── */
@keyframes draw     { to { stroke-dashoffset: 0; } }
@keyframes fade-in  { to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-down {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes grain-in  { to { opacity: 0.07; } }
@keyframes grain-shift {
  0%   { background-position: 0 0; }
  25%  { background-position: -40px 20px; }
  50%  { background-position: 30px -30px; }
  75%  { background-position: -20px -10px; }
  100% { background-position: 0 0; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ─────────── motion-safe ─────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .colophon, .logo-fills, .gold-canvas, .grain { opacity: 1 !important; }
  .logo-strokes { display: none; }
  .grain { opacity: 0.05 !important; }
  .manifesto-track .line.current { opacity: 1 !important; transform: none !important; }
}

/* ─────────── small screens ─────────── */
@media (max-width: 720px) {
  .colophon.top,
  .colophon.bottom {
    grid-template-columns: 1fr;
  }
  .colophon.bottom {
    grid-template-areas:
      "rule"
      "manifesto"
      "bl"
      "br";
  }
  .col.tr, .col.br { text-align: left; }
  .logo-stage { width: clamp(200px, 60vw, 320px); }
  .manifesto { font-size: clamp(20px, 6vw, 30px); }
}
