/* Faultline marketing site — design tokens mirror the iOS app's
   FaultlineDesign palette. Update both if either drifts. */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Serif:wght@500;600&display=swap');

:root {
  /* Paper / terrain / ink palette */
  --paper-50:  #FBF6EC;
  --paper-100: #F5EEDF;
  --paper-200: #ECE2CB;
  --paper-300: #DCCDA9;
  --terrain-100: #D9C9A4;
  --terrain-300: #A98E60;
  --ink-900: #14202E;
  --ink-700: #324358;
  --ink-600: #4D6076;
  --ink-500: #6B7E94;
  --ink-400: #94A3B5;
  --ink-300: #B9C3D0;
  --copper-100: #F4D8AF;
  --copper-300: #DC9D45;
  --copper-400: #C2811F;
  --copper-500: #9C6512;
  --hazard-500: #DA3F1B;
  --moss-100:   #E1E8D2;
  --moss-500:   #5F7A3E;

  /* Semantic roles */
  --bg:          var(--paper-100);
  --bg-elevated: var(--paper-50);
  --fg:          var(--ink-900);
  --fg-muted:    var(--ink-600);
  --fg-subtle:   var(--ink-400);
  --border:      var(--paper-300);
  --accent:      var(--copper-400);
  --accent-hover: var(--copper-500);
  --success:     var(--moss-500);

  /* Type */
  --font-sans:    'IBM Plex Sans', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-display: 'IBM Plex Serif', 'Iowan Old Style', Georgia, serif;

  --text-xs:   12px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-md:   17px;
  --text-lg:   20px;
  --text-xl:   24px;
  --text-2xl:  32px;
  --text-3xl:  44px;

  --tracking-tight:    -0.01em;
  --tracking-mapcaps:   0.16em;

  /* Spacing */
  --space-3:  12px;
  --space-4:  16px;
  --space-6:  24px;
  --space-8:  32px;
  --space-12: 48px;

  /* Radii */
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-card:
    0 1px 0 rgba(20, 32, 46, 0.04),
    0 4px 14px -6px rgba(20, 32, 46, 0.10),
    0 12px 32px -16px rgba(20, 32, 46, 0.18);
  --shadow-card-hover:
    0 1px 0 rgba(20, 32, 46, 0.06),
    0 8px 24px -8px rgba(20, 32, 46, 0.16),
    0 20px 48px -20px rgba(20, 32, 46, 0.24);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 160ms;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Topographic contour as a subtle fixed background motif. */
body {
  background-image: url('texture-contour.svg');
  background-repeat: no-repeat;
  background-position: top -120px left -120px;
  background-size: 880px auto;
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: var(--copper-500); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Layout */
.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header { padding: 22px 0 8px; }
.site-header .container {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--fg);
}
.brand img.wordmark { height: 32px; width: auto; }
.brand img.mark     { height: 36px; width: auto; }
.nav {
  margin-left: auto;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.nav a {
  color: var(--fg-muted);
  font-weight: 600;
  font-size: 14px;
}
.nav a:hover  { color: var(--accent-hover); text-decoration: none; }
.nav a.active { color: var(--fg); }

/* Footer */
.site-footer {
  margin-top: 64px;
  padding: 32px 0 64px;
  color: var(--fg-subtle);
  font-size: 13px;
  border-top: 1px solid var(--border);
}
.site-footer .container {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
}
.site-footer a {
  color: var(--fg-muted);
  font-weight: 600;
  margin-right: 18px;
}

/* Typography */
h1, h2, h3, h4 { margin-top: 0; color: var(--fg); }
h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 5.5vw, 52px);
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
  margin-bottom: 12px;
}
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: var(--tracking-tight);
  margin-bottom: 14px;
}
h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 8px;
}

p { line-height: 1.55; color: var(--fg-muted); margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

.lede {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: 60ch;
}

.eyebrow, .mapcaps {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--tracking-mapcaps);
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 14px;
}
.eyebrow {
  color: var(--paper-50);
  background: var(--ink-900);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 13px 24px;
  background: var(--copper-400);
  color: var(--paper-50);
  border: 1px solid var(--copper-500);
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn:hover   { background: var(--copper-500); text-decoration: none; transform: translateY(-1px); }
.btn:active  { transform: translateY(0); }
.btn.secondary {
  background: var(--bg-elevated);
  color: var(--fg);
  border-color: var(--border);
}
.btn.secondary:hover { background: var(--paper-200); }
.btn.disabled, .btn[aria-disabled="true"] {
  background: var(--ink-300);
  color: var(--ink-700);
  border-color: var(--ink-400);
  cursor: not-allowed;
  pointer-events: none;
}
.btn:focus-visible,
.nav a:focus-visible,
.site-footer a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Hero */
.hero { padding: 28px 0 8px; }
.hero .container {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 36px;
  align-items: center;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.hero-art {
  text-align: center;
  position: relative;
  padding: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}
.hero-art > img { width: 200px; height: 200px; margin: 0 auto; border-radius: 36px; }

@media (max-width: 720px) {
  .hero .container  { grid-template-columns: 1fr; }
  .hero-art > img   { width: 160px; height: 160px; }
}

/* Section spacing */
section { padding: 24px 0; }

/* Mode cards (index page) */
.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 28px;
}
@media (max-width: 720px) { .modes { grid-template-columns: 1fr; } }
.mode-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.mode-card .mapcaps { color: var(--accent-hover); margin-bottom: 6px; }
.mode-card h2 { font-size: 24px; margin-bottom: 8px; }
.mode-card img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin: 12px 0;
}
.mode-card ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.mode-card li {
  padding: 6px 0;
  color: var(--fg-muted);
  border-top: 1px dashed var(--border);
  font-size: 14px;
}
.mode-card li:first-child { border-top: 0; }

/* Feature grid (index page) */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 28px 0;
}
.feature {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.feature h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.feature p { font-size: 14px; color: var(--fg-muted); }
.feature .icon {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  background: var(--copper-100);
  color: var(--copper-500);
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
}

/* Tier grid (pricing page) */
.tier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
@media (max-width: 720px) { .tier-grid { grid-template-columns: 1fr; } }
.tier {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.tier.featured {
  background: linear-gradient(180deg, var(--copper-100) 0%, var(--paper-50) 60%);
  border-color: var(--copper-400);
}
.tier-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin-bottom: 4px;
}
.tier-price {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 40px;
  font-weight: 600;
  margin: 12px 0 4px;
  color: var(--fg);
}
.tier-price small {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-subtle);
  margin-left: 4px;
}
.tier ul {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.tier li {
  padding: 8px 0;
  border-top: 1px dashed var(--border);
  color: var(--fg-muted);
  font-size: 14px;
}
.tier li:first-child { border-top: 0; }
.tier li::before {
  content: "✓  ";
  color: var(--success);
  font-weight: 700;
}
.pricing-note {
  margin-top: 16px;
  color: var(--fg-subtle);
  font-size: 13px;
}

/* CTA strip */
.cta-strip {
  margin-top: 48px;
  padding: 36px 28px;
  background: var(--paper-50);
  border: 1px solid var(--copper-300);
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-card);
}
.cta-strip h2 { margin-bottom: 8px; }
.cta-strip p  { font-size: 16px; color: var(--fg-muted); margin-bottom: 16px; }
.cta-strip .hero-actions { justify-content: center; }

/* Long-form prose for legal pages */
.prose section { padding: 18px 0 8px; }
.prose h2 { margin-top: 28px; margin-bottom: 8px; }
.prose h3 { margin-top: 18px; }
.prose ul { padding-left: 22px; }
.prose li { margin: 4px 0; color: var(--fg-muted); line-height: 1.55; }
.prose .meta {
  color: var(--fg-subtle);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* FAQ accordion (support page) */
details.faq {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin: 10px 0;
  box-shadow: var(--shadow-card);
}
details.faq[open] summary { margin-bottom: 8px; }
details.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--fg);
  list-style: none;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: '+';
  float: right;
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}
details.faq[open] summary::after { content: '−'; }
details.faq p { font-size: 14px; }
