/* Althea Power. Foundation: tokens, reset, type, masthead, buttons, footer,
   motion primitives. Every colour is a variable so the brand palette can be
   swapped in one place when the identity lands. */

@layer reset, tokens, base, layout, components, theme;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
  ul, ol { padding: 0; list-style: none; }
  img, video { display: block; max-width: 100%; height: auto; }
  button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
  a { color: inherit; text-decoration: none; }
  input, select, textarea { font: inherit; color: inherit; }
  html { -webkit-text-size-adjust: 100%; }
}

@layer tokens {
  :root {
    /* Brand palette from the deck (marked placeholders there). */
    --ink: #3E2312;
    --ground: #F7F7F3;
    --surface: #E3E8EC;
    --live: #E2E049;
    --live-deep: #CAC426;

    --black: #0F0F0E;
    --black-2: #181817;
    --black-3: #222220;
    --clay: #B9B5AD;
    --clay-2: #9C9890;

    /* Role tokens. Dark bands override these. */
    --bg: var(--ground);
    --fg: var(--ink);
    --fg-2: color-mix(in oklab, var(--ink) 64%, var(--ground));
    --rule: color-mix(in oklab, var(--ink) 14%, transparent);
    --pill: color-mix(in srgb, var(--ink) 8%, transparent);

    /* Archivo: the width axis sets the voice. 100 for text and section
       type, 110–115 for the tagline and figures, so the wide set reads as
       the brand's own cut rather than a different font. */
    --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
    --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --wide: 112;
    --t-xs: .75rem;
    --t-s: .875rem;
    --t-m: 1rem;
    --t-lede: clamp(1.0625rem, .95rem + .5vw, 1.375rem);
    --t-h3: clamp(1.25rem, 1.05rem + .9vw, 1.75rem);
    --t-h2: clamp(2rem, 1.2rem + 3.2vw, 4.25rem);
    --t-h1: clamp(3.25rem, 1.6rem + 8vw, 9.5rem);

    --gutter: clamp(20px, 4vw, 56px);
    --col-gap: clamp(16px, 2.2vw, 36px);
    --max: 1600px;
    --sec: clamp(80px, 11vw, 168px);
    --head-h: 72px;
    --radius: 10px;

    --ease: cubic-bezier(.22, .61, .36, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --mo-ui: .22s;
    --mo-move: .7s;
  }
}

@layer base {
  html { background: var(--black); color: var(--fg); font-family: var(--font); font-optical-sizing: auto; line-height: 1.5; }
  body {
    background: var(--bg); color: var(--fg); min-height: 100svh;
    font-size: var(--t-m); font-weight: 400; font-variation-settings: "wdth" 100;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  }
  h1, h2, h3 { font-weight: 500; line-height: 1.04; letter-spacing: -.028em; text-wrap: balance; }
  h1 { font-size: var(--t-h1); line-height: .92; letter-spacing: -.04em; font-weight: 600; font-variation-settings: "wdth" var(--wide); }
  h2 { font-size: var(--t-h2); }
  h3 { font-size: var(--t-h3); letter-spacing: -.016em; }
  p { max-width: 62ch; text-wrap: pretty; }
  :focus-visible { outline: 2px solid var(--live-deep); outline-offset: 3px; }
  .skip { position: absolute; left: var(--gutter); top: -100px; z-index: 100; background: var(--ink); color: var(--ground); padding: .6em 1em; border-radius: 4px; }
  .skip:focus { top: 12px; }
  .screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .mono { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: .06em; text-transform: uppercase; font-weight: 400; }
  .display { font-size: var(--t-h2); font-weight: 500; line-height: 1.02; letter-spacing: -.03em; max-width: 18ch; }
  .display--xl { font-size: clamp(2.5rem, 1.2rem + 5.4vw, 6.25rem); max-width: 12ch; }
  .lede { font-size: var(--t-lede); line-height: 1.45; letter-spacing: -.01em; color: var(--fg-2); max-width: 52ch; }
  .prose > * + * { margin-top: 1em; }
  .prose a { text-decoration: underline; }
}

@layer layout {
  .wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
  .band { position: relative; padding-block: var(--sec); overflow: clip; }
  .band--light { background: var(--ground); color: var(--ink); --bg: var(--ground); --fg: var(--ink); --fg-2: color-mix(in oklab, var(--ink) 64%, var(--ground)); --rule: color-mix(in oklab, var(--ink) 14%, transparent); --pill: color-mix(in srgb, var(--ink) 8%, transparent); }
  .band--surface { background: var(--surface); color: var(--ink); --bg: var(--surface); --fg: var(--ink); --fg-2: color-mix(in oklab, var(--ink) 66%, var(--surface)); --rule: color-mix(in oklab, var(--ink) 16%, transparent); --pill: color-mix(in srgb, var(--ink) 8%, transparent); }
  .band--dark { background: var(--black); color: var(--ground); --bg: var(--black); --fg: var(--ground); --fg-2: rgba(247, 247, 243, .64); --rule: rgba(247, 247, 243, .14); --pill: rgba(247, 247, 243, .1); }
  .band > * { position: relative; z-index: 1; }
}

@layer components {

  /* Masthead: pills over the page, no bar. Tone follows the band beneath. */
  .masthead {
    position: fixed; left: 0; right: 0; top: 0; z-index: 50;
    height: var(--head-h); color: var(--ground);
    transition: color .4s var(--ease);
    --pill: rgba(247, 247, 243, .12); --pill-hi: rgba(247, 247, 243, .2);
  }
  .masthead.is-on-light { color: var(--ink); --pill: color-mix(in srgb, var(--ink) 8%, transparent); --pill-hi: color-mix(in srgb, var(--ink) 14%, transparent); }
  .masthead__row { display: flex; align-items: center; gap: 8px; height: 100%; padding-inline: clamp(14px, 1.6vw, 24px); }
  /* Wordmark: the client's logo lockup, drawn as a mask filled with the
     masthead's current colour, so one file follows the light and dark tones. */
  .wordmark { display: inline-flex; align-items: center; height: 44px; margin-right: 10px; color: currentColor; }
  .wordmark__logo {
    display: block; height: 44px; aspect-ratio: 1892 / 503; background: currentColor;
    -webkit-mask: url(../img/althea-logo.png) center / contain no-repeat; mask: url(../img/althea-logo.png) center / contain no-repeat;
  }
  /* Wordmark left, CTA right, the list centred between them. */
  .nav { display: flex; align-items: center; gap: 8px; flex: 1; }
  .nav__list { display: flex; gap: 6px; flex: 1; justify-content: center; }
  .nav__item { position: relative; }
  .nav__link {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
    background: var(--pill); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    font-size: var(--t-s); font-weight: 500; letter-spacing: -.01em; white-space: nowrap;
    transition: background var(--mo-ui) var(--ease);
  }
  .nav__link:hover, .nav__item.is-open > .nav__link, .nav__item:focus-within > .nav__link { background: var(--pill-hi); }
  .nav__item.is-here > .nav__link { box-shadow: inset 0 0 0 1px currentColor; }
  .nav__caret { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .7; }
  .nav__cta { margin-left: auto; height: 40px; }
  .nav__panel {
    position: absolute; left: 0; top: calc(100% + 8px); z-index: 5; min-width: 340px;
    visibility: hidden; opacity: 0; translate: 0 -6px;
    transition: opacity var(--mo-ui) var(--ease), translate var(--mo-ui) var(--ease), visibility var(--mo-ui);
  }
  .nav__item.is-open > .nav__panel { visibility: visible; opacity: 1; translate: 0 0; }
  @media (hover: hover) and (pointer: fine) {
    .nav__item--group:hover > .nav__panel, .nav__item--group:focus-within > .nav__panel { visibility: visible; opacity: 1; translate: 0 0; }
  }
  .nav__panel-in { background: var(--black-2); color: var(--ground); border: 1px solid rgba(247, 247, 243, .1); border-radius: 14px; padding: 8px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .6); }
  .nav__overview { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 12px 14px; border-radius: 8px; font-weight: 600; font-size: 1rem; letter-spacing: -.015em; }
  .nav__overview .mono { color: var(--live); }
  .nav__overview:hover { background: rgba(247, 247, 243, .06); }
  .nav__sub { border-top: 1px solid rgba(247, 247, 243, .1); margin-top: 6px; padding-top: 6px; }
  .nav__sub a { display: flex; gap: 14px; align-items: baseline; padding: 9px 14px; border-radius: 8px; font-size: var(--t-s); color: rgba(247, 247, 243, .8); }
  .nav__sub a:hover { background: rgba(247, 247, 243, .06); color: var(--ground); }
  .nav-toggle { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; background: var(--pill); margin-left: auto; }
  .nav-toggle__box { position: relative; display: block; width: 18px; height: 10px; }
  .nav-toggle__box i { position: absolute; left: 0; width: 100%; height: 1.5px; border-radius: 2px; background: currentColor; transition: transform var(--mo-ui) var(--ease); }
  .nav-toggle__box i:first-child { top: 0; }
  .nav-toggle__box i:last-child { bottom: 0; }
  .masthead.is-open .nav-toggle__box i:first-child { transform: translateY(4.25px) rotate(45deg); }
  .masthead.is-open .nav-toggle__box i:last-child { transform: translateY(-4.25px) rotate(-45deg); }

  /* Buttons */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    height: 44px; padding: 0 20px; border-radius: 999px;
    font-size: var(--t-s); font-weight: 600; line-height: 1; letter-spacing: -.01em; white-space: nowrap;
    transition: background var(--mo-ui), color var(--mo-ui), box-shadow var(--mo-ui), transform var(--mo-ui);
  }
  .btn:active { transform: translateY(1px); }
  .btn--lg { height: 54px; padding: 0 28px; font-size: 1rem; }
  .btn--live { background: var(--live); color: var(--black); }
  .btn--live:hover { background: #fff; }
  .btn--ghost { background: var(--pill); color: currentColor; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 35%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .btn--ghost:hover { background: var(--fg); color: var(--bg); }
  .btn--ink { background: var(--ink); color: var(--ground); }
  .btn--ink:hover { background: var(--black); }
  .arrow { position: relative; display: inline-block; width: 14px; height: 10px; }
  .arrow::before { content: ""; position: absolute; right: 1px; top: 1px; width: 7px; height: 7px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); }
  .arrow::after { content: ""; position: absolute; left: 0; right: 1px; top: 4.25px; height: 1.5px; background: currentColor; }
  .arrow--back { transform: rotate(180deg); }

  /* Render slots: the shape of a render before the render exists. */
  .slot { position: relative; width: 100%; background: var(--clay); overflow: hidden; isolation: isolate; }
  .slot::before { content: ""; position: absolute; inset: 0; background: radial-gradient(130% 95% at 28% 18%, color-mix(in oklab, var(--clay) 72%, white) 0%, var(--clay) 46%, var(--clay-2) 100%); }
  .slot--hero { aspect-ratio: 16 / 9; }
  .slot--still { aspect-ratio: 4 / 3; }
  .slot--atmo { aspect-ratio: 3 / 2; }
  .slot__note { position: absolute; right: 14px; bottom: 11px; z-index: 1; font-family: var(--mono); font-size: var(--t-xs); color: color-mix(in oklab, var(--ink) 52%, var(--clay)); }

  /* Footer: the brown lives here. */
  /* Footer: the brand yellow as a ground, brown type on it. */
  .foot { background: var(--live); color: var(--ink); padding-block: clamp(56px, 7vw, 96px) 28px; --fg-2: color-mix(in oklab, var(--ink) 74%, var(--live)); --rule: color-mix(in oklab, var(--ink) 22%, transparent); }
  .foot__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(28px, 4vw, 64px); }
  .foot__h { font-size: var(--t-s); font-weight: 600; letter-spacing: 0; margin-bottom: 12px; }
  .foot__col ul { display: grid; gap: 7px; font-size: var(--t-s); color: var(--fg-2); }
  .foot__col a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
  .foot__base { display: flex; justify-content: space-between; gap: 16px; margin-top: clamp(40px, 6vw, 72px); padding-top: 20px; border-top: 1px solid var(--rule); font-size: var(--t-xs); color: var(--fg-2); }

  /* Motion primitives. Settle once on load; reveal once on scroll. */
  .js [data-reveal] { opacity: 0; translate: 0 12px; transition: opacity .9s var(--ease), translate .9s var(--ease); }
  .js [data-reveal].is-in { opacity: 1; translate: 0 0; }
  .js [data-settle] { opacity: 0; translate: 0 18px; }
  .js .is-ready [data-settle] { animation: settle 1.1s var(--ease-out) forwards; }
  .js .is-ready [data-settle] ~ [data-settle] { animation-delay: .12s; }
  .js .is-ready [data-settle] ~ [data-settle] ~ [data-settle] { animation-delay: .24s; }
  .js .is-ready [data-settle] ~ [data-settle] ~ [data-settle] ~ [data-settle] { animation-delay: .36s; }
  @keyframes settle { to { opacity: 1; translate: 0 0; } }
  .js [data-mask] > * { clip-path: inset(12% 0 12% 0); transform: scale(1.06); transition: clip-path 1.4s var(--ease), transform 1.4s var(--ease); }
  .js [data-mask].is-in > * { clip-path: inset(0 0 0 0); transform: scale(1); }

  @media (max-width: 1100px) {
    .nav__link { padding: 0 12px; }
  }
  @media (max-width: 960px) {
    /* Glass masthead on phones: clear over the hero, frosted once scrolled so
       the wordmark and toggle hold against any band. Tint follows the tone. */
    .masthead {
      --glass: rgba(15, 15, 14, .55); --glass-line: rgba(247, 247, 243, .1);
      transition: color .4s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease);
      border-bottom: 1px solid transparent;
    }
    .masthead.is-on-light { --glass: rgba(247, 247, 243, .6); --glass-line: color-mix(in srgb, var(--ink) 12%, transparent); }
    .masthead.is-scrolled, .masthead.is-open {
      background-color: var(--glass); border-color: var(--glass-line);
      -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
    }
    /* Open menu: header and panel become one dark glass surface, whatever the band. */
    .masthead.is-open { --glass: rgba(15, 15, 14, .72); border-color: transparent; color: var(--ground); }
    .masthead.is-open .nav-toggle { --pill: rgba(247, 247, 243, .12); }
    .nav-toggle { display: inline-flex; }
    .nav {
      position: fixed; inset: var(--head-h) 12px auto 12px; max-height: calc(100svh - var(--head-h) - 12px); overflow: auto;
      display: grid; gap: 4px; align-content: start;
      padding: 10px; border-radius: 16px; background: var(--black-2); color: var(--ground); border: 1px solid rgba(247, 247, 243, .1);
      box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .6);
      visibility: hidden; opacity: 0; translate: 0 -6px;
      transition: opacity var(--mo-ui), translate var(--mo-ui), visibility var(--mo-ui);
      --pill: rgba(247, 247, 243, .06); --pill-hi: rgba(247, 247, 243, .12);
    }
    .masthead.is-open .nav { visibility: visible; opacity: 1; translate: 0 0; }
    .nav__list { flex-direction: column; gap: 2px; }
    .nav__link { width: 100%; justify-content: space-between; height: 46px; border-radius: 10px; backdrop-filter: none; -webkit-backdrop-filter: none; font-size: 1rem; }
    .nav__panel { position: static; min-width: 0; display: none; }
    .nav__item.is-open > .nav__panel { display: block; visibility: visible; opacity: 1; translate: 0 0; }
    .nav__panel-in { border: 0; box-shadow: none; background: transparent; padding: 0 0 6px; }
    .nav__cta { width: 100%; margin: 6px 0 0; }
    .foot__grid { grid-template-columns: 1fr 1fr; }
  }
  @media (max-width: 560px) {
    .foot__grid { grid-template-columns: 1fr; }
    .foot__base { flex-direction: column; }
  }
  @media (prefers-reduced-motion: reduce) {
    .js [data-reveal], .js [data-settle] { opacity: 1; translate: 0 0; animation: none; transition: none; }
    .js [data-mask] > * { clip-path: none; transform: none; transition: none; }
    .btn, .nav__link, .nav__panel { transition: none; }
  }
}
