/* ============================================================
   THE AMERICAN RETURNS — form-journey motion graphics
   Forms draw themselves; a gold spine connects their journey.
   ============================================================ */

/* ---------- hero ---------- */
.uf-hero {
  min-height: 92vh; display: flex; align-items: center; position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 75% 30%, rgba(200, 164, 92, 0.09), transparent 60%),
    linear-gradient(180deg, #070C16 0%, var(--black) 100%);
  padding: 140px 0 80px;
}
.uf-hero .container { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 70px; align-items: center; position: relative; z-index: 2; }
.uf-hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 5.6vw, 4.8rem); line-height: 1.06; margin-top: 26px; }
.uf-hero h1 em { font-style: italic; color: var(--gold-soft); }
.uf-hero .sub { margin-top: 28px; color: var(--ivory-dim); max-width: 50ch; line-height: 2; font-size: 0.97rem; }

/* floating ghost forms behind hero */
.ghosts { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.ghost {
  position: absolute; border: 1px solid rgba(200, 164, 92, 0.13);
  background: rgba(10, 19, 34, 0.35); border-radius: 4px;
  animation: drift-up linear infinite;
}
.ghost::before {
  content: attr(data-no); position: absolute; top: 10px; left: 12px;
  font-family: var(--serif); font-style: italic; color: rgba(200, 164, 92, 0.35); font-size: 0.85rem;
}
@keyframes drift-up {
  from { transform: translateY(110vh) rotate(var(--tilt, -4deg)); }
  to   { transform: translateY(-130%) rotate(var(--tilt, -4deg)); }
}

/* ---------- the document SVG cards ---------- */
.doc { width: 100%; max-width: 320px; filter: drop-shadow(0 24px 50px rgba(0, 0, 0, 0.55)); }
.doc-frame { fill: rgba(13, 23, 40, 0.92); stroke: rgba(200, 164, 92, 0.35); stroke-width: 1.5; }
.doc-head { fill: rgba(200, 164, 92, 0.08); }
.doc-no { font-family: "Cormorant Garamond", Georgia, serif; font-size: 34px; fill: #DDC28A; }
.doc-sub { font-family: "Manrope", sans-serif; font-size: 8.5px; letter-spacing: 2.5px; fill: #8B93A1; }

/* writing lines — draw when .in */
.wline, .sigline, .wire {
  stroke-dasharray: 1; stroke-dashoffset: 1; fill: none;
}
.wline { stroke: rgba(243, 239, 230, 0.30); stroke-width: 2; stroke-linecap: round; }
.wline.gold { stroke: rgba(200, 164, 92, 0.65); }
.sigline { stroke: #DDC28A; stroke-width: 2.2; stroke-linecap: round; }
.in .wline, .in .sigline {
  transition: stroke-dashoffset 1.1s cubic-bezier(.5, 0, .3, 1);
  stroke-dashoffset: 0;
}
.in .w1 { transition-delay: 0.15s; } .in .w2 { transition-delay: 0.3s; }
.in .w3 { transition-delay: 0.45s; } .in .w4 { transition-delay: 0.6s; }
.in .w5 { transition-delay: 0.75s; } .in .w6 { transition-delay: 0.9s; }
.in .w7 { transition-delay: 1.05s; } .in .sigline { transition-delay: 1.3s; transition-duration: 1.6s; }
.doc .box { fill: none; stroke: rgba(200, 164, 92, 0.4); stroke-width: 1.5; }
.doc .tick { stroke: #DDC28A; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.in .tick { transition: stroke-dashoffset 0.5s ease 1.2s; stroke-dashoffset: 0; }

/* ---------- stamps ---------- */
.stamp {
  position: absolute; right: -14px; top: 18px;
  font-family: var(--sans); font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--gold-soft); border: 1.5px solid var(--gold-soft);
  padding: 9px 16px; transform: rotate(8deg) scale(2.4); opacity: 0;
  background: rgba(5, 8, 14, 0.75);
}
.in .stamp { animation: thunk 0.5s cubic-bezier(.2, 1.6, .35, 1) 1.6s forwards; }
@keyframes thunk {
  from { transform: rotate(8deg) scale(2.4); opacity: 0; }
  60%  { transform: rotate(-7deg) scale(0.96); opacity: 1; }
  to   { transform: rotate(-7deg) scale(1); opacity: 1; }
}

/* ---------- the journey spine & stations ---------- */
.chapter-head { text-align: center; padding: 130px 24px 30px; }
.chapter-head .label { display: block; }
.chapter-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 4.4vw, 3.6rem); margin-top: 16px; }
.chapter-head h2 em { font-style: italic; color: var(--gold-soft); }
.chapter-head p { color: var(--muted); max-width: 54ch; margin: 20px auto 0; line-height: 2; font-size: 0.93rem; }

.spine-track { position: relative; }
.spine {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  height: 100%; width: 2px; overflow: visible; z-index: 0;
}
.spine .rail { stroke: rgba(200, 164, 92, 0.12); stroke-width: 2; }
.spine .flow { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 6px rgba(200, 164, 92, 0.8)); }

.station {
  display: grid; grid-template-columns: 1fr 1fr; gap: 90px;
  align-items: center; min-height: 88vh; position: relative; z-index: 1;
  padding: 40px 0;
}
.station .visual { display: flex; justify-content: flex-end; position: relative; }
.station.flip .visual { order: 2; justify-content: flex-start; }
.station.flip .copy { order: 1; text-align: right; }
.station .copy .when {
  font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 1.05rem;
}
.station .copy h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 3vw, 2.5rem); margin: 14px 0 16px; line-height: 1.15; }
.station .copy p { color: var(--ivory-dim); line-height: 2; font-size: 0.94rem; max-width: 46ch; }
.station.flip .copy p { margin-left: auto; }
.station .copy .forms-met { margin-top: 20px; font-size: 0.68rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); }
.station .copy .forms-met b { color: var(--gold); font-weight: 500; }

/* spine node dot at each station */
.station::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 10px; height: 10px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--black); border: 2px solid var(--gold-faint);
  transition: all 0.6s ease 0.4s; z-index: 2;
}
.station.in::after { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 18px rgba(200, 164, 92, 0.9); }

/* ---------- card fans & stacks ---------- */
.fan { position: relative; width: 320px; height: 380px; }
.fan .doc { position: absolute; inset: 0; max-width: 300px; transition: transform 1.2s cubic-bezier(.16,.84,.3,1) ; }
.fan .doc:nth-child(1) { z-index: 3; }
.fan .doc:nth-child(2) { z-index: 2; }
.fan .doc:nth-child(3) { z-index: 1; }
.in .fan .doc:nth-child(2) { transform: rotate(-9deg) translate(-34px, 10px); }
.in .fan .doc:nth-child(3) { transform: rotate(9deg) translate(34px, 12px); }

/* K-1 satellites flying out */
.k1-wrap { position: relative; width: 320px; }
.k1 {
  position: absolute; width: 86px; height: 110px; border-radius: 3px;
  border: 1px solid rgba(200, 164, 92, 0.45); background: rgba(13, 23, 40, 0.95);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-style: italic; color: var(--gold-soft); font-size: 0.85rem;
  opacity: 0; z-index: 4;
  transition: transform 1.3s cubic-bezier(.16,.84,.3,1), opacity 0.7s ease;
}
.k1.a { top: 16%; left: 50%; }
.k1.b { top: 42%; left: 50%; }
.k1.c { top: 68%; left: 50%; }
.in .k1 { opacity: 1; }
.in .k1.a { transform: translate(150px, -56px) rotate(7deg); transition-delay: 1.2s; }
.in .k1.b { transform: translate(186px, 0) rotate(-4deg); transition-delay: 1.4s; }
.in .k1.c { transform: translate(150px, 56px) rotate(6deg); transition-delay: 1.6s; }

/* ---------- quarterly ring (941 / 1040-ES) ---------- */
.qring { position: relative; width: 320px; height: 320px; }
.qring .orbit {
  position: absolute; inset: 26px; border-radius: 50%;
  border: 1px solid rgba(200, 164, 92, 0.22);
}
.qring .sweep {
  position: absolute; inset: 26px; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(200, 164, 92, 0.22), transparent 70deg, transparent 360deg);
  animation: sweep 8s linear infinite; opacity: 0; transition: opacity 0.8s ease 0.6s;
}
.in .qring .sweep { opacity: 1; }
@keyframes sweep { to { transform: rotate(360deg); } }
.qring .q {
  position: absolute; width: 74px; height: 74px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(13, 23, 40, 0.95); border: 1px solid var(--gold-faint);
  transform: scale(0); transition: transform 0.6s cubic-bezier(.2, 1.4, .4, 1);
}
.qring .q .qn { font-family: var(--serif); font-style: italic; color: var(--gold-soft); font-size: 1.1rem; line-height: 1; }
.qring .q .qd { font-size: 0.5rem; letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; margin-top: 4px; }
.qring .q1 { top: -6px; left: 50%; margin-left: -37px; }
.qring .q2 { top: 50%; right: -6px; margin-top: -37px; }
.qring .q3 { bottom: -6px; left: 50%; margin-left: -37px; }
.qring .q4 { top: 50%; left: -6px; margin-top: -37px; }
.in .qring .q1 { transform: scale(1); transition-delay: 0.5s; }
.in .qring .q2 { transform: scale(1); transition-delay: 0.7s; }
.in .qring .q3 { transform: scale(1); transition-delay: 0.9s; }
.in .qring .q4 { transform: scale(1); transition-delay: 1.1s; }
.qring .core {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; font-family: var(--serif);
}
.qring .core .big { font-size: 2rem; color: var(--ivory); }
.qring .core .small { font-size: 0.6rem; letter-spacing: 0.3em; color: var(--muted); text-transform: uppercase; margin-top: 4px; font-family: var(--sans); }

/* ---------- entity branching ---------- */
.branch { width: 100%; max-width: 760px; margin: 0 auto; }
.branch .wire { stroke: rgba(200, 164, 92, 0.55); stroke-width: 1.5; }
.in .branch .wire { transition: stroke-dashoffset 1.4s cubic-bezier(.5, 0, .3, 1); stroke-dashoffset: 0; }
.in .branch .wb1 { transition-delay: 0.3s; }
.in .branch .wb2 { transition-delay: 0.55s; }
.in .branch .wb3 { transition-delay: 0.8s; }
.branch-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; max-width: 760px; margin: 0 auto; }
.bcard {
  border: 1px solid var(--gold-hairline); background: rgba(13, 23, 40, 0.8);
  padding: 28px 26px; text-align: center;
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.16,.84,.3,1);
}
.in .bcard:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.9s; }
.in .bcard:nth-child(2) { opacity: 1; transform: none; transition-delay: 1.1s; }
.in .bcard:nth-child(3) { opacity: 1; transform: none; transition-delay: 1.3s; }
.bcard .bno { font-family: var(--serif); font-size: 1.9rem; color: var(--gold-soft); }
.bcard .bwho { font-size: 0.66rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.bcard .bdue { font-family: var(--serif); font-style: italic; color: var(--ivory-dim); margin-top: 14px; font-size: 0.95rem; }
.branch-title { text-align: center; }

/* ---------- chapter divider ---------- */
.divider-band {
  text-align: center; padding: 120px 24px;
  border-top: 1px solid var(--gold-hairline); border-bottom: 1px solid var(--gold-hairline);
  background: radial-gradient(ellipse 60% 80% at 50% 50%, rgba(200, 164, 92, 0.06), transparent 70%), var(--navy);
}
.divider-band .t { font-family: var(--serif); font-style: italic; font-size: clamp(1.5rem, 3vw, 2.4rem); color: var(--ivory); max-width: 36ch; margin: 0 auto; line-height: 1.5; }
.divider-band .t strong { color: var(--gold-soft); font-weight: 400; }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .uf-hero .container { grid-template-columns: 1fr; }
  .uf-hero .visual { display: none; }
  .station { grid-template-columns: 1fr; gap: 40px; min-height: auto; padding: 70px 0; }
  .station .visual, .station.flip .visual { order: 1; justify-content: center; }
  .station .copy, .station.flip .copy { order: 2; text-align: left; }
  .station.flip .copy p { margin-left: 0; }
  .spine, .station::after { display: none; }
  .branch-cards { grid-template-columns: 1fr; }
}
