/* ===========================================================================
   Denote — landing page (v2 redesign: typography-led, light/dark)
   Self-contained. Does NOT share classes with site.css (docs + explorations).
   Color tokens are ported verbatim from the app (src/renderer/src/globals.css).
   =========================================================================== */

/* ---------- Display face: Söhne Dreiviertelfett (self-hosted) ---------- */
@font-face {
  /* Single weight (Dreiviertelfett, ~640). Declared as a range so every
     headline weight resolves to this one file with no synthetic bolding. */
  font-family: "Soehne";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/soehne-dreiviertelfett.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  /* Light theme (app :root) */
  --bg: 222 20% 93%;
  --band: 0 0% 100%;
  --fg: 222 30% 10%;
  --fg-soft: 222 16% 28%;
  --fg-muted: 215 14% 44%;
  --card: 0 0% 100%;
  --border: 220 16% 80%;
  --hairline: 220 16% 85%;
  --accent: 217 91% 50%;
  --accent-strong: 217 91% 44%;
  --accent-fg: 0 0% 100%;
  --frame-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 24px 48px -24px rgba(16, 24, 40, 0.28);

  --font-display: "Soehne", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --measure: 42rem;
  --wrap: 90rem; /* 1440px — matches claude.com (--max-width--main) */
  --gutter: clamp(2rem, 1.43rem + 2.86vw, 4rem); /* 32–64px, matches claude.com (--site--margin) */
  --section-y: clamp(4.5rem, 9vw, 8.5rem);

  color-scheme: light;
}

.dark {
  /* Dark theme (app .dark) */
  --bg: 222 16% 4%;
  --band: 222 14% 7%;
  --fg: 210 20% 98%;
  --fg-soft: 213 23% 80%;
  --fg-muted: 215 20% 62%;
  --card: 222 14% 12%;
  --border: 222 12% 18%;
  --hairline: 222 12% 14%;
  --accent: 217 91% 62%;
  --accent-strong: 217 91% 70%;
  --accent-fg: 222 30% 8%;
  --frame-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 28px 60px -28px rgba(0, 0, 0, 0.7);

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: hsl(var(--bg));
  color: hsl(var(--fg));
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
  color: hsl(var(--fg));
}

p {
  margin: 0;
}

::selection {
  background: hsl(var(--accent) / 0.22);
}

:focus-visible {
  outline: 2px solid hsl(var(--accent));
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Layout primitives ---------- */
.wrap {
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--wrap);
  margin-inline: auto;
}

.measure {
  max-width: var(--measure);
}

.center {
  text-align: center;
  margin-inline: auto;
}

.section {
  padding-block: var(--section-y);
}

/* Banded sections create the Claude-like alternating rhythm. */
.band {
  background: hsl(var(--band));
  border-block: 1px solid hsl(var(--hairline));
  padding-block: var(--section-y);
}

.lead {
  font-size: clamp(1.125rem, 1.02rem + 0.5vw, 1.375rem);
  line-height: 1.5;
  color: hsl(var(--fg-soft));
}

.body {
  color: hsl(var(--fg-soft));
  line-height: 1.7;
}

.section-title {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  line-height: 1.08;
  text-wrap: balance;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: hsl(var(--accent) / 0.1);
  color: hsl(var(--accent-strong));
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* ---------- Top bar (static, scrolls away with the page) ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: hsl(var(--fg));
}

.brand svg {
  height: 1.5rem;
  width: auto;
  display: block;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.25rem;
  padding: 0 0.85rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: hsl(var(--fg-soft));
  text-decoration: none;
  border: 1px solid hsl(var(--border));
  border-radius: 9px;
  background: transparent;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.nav__btn:hover {
  color: hsl(var(--fg));
  background: hsl(var(--fg) / 0.05);
}

.nav__btn svg {
  width: 1.05rem;
  height: 1.05rem;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid hsl(var(--border));
  border-radius: 9px;
  background: transparent;
  color: hsl(var(--fg-soft));
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  color: hsl(var(--fg));
  background: hsl(var(--fg) / 0.05);
}

.theme-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}

.theme-toggle .icon-sun {
  display: none;
}
.dark .theme-toggle .icon-sun {
  display: block;
}
.dark .theme-toggle .icon-moon {
  display: none;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  color: hsl(var(--accent-fg));
  background: hsl(var(--accent));
  padding: 0.85rem 1.5rem;
  border-radius: 10px;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px hsl(var(--accent) / 0.25);
}

.btn-primary:hover {
  background: hsl(var(--accent-strong));
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px hsl(var(--accent) / 0.6);
}

.btn-primary svg {
  width: 1.05rem;
  height: 1.05rem;
}

/* Primary CTA keeps the light-mode treatment in dark mode too — white on deep blue.
   The lighter dark-mode accent makes dark button text muddy, so pin it for readability. */
.dark .btn-primary {
  color: hsl(0 0% 100%);
  background: hsl(217 91% 50%);
}
.dark .btn-primary:hover {
  background: hsl(217 91% 44%);
}

/* ---------- Hero (two-column: text left, art right) ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  min-height: min(90vh, 64rem);
  padding-top: clamp(1.5rem, 4vw, 3.5rem);
  padding-bottom: clamp(3rem, 6vw, 5.5rem);
}

.hero__title {
  font-size: clamp(2.5rem, 1.3rem + 3vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.018em;
}

.hero__sub {
  margin-top: clamp(1.5rem, 3vw, 2rem);
  max-width: 30rem;
  font-size: clamp(1.125rem, 1.02rem + 0.55vw, 1.375rem);
  line-height: 1.5;
  color: hsl(var(--fg-soft));
}

.hero__cta {
  margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
}

.hero__art {
  width: 100%;
}

.hero__shot {
  margin: 0;
  width: 100%;
}

/* Mobile: stack, screenshot on top */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    align-content: start;
    min-height: auto;
    gap: clamp(2rem, 8vw, 4rem);
    padding-top: clamp(1.5rem, 6vw, 3rem);
    padding-bottom: clamp(2.5rem, 7vw, 3.75rem);
  }
  .hero__art {
    order: -1;
  }
}

/* ---------- Screenshot frame ---------- */
.frame {
  margin: 0 auto;
  max-width: 64rem;
  border: 1px solid hsl(var(--border));
  border-radius: 14px;
  overflow: hidden;
  background: hsl(var(--card));
  box-shadow: var(--frame-shadow);
}

.frame img {
  width: 100%;
  height: auto;
}

/* ---------- Premise (statement) ---------- */
.statement {
  font-size: clamp(1.9rem, 1.3rem + 2.5vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  /* Wider than the reading measure so the headline lands on two lines */
  max-width: 56rem;
  margin-inline: auto;
}

.statement + .lead {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.premise-shot {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

/* ---------- Pipeline (the five steps): centered column ---------- */
.pipeline__head {
  max-width: 42rem;
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
}

.pipeline__intro {
  margin-top: 1.25rem;
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.5;
  color: hsl(var(--fg-muted));
}

.steps {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 42rem;
}

/* ---------- Intelligence (text 1/3 · knowledge demo 2/3) ---------- */
.intel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.section-title--sm {
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.4rem);
  text-wrap: wrap;
}
.intel__demo {
  min-width: 0;
}

/* ---------- Files (logos · text) ---------- */
.files {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
}
.files__logos {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(1.75rem, 4vw, 3.5rem);
}
.logo-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}
.logo {
  height: 52px;
  width: auto;
  display: block;
}
.logo-md,
.logo-json {
  color: hsl(var(--fg-soft));
}
.logo-card figcaption {
  font-size: 0.9rem;
  color: hsl(var(--fg-muted));
}
.files__text {
  max-width: 38rem;
}

@media (max-width: 64rem) {
  .intel {
    grid-template-columns: 1fr;
    gap: clamp(2rem, 5vw, 3rem);
  }
  /* Stacked: demo on top, text below */
  .intel__demo {
    order: -1;
  }
  .files {
    grid-template-columns: 1fr;
    gap: clamp(2rem, 5vw, 3rem);
  }
}

.step {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: clamp(1rem, 3vw, 2rem);
  padding-block: clamp(1.75rem, 3.5vw, 2.5rem);
  border-top: 1px solid hsl(var(--hairline));
}
.step:first-child {
  border-top: none;
}

.step__num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  font-feature-settings: "tnum" 1;
  color: hsl(var(--accent));
  line-height: 1.2;
}

.step__title {
  font-size: 1.625rem;
  line-height: 1.15;
}

.step__desc {
  margin-top: 0.6rem;
  color: hsl(var(--fg-soft));
  line-height: 1.65;
}

.step__lead-in {
  font-weight: 600;
  color: hsl(var(--fg));
}

.step__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.9rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: hsl(var(--accent-strong));
  text-decoration: none;
}

.step__link svg {
  width: 0.95rem;
  height: 0.95rem;
  transition: transform 0.15s ease;
}

.step__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.step__link:hover svg {
  transform: translateX(2px);
}

/* ---------- Generic section content spacing ---------- */
.prose > * + * {
  margin-top: 1.25rem;
}

.prose .lead + .body,
.prose .body + .body {
  margin-top: 1.5rem;
}

.section__title-block .section-title {
  margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
}

/* ---------- Closing ---------- */
.closing {
  text-align: center;
}

.closing__title {
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
  line-height: 1.06;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem);
}

.fineprint {
  display: block;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  font-size: 0.875rem;
  color: hsl(var(--fg-muted));
}

.fineprint a {
  color: hsl(var(--fg-soft));
  text-decoration: none;
}

.fineprint a:hover {
  color: hsl(var(--accent-strong));
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Page fade-in on load (whole site, incl. the above-the-fold hero) ---------- */
.js body {
  animation: page-fade-in 0.5s ease both;
}
@keyframes page-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Scroll reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js body {
    animation: none;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  body,
  .nav,
  .theme-toggle,
  .btn-primary {
    transition: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  /* Tighter side gutters (~4% each side / ~92% content width) + more breathing room above the logo */
  :root {
    --gutter: clamp(0.75rem, 4vw, 1.75rem);
  }
  .nav {
    padding-block: 1.5rem 1rem;
  }
  .step {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .step__num {
    font-size: 1.25rem;
  }
  /* Premise reads better left-aligned than centered on small screens */
  .statement,
  .statement + .lead {
    text-align: left;
  }
}
