/* ==========================================================================
   TYPHOON STADIUM — root homepage
   Web Release 1.3

   Design language: the artwork is still the only ornament — but release 1.3
   stops treating the page as a printed plate.  The composition became a modern
   web layout instead:

     · a sticky header carrying the brand and the language switch, so the switch
       is a site control rather than a caption buried in the intro;
     · one full-bleed hero at the top, which is the honest shape of the approved
       artwork (1672 x 941) rather than a 3.4:1 letterbox cut out of it;
     · the two generations as two large, clickable cards with a real radius,
       a soft shadow, an internal hairline grid and one navy accent — the
       current generation filled, the archive one on paper;
     · one restrained entrance, and nothing that animates continuously.

   Fonts, colour and motion come from assets/tokens-2026.css.  Chinese and Latin
   are set differently there, keyed off <html lang>.
   ========================================================================== */

/* ==========================================================================
   Shell
   ========================================================================== */
.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--pad) clamp(28px, 4vw, 56px);
}

/* ==========================================================================
   Header
   The homepage is a document, so the way back to the top is the brand — the
   sticky bar is a convenience, not a navigation system.
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  padding: 10px 0;
  margin-bottom: clamp(14px, 2vw, 24px);
}

/* the frosted plate: a pseudo-element so the blur does not clip the contents */
.topbar::before {
  content: "";
  position: absolute;
  inset: 0 calc(var(--pad) * -1);
  background: rgba(237, 240, 244, 0.82);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid rgba(211, 218, 227, 0.7);
  z-index: -1;
}

.brand {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.brand__mark {
  font-size: clamp(12.5px, 1.1vw, 14px);
  letter-spacing: 0.26em;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.brand__sub {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ==========================================================================
   Hero
   The approved artwork, uncropped, at the top of the page.  The introduction
   sits on it behind glass: the plate is dark enough to guarantee contrast over
   the bright half of the storm and light enough to disappear over the pale half.
   ========================================================================== */
.hero {
  position: relative;
  margin: 0 calc(var(--pad) * -1) clamp(14px, 2vw, 22px);
  border-radius: 0 0 clamp(18px, 2vw, 28px) clamp(18px, 2vw, 28px);
  overflow: hidden;
  isolation: isolate;
  background: #dbe1e9;
}

.hero__art { margin: 0; }

.hero__art img {
  width: 100%;
  height: auto;
}

/* the second band of artwork only exists on phones */
.hero__band2 { display: none; }

/* a soft scrim, left to right.  The artwork has its own wordmark in the left
   third; the glass plate lands on exactly that, which would read as a doubled
   title, so the scrim is dense enough on the left to retire the baked-in type
   and falls away completely by two thirds. */
.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(222, 228, 236, 0.94) 0%,
    rgba(222, 228, 236, 0.80) 30%,
    rgba(222, 228, 236, 0.22) 52%,
    rgba(222, 228, 236, 0.00) 68%
  );
  pointer-events: none;
}

.hero__lead {
  position: absolute;
  left: clamp(20px, 4vw, 52px);
  bottom: clamp(20px, 4vw, 52px);
  z-index: 2;
  width: min(28rem, 58%);
  padding: clamp(18px, 2vw, 26px) clamp(20px, 2.2vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: clamp(14px, 1.5vw, 20px);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  box-shadow:
    0 2px 4px rgba(14, 23, 38, 0.05),
    0 30px 70px -40px rgba(14, 23, 38, 0.55);
}

.hero__lead .u-label { margin-bottom: clamp(9px, 1.1vw, 13px); }

.hero__title {
  margin: 0 0 clamp(8px, 1vw, 12px);
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1;
  letter-spacing: -0.022em;
  font-weight: 700;
  color: var(--navy-deep);
}

.hero__text {
  margin: 0;
  font-size: clamp(14.5px, 1.15vw, 16.5px);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 34ch;
}

.hero__hint { margin: clamp(14px, 1.6vw, 20px) 0 0; }

/* ==========================================================================
   Generations
   Two panels.  Generation 02 is the current design and is filled; Generation 01
   is an archive and sits on paper.  Same skeleton, opposite value — which is
   the whole argument the page is making.
   ========================================================================== */
.generations {
  display: grid;
  grid-template-columns: 1.06fr 1fr;
  gap: clamp(14px, 1.6vw, 22px);
  align-items: stretch;
}

.gen {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 2.4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
  color: var(--ink);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform 320ms var(--ease-out),
              box-shadow 320ms var(--ease-out),
              border-color 320ms var(--ease-out),
              background-color 320ms var(--ease-out);
}

/* the accent rule draws in from the left on hover */
.gen::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px; width: 100%;
  background: var(--navy);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 460ms var(--ease-out);
}

.gen:hover,
.gen:focus-visible {
  transform: translateY(-3px);
  border-color: #b9c3d1;
  box-shadow: var(--shadow-2);
}

.gen:hover::after,
.gen:focus-visible::after { transform: scaleX(1); }

.gen:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }

/* ---- head row: chip on the left, label and numeral on the right ---------- */
.gen__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: clamp(20px, 2.4vw, 30px);
}

.gen__head .u-chip { padding: 6px 11px; font-size: 11px; }

.gen__id {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-left: auto;
  text-align: right;
}

.gen__id .u-label { padding-top: 4px; }

.gen__index {
  font-size: clamp(34px, 3.6vw, 50px);
  line-height: 0.8;
  font-weight: 700;
  letter-spacing: -0.045em;
  color: var(--ink);
  opacity: 0.09;
  transition: opacity 320ms var(--ease-out);
  pointer-events: none;
  user-select: none;
}

.gen:hover .gen__index { opacity: 0.16; }

/* ---- body ---------------------------------------------------------------- */
.gen__name {
  margin: 0 0 clamp(10px, 1.1vw, 14px);
  font-size: clamp(22px, 2.3vw, 31px);
  line-height: 1.06;
  letter-spacing: -0.016em;
  font-weight: 700;
  color: var(--navy-deep);
}

.gen__desc {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.66;
  color: var(--ink-soft);
  max-width: 34rem;
}

/* ---- fact rail ----------------------------------------------------------- */
.gen__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: clamp(20px, 2.2vw, 28px) 0 0;
  padding: 0;
  list-style: none;
}

.gen__facts li {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-chip);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ---- call to action: pinned to the bottom so the two cards agree --------- */
.gen__cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  align-self: flex-start;
  margin-top: auto;
  padding-top: clamp(22px, 2.6vw, 34px);
  font-size: 13.5px;
  letter-spacing: 0.02em;
  font-weight: 700;
  color: var(--navy);
}

.gen__arrow {
  display: inline-block;
  transition: transform 320ms var(--ease-out);
}

.gen:hover .gen__arrow { transform: translateX(6px); }

/* ---- current generation: filled ------------------------------------------ */
.gen--primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #eef2f7;
  box-shadow:
    0 2px 4px rgba(14, 23, 38, 0.08),
    0 30px 66px -34px rgba(14, 23, 38, 0.72);
}

.gen--primary:hover,
.gen--primary:focus-visible {
  border-color: var(--navy-line);
  box-shadow:
    0 4px 8px rgba(14, 23, 38, 0.10),
    0 40px 80px -34px rgba(14, 23, 38, 0.80);
}

.gen--primary .gen__index { color: #ffffff; opacity: 0.14; }
.gen--primary:hover .gen__index { opacity: 0.22; }
.gen--primary .gen__id .u-label { color: #9fb0cb; }
.gen--primary .gen__name { color: #ffffff; }
.gen--primary .gen__desc { color: #c6d1e2; }
.gen--primary .gen__facts li {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: #d3dcec;
}
.gen--primary .gen__cta { color: #ffffff; }
.gen--primary::after { background: #ffffff; }
.gen--primary .u-chip {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
.gen--primary .u-chip__dot { background: #7fd1c4; }

/* ==========================================================================
   Footer
   ========================================================================== */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: clamp(20px, 2.4vw, 30px);
  padding-top: clamp(14px, 1.6vw, 20px);
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.foot__spacer { margin-left: auto; }

/* ==========================================================================
   Portrait phones
   One wide composition cannot hold both the wordmark that is baked into the
   artwork and a readable introduction, so the hero swaps to the artwork's
   portrait bands and the introduction comes out of the glass and onto paper,
   where it has room.  The cards become a single column.
   ========================================================================== */
@media (max-width: 899px) {
  /* A full-bleed hero that still respects the page gutter.  On a wide screen the
     hero runs to the window edges and the introduction sits on the artwork; on a
     phone the negative gutter is dropped instead, so the artwork and the text
     below it share one left edge — a bleed here put the text flush against the
     side of the screen. */
  .hero {
    margin: 0 0 clamp(14px, 2vw, 22px);
    border-radius: clamp(14px, 3vw, 20px);
    background: var(--paper);
    isolation: auto;
  }

  /* On a phone the wide composition is replaced by two bands of the same
     artwork, stacked: the wordmark band, then a mirrored crop of the eye.  The
     wide <picture> is removed from the flow entirely so nothing is downloaded
     twice or shown twice.

     The band keeps its own aspect ratio.  A minimum height here would crop the
     band to the width of the file rather than to its shape, which is what hid
     the wordmark at 390 px, and upscaling a 730 px file to fill 834 px cost
     sharpness for nothing. */
  .hero__art > picture { display: none; }

  .hero__art > picture img { aspect-ratio: 1276 / 333; }

  .hero__band2 {
    display: block;
    /* pulled up by a hairline so the two bands read as one continuous graphic */
    margin-top: -1px;
  }

  .hero__scrim { display: none; }

  .hero__lead {
    position: static;
    width: auto;
    padding: clamp(18px, 4.4vw, 26px) 0 0;
    border: 0;
    border-radius: 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }

  .hero__lead .u-label { margin-bottom: 10px; }

  .hero__title { font-size: clamp(27px, 8.4vw, 40px); }

  .hero__text { max-width: none; }

  .generations { grid-template-columns: 1fr; }

  .gen__index { font-size: 40px; }

  /* on a phone the bar keeps the brand on one line and the switch on the other */
  .brand__sub { display: none; }
}

@media (max-width: 560px) {
  .topbar { min-height: 56px; }
  .gen { padding: 20px 18px; }

  /* On a narrow card the watermark numeral belongs with the label, above the
     title — not behind it, where it reads as smudged type. */
  .gen__id {
    order: -1;
    margin-left: 0;
    text-align: left;
    width: 100%;
  }

  .gen__head { gap: 8px 12px; }

  .foot { justify-content: space-between; font-size: 10px; letter-spacing: 0.14em; }
  .foot__spacer { display: none; }
}

/* ==========================================================================
   Entrance — one restrained stagger, and nothing at all if the visitor has
   asked for reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .hero,
  .gen,
  .foot {
    opacity: 0;
    transform: translateY(12px);
    animation: rise 640ms var(--ease-out) forwards;
  }

  .gen:nth-of-type(1) { animation-delay: 90ms; }
  .gen:nth-of-type(2) { animation-delay: 170ms; }
  .foot { animation-delay: 240ms; }

  @keyframes rise {
    to { opacity: 1; transform: none; }
  }
}

/* REV02: retain the approved 1.3 composition; add the third generation. */
body:not(.viewing){background:var(--paper);color:var(--ink)}
body:not(.viewing) .site-header{position:sticky;top:0;height:62px;padding:0 var(--pad);max-width:var(--measure);margin:auto;background:#edf0f4ed;backdrop-filter:blur(14px);border-bottom:1px solid var(--line);z-index:30}
body:not(.viewing) .wordmark{font-weight:700;font-size:14px}
#archive-page .hero{margin-top:18px}
#archive-page .generations{grid-template-columns:1fr 1fr 1.15fr}
.hero__text,.gen__desc{white-space:pre-line}
@media(max-width:899px){#archive-page .generations{grid-template-columns:1fr}.hero__art>picture{display:block}.hero__art>picture img{aspect-ratio:auto}.hero__lead{padding:22px 4px}.gen--primary{order:-1}.hero__title{font-size:32px}}
