/*
 * stardust.style v2 — foundation
 * Palette P10. Type: system stacks by design (no webfonts).
 * Every brand colour is a token on :root; the cube layer (styles/cube-palettes.css) recolours the
 * page by overriding these tokens on [data-cube-face]. Never add a raw hex outside :root.
 */

:root {
  /* P10 tokens */
  --page: #060a14;
  --navy: #081e3d;
  --glow: #163255;
  --gold: #f7ca6e;
  --coral: #ed6f4c;
  --text: #f4f2ec;
  --text-72: rgb(244 242 236 / 72%);
  --text-55: rgb(244 242 236 / 55%);
  --text-40: rgb(244 242 236 / 40%);
  --text-15: rgb(244 242 236 / 15%);
  --text-08: rgb(244 242 236 / 8%);
  --gold-tint: #fbe7be;

  /* the install stage sits on the seed colour; these pick the most readable ink and panel
     for that ground, per palette (styles/cube-palettes.css overrides them per face) */
  --seed-ink: var(--navy);
  --seed-panel: var(--navy);
  --seed-panel-ink: var(--text);

  /* type */
  --display: "SF Pro Display", -apple-system, blinkmacsystemfont, system-ui, sans-serif;
  --body: "SF Pro Text", -apple-system, blinkmacsystemfont, system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", menlo, monospace;

  /* layout */
  --pad: clamp(20px, 4vw, 64px);
  --maxw: 1440px;
  --nav-h: 56px;

  /* the nav is an overlay: nothing is reserved in flow (#108) */
  --nav-height: 0px;

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 0.32s;
  --dur: 0.8s;
  --dur-slow: 1.4s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--page);
}

html.lenis {
  scroll-behavior: auto;
}

body {
  display: none;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px/1.55 var(--body);
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.appear {
  display: block;
}

body.introducing {
  overflow: hidden;
}

/* film grain over everything (was <div class="grain"> in the prototype) */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 60;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.07;
  mix-blend-mode: soft-light;
  animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-2%, 3%); }
  40% { transform: translate(3%, -2%); }
  60% { transform: translate(-3%, -3%); }
  80% { transform: translate(2%, 2%); }
  100% { transform: translate(0, 0); }
}

header {
  height: var(--nav-height);
}

header .header,
footer .footer {
  visibility: hidden;
}

header .header[data-block-status="loaded"],
footer .footer[data-block-status="loaded"] {
  visibility: visible;
}

a {
  color: inherit;
  text-decoration: none;
}

a:any-link {
  color: inherit;
  text-decoration: none;
  overflow-wrap: break-word;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
}

::selection {
  background: var(--gold);
  color: var(--navy);
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- typography ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--display);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.t-hero {
  font-size: clamp(56px, 10.5vw, 168px);
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.t-xl {
  font-size: clamp(40px, 5.2vw, 84px);
  line-height: 1;
  letter-spacing: -0.035em;
}

.t-l {
  font-size: clamp(30px, 3.4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.t-m {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.t-lede {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(19px, 1.5vw, 24px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text-72);
  max-width: 44ch;
}

p {
  margin: 0 0 1em;
  color: var(--text-72);
  max-width: 62ch;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

pre {
  margin: 0;
}

.mono,
.eyebrow,
.label {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  line-height: 1;
}

.eyebrow {
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.label {
  color: var(--text-55);
}

.num-display {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.85;
}

.mono-line {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* ---------- reveal system (driven by scripts/motion.js) ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
  will-change: opacity, transform;
}

[data-reveal].in {
  opacity: 1;
  transform: none;
}

[data-reveal="fade"] {
  transform: none;
}

[data-reveal="scale"] {
  transform: scale(0.96) translateY(12px);
}

/* masked line reveal: <span class="line"><span>text</span></span> */
.lines .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
}

.lines .line > span {
  display: block;
  transform: translateY(112%) rotate(0.6deg);
  transform-origin: 0 100%;
  transition: transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 110ms + var(--d, 0ms));
}

.lines.in .line > span {
  transform: none;
}

/* ---------- plus icon (appended by block JS to links and buttons) ---------- */
.plus {
  display: inline-block;
  width: 10px;
  height: 10px;
  position: relative;
  transition: transform 0.5s var(--ease-out);
}

.plus::before,
.plus::after {
  content: "";
  position: absolute;
  background: currentcolor;
  inset: 50% 0 auto;
  height: 1.5px;
  transform: translateY(-50%);
}

.plus::after {
  inset: 0 50% 0 auto;
  width: 1.5px;
  height: 100%;
  transform: translateX(50%);
}

a:hover .plus,
button:hover .plus {
  transform: rotate(90deg);
}

/* ---------- buttons: authored <strong><a> = primary, <em><a> = secondary ---------- */
p.button-wrapper {
  margin: 0;
  display: inline-flex;
  max-width: none;
}

a.button:any-link,
button.button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--text-15);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  transition: all var(--dur-fast);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  white-space: nowrap;
}

a.button.primary,
button.button.primary {
  z-index: 0;
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
  font-weight: 600;
}

a.button.primary::after,
button.button.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--text);
  transform: translateX(-101%);
  transition: transform 0.5s var(--ease-out);
  z-index: -1;
}

a.button.primary:hover::after,
button.button.primary:hover::after {
  transform: none;
}

a.button.secondary:hover,
button.button.secondary:hover {
  border-color: var(--gold);
}

/* ---------- shared layout + components ---------- */
.two {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 96px);
  align-items: start;
}

.aside-quote {
  border-left: 2px solid var(--gold);
  padding: 6px 0 6px 22px;
  align-self: start;
}

.aside-quote p {
  font-family: var(--display);
  font-size: clamp(18px, 1.5vw, 24px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 10px;
  max-width: 26ch;
}

.aside-quote p em {
  font-style: normal;
}

.aside-quote .mono,
.aside-quote p + p,
.aside-quote.small p + p {
  color: var(--text-55);
  display: block;
  letter-spacing: 0.1em;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  margin: 0;
  max-width: none;
}

.aside-quote.small {
  margin-top: 36px;
}

.aside-quote.small p {
  font-size: clamp(16px, 1.2vw, 19px);
  color: var(--text-72);
}

/* svg marks follow the tokens */
.f-gold { fill: var(--gold); }
.f-coral { fill: var(--coral); }
.f-text { fill: var(--text); }
.s-gold { stroke: var(--gold); }
.s-text { stroke: var(--text); }

/* ---------- sections: blocks paint their own stage, edge to edge ---------- */
main > .section {
  margin: 0;
}

main > .section > div {
  max-width: none;
  margin: 0;
  padding: 0;
}

main .section:empty {
  display: none;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  [data-reveal],
  .lines .line > span {
    opacity: 1 !important;
    transform: none !important;
  }

  body::after {
    display: none;
  }
}
