/* Zora Constellation: the home sky and the door pages.
   One sky, five lit doors. Always dark: it is space. Every rule here has a reason in FORMULA.md. */

/* The footer holds the doors and the company links on one line and the owner line under it. */
:root { --footer-h: 78px; }

/* ---------- The stage ---------- */

.home, .gate-page {
  position: relative; isolation: isolate; overflow: hidden;
  background: #03060f radial-gradient(70% 60% at 70% 20%, rgba(78, 36, 150, 0.28), transparent 70%);
  color: #f2f1eb;
  --text: #f2f1eb; --text-2: rgba(242, 241, 235, 0.8); --text-3: rgba(242, 241, 235, 0.62);
  --line: rgba(242, 241, 235, 0.1); --line-2: rgba(242, 241, 235, 0.22);
  --accent: #9fe3de; --accent-2: #c2efeb; --on-accent: #03060f; --focus: #9fe3de;
  --plate: rgba(6, 13, 26, 0.74); --plate-2: rgba(9, 19, 36, 0.9);
}
.sky-gl { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; display: block; }
.home { display: flex; flex-direction: column; min-height: calc(100svh - var(--header-h) - var(--footer-h)); padding-block: clamp(14px, 2.6vh, 32px) 12px; }
.home-grid { flex: 1; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 0; }

/* Words first: the visitor must know what this is within seconds, so nothing waits for the sky. */
.home-top { max-width: 34em; }
.home-top .eyebrow { color: var(--accent); margin-bottom: clamp(8px, 1.4vh, 16px); }
.home-h1 { font-size: clamp(2.2rem, min(1.3rem + 4vw, 8.2vh), 4.8rem); text-shadow: 0 2px 40px rgba(3, 6, 15, 0.7); }
.home-lead { margin-top: clamp(10px, 1.8vh, 18px); max-width: 26em; font-size: clamp(1rem, 0.95rem + 0.3vw, 1.2rem); line-height: 1.45; color: var(--text-2); text-shadow: 0 1px 18px rgba(3, 6, 15, 0.9); }
.home-sky { min-height: 36px; }

/* ---------- Doors ---------- */

.gates { display: grid; gap: 10px; }
.gate { position: relative; display: flex; }
.gate-link {
  position: relative; flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 8px;
  padding: 22px 18px 16px;
  border: 1px solid rgba(242, 241, 235, 0.13); border-radius: 14px;
  background: var(--plate);
  color: inherit; text-decoration: none;
  box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.9);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.25s var(--ease), box-shadow 0.25s ease;
}
/* A thin line of the door's own color on its top edge: color says which door before a word is read. */
.gate-link::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--hue-rgb), 0.95), transparent);
}
.gate-link:hover, .gate-link:focus-visible {
  border-color: rgba(var(--hue-rgb), 0.7); background: var(--plate-2);
  transform: translateY(-4px);
  box-shadow: 0 34px 60px -30px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(var(--hue-rgb), 0.2), 0 0 40px -10px rgba(var(--hue-rgb), 0.35);
}
.gate-link:focus-visible { outline: 2px solid var(--hue); outline-offset: 3px; }
/* The star's anchor: the sky draws the star here. Without any canvas, the dot below stands in. */
.gate-star { position: absolute; left: 50%; top: 0; width: 1px; height: 1px; transform: translate(-50%, -50%); pointer-events: none; }
.no-sky .gate-star {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 25%, var(--hue) 45%, transparent 72%);
  box-shadow: 0 0 18px 4px rgba(var(--hue-rgb), 0.5);
}
.gate-mini { display: block; height: 64px; color: var(--hue); }
.gate-mini svg, .gate-figure svg { width: 100%; height: 100%; overflow: visible; }
.gate-you { font-size: clamp(1.05rem, 0.92rem + 0.55vw, 1.3rem); font-weight: 800; letter-spacing: -0.015em; line-height: 1.12; text-wrap: balance; }
.gate-name { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--hue); }
.gate-status { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; line-height: 1.3; color: var(--text-2); }
.gate-status::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.55; }
.gate[data-status="now"] .gate-status { color: var(--accent); }
.gate[data-status="now"] .gate-status::before { opacity: 1; box-shadow: 0 0 8px 1px var(--accent); }
.gate-go {
  display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px;
  font-size: 0.88rem; font-weight: 700; color: var(--hue);
}
.gate-go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.18s ease; }
.gate-link:hover .gate-go svg, .gate-link:focus-visible .gate-go svg { transform: translateX(4px); }
/* New for three weeks: a small mark in the corner, in the door's own color. */
.gate.is-new .gate-link::after {
  content: "New"; position: absolute; top: 10px; right: 12px; padding: 2px 8px; border-radius: 999px;
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.5;
  color: #03060f; background: var(--hue);
}
/* The door that works today is the brightest door: a steady line of its color and a soft glow. */
.gate[data-status="now"] .gate-link { border-color: rgba(var(--hue-rgb), 0.5); box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.9), 0 0 36px -12px rgba(var(--hue-rgb), 0.45); }

/* With JavaScript the doors arrive as their stars light. Without it, they are simply there. */
.js [data-sky]:not(.no-sky) .gate { opacity: 0; transition: opacity 0.7s ease; }
.js [data-sky]:not(.no-sky) .gate.is-lit { opacity: 1; }
.js [data-sky]:not(.no-sky) .home-top { animation: home-words 0.6s ease both; }
@keyframes home-words { from { opacity: 0; } to { opacity: 1; } }

.home-person { margin-top: 14px; font-size: 0.88rem; line-height: 1.5; color: var(--text-2); }
.home-person a { color: var(--text); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.home-person a:hover { color: var(--accent); }
.home-person .sep { margin-inline: 8px; color: var(--text-3); }

/* ---------- Compact footer: the home fits one screen ---------- */

.footer-compact {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
  min-height: var(--footer-h); padding: 8px var(--gutter);
  border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--text-3);
}
.footer-compact .footer-nav { gap: 0 16px; }
.footer-compact .footer-nav a { min-height: 36px; font-size: 0.82rem; }
.footer-compact p { margin: 0; }

/* ---------- Layouts ---------- */

/* Phones and narrow tablets: a spine. Every star sits on one vertical line at the left; the core is in the middle of it. */
@media (max-width: 899px) {
  .home-sky { min-height: 16px; }
  .home-h1 { font-size: clamp(2rem, 9.6vw, 2.6rem); }
  .home-lead { font-size: 0.95rem; max-width: 24em; }
  .gates { gap: 8px; }
  .gate-link { flex-direction: row; align-items: center; gap: 12px; padding: 9px 12px 9px 20px; border-radius: 12px; }
  .gate-link::before { left: auto; right: auto; top: 14px; bottom: 14px; width: 1px; height: auto; left: -1px; background: linear-gradient(180deg, transparent, rgba(var(--hue-rgb), 0.95), transparent); }
  .gate-star { left: 0; top: 50%; }
  .gate-mini { flex: none; width: 80px; height: 32px; }
  .gate-text-wrap { min-width: 0; }
  .gate-you { font-size: 0.95rem; }
  .gate-name { font-size: 0.66rem; letter-spacing: 0.1em; }
  .gate-status { font-size: 0.74rem; }
  .gate-go { display: none; }
  .gate.is-new .gate-link::after { top: 8px; right: 10px; padding: 1px 7px; font-size: 0.6rem; }
  .lead-more, .home-where, .home-person .sep:last-of-type { display: none; }
  .home-person { font-size: 0.82rem; }
  .footer-compact { flex-direction: column; align-items: flex-start; }
}
/* The spine layout puts the words in one column beside the miniature. */
@media (max-width: 899px) {
  .gate-link { display: grid; grid-template-columns: 80px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 12px; row-gap: 2px; }
  .gate-mini { grid-row: 1 / span 3; align-self: center; }
  .gate-you { grid-column: 2; }
  .gate-name { grid-column: 2; }
  .gate-status { grid-column: 2; }
}
@media (max-width: 899px) and (max-height: 760px) {
  .home-h1 { font-size: clamp(2rem, 9vw, 2.5rem); }
  .home-lead { display: none; }
  .gate-mini { width: 76px; height: 30px; }
  .gate-link { grid-template-columns: 76px minmax(0, 1fr); padding-block: 8px; }
}

/* Laptops and up: a row of five under the sky, the core raised. Stars sit on each door's top edge. */
@media (min-width: 900px) {
  .home { padding-bottom: 10px; }
  .home-grid { grid-template-rows: auto minmax(48px, 1fr) auto auto; }
  .gates { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
  .gate[data-core] { margin-bottom: 36px; }
  .gate[data-core] .gate-link { background: rgba(6, 13, 26, 0.66); }
  .gate-link { min-height: 196px; }
  .home-person { margin-top: 16px; }
}
@media (min-width: 900px) and (max-height: 800px) {
  .home-h1 { font-size: clamp(2.2rem, min(1.3rem + 4vw, 7.6vh), 4.8rem); }
  .gate-mini { height: 56px; }
  .gate-link { min-height: 160px; padding-top: 18px; gap: 6px; }
  .gate[data-core] { margin-bottom: 28px; }
  .home-lead { margin-top: 8px; }
  .home-person { margin-top: 12px; }
}
@media (min-width: 900px) and (max-width: 1199px) {
  .gates { gap: 12px; }
  .gate-link { padding: 18px 14px 14px; gap: 6px; }
  .gate-you { font-size: 1rem; }
  .gate-name { font-size: 0.68rem; letter-spacing: 0.1em; }
  .gate-status, .gate-go { font-size: 0.8rem; }
  .gate-mini { height: 52px; }
  .gate[data-core] { margin-bottom: 24px; }
  /* The shared header is tight at this width: the same rule belongs in site.css for every page. */
  .nav-list { gap: 16px; }
  .nav-list a { font-size: 0.86rem; white-space: nowrap; }
  .site-header .header-cta { padding: 0 14px; font-size: 0.86rem; }
}
@media (min-width: 1200px) {
  .gates { gap: 22px; }
  .gate-link { padding: 24px 20px 18px; }
}

/* ---------- Door pages ---------- */

.gate-page { display: flex; flex-direction: column; justify-content: center; min-height: calc(100svh - var(--header-h) - var(--footer-h) - var(--armbar-h, 0px)); padding-block: clamp(24px, 5vh, 56px); }
.gate-page-grid { display: grid; gap: 28px; align-items: center; }
.gate-page .eyebrow { color: var(--hue); }
.gate-h1 { font-size: clamp(2.3rem, min(1.3rem + 4vw, 9vh), 4.6rem); text-shadow: 0 2px 40px rgba(3, 6, 15, 0.7); }
.gate-status-page { margin-top: 14px; color: var(--text-2); }
.gate-page[data-status="now"] .gate-status-page { color: var(--accent); }
.gate-text { margin-top: 14px; max-width: 30em; font-size: clamp(1rem, 0.95rem + 0.3vw, 1.2rem); line-height: 1.5; color: var(--text-2); }
.gate-person { margin-top: clamp(18px, 3vh, 30px); font-size: 0.9rem; color: var(--text-2); }
.gate-person a { color: var(--text); font-weight: 700; }
.gate-figure { position: relative; width: min(100%, 520px); margin-inline: auto; color: var(--hue); aspect-ratio: 220 / 84; }
.gate-figure .gate-star { left: 50%; top: 50%; }
.gate-figure svg { position: relative; filter: drop-shadow(0 0 18px rgba(var(--hue-rgb), 0.35)); }
@media (min-width: 900px) {
  .gate-page-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; }
  .gate-figure { width: min(100%, 560px); }
}

/* ---------- Miniatures: still until asked. What is live, moves. ----------
   A door plays its glimpse once when its star lights (.is-glimpse), and loops while the pointer or focus is on it (.is-live).
   The door that is available now loops always: the one thing that works today should be seen working. */

.mini { display: block; }
.mb-scan { opacity: 0; }
.mb-flag { opacity: 0.55; }
.is-glimpse .mb-scan, .is-live .mb-scan { animation: mb-scan 2.6s linear both; }
.is-glimpse .mb-flag, .is-live .mb-flag { animation: mb-flag 2.6s linear both; }
.is-glimpse .mb-flag-2, .is-live .mb-flag-2 { animation-name: mb-flag-2; }
.is-glimpse .mb-band, .is-live .mb-band { animation: mb-band 2.6s linear both; }
.is-glimpse .mb-band-2, .is-live .mb-band-2 { animation-name: mb-band-2; }
.is-live .mb-scan, .is-live .mb-flag, .is-live .mb-band { animation-iteration-count: infinite; }
@keyframes mb-scan { 0% { transform: translateX(0); opacity: 0; } 4% { opacity: 1; } 78% { transform: translateX(198px); opacity: 1; } 84%, 100% { transform: translateX(198px); opacity: 0; } }
@keyframes mb-flag { 0%, 30% { opacity: 0.55; color: inherit; } 36%, 92% { opacity: 1; color: #fe9a00; } 100% { opacity: 0.55; } }
@keyframes mb-flag-2 { 0%, 60% { opacity: 0.55; color: inherit; } 66%, 92% { opacity: 1; color: #fe9a00; } 100% { opacity: 0.55; } }
@keyframes mb-band { 0%, 30% { opacity: 0; } 36%, 92% { opacity: 0.14; } 100% { opacity: 0; } }
@keyframes mb-band-2 { 0%, 60% { opacity: 0; } 66%, 92% { opacity: 0.14; } 100% { opacity: 0; } }
.mb-flag, .mb-band { color: inherit; }
.mb-flag path { stroke: currentColor; }
.mb-band { fill: #fe9a00; }

.mbal-beam { transform-box: view-box; transform-origin: 110px 20px; transform: rotate(-7deg); }
.is-glimpse .mbal-beam, .is-live .mbal-beam { animation: mbal 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.is-live .mbal-beam { animation-iteration-count: infinite; animation-direction: alternate; }
@keyframes mbal { 0% { transform: rotate(-7deg); } 60% { transform: rotate(1.5deg); } 100% { transform: rotate(0deg); } }

.mc-ring { transform-box: fill-box; transform-origin: center; }
.is-glimpse .mc-ring, .is-live .mc-ring { animation: mc-breathe 2.8s ease-in-out both; }
.is-live .mc-ring { animation-iteration-count: infinite; }
.is-live .mc-r2 { animation-delay: 0.25s; }
.is-live .mc-r1 { animation-delay: 0.5s; }
.is-glimpse .mc-nodes, .is-live .mc-nodes { animation: mc-pulse 2.8s ease-in-out both; }
.is-live .mc-nodes { animation-iteration-count: infinite; }
@keyframes mc-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes mc-pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

.mw-cube { transform-box: fill-box; transform-origin: center; }
.is-glimpse .mw-cube, .is-live .mw-cube { animation: mw-rise 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.is-live .mw-cube { animation-iteration-count: infinite; }
.is-glimpse .mw-c2, .is-live .mw-c2 { animation-delay: 0.18s; }
.is-glimpse .mw-c3, .is-live .mw-c3 { animation-delay: 0.36s; }
.is-glimpse .mw-c4, .is-live .mw-c4 { animation-delay: 0.54s; }
@keyframes mw-rise { 0% { opacity: 0; transform: translateY(10px); } 22%, 86% { opacity: 1; transform: none; } 100% { opacity: 1; } }
.is-live .mw-sun { animation: mw-sun 6s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes mw-sun { to { transform: rotate(360deg); } }

.md-head { transform: translateX(110px); }
.md-layers rect { opacity: 1; }
.is-glimpse .md-head, .is-live .md-head { animation: md-head 2.8s ease-in-out both; }
.is-live .md-head { animation-iteration-count: infinite; }
.is-glimpse .md-layers rect, .is-live .md-layers rect { animation: md-layer 2.8s linear both; }
.is-live .md-layers rect { animation-iteration-count: infinite; }
.is-glimpse .md-l2, .is-live .md-l2 { animation-delay: 0.5s; }
.is-glimpse .md-l3, .is-live .md-l3 { animation-delay: 1s; }
.is-glimpse .md-l4, .is-live .md-l4 { animation-delay: 1.5s; }
@keyframes md-head { 0% { transform: translateX(80px); } 25% { transform: translateX(140px); } 50% { transform: translateX(80px); } 75% { transform: translateX(140px); } 100% { transform: translateX(80px); } }
@keyframes md-layer { 0% { opacity: 0; } 12%, 90% { opacity: 1; } 100% { opacity: 1; } }
.is-live .md-layers rect { animation-name: md-layer-loop; }
@keyframes md-layer-loop { 0% { opacity: 0; } 12%, 80% { opacity: 1; } 92%, 100% { opacity: 0; } }

/* After a glimpse the miniature settles at its finished state. */
.mb-flag, .mbal-beam, .mw-cube, .md-layers rect { animation-fill-mode: both; }

@media (prefers-reduced-motion: reduce) {
  .mini * { animation: none !important; }
  .mbal-beam { transform: none; }
  .md-layers rect { opacity: 1; }
  .js [data-sky] .gate, .js [data-sky] .home-top { opacity: 1; animation: none; }
}
