/* TelexMail landing page — Keycap Workshop, per root DESIGN.md.
   Geist / Geist Mono — SIL Open Font License 1.1, https://github.com/vercel/geist-font */

@font-face {
  font-family: 'Geist';
  src: url('fonts/Geist-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('fonts/Geist-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('fonts/Geist-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('fonts/Geist-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/GeistMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens (names and values match frontend/src/assets/main.css) ── */

:root {
  --color-canvas-base: #fcfcf9;
  --color-surface-white: #ffffff;
  --color-surface-muted: #f4f4f0;
  --color-ink-primary: #18181b;
  --color-ink-muted: #71717a;
  --color-brand-primary: #e58e12;
  --color-brand-hover: #d4890f;
  --color-brand-lip: #b46b08;
  --color-danger: #b42318;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Zero blur. Always. */
  --shadow-keycap: 0 3.5px 0 0 #18181b;
  --shadow-keycap-sm: 0 2px 0 0 #18181b;
  --shadow-keycap-brand: 0 3.5px 0 0 #b46b08;
  --shadow-keycap-brand-sm: 0 2px 0 0 #b46b08;
  --shadow-card: 4px 4px 0 0 #18181b;
  --shadow-card-hover: 5px 5px 0 0 #18181b;
  --shadow-card-brand: 5px 5px 0 0 #b46b08;
  --shadow-modal: 8px 8px 0 0 #18181b;

  --border-ink: 1.5px solid var(--color-ink-primary);

  --font-sans: 'Geist', system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --text-display: clamp(2rem, 4vw, 3rem);
  --text-headline: 1.5rem;
  --text-title: 1.125rem;
  --text-body: 0.9375rem;
  --text-label: 0.8125rem;
  --text-mono: 0.875rem;

  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-section: 96px;

  --duration-press: 75ms;
  --duration-hover: 150ms;

  --header-height: 64px;
}

/* ── Base ── */

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--color-ink-primary) var(--color-canvas-base);
}

body {
  margin: 0;
  background: var(--color-canvas-base);
  color: var(--color-ink-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

::selection {
  background: var(--color-brand-primary);
  color: var(--color-ink-primary);
}

:focus-visible {
  outline: 2px solid var(--color-ink-primary);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -56px;
  left: var(--space-md);
  z-index: 20;
  background: var(--color-surface-white);
  border: var(--border-ink);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-md);
}

/* ── Layout ── */

.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-xl);
}

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

section[id] {
  scroll-margin-top: calc(var(--header-height) + var(--space-md));
}

.section-alt {
  background: var(--color-surface-muted);
}

/* Muted text fails 4.5:1 on the muted band — ink on colored surfaces. */
.section-alt :is(.section-label, .section-sub) {
  color: var(--color-ink-primary);
}

.section-label {
  margin-bottom: var(--space-md);
  color: var(--color-ink-muted);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.section-title {
  margin-bottom: var(--space-xl);
  font-size: var(--text-headline);
  font-weight: 600;
  line-height: 1.2;
  max-width: 34ch;
}

.section-sub {
  margin-bottom: var(--space-xl);
  color: var(--color-ink-muted);
  max-width: 32rem;
}

/* ── Header / nav ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-surface-white);
  border-bottom: var(--border-ink);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: auto;
  flex-shrink: 0;
}

.brand-lip {
  fill: var(--color-ink-primary);
}

.brand-key {
  fill: var(--color-brand-primary);
  stroke: var(--color-ink-primary);
}

.brand-envelope {
  fill: var(--color-surface-white);
  stroke: var(--color-ink-primary);
}

.brand-glyph {
  fill: none;
  stroke: var(--color-ink-primary);
}

.brand-word {
  display: inline-flex;
  align-items: baseline;
  font-size: var(--text-title);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-ink-primary);
}

.brand-telex {
  font-weight: 600;
}

.brand-mail {
  font-weight: 300;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-link {
  color: var(--color-ink-muted);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color var(--duration-hover) ease-out;
}

.nav-link:hover {
  color: var(--color-ink-primary);
}

.nav-toggle {
  display: none;
}

/* ── Buttons — keycaps ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--border-ink);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--duration-press) ease-out,
    box-shadow var(--duration-press) ease-out,
    background-color var(--duration-hover) ease-out;
}

.btn-primary {
  background: var(--color-brand-primary);
  color: var(--color-ink-primary);
  box-shadow: var(--shadow-keycap-brand);
}

.btn-primary:hover {
  background: var(--color-brand-hover);
}

.btn-secondary {
  background: var(--color-surface-white);
  color: var(--color-ink-primary);
  box-shadow: var(--shadow-keycap);
}

.btn-secondary:hover {
  background: var(--color-surface-muted);
}

/* The keycap press: depress the full shadow depth. */
.btn:active {
  transform: translateY(3.5px);
  box-shadow: none;
}

/* ── Hero ── */

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

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--space-2xl);
  align-items: center;
}

.hero-title {
  margin-bottom: var(--space-lg);
  font-size: var(--text-display);
  font-weight: 300;
  line-height: 1.1;
}

.hero-sub {
  margin-bottom: var(--space-xl);
  color: var(--color-ink-muted);
  max-width: 32rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.chip {
  display: inline-block;
  margin-bottom: var(--space-lg);
  background: var(--color-surface-muted);
  border: var(--border-ink);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

/* ── Code cards ── */

.code-card {
  background: var(--color-surface-white);
  border: var(--border-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
}

.code-chip {
  display: inline-block;
  margin-bottom: var(--space-md);
  background: var(--color-ink-primary);
  color: var(--color-surface-white);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
}

.code-card pre {
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  line-height: 1.5;
}

.tok-key {
  color: var(--color-ink-muted);
}

.code-caption {
  margin-top: var(--space-md);
  color: var(--color-ink-muted);
}

/* ── Cards ── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.card {
  background: var(--color-surface-white);
  border: var(--border-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
}

/* Cards never depress — they are grounded surfaces. */
.card h3 {
  margin-bottom: var(--space-sm);
  font-size: var(--text-title);
  font-weight: 600;
  line-height: 1.3;
}

.card p {
  color: var(--color-ink-muted);
}

/* ── Moat ── */

.moat-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-2xl);
  align-items: center;
}

.moat-features li {
  padding-block: 12px;
  font-size: var(--text-body);
}

.moat-features li + li {
  border-top: var(--border-ink);
}

.moat-features strong {
  font-weight: 600;
}

.moat-panel {
  max-width: 480px;
}

/* ── Pricing ── */

.pricing-grid {
  grid-template-columns: repeat(3, 1fr);
}

.tier {
  display: flex;
  flex-direction: column;
}

.tier h3 {
  margin-bottom: var(--space-sm);
  font-size: var(--text-title);
  font-weight: 600;
  line-height: 1.3;
}

.tier-price {
  margin-bottom: var(--space-sm);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.1;
}

.tier-per {
  font-size: var(--text-label);
  font-weight: 500;
  color: var(--color-ink-muted);
}

.tier-desc {
  padding-bottom: var(--space-lg);
  border-bottom: var(--border-ink);
  color: var(--color-ink-muted);
}

.tier-features {
  display: grid;
  gap: var(--space-sm);
  flex-grow: 1;
  padding-block: var(--space-lg);
}

.tier-cta {
  width: 100%;
}

/* The featured tier carries the amber-lip shadow: a brand emphasis moment. */
.tier-featured {
  box-shadow: var(--shadow-card-brand);
}

/* ── Footer ── */

.site-footer {
  background: var(--color-surface-white);
  border-top: var(--border-ink);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: var(--space-lg);
}

.footer-copy {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  color: var(--color-ink-muted);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.footer-copy .brand-word {
  font-size: var(--text-label);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  color: var(--color-ink-muted);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color var(--duration-hover) ease-out;
}

.footer-links a:hover {
  color: var(--color-ink-primary);
}

/* ── Responsive ── */

@media (max-width: 1000px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .hero-grid,
  .moat-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .hero {
    padding-block: var(--space-2xl);
  }

  .moat-panel {
    max-width: none;
  }
}

@media (max-width: 768px) {
  .container {
    padding-inline: 20px;
  }

  .brand {
    gap: 6px;
  }

  .brand-mark {
    width: 20px;
  }

  .brand-word {
    font-size: var(--text-body);
  }

  .section {
    padding-block: 64px;
  }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 44px;
    height: 40px;
    background: var(--color-surface-white);
    border: var(--border-ink);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-keycap-sm);
    cursor: pointer;
    transition:
      transform var(--duration-press) ease-out,
      box-shadow var(--duration-press) ease-out;
  }

  .nav-toggle:active {
    transform: translateY(2px);
    box-shadow: none;
  }

  .nav-toggle-bar {
    width: 18px;
    height: 1.5px;
    margin-inline: auto;
    background: var(--color-ink-primary);
  }

  /* The menu opens as a modal-elevation panel. */
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--color-surface-white);
    border: var(--border-ink);
    border-top: none;
    box-shadow: var(--shadow-modal);
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-link {
    display: block;
    padding: var(--space-sm);
    font-size: var(--text-body);
  }

  .nav-cta-item {
    margin-top: var(--space-sm);
  }

  .nav-cta-item .btn {
    width: 100%;
  }

  .card-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: var(--space-md);
  }

  .hero-actions .btn {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none;
  }
}
