/* ─────────────────────────────────────────────────────────────────
   kausframe.com — marketing site
   ────────────────────────────────────────────────────────────────*/

/* Tokens — mirror the studio app's design language so the brand
   reads as one continuous system between the .com and .io surfaces. */
:root {
  /* Type families — referenced everywhere via var() so the future
     Söhne / GT Sectra swap is a one-line change. Geist is the free
     alternative we ship with; Söhne is the paid upgrade target once
     budget allows (Klim Type Foundry, ~£300 modular licence). */
  --font-sans:  'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Future Söhne swap (when licence acquired):
       --font-sans: 'Söhne', 'Geist', system-ui, sans-serif;
     Future GT Sectra / Tiempos pairing (paid serif):
       --font-serif: 'GT Sectra', 'Cormorant Garamond', Georgia, serif;
  */

  --bg: #ffffff;
  --surface-2: #f3f3ee;
  --ink: #0a0a0a;
  --muted: #6e6e69;
  --rule: #e8e8e2;
  --rule-strong: #c8c8c0;
  --st-confirmed: #7c8a5b;
  --st-progress:  #b8945a;
  --st-pending:   #a89464;
}

[data-theme="dark"] {
  --bg: #0b0b0a;
  --surface-2: #1a1a17;
  --ink: #f3f3ee;
  --muted: #8a8a85;
  --rule: #1e1e1b;
  --rule-strong: #2c2c28;
  --st-confirmed: #92a070;
  --st-progress:  #c8a468;
  --st-pending:   #b8a474;
}

/* ─────────────────────────────────────────────────────────────────
   Reset + base
   ────────────────────────────────────────────────────────────────*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 200ms ease, color 200ms ease;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }

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

/* ─────────────────────────────────────────────────────────────────
   Header — minimal top-right affordances
   ────────────────────────────────────────────────────────────────*/
.site-head {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  pointer-events: none;
}
.site-head > * { pointer-events: auto; }

.site-head__home {
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex; align-items: baseline; gap: 4px;
}
.site-head__home .bracket { color: var(--muted); font-weight: 300; }
.site-head__home:hover { color: var(--muted); }
.site-head__home:hover .bracket { color: var(--ink); }

.site-head__right {
  display: flex; align-items: center; gap: 18px;
}

.site-head__signin {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
}
.site-head__signin:hover { color: var(--ink); }

.site-head__theme {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
  border-radius: 50%;
  transition: color 150ms ease;
}
.site-head__theme:hover { color: var(--ink); }
.site-head__theme[data-state="auto"] { color: var(--ink); }
.site-head__theme .theme-glyph {
  font-size: 16px; line-height: 1;
  transition: transform 200ms ease;
}
/* Subtle scale tap-feedback when state changes — replaces the old
   180° rotation hover, which competed with the glyph itself
   changing. */
.site-head__theme:active .theme-glyph { transform: scale(0.85); }

/* When signed-in (set by JS once whoami works): swap to avatar pip */
.site-head__signin.is-signed-in {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink);
}
.site-head__signin.is-signed-in::before {
  content: attr(data-initials);
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--ink);
  font-family: var(--font-sans);
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
  background: var(--bg);
}

/* ─────────────────────────────────────────────────────────────────
   Bands — vertical rhythm
   ────────────────────────────────────────────────────────────────*/
.band {
  padding: 140px 64px;
  position: relative;
}
.band--hero    { padding: 180px 64px 140px; }
.band--tall    { padding: 180px 64px; }
.band--invert  { background: var(--ink); color: var(--bg); transition: background-color 200ms ease, color 200ms ease; }
.band--rule    { border-top: 1px solid var(--rule); }
.band__inner {
  max-width: 960px;
  margin: 0 auto;
}
.band__inner--narrow { max-width: 720px; }
.band__inner--wide   { max-width: 1080px; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase;
  font-weight: 600; color: var(--muted);
  margin-bottom: 24px;
}
.eyebrow--invert { color: rgba(255, 255, 255, 0.5); }

/* ─────────────────────────────────────────────────────────────────
   Chapter opener — large Cormorant italic phrase that anchors each
   band. Used as the section title; replaces the small mono eyebrow
   pattern wherever an editorial landing moment is needed.

   Pairs with a tiny mono section label sitting above it in mono,
   so the page reads as a sequence of chapters with quiet numbering.
   ────────────────────────────────────────────────────────────────*/
.chapter {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 32px;
  align-items: baseline;
  margin-bottom: 72px;
}
.chapter__no {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
  align-self: start;
  padding-top: 28px;
}
.chapter__title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 72px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0;
}
.chapter__sub {
  display: block;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 14px;
  max-width: 50ch;
}
.chapter--invert .chapter__no { color: rgba(255,255,255,0.5); }
.chapter--invert .chapter__title { color: var(--bg); }
.chapter--invert .chapter__sub { color: rgba(255,255,255,0.65); }

@media (max-width: 720px) {
  .chapter { grid-template-columns: 1fr; gap: 12px; margin-bottom: 48px; }
  .chapter__no { padding-top: 0; }
  .chapter__title { font-size: 44px; }
}

/* Scroll-fade — bands fade in once when they enter view. The
   no-js fallback is "always visible" (opacity is set to 1 only
   by the IntersectionObserver). */
.js .band[data-band] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.js .band[data-band].is-in-view {
  opacity: 1;
  transform: translateY(0);
}
/* Hero never fades — it's the first thing seen */
.js .band--hero { opacity: 1; transform: none; }

/* Respect prefers-reduced-motion — disable all animations */
@media (prefers-reduced-motion: reduce) {
  .js .band[data-band],
  .js .band[data-band].is-in-view {
    opacity: 1; transform: none; transition: none;
  }
  .site-head__theme { transition: none; }
  .site-head__theme:hover { transform: none; }
}

/* ─────────────────────────────────────────────────────────────────
   Hero
   ────────────────────────────────────────────────────────────────*/
.mark {
  font-family: var(--font-sans);
  font-size: 84px; line-height: 1; font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
  display: inline-flex; align-items: baseline; gap: 18px;
}
.mark .bracket {
  font-weight: 300; color: var(--muted);
  font-size: 78px; line-height: 1;
  transition: color 150ms ease;
}
.mark:hover .bracket { color: var(--ink); }
.mark .word { display: inline-block; }

.hero__lead {
  margin-top: 56px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 38px; line-height: 1.2;
  color: var(--ink);
  max-width: 24ch;
}
.hero__sub {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px; color: var(--muted);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.hero__contact-row {
  margin-top: 56px;
}
.hero__contact {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--muted);
  letter-spacing: 0.08em;
  text-decoration: none;
}
.hero__contact:hover { color: var(--ink); }

/* ─────────────────────────────────────────────────────────────────
   Manifesto / prose
   ────────────────────────────────────────────────────────────────*/
.prose p {
  font-family: var(--font-sans);
  font-size: 17px; line-height: 1.6;
  color: var(--ink);
  margin: 0 0 20px;
  max-width: 60ch;
}
.prose p:last-child { margin-bottom: 0; }
.prose .lede {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin: 0 0 36px;
  max-width: 28ch;
}
.prose .closer {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 56px;
}

@media (max-width: 720px) {
  .prose .lede { font-size: 22px; }
}

/* ─────────────────────────────────────────────────────────────────
   Constellation + Frame
   ────────────────────────────────────────────────────────────────*/
.constellation {
  display: flex; gap: 80px; align-items: flex-start;
}
.constellation__art {
  flex: 0 0 380px;
}
.constellation__art svg {
  display: block; width: 100%; height: auto;
}
.constellation__body {
  flex: 1;
  max-width: 36ch;
}
.constellation__body .quote {
  font-family: var(--font-serif);
  font-weight: 400; font-size: 24px; line-height: 1.4;
  color: var(--ink);
  margin: 0 0 18px;
}
.constellation__body .quote em {
  font-style: italic;
  color: var(--ink);
}
.constellation__body .star-list {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--muted); letter-spacing: 0.06em;
  line-height: 1.9;
  margin-bottom: 28px;
}
.constellation__body .star-list .name {
  color: var(--ink); font-weight: 500;
}
.constellation__body .rule {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 28px 0;
}

/* ─── Constellation animations ─────────────────────────────────
   Reveal sequence (replayable — JS toggles .is-revealed on entry
   and leaves the viewport):

     0ms       diagram empty (only the frame rect visible)
     0-800ms   everything except the bow arc fades in: bowstring,
               stars, labels, arrow, supporting context, attribution
     200-1600ms bow arc draws itself across the three stars via
                stroke-dashoffset transition
     1600ms+   stars start twinkling, staggered

   Uses CSS transitions (not @keyframes) for the bow + opacity so
   the whole sequence runs again when scrolling away and back.
   ──────────────────────────────────────────────────────────── */

/* Everything in the SVG except the frame rect and the bow arc
   fades in once revealed. The bow has its own rule with combined
   opacity + stroke-draw transitions, excluded here so the wrapper's
   `transition: opacity` doesn't override it (specificity tie). */
.js #constellation-svg > *:not(rect):not(#bow-arc) {
  opacity: 0;
  transition: opacity 800ms ease-out;
}
.js #constellation-svg.is-revealed > *:not(rect):not(#bow-arc) {
  opacity: 1;
}

/* Bow arc — opacity fade + stroke-draw. Delays the dasharray
   draw 200ms so the curve appears sketched onto the diagram
   rather than spawning before the rest. */
.js #bow-arc {
  opacity: 0;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  transition:
    opacity 800ms ease-out,
    stroke-dashoffset 1400ms ease-out 200ms;
}
.js #constellation-svg.is-revealed #bow-arc {
  opacity: 1;
  stroke-dashoffset: 0;
}

/* Stars twinkle once the bow has drawn — staggered so they never sync. */
.js #constellation-svg.is-revealed .star {
  animation: twinkle 6s ease-in-out infinite;
}
.js #constellation-svg.is-revealed .star--b { animation-delay: 1600ms; }
.js #constellation-svg.is-revealed .star--m { animation-delay: 3200ms; }
.js #constellation-svg.is-revealed .star--a { animation-delay: 4800ms; }
@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .js #constellation-svg > *:not(rect):not(#bow-arc) { opacity: 1; transition: none; }
  .js #bow-arc { opacity: 1; stroke-dashoffset: 0; transition: none; }
  .js #constellation-svg.is-revealed .star { animation: none; }
}

/* ─────────────────────────────────────────────────────────────────
   Inside — thematic chapters of what's in the product.
   Five named movements: Author / Make / Run / Review / Reach.
   Each is a serif italic name (the landing typographic moment)
   paired with a single sentence describing the capability area.
   ────────────────────────────────────────────────────────────────*/
.inside-list {
  display: grid; gap: 0;
  margin: 0; padding: 0;
  list-style: none;
}
.inside-list li {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: baseline;
  padding: 36px 0;
  border-top: 1px solid var(--rule);
}
.inside-list li:last-child {
  border-bottom: 1px solid var(--rule);
}
.inside-list li.is-postscript {
  padding: 24px 0;
  grid-template-columns: 220px 1fr;
}
.inside-list .name {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 42px;
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.inside-list .what {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  max-width: 56ch;
}
.inside-list .is-postscript .name {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 6px;
}
.inside-list .is-postscript .what {
  color: var(--muted);
  font-style: italic;
  font-size: 14px;
}

@media (max-width: 720px) {
  .inside-list li {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 24px 0;
  }
  .inside-list .name { font-size: 32px; }
}

/* ─────────────────────────────────────────────────────────────────
   For — Studios + Artists, Creatives & Crew
   ────────────────────────────────────────────────────────────────*/
.for-group-head {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 80px 0 32px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.for-group-head:first-of-type { margin-top: 0; }

.for-preamble {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.4;
  color: var(--muted);
  margin: -8px 0 32px;
  max-width: 40ch;
}

.for-list { display: grid; gap: 0; }
.for-row {
  display: grid;
  grid-template-columns: 320px 1fr;
  align-items: baseline;
  gap: 40px;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
}
.for-row:last-child { border-bottom: 1px solid var(--rule); }
.for-row__who {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 42px;
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.for-row__what {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink);
  line-height: 1.55;
  max-width: 50ch;
}

@media (max-width: 720px) {
  .for-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 24px 0;
  }
  .for-row__who { font-size: 32px; }
}

/* ─────────────────────────────────────────────────────────────────
   Contact (inverted band)
   ────────────────────────────────────────────────────────────────*/
.contact__mailto {
  display: inline-block;
  font-family: var(--font-serif);
  font-weight: 400; font-size: 48px;
  color: var(--bg);
  text-decoration: underline;
  text-underline-offset: 8px;
  text-decoration-thickness: 1px;
}
.contact__sub {
  margin-top: 28px;
  font-family: var(--font-sans); font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  max-width: 50ch; line-height: 1.55;
}
.contact__form {
  margin-top: 40px;
  display: flex; gap: 0; max-width: 480px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.contact__form input {
  flex: 1;
  background: transparent; border: 0; outline: none;
  padding: 14px 18px;
  font-family: var(--font-sans); font-size: 13px;
  color: var(--bg);
}
.contact__form input::placeholder { color: rgba(255, 255, 255, 0.4); }
.contact__form input:focus { background: rgba(255, 255, 255, 0.04); }
.contact__form button {
  background: var(--bg); color: var(--ink);
  border: 0; padding: 0 22px;
  font-family: var(--font-sans); font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase; font-weight: 600;
}
.contact__form button:hover { background: var(--rule); }

/* ─────────────────────────────────────────────────────────────────
   Footer
   ────────────────────────────────────────────────────────────────*/
.site-foot {
  padding: 32px 64px;
  border-top: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--muted); letter-spacing: 0.06em;
}
.site-foot__left,
.site-foot__right { display: flex; align-items: center; gap: 18px; }
.site-foot .mark-mini {
  font-family: var(--font-sans); font-size: 12px;
  color: var(--ink);
  display: inline-flex; align-items: baseline; gap: 4px;
}
.site-foot .mark-mini .bracket { color: var(--muted); font-weight: 300; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

/* ─────────────────────────────────────────────────────────────────
   Boilerplate legal pages — privacy, legal, cookies
   ────────────────────────────────────────────────────────────────*/
.legal-page {
  max-width: 720px;
  margin: 120px auto 80px;
  padding: 0 32px;
}
.legal-page h1 {
  font-family: var(--font-serif);
  font-weight: 400; font-size: 40px; line-height: 1.15;
  margin-bottom: 12px;
}
.legal-page .updated {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 40px;
}
.legal-page h2 {
  font-family: var(--font-serif);
  font-weight: 400; font-size: 24px;
  margin: 32px 0 12px;
}
.legal-page p,
.legal-page li {
  font-family: var(--font-sans);
  font-size: 15px; line-height: 1.65;
  color: var(--ink);
  margin: 0 0 14px;
}
.legal-page ul {
  margin: 0 0 14px;
  padding-left: 0;
}
.legal-page li {
  position: relative;
  padding-left: 18px;
}
.legal-page li::before {
  content: '·';
  position: absolute; left: 4px; top: 0;
  color: var(--muted);
}
.legal-page a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-page .back {
  display: inline-block;
  margin-top: 56px;
  font-family: var(--font-mono);
  font-size: 11px; color: var(--muted);
  letter-spacing: 0.06em;
  text-decoration: none;
}
.legal-page .back:hover { color: var(--ink); }

/* ─────────────────────────────────────────────────────────────────
   Responsive — single break, mobile-friendly
   ────────────────────────────────────────────────────────────────*/
@media (max-width: 720px) {
  .site-head { padding: 14px 20px; }
  .band { padding: 64px 28px; }
  .band--hero { padding: 100px 28px 72px; }
  .mark { font-size: 56px; }
  .mark .bracket { font-size: 52px; }
  .hero__lead { font-size: 28px; }

  .constellation { flex-direction: column; gap: 32px; }
  .constellation__art { flex: 0 0 auto; max-width: 320px; }

  .for-row { grid-template-columns: 1fr; }
  .for-row__who { font-size: 22px; }

  .contact__mailto { font-size: 32px; }

  .site-foot {
    flex-direction: column; align-items: flex-start;
    padding: 32px 28px;
  }

  .legal-page { margin: 80px auto 60px; padding: 0 20px; }
  .legal-page h1 { font-size: 32px; }
}
