/* Commitments — static landing site.
 *
 * Ported from the app's frontend/src/styles/landing.css + tokens.css
 * (neutral palette, newsreader type stack, `held` mark). Kept as one plain
 * stylesheet so the site needs no build step while the core is in progress.
 */

@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@300;400;500;600;700&family=Newsreader:ital,opsz,wght@0,6..72,200..700;1,6..72,200..700&display=swap');

:root {
  --font-mono: 'Geist Mono', ui-monospace, 'Cascadia Code', 'JetBrains Mono', 'Fira Code', monospace;
  --font-display: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --font-serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;

  --display-weight: 400;
  --display-tracking: -0.015em;

  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;

  --leading-normal: 1.5;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  --border-width: 1px;
  --transition: 120ms ease-out;
}

[data-theme='light'] {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f4;
  --border: #e4e4e4;
  --border-strong: #c6c6c6;
  --text: #0a0a0a;
  --text-muted: #525252;
  --text-subtle: #6b6b6b;
  --accent: #0a0a0a;
  --accent-fg: #ffffff;
  --accent-soft: rgba(10, 10, 10, 0.06);
}

[data-theme='dark'] {
  --bg: #0a0a0a;
  --surface: #131313;
  --surface-2: #1b1b1b;
  --border: #242424;
  --border-strong: #3b3b3b;
  --text: #ededed;
  --text-muted: #a3a3a3;
  --text-subtle: #7c7c7c;
  --accent: #ededed;
  --accent-fg: #0a0a0a;
  --accent-soft: rgba(237, 237, 237, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Buttons -----------------------------------------------------------------
 * The subset of .ds-btn the page actually uses: default + primary, lg + sm. */

.btn {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: transparent;
  color: var(--text);
  border: var(--border-width) solid var(--border-strong);
  padding: 0 var(--space-4);
  height: 36px;
  min-width: 96px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--text-muted);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  filter: brightness(1.08);
}

.btn--lg {
  height: 44px;
  padding: 0 var(--space-6);
}

.btn--sm {
  height: 28px;
  font-size: var(--text-xs);
  padding: 0 var(--space-3);
  min-width: 72px;
}

.btn-icon {
  display: inline-flex;
  flex-shrink: 0;
}

/* Theme toggle — square icon button, sized to sit beside a small button. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: var(--border-width) solid var(--border-strong);
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--text-base);
  line-height: 1;
  padding: 0;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--text-muted);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* One glyph per theme; the inactive one is hidden. */
[data-theme='dark'] .theme-toggle-sun { display: none; }
[data-theme='light'] .theme-toggle-moon { display: none; }

/* Shell ------------------------------------------------------------------- */

.lp-shell {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.lp-skip {
  position: absolute;
  top: -40px;
  left: var(--space-4);
  background: var(--surface);
  color: var(--text);
  border: var(--border-width) solid var(--border-strong);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  z-index: 100;
}

.lp-skip:focus {
  top: var(--space-3);
}

.lp-skip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: var(--border-width) solid var(--border);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  z-index: 10;
}

@supports not (backdrop-filter: blur(8px)) {
  .lp-nav { background: var(--bg); }
}

.lp-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
}

.lp-nav-brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lp-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.lp-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Section frame ----------------------------------------------------------- */

.lp-section {
  width: 100%;
  padding: var(--space-16) var(--space-6);
  display: flex;
  justify-content: center;
}

.lp-section-inner {
  width: 100%;
  max-width: 1080px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lp-section-inner > * + * { margin-top: var(--space-4); }
.lp-section-inner > .lp-section-heading { margin-top: var(--space-3); }
.lp-section-inner > .lp-section-lead { margin-top: var(--space-6); }

.lp-section-inner > .lp-concept,
.lp-section-inner > .lp-app-grid {
  margin-top: var(--space-12);
}

.lp-hero-inner > * + *,
.lp-closing-inner > * + * {
  margin-top: 0;
}

/* Section eyebrow sits on a hairline that runs to the measure. Body sections
 * only — the centred bookends drop the rule. */
.lp-section-inner > .lp-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.lp-section-inner > .lp-eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.lp-hero-inner > .lp-eyebrow,
.lp-closing-inner > .lp-eyebrow {
  display: inline-flex;
  flex: 0 0 auto;
}

.lp-hero-inner > .lp-eyebrow::after,
.lp-closing-inner > .lp-eyebrow::after {
  content: none;
}

/* Hero -------------------------------------------------------------------- */

.lp-hero {
  min-height: min(88vh, 920px);
  align-items: center;
  padding-top: clamp(var(--space-12), 9vh, 112px);
  padding-bottom: clamp(var(--space-12), 9vh, 112px);
}

.lp-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
  text-align: center;
  max-width: 960px;
}

.lp-hero-inner > .lp-subhead { margin-top: var(--space-6); }
.lp-hero-inner > .lp-cta-row { margin-top: var(--space-8); }

.lp-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.lp-headline {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.7rem + 3.4vw, 5.75rem);
  line-height: 1.04;
  letter-spacing: var(--display-tracking);
  margin: 0;
  font-weight: var(--display-weight);
  color: var(--text);
  text-wrap: balance;
  word-break: break-word;
  hyphens: auto;
}

.lp-accent-word {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text);
}

.lp-headline .lp-accent-word {
  display: block;
}

.lp-subhead {
  font-family: var(--font-mono);
  font-size: clamp(0.94rem, 0.85rem + 0.45vw, 1.1875rem);
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0;
  text-wrap: balance;
}

.lp-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

/* Section heading + lead --------------------------------------------------- */

.lp-section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 1.15rem + 1.4vw, 2.625rem);
  line-height: 1.14;
  letter-spacing: var(--display-tracking);
  margin: 0;
  font-weight: var(--display-weight);
  color: var(--text);
}

.lp-section-lead {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--text-muted);
  max-width: 64ch;
  margin: 0;
}

.lp-pull-quote {
  margin-top: auto;
  border-left: 2px solid var(--border-strong);
  padding: var(--space-3) var(--space-4);
  background: var(--accent-soft);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-xl);
  line-height: 1.4;
  color: var(--text);
  max-width: 60ch;
}

/* Two-column "concept + illustration" pattern ------------------------------ */

.lp-concept {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-12);
  align-items: stretch;
}

@media (width <= 880px) {
  .lp-concept {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

.lp-concept-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.lp-concept-points {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  margin: 0;
}

.lp-concept-point {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--space-3);
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: var(--leading-normal);
}

.lp-concept-point strong {
  color: var(--text);
  font-weight: 500;
}

.lp-concept-point-num {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}

.lp-concept-illus {
  display: grid;
  grid-template-rows: 1fr auto;
  margin: 0;
  padding: 0;
  min-height: 340px;
  background: transparent;
  border: var(--border-width) solid var(--border);
}

.lp-concept-illus-plate {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  min-width: 0;
}

.lp-concept-illus svg {
  width: 100%;
  height: auto;
  max-width: 480px;
}

@media (width <= 880px) {
  .lp-concept-illus { min-height: 240px; }
  .lp-concept-illus-plate { padding: var(--space-4); }
}

@media (width <= 540px) {
  .lp-concept-illus { min-height: 200px; }
  .lp-concept-illus-plate { padding: var(--space-3); }
}

.lp-concept-illus-caption {
  border-top: var(--border-width) solid var(--border);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  text-transform: uppercase;
  text-align: center;
}

/* Applications grid -------------------------------------------------------- */

.lp-app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: var(--border-width) solid var(--border);
  border-left: var(--border-width) solid var(--border);
}

@media (width <= 1180px) {
  .lp-app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (width <= 880px) {
  .lp-app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (width <= 640px) {
  .lp-app-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}

.lp-app-card {
  padding: var(--space-4);
  background: transparent;
  border-right: var(--border-width) solid var(--border);
  border-bottom: var(--border-width) solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 160px;
  transition: background var(--transition);
}

.lp-app-card:hover { background: var(--accent-soft); }

.lp-app-card-index {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}

.lp-app-card-name {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  color: var(--text);
  letter-spacing: 0.02em;
  font-weight: 500;
}

.lp-app-card-blurb {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-normal);
  margin: 0;
}

/* Closing ------------------------------------------------------------------ */

.lp-closing {
  border-top: var(--border-width) solid var(--border);
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.lp-closing-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  text-align: center;
  max-width: 880px;
}

.lp-closing-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.35rem + 2.2vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: var(--display-tracking);
  margin: 0;
  font-weight: var(--display-weight);
  color: var(--text);
  max-width: 20ch;
}

.lp-closing-lead {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0;
}

/* Footer ------------------------------------------------------------------- */

.lp-footer {
  border-top: var(--border-width) solid var(--border);
  padding: var(--space-8) var(--space-6);
  display: flex;
  justify-content: center;
  background: var(--surface);
}

.lp-footer-inner {
  width: 100%;
  max-width: 1080px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-subtle);
  letter-spacing: 0.05em;
}

.lp-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.lp-footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.lp-footer-link {
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
}

.lp-footer-link:hover {
  color: var(--accent);
}

.lp-footer-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Illustration shared bits ------------------------------------------------- */

.lp-illus-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--text-muted);
}

.lp-illus-label--accent {
  fill: var(--accent);
}

.lp-illus-stroke {
  stroke: var(--border-strong);
  stroke-width: 1;
  fill: none;
}

.lp-illus-stroke--accent {
  stroke: var(--accent);
}

/* Value in motion: dashed line marching in the direction the path is drawn.
 * One dash period (4 + 4 units) per 1.6s. */
.lp-illus-flow {
  stroke-dasharray: 4 4;
  animation: lp-illus-flow 1.6s linear infinite;
}

@keyframes lp-illus-flow {
  to {
    stroke-dashoffset: -8;
  }
}

/* Scroll reveal ------------------------------------------------------------
 * Stands in for the app's framer-motion fade-ups: elements with [data-reveal]
 * start shifted down and fade in once, when they enter the viewport. The
 * no-JS fallback below keeps everything visible if the script never runs. */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--reveal-delay, 0s);
}

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

html:not(.js) [data-reveal] {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .lp-shell *,
  .lp-shell *::before,
  .lp-shell *::after {
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
  }
}

/* Mobile ------------------------------------------------------------------- */

@media (width <= 720px) {
  .lp-section {
    padding: var(--space-12) var(--space-4);
  }

  .lp-hero,
  .lp-closing {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }

  .lp-nav { padding: var(--space-3) var(--space-4); }

  .lp-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .lp-footer-links {
    gap: var(--space-2) var(--space-5);
    row-gap: var(--space-3);
  }

  .lp-footer-link {
    padding: var(--space-2) 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

@media (width <= 540px) {
  .lp-nav { position: static; }

  .lp-cta-row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  .lp-cta-row > * {
    width: 100%;
  }
}
