/* Trajanic Ventures */

:root {
  --night: #0B1226;
  --ink: #0F1830;
  --navy: #19284A;
  --gold: #C59827;
  --gold-light: #E0BC5A;
  --ivory: #F3EDE0;
  --muted: #C9C3B6;
  --dim: #9AA0B3;
  --gutter: clamp(20px, 5vw, 80px);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --label: 'Oswald', 'Arial Narrow', sans-serif;
  --sans: 'Source Sans 3', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; } /* the page mustn't shift when the intro hides the scrollbar */
html.intro-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-light); }
a:hover { color: var(--ivory); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 4px; }

.wrap { width: min(1280px, calc(100% - 2 * var(--gutter))); margin-inline: auto; }

.label {
  font-family: var(--label);
  font-size: 14px;
  letter-spacing: 0.4em;
  color: var(--gold-light);
}
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.05; margin: 0; }
h2 { font-size: clamp(36px, 4vw, 56px); margin-top: 16px; }
em { color: var(--gold-light); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 24, 48, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(197, 152, 39, 0.28);
}
.site-header .wrap { height: 84px; display: flex; align-items: center; justify-content: space-between; }
.brand {
  display: flex; align-items: center; gap: 14px;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--ivory);
}
/* The eagle turns all the way round on its own GPU layer, like a thin plate: seen from behind
   it's mirrored (gold on the right), just as a real one would be. */
.brand-mark {
  display: block; flex: none; width: 56px;
  will-change: transform;
  animation: tvSpin 6s linear infinite;
}
.brand-mark img { width: 100%; }
@keyframes tvSpin { from { transform: perspective(400px) rotateY(0deg); } to { transform: perspective(400px) rotateY(360deg); } }
.brand-name { font-family: var(--label); font-weight: 500; font-size: 18px; letter-spacing: 0.3em; white-space: nowrap; }
.brand-name b { font-weight: 500; color: var(--gold); }
#site-nav ul { display: flex; gap: 44px; list-style: none; margin: 0; padding: 0; }
#site-nav a { font-family: var(--label); font-size: 14px; letter-spacing: 0.2em; text-decoration: none; color: var(--ivory); }
#site-nav a:hover { color: var(--gold-light); }
.menu-btn {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid rgba(197, 152, 39, 0.5); color: var(--gold-light);
  padding: 0; cursor: pointer;
}

@media (max-width: 760px) {
  .site-header .wrap { height: 72px; }
  .brand-mark { width: 44px; }
  .brand-name { font-size: 15px; letter-spacing: 0.28em; }
  .menu-btn { display: flex; }
  #site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 72px;
    background: var(--ink);
    border-bottom: 1px solid rgba(197, 152, 39, 0.28);
  }
  #site-nav.open { display: block; }
  #site-nav ul { flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px; }
  #site-nav a { display: flex; align-items: center; min-height: 52px; }
}
/* The full name always shows; on the narrowest phones it tightens up to fit beside the menu button */
@media (max-width: 360px) {
  .brand { gap: 10px; }
  .brand-name { font-size: 13px; letter-spacing: 0.2em; }
}

/* ---------- Hero ---------- */

.hero {
  min-height: calc(100svh - 84px);
  display: flex; align-items: center;
  padding: 56px 0 72px;
  text-align: center;
}
.hero-logo { width: min(460px, 72vw); margin: 0 auto; }
.hero h1 { font-size: clamp(38px, 5vw, 64px); line-height: 1.08; margin: 40px 0 20px; }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 640px; margin: 0 auto; }
.actions { display: flex; gap: 16px 28px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 36px; }
.btn {
  display: inline-block;
  background: var(--gold); color: var(--ink);
  padding: 18px 32px;
  font-family: var(--label); font-weight: 600; font-size: 15px; letter-spacing: 0.2em;
  text-decoration: none;
}
.btn:hover { background: var(--gold-light); color: var(--ink); }
.link-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--muted); font-family: var(--label); font-size: 14px; letter-spacing: 0.25em;
}
.link-btn:hover { color: var(--ivory); }

/* ---------- Ventures ring ---------- */

.ventures { background: var(--navy); padding: clamp(72px, 9vw, 112px) 0; overflow: hidden; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.car-btns { display: flex; gap: 12px; }
.car-btns[hidden] { display: none; }
.car-btn {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--gold); color: var(--gold-light);
  cursor: pointer; padding: 0;
}
.car-btn:hover:not(:disabled) { background: rgba(197, 152, 39, 0.12); }
.car-btn:disabled { opacity: 0.35; cursor: default; }

.ring-stage {
  --card-w: 280px;
  --card-h: 330px;
  --card-gap: 170px;
  position: relative;
  height: calc(var(--card-h) + 150px);
  perspective: 1300px;
  perspective-origin: 50% 35%;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.ring-stage.dragging { cursor: grabbing; }
/* Gold light pooled on the floor beneath the ring */
.ring-stage::before {
  content: "";
  position: absolute; left: 50%; bottom: 6px;
  width: min(1100px, 130%); height: 110px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(197, 152, 39, 0.28), rgba(197, 152, 39, 0.08) 55%, rgba(197, 152, 39, 0) 100%);
  pointer-events: none;
}
.ring {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.slot {
  --face: 1;
  --glow: 0;
  position: absolute; left: 50%; top: 50%;
  width: var(--card-w); height: var(--card-h);
  margin: calc(var(--card-h) / -2) 0 0 calc(var(--card-w) / -2);
  transform-style: preserve-3d;
}
.slot > * {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.venture {
  padding: 26px 22px;
  background: var(--ink);
  border: 1px solid rgba(197, 152, 39, 0.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  text-align: center; text-decoration: none; color: var(--ivory);
  transition: border-color 0.3s;
}
.v-front {
  overflow: hidden;
  border-color: rgba(197, 152, 39, calc(0.22 + 0.6 * var(--glow)));
  box-shadow: 0 0 calc(40px * var(--glow)) rgba(197, 152, 39, calc(0.3 * var(--glow))), 0 24px 50px rgba(0, 0, 0, 0.35);
  filter: brightness(calc(0.35 + 0.65 * var(--face)));
}
/* Sheen that follows the cursor */
.v-front::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 30%), rgba(224, 188, 90, 0.2), rgba(224, 188, 90, 0) 60%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.v-front:hover::after, .v-front:focus-visible::after { opacity: 1; }
a.venture:hover, a.venture:focus-visible { border-color: var(--gold-light); color: var(--ivory); }
.venture.forming { border-style: dashed; }
.venture.forming .v-name { color: var(--muted); }

/* The back of each card, seen as it passes behind the ring */
.v-back {
  transform: rotateY(180deg);
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(closest-side, rgba(197, 152, 39, 0.16), rgba(197, 152, 39, 0)),
    var(--ink);
  border: 1px solid rgba(197, 152, 39, 0.28);
  opacity: calc(0.25 + 0.4 * (1 - var(--face)));
  pointer-events: none;
}
.v-back span {
  font-family: var(--serif); font-weight: 600; font-size: 96px; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--gold);
}

.v-logo { width: 100%; height: 146px; object-fit: contain; pointer-events: none; }
.v-plate {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 146px; padding: 14px 18px;
  background: var(--ivory);
}
.v-plate .v-logo { width: 100%; height: 100%; }
.v-mark {
  width: 136px; height: 136px; border-radius: 50%;
  border: 1px dashed rgba(197, 152, 39, 0.5);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 56px; color: var(--gold);
}
.v-name { font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.15; }
.v-num { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--gold); }
.venture.soon { min-height: 220px; border-style: dashed; }
.venture.soon p { margin: 0; color: var(--muted); }

.ring-meta {
  display: flex; justify-content: center; align-items: baseline; gap: 22px;
  margin-top: 8px;
  font-family: var(--label); font-size: 13px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--dim);
}
.ring-meta[hidden] { display: none; }
.ring-count { font-family: var(--serif); font-size: 22px; letter-spacing: 0.08em; color: var(--gold-light); min-width: 5ch; text-align: right; }
@media (hover: none) { .hint-mouse { display: none; } }

@media (max-width: 640px) {
  .section-head { flex-direction: column; align-items: flex-start; }
  .ring-stage { --card-w: 210px; --card-h: 270px; --card-gap: 70px; perspective: 900px; height: calc(var(--card-h) + 110px); }
  .venture { padding: 20px 16px; gap: 12px; }
  .v-logo, .v-plate { height: 116px; }
  .v-mark { width: 104px; height: 104px; font-size: 44px; }
  .v-name { font-size: 22px; }
  .v-back span { font-size: 72px; }
  .ring-meta { flex-direction: column; align-items: center; gap: 6px; }
  .ring-count { text-align: center; }
}

/* ---------- About ---------- */

.about { padding: clamp(80px, 10vw, 120px) 0; border-top: 1px solid rgba(197, 152, 39, 0.22); }
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 80px; }
.about-grid { align-items: center; }
.about-copy { color: var(--muted); font-size: 19px; line-height: 1.65; }
.about-copy h2 { color: var(--ivory); margin-bottom: 28px; }

/* Slowly turning marble bust of Trajan */
.bust { position: relative; margin: 0; }
.bust::before {
  content: "";
  position: absolute; left: 50%; top: 46%; width: 90%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(197, 152, 39, 0.22), rgba(197, 152, 39, 0) 70%);
  pointer-events: none;
}
.bust model-viewer {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(360px, 40vw, 560px);
  background: transparent;
  --poster-color: transparent;
  --progress-bar-color: var(--gold);
}
.bust figcaption {
  position: relative;
  margin-top: 14px;
  text-align: center;
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(21px, 1.9vw, 26px); line-height: 1.35;
  color: var(--ivory);
}
.bust figcaption::before {
  content: "";
  display: block; width: 56px; height: 1px; margin: 0 auto 14px;
  background: var(--gold);
}
.about-copy p { margin: 0 0 20px; }
.about-copy em { font-family: var(--serif); font-size: 1.15em; line-height: 1; }
.code-head { margin-top: 96px; }
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; margin-top: 28px; }
.principles > div { border-top: 2px solid var(--gold); padding-top: 24px; }
.principles h3 { margin: 0 0 10px; font-family: var(--label); font-weight: 500; font-size: 18px; letter-spacing: 0.22em; }
.principles p { margin: 0; color: var(--muted); font-size: 17px; }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
  .code-head { margin-top: 56px; }
  .principles { grid-template-columns: 1fr; gap: 28px; margin-top: 20px; }
}

/* ---------- Contact ---------- */

.contact { background: var(--gold); color: var(--ink); padding: clamp(64px, 8vw, 88px) 0; overflow: hidden; } /* keeps the founder card's burst inside the band */
.contact-grid { display: grid; gap: 40px; }
.contact h2 { font-weight: 700; margin: 0; }
.contacts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.contacts > div { border-top: 2px solid var(--ink); padding-top: 18px; }

/* The founder's card: an easter egg (five taps on the footer eagle, see main.js) */
#foot-mark { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.founder { position: relative; }
.founder.boom { animation: tvFounderIn 0.9s cubic-bezier(.2, .9, .25, 1.15) both; }
.founder.going { animation: tvFounderOut 0.45s ease-in both; }
/* The eagle's silhouette thrown outward from the card, behind a white flash */
.f-shock {
  position: absolute; left: 50%; top: 50%; width: 140px; height: 132px; margin: -66px 0 0 -70px;
  -webkit-mask: url(../img/eagle-mask.svg) center / contain no-repeat;
  mask: url(../img/eagle-mask.svg) center / contain no-repeat;
  background: var(--ink);
  opacity: 0; pointer-events: none;
}
.founder.boom .f-shock { animation: tvFounderShock 1.1s cubic-bezier(.15, .7, .3, 1) both; }
.founder.boom::before {
  content: "";
  position: absolute; left: 50%; top: 50%; width: 80px; height: 80px; margin: -40px 0 0 -40px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0.7) 30%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  animation: tvFounderFlash 0.8s ease-out both;
}
.contact.shake { animation: tvShake .4s linear both; }
@keyframes tvFounderIn {
  0% { opacity: 0; transform: scale(.3); filter: blur(10px); }
  45% { opacity: 1; transform: scale(1.1); filter: blur(0); }
  70% { transform: scale(.97); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes tvFounderOut { to { opacity: 0; transform: scale(.6); filter: blur(6px); } }
@keyframes tvFounderShock { 0% { opacity: .55; transform: scale(.4); } 100% { opacity: 0; transform: scale(6); } }
@keyframes tvFounderFlash { 0% { opacity: 0; transform: scale(.2); } 15% { opacity: 1; } 100% { opacity: 0; transform: scale(7); } }
.c-label { font-family: var(--label); font-weight: 500; font-size: 14px; letter-spacing: 0.3em; }
.email {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px;
  font-family: var(--serif); font-weight: 600; font-size: clamp(20px, 1.7vw, 24px);
  color: var(--ink); text-decoration: none; overflow-wrap: anywhere;
}
.email:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* The contact form (posts to FormDesk; formdesk.js fills in its spam-check fields and shows the note) */
.contact-form { display: grid; gap: 18px; max-width: 880px; border-top: 2px solid var(--ink); padding-top: 18px; }
.cf-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 32px; }
.cf-field { display: grid; gap: 6px; }
.cf-label { font-family: var(--label); font-weight: 500; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; }
.contact-form input, .contact-form textarea {
  width: 100%; box-sizing: border-box;
  font: inherit; font-size: 18px; color: var(--ink);
  background: rgba(243, 237, 224, 0.55); border: 2px solid var(--ink); border-radius: 0;
  padding: 12px 14px;
}
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form input:focus, .contact-form textarea:focus { outline: 3px solid var(--ink); outline-offset: 2px; background: var(--ivory); }
.cf-send {
  justify-self: start; min-height: 48px; cursor: pointer;
  background: var(--ink); color: var(--gold); border: 0;
  padding: 16px 36px;
  font-family: var(--label); font-weight: 600; font-size: 15px; letter-spacing: 0.2em;
}
.cf-send:hover { background: var(--navy); color: var(--gold-light); }
.form-note { margin: 0; padding: 12px 16px; font-weight: 600; border-left: 4px solid var(--ink); background: rgba(243, 237, 224, 0.55); }
.form-note[data-state="problem"] { background: var(--ink); color: var(--ivory); border-left-color: var(--ivory); }
/* The honeypot: kept off screen for people (robots still find and fill it) */
.cf-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 900px) {
  .contacts { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 640px) {
  .cf-row { grid-template-columns: 1fr; }
  .cf-send { justify-self: stretch; }
}

/* ---------- Footer ---------- */

.site-footer { padding: 48px 0; }
.site-footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-brand { display: flex; align-items: center; gap: 14px; }
.foot-brand .brand-mark { width: 44px; }
.foot-brand .brand-name { display: block; font-size: 15px; letter-spacing: 0.28em; color: var(--ivory); }
.foot-copy { display: block; margin-top: 2px; color: var(--dim); font-size: 14px; }
.site-footer nav { display: flex; gap: 32px; font-size: 15px; }
.site-footer nav a { color: var(--muted); text-decoration: none; }
.site-footer nav a:hover { color: var(--ivory); }

/* ---------- Opening sequence ---------- */

.intro {
  position: fixed; inset: 0; z-index: 100;
  background: var(--night);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: opacity 0.7s ease, background-color 0.8s ease;
}
.intro[hidden] { display: none; }
.intro.out { opacity: 0; pointer-events: none; }
/* Handing over to the page: the backdrop clears while the logo and headline glide into place (see closeIntro) */
.intro.out.handoff { opacity: 1; background-color: rgba(11, 18, 38, 0); }
html.intro-handoff .hero-logo, html.intro-handoff:not(.intro-handoff-text) .hero h1 { visibility: hidden; }
.i-stage { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0 var(--gutter); }
.i-logo {
  position: relative;
  width: min(520px, 72vw, 52vh);
  aspect-ratio: 1335 / 1255;
  padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer;
}
.i-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.i-seam {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: var(--gold-light); transform-origin: top; opacity: 0;
}
.i-glow {
  position: absolute; left: 50%; top: 40%; width: 110vmax; height: 110vmax;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(197, 152, 39, 0.2), rgba(197, 152, 39, 0) 60%);
}
.i-flash {
  position: absolute; left: 50%; top: 65%; width: 60px; height: 60px; margin: -30px 0 0 -30px;
  border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #FFF8E1 0%, rgba(224, 188, 90, 0.85) 35%, rgba(224, 188, 90, 0) 70%);
}
/* Eagle-shaped shockwaves: outlines that start on the eagle and fly outward from its centre */
.i-burst { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.i-burst g {
  fill: none; stroke: var(--gold-light); stroke-width: 2; stroke-linejoin: round;
  transform-box: view-box; transform-origin: 707.5px 830px;
  opacity: 0;
}
.i-burst use { vector-effect: non-scaling-stroke; }
.i-burst .b2 { stroke: #FFF6DC; stroke-width: 1.5; }
.i-burst .b3 { stroke-width: 1; }
.i-glint {
  position: absolute; inset: 0;
  -webkit-mask: url(../img/eagle-mask.svg) center / 100% 100% no-repeat;
  mask: url(../img/eagle-mask.svg) center / 100% 100% no-repeat;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0) 44%, rgba(255, 246, 220, 0.95) 50%, rgba(255, 255, 255, 0) 56%);
  background-size: 300% 100%;
  background-position: 0% 0;
}
.i-trajanic { transform-origin: 50% 12%; }
/* The closing wipe of light, after Prism II: a slim bar sweeps across behind the logo
   while the eagle and the words light up as it passes, fringed with a faint rainbow. */
.i-beam {
  position: absolute; top: -45%; bottom: -45%; left: -50%; width: 140px; margin-left: -70px;
  background: linear-gradient(90deg, rgba(255, 246, 220, 0) 0%, rgba(224, 188, 90, 0.07) 30%, rgba(255, 250, 240, 0.9) 49.3%, rgba(255, 250, 240, 0.9) 50.7%, rgba(224, 188, 90, 0.07) 70%, rgba(255, 246, 220, 0) 100%);
  -webkit-mask: linear-gradient(transparent, #000 30%, #000 70%, transparent);
  mask: linear-gradient(transparent, #000 30%, #000 70%, transparent);
  opacity: 0;
}
.i-wipe {
  position: absolute; inset: 0;
  -webkit-mask: url(../img/eagle-mask.svg) center / 100% 100% no-repeat, url(../img/word-trajanic-ivory.svg) center / 100% 100% no-repeat, url(../img/word-ventures-gold.svg) center / 100% 100% no-repeat;
  mask: url(../img/eagle-mask.svg) center / 100% 100% no-repeat, url(../img/word-trajanic-ivory.svg) center / 100% 100% no-repeat, url(../img/word-ventures-gold.svg) center / 100% 100% no-repeat;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0) 42%, rgba(90, 150, 255, 0.35) 45%, rgba(120, 230, 255, 0.45) 47%,
    rgba(255, 252, 244, 1) 50%,
    rgba(255, 210, 110, 0.5) 53%, rgba(255, 120, 190, 0.35) 55%, rgba(255, 255, 255, 0) 58%);
  background-size: 300% 100%;
  background-position: 100% 0;
  mix-blend-mode: screen;
  opacity: 0;
}
.i-head {
  margin: clamp(16px, 3vh, 32px) 0 0;
  text-align: center;
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, min(4.4vw, 6.4vh), 62px); line-height: 1.08; /* same as .hero h1, so the hand-off lines up */
}
.i-head .w { display: inline-block; }
/* On phones the page headline sits at its 38px floor and wraps; match it so both wrap alike */
@media (max-width: 480px) { .i-head { font-size: 38px; } }
.i-dust span { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--gold-light); opacity: 0; }
.i-enter {
  margin-top: clamp(8px, 3vh, 32px);
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 44px;
  background: none; border: 0; padding: 4px 12px; cursor: pointer;
  font-family: var(--label); font-size: 13px; letter-spacing: 0.4em; color: var(--gold-light);
}
.i-skip {
  position: absolute; right: clamp(16px, 3vw, 40px); top: clamp(16px, 3vw, 36px);
  height: 44px; padding: 0 18px;
  background: transparent; border: 1px solid rgba(197, 152, 39, 0.45); color: var(--muted);
  font-family: var(--label); font-size: 12px; letter-spacing: 0.3em; cursor: pointer;
}
.i-skip:hover, .i-enter:hover { color: var(--ivory); }

/* The timeline runs only while .play is set; removing and re-adding it replays. */
.intro.play .i-glow     { animation: tvFade 1.8s ease 1.5s both; }
.intro.play .i-seam     { animation: tvSeam 2.1s cubic-bezier(.6, 0, .2, 1) .1s both; }
.intro.play .i-logo     { animation: tvShake .4s linear 1.5s both; }
.intro.play .i-left     { animation: tvSlideL 1s cubic-bezier(.16, .84, .24, 1) .5s both; }
.intro.play .i-right    { animation: tvSlideR 1s cubic-bezier(.16, .84, .24, 1) .5s both; }
.intro.play .i-flash    { animation: tvFlash 1s ease-out 1.45s both; }
.intro.play .i-burst .b1 { animation: tvBurst 1.4s cubic-bezier(.2, .7, .3, 1) 1.5s both; }
.intro.play .i-burst .b2 { animation: tvBurst 1.5s cubic-bezier(.2, .7, .3, 1) 1.62s both; }
.intro.play .i-burst .b3 { animation: tvBurst 1.6s cubic-bezier(.2, .7, .3, 1) 1.76s both; }
.intro.play .i-glint    { animation: tvGlint 1.2s ease-in-out 2.1s both; }
.intro.play .i-trajanic { animation: tvWipe 1s cubic-bezier(.2, .8, .2, 1) 2.4s both; }
.intro.play .i-ventures { animation: tvRise .8s ease 3.1s both; }
.intro.play .i-beam     { animation: tvBeam 1.8s cubic-bezier(.45, 0, .55, 1) 4s both; }
.intro.play .i-wipe     { animation: tvWipeLight 1.8s cubic-bezier(.45, 0, .55, 1) 4s both; }
.intro.play .i-head .w  { animation: tvWord .7s ease both; }
.intro.play .i-enter    { animation: tvRise .8s ease 5s both; }
.intro.play .i-enter svg { animation: tvBob 1.6s ease-in-out 5.8s infinite; }
.intro.play .i-dust span { animation-name: tvDust; animation-timing-function: ease-out; animation-iteration-count: infinite; animation-fill-mode: both; }

@keyframes tvFade   { from { opacity: 0; } to { opacity: 1; } }
@keyframes tvSeam   { 0% { transform: scaleY(0); opacity: 1; } 40% { transform: scaleY(1); opacity: 1; } 70% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
@keyframes tvSlideL { from { transform: translateX(-60vw); opacity: 0; filter: blur(10px); } 60% { opacity: 1; } to { transform: none; opacity: 1; filter: blur(0); } }
@keyframes tvSlideR { from { transform: translateX(60vw); opacity: 0; filter: blur(10px); } 60% { opacity: 1; } to { transform: none; opacity: 1; filter: blur(0); } }
@keyframes tvShake  { 0%, 100% { transform: none; } 20% { transform: translate(-3px, 2px); } 40% { transform: translate(3px, -2px); } 60% { transform: translate(-2px, 1px); } 80% { transform: translate(2px, -1px); } }
@keyframes tvFlash  { 0% { opacity: 0; transform: scale(.2); } 12% { opacity: 1; } 100% { opacity: 0; transform: scale(9); } }
@keyframes tvBurst  { 0% { opacity: 0; transform: scale(1); } 8% { opacity: .95; } 100% { opacity: 0; transform: scale(5.5); } }
@keyframes tvGlint  { from { background-position: 100% 0; } to { background-position: 0% 0; } }
@keyframes tvWipe   { from { clip-path: inset(0 50% 0 50%); opacity: .3; transform: scale(1.05); } to { clip-path: inset(0 0 0 0); opacity: 1; transform: none; } }
@keyframes tvBeam   { 0% { left: -50%; opacity: 0; } 20%, 80% { opacity: 1; } 100% { left: 150%; opacity: 0; } }
@keyframes tvWipeLight { 0% { background-position: 100% 0; opacity: 0; } 50% { opacity: 1; } 100% { background-position: 0% 0; opacity: 0; } }
@keyframes tvRise   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes tvWord   { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes tvBob    { 0%, 100% { transform: none; } 50% { transform: translateY(6px); } }
@keyframes tvDust   { 0% { opacity: 0; transform: translateY(0); } 25% { opacity: .8; } 100% { opacity: 0; transform: translateY(-180px); } }

/* The doors to the Forum: the hidden portfolio (five taps on the bust, see main.js; forum-traiani/ opens them again).
   Each door carries half of the eagle, so the two halves meet as they shut. */
.doors { position: fixed; inset: 0; z-index: 300; display: none; pointer-events: none; overflow: hidden; }
.door { position: absolute; top: 0; bottom: 0; width: 50%; background: var(--night); overflow: hidden; }
.door img { position: absolute; top: 50%; width: min(56vw, 56vh, 520px); max-width: none; translate: -50% -50%; } /* centred on the seam, so each door shows its own half */
.door-l { left: 0; }
.door-l img { left: 100%; }
.door-r { right: 0; }
.door-r img { left: 0; }
.door-closing .doors, .door-arrival .doors { display: block; pointer-events: auto; }
.door-closing .door-l { animation: tvDoorL 0.75s cubic-bezier(.6, 0, .25, 1) both; }
.door-closing .door-r { animation: tvDoorR 0.75s cubic-bezier(.6, 0, .25, 1) both; }
.door-opening .door-l { animation: tvDoorL 1s cubic-bezier(.6, 0, .25, 1) reverse both; }
.door-opening .door-r { animation: tvDoorR 1s cubic-bezier(.6, 0, .25, 1) reverse both; }
@keyframes tvDoorL { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes tvDoorR { from { transform: translateX(100%); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro *, .intro, .brand-mark { animation: none !important; transition: none !important; }
}
