/* Warm light, long context, and a quiet place for the message. */
:root {
  --night: #14100B;
  --ground: #0D0906;
  --pale: #F3EAD9;
  --gold: #D9A465;
  --muted: #BDA589;
  --gutter: clamp(1.25rem, 4vw, 5rem);
}
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; }
body {
  position: relative; margin: 0; min-height: 100svh;
  display: grid; grid-template-rows: auto 1fr auto;
  background: var(--ground); color: var(--pale);
  font: 400 1rem/1.5 "Poppins", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* The scene scrolls with the page, so on short or zoomed screens the tagline never slides over the artwork. */
#scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; pointer-events: none; }
.bar, main, .foot { position: relative; z-index: 1; padding-inline: var(--gutter); }
a { color: inherit; }
/* A dark halo under the ring keeps focus distinct where it crosses lit threads or the source. */
a:focus-visible, button:focus-visible { outline: 2px solid var(--pale); outline-offset: 4px; box-shadow: 0 0 0 9px rgba(13,9,6,.92); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding-top: calc(28px + env(safe-area-inset-top));
}
.mark { display: inline-flex; align-items: center; min-height: 44px; flex: none; }
.mark img { height: 40px; width: auto; }
.x-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid rgba(217,164,101,.65); border-radius: 999px;
  color: var(--pale); text-decoration: none; font-size: clamp(.875rem, .62vw, 1rem); font-weight: 500;
  background: rgba(20,16,11,.65);
  transition: background-color .2s, border-color .2s;
}
.x-btn svg, .x-link svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.x-btn:hover { background: #3E2417; border-color: var(--gold); }
.x-link { display: inline-flex; align-items: center; gap: 9px; }
/* The top padding is only a floor: on tall screens main grows and the tagline sits low;
   on short or zoomed screens it shrinks with the viewport so contact stays in view. */
main { display: flex; align-items: flex-end; justify-content: flex-end; padding-top: clamp(6rem, 40svh, 380px); padding-bottom: clamp(1.25rem, 4.5svh, 3.6rem); }
h1 {
  position: relative; margin: 0; font-weight: 500; text-align: right;
  font-size: clamp(2rem, 3.4vw, 5.25rem); line-height: 1.15; letter-spacing: -.02em;
  text-wrap: balance;
  text-shadow: 0 2px 28px var(--ground);
}
/* With the scene running, the words land as the threads reach their applications.
   Without the script the tagline shows at once. */
.enhanced h1 { animation: arrive 1s ease-out .8s both; }
h1::before {
  content: ""; position: absolute; z-index: -1; inset: -1.5rem -1.25rem;
  background: radial-gradient(closest-side, rgba(13,9,6,.8), rgba(13,9,6,0));
  pointer-events: none;
}
.hl { color: var(--gold); }
h1 a { display: inline-block; min-height: 44px; }
.enhanced h1.now { animation-delay: 0s; }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px 24px;
  padding-block: 2.25rem calc(1.375rem + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(13,9,6,0), rgba(13,9,6,.9) 48%, var(--ground));
  font-size: clamp(.9375rem, .9vw, 1.0625rem); color: var(--muted);
}
.foot p { position: relative; margin: 0; }
/* The stealth line keeps its own shade, so no rack light ever sits right behind it. */
.foot p::before {
  content: ""; position: absolute; z-index: -1; inset: -.75rem -1rem;
  background: radial-gradient(closest-side, rgba(13,9,6,.92) 55%, rgba(13,9,6,0));
  pointer-events: none;
}
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .75rem 1.75rem; }
.foot li:has(> [hidden]) { display: none; }
.foot ul a { display: inline-flex; align-items: center; min-height: 44px; }
.foot a { color: var(--pale); text-decoration: none; text-underline-offset: 5px; }
.foot a:hover { color: var(--gold); text-decoration: underline; }
.motion {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid rgba(217,164,101,.6); border-radius: 50%;
  background: var(--night); color: var(--pale); cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.motion[hidden] { display: none; }
.motion:hover { border-color: var(--gold); background: #3E2417; }
.motion svg { grid-area: 1 / 1; width: 14px; height: 14px; fill: currentColor; }
.motion .i-play, .motion[aria-pressed="true"] .i-pause { display: none; }
.motion[aria-pressed="true"] .i-play { display: block; }
.frozen h1, .settled h1, .enhanced.frozen h1, .enhanced.settled h1 { animation: none; }
@media (min-width: 1800px) {
  .mark img { height: 46px; }
  .x-btn { font-size: 1.0625rem; }
}
@media (max-width: 1100px) {
  .foot { flex-wrap: wrap; }
  .foot ul { margin-left: auto; }
}
@media (max-aspect-ratio: 9/10) and (min-width: 641px) {
  main { padding-top: clamp(8rem, 46svh, 650px); }
  h1 { max-width: 700px; font-size: clamp(42px, 5.5vw, 64px); }
}
/* Phones held upright. Landscape phones keep the wide layout, with the short-screen rules below. */
@media (max-width: 640px) and (max-aspect-ratio: 1/1) {
  :root { --gutter: 20px; }
  .bar { padding-top: calc(20px + env(safe-area-inset-top)); gap: 12px; flex-wrap: wrap; }
  .mark img { height: 31px; }
  .x-btn { padding: 9px 13px; gap: 8px; }
  .x-btn svg { width: 14px; height: 14px; }
  main { padding-top: clamp(8rem, 44svh, 478px); padding-bottom: 1.75rem; justify-content: flex-start; }
  h1 { text-align: left; max-width: 22rem; font-size: clamp(1.75rem, 8vw, 2.625rem); line-height: 1.13; }
  .foot { padding-block: 1rem calc(1.25rem + env(safe-area-inset-bottom)); gap: .5rem; font-size: .875rem; }
  .foot p { max-width: 22rem; }
  .foot ul { margin: 0; width: 100%; flex-direction: column; align-items: flex-start; gap: 0; }
  .foot .ctl { position: absolute; right: var(--gutter); bottom: calc(20px + env(safe-area-inset-bottom)); }
}
/* Narrowest phones: the X pill becomes an icon button that keeps its full name. */
@media (max-width: 380px) {
  .x-btn { width: 44px; padding: 0; }
  .x-btn span:not(.sr-only) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* Short landscape screens (landscape phones, 200% zoom): tighten the vertical rhythm. */
@media (max-height: 560px) and (min-aspect-ratio: 1/1) {
  .bar { padding-top: calc(.75rem + env(safe-area-inset-top)); }
  main { padding-top: 22svh; padding-bottom: .5rem; }
  /* Sized by the height too, so the scene keeps a usable band above the line. */
  h1 { font-size: clamp(1.375rem, min(3.4vw, 8svh), 3rem); }
  .foot { padding-block: .75rem calc(.5rem + env(safe-area-inset-bottom)); gap: 0 1rem; }
  .foot ul { gap: 0 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  h1, .enhanced h1 { animation: none; }
  *, *::before, *::after { transition: none !important; }
}
