/* Shared styles for every page on tectonicmvmtlabs.com.
   Extracted from index.html so the Koda pages share one design system. */

:root {
  --bg: #f5f0e6;
  --bg-alt: #ede6d3;
  --bg-dark: #1a1a1a;
  --text: #1a1a1a;
  --text-secondary: #444444;
  --text-tertiary: #6a6a6a;
  --accent: #6d8b62;
  --accent-soft: #a8bd9f;
  --hairline: #d9d0bb;
  --hairline-strong: #b8ad95;
  --font-display: "Oswald", "Impact", sans-serif;
  --font-serif: "Source Serif 4", "Georgia", serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --font-body: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  /* Derived tokens, so dark mode only has to restate colours, never rules. */
  --accent-rgb: 109, 139, 98;
  --nav-bg: rgba(245, 240, 230, 0.88);
  --button-bg: #1a1a1a;
  --button-fg: #ffffff;
  --shadow-rgb: 0, 0, 0;
  --shadow-strength: 1;
  --screen-ring: transparent;
  --topo-stroke: #b8ad95;
  color-scheme: light dark;
}

/* Dark mode follows the system setting. A warm charcoal rather than
   neutral black, so the paper-and-sage character survives the switch.
   Sage is lifted so links and the CTA keep contrast on the dark ground. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171613;
    --bg-alt: #201e1a;
    --bg-dark: #ece6d8;
    --text: #ece6d8;
    --text-secondary: #c2baa9;
    --text-tertiary: #938b7c;
    --accent: #9dba90;
    --accent-soft: #5f7556;
    --hairline: #2f2c26;
    --hairline-strong: #4a453b;
    --accent-rgb: 157, 186, 144;
    --nav-bg: rgba(23, 22, 19, 0.85);
    --button-bg: #ece6d8;
    --button-fg: #171613;
    --shadow-strength: 2.5;
    --screen-ring: rgba(255, 255, 255, 0.08);
    --topo-stroke: #4a453b;
  }
  /* The wordmark is black line art on transparent; inverting it is
     exact, and keeps one logo file. */
  img[src="/logo.svg"] { filter: invert(1) hue-rotate(180deg); }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 700ms ease-out, transform 700ms ease-out;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Nav */
.nav {
  position: sticky; top: 0;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--hairline);
  z-index: 100;
}
.nav-inner {
  max-width: 1120px; margin: 0 auto;
  padding: 1rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
}
.nav-brand {
  display: inline-flex; align-items: center;
  text-decoration: none; color: var(--text);
  line-height: 0;
}
.nav-brand img {
  height: 56px; width: auto; display: block;
}
.nav-links { display: flex; gap: 1.75rem; font-size: 0.9375rem; }
.nav-links a {
  color: var(--text-secondary); text-decoration: none;
  transition: color 150ms ease;
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--text); }

.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 0.5rem; margin: -0.5rem;
  color: var(--text);
}
.nav-toggle svg { display: block; }

.nav-mobile-panel {
  display: none;
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
}
.nav-mobile-panel.open { display: block; }
.nav-mobile-panel ul {
  list-style: none;
  max-width: 1120px; margin: 0 auto;
  padding: 0.5rem 1.25rem 1.25rem;
}
.nav-mobile-panel a {
  display: block;
  padding: 0.875rem 0;
  font-size: 1.0625rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
}
.nav-mobile-panel li:last-child a { border-bottom: none; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 2rem; }

/* Status pill */
.status {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.875rem 0.45rem 0.7rem;
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--text);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}
.status-version { color: var(--text-tertiary); }

/* Hero */
.hero-wrap { position: relative; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 40%, transparent 100%);
}
.hero-bg svg { width: 100%; height: 100%; }
.hero-bg svg g { stroke: var(--topo-stroke); }

.hero {
  position: relative;
  padding: 3rem 0 4rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 4rem;
  align-items: start;
}
.hero-left { display: grid; gap: 2rem; }
.hero-headline h1 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.5rem, 5.25vw, 4.5rem);
  line-height: 0.98; letter-spacing: -0.005em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}
.hero-headline .lede {
  font-family: var(--font-serif);
  font-size: 1.625rem; line-height: 1.4;
  color: var(--text-secondary);
  max-width: 32ch;
}

.hero-meta { display: grid; gap: 1.75rem; padding-top: 4.5rem; }
.hero-meta-item { border-top: 1px solid var(--hairline-strong); padding-top: 0.875rem; }
.hero-meta-label {
  font-family: var(--font-mono);
  font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}
.hero-meta-value {
  font-family: var(--font-display); font-size: 1.25rem;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.hero-meta-sub {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-top: 0.375rem;
}
.hero-meta-email {
  font-family: var(--font-body); font-size: 1rem;
  text-transform: none; letter-spacing: 0;
}
.hero-meta-email a {
  color: var(--text); text-decoration: none;
  border-bottom: 1px solid var(--hairline-strong);
  transition: border-color 150ms ease;
}
.hero-meta-email a:hover, .hero-meta-email a:focus-visible {
  border-color: var(--accent);
}

/* Sections */
.section {
  padding: 5rem 0;
  border-top: 1px solid var(--hairline);
}
.section-grid {
  display: grid; grid-template-columns: 220px 1fr; gap: 3rem;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.8125rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-tertiary);
  padding-top: 0.5rem;
}

/* Product (Koda) */
.product {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3.5rem;
  align-items: start;
}
.product-meta {
  display: flex; gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem; color: var(--text-tertiary);
  letter-spacing: 0.04em; text-transform: uppercase;
  margin-bottom: 1rem;
}
.product-name {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.25rem, 3.75vw, 3rem);
  letter-spacing: 0.02em; text-transform: uppercase;
  line-height: 1; margin-bottom: 1.5rem;
}
.product-desc {
  font-family: var(--font-serif);
  font-size: 1.25rem; line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 44ch;
}
.product-cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-size: 0.9375rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid var(--accent); padding-bottom: 4px;
  transition: gap 200ms ease, opacity 150ms ease;
}
.product-cta:hover, .product-cta:focus-visible {
  gap: 0.75rem; opacity: 0.85;
}

/* Device screenshot */
.device-wrap {
  width: 100%;
  max-width: 280px;
  justify-self: end;
}
.device-screenshot {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 38px;
  box-shadow:
    0 0 0 1px var(--screen-ring),
    0 1px 2px rgba(var(--shadow-rgb), calc(0.04 * var(--shadow-strength))),
    0 8px 32px rgba(var(--shadow-rgb), calc(0.08 * var(--shadow-strength))),
    0 24px 64px rgba(var(--shadow-rgb), calc(0.06 * var(--shadow-strength)));
}

/* Principles */
.principles {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
}
.principle {
  display: grid; gap: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}
.principle-num {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.principle h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.3125rem; letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 0.375rem;
}
.principle p {
  font-size: 1rem; line-height: 1.6;
  color: var(--text-secondary);
}

/* About */
.about p {
  font-family: var(--font-serif);
  font-size: 1.25rem; line-height: 1.6;
  max-width: 60ch;
}
.about p + p { margin-top: 1.25rem; }

/* Footer */
footer {
  margin-top: 5rem; padding: 3.5rem 0 2rem;
  border-top: 1px solid var(--hairline);
  background: var(--bg-alt);
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 2.5rem; margin-bottom: 3.5rem;
}
.footer-brand img { height: 64px; width: auto; margin-bottom: 1rem; }
.footer-brand p {
  font-size: 0.9375rem; color: var(--text-secondary);
  max-width: 28ch;
}
.footer-col-label {
  font-family: var(--font-mono);
  font-size: 0.75rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-tertiary);
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; display: grid; gap: 0.5rem; }
.footer-col a {
  color: var(--text-secondary); text-decoration: none;
  font-size: 1rem; transition: color 150ms ease;
}
.footer-col a:hover, .footer-col a:focus-visible { color: var(--text); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8125rem; color: var(--text-tertiary);
  padding-top: 1.5rem; border-top: 1px solid var(--hairline);
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Mobile */
@media (max-width: 800px) {
  body { font-size: 17px; }
  .nav-inner { padding: 0.875rem 1.25rem; }
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-brand img { height: 44px; }
  .container { padding: 0 1.25rem; }
  .hero {
    grid-template-columns: 1fr; gap: 2.5rem;
    padding: 2.25rem 0 3rem;
  }
  .hero-headline h1 { font-size: clamp(2.25rem, 9vw, 3rem); }
  .hero-headline .lede { font-size: 1.3125rem; }
  .hero-meta { padding-top: 0; }
  .hero-meta-value { font-size: 1.1875rem; }
  .section { padding: 3.5rem 0; }
  .section-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .product { grid-template-columns: 1fr; gap: 2rem; }
  .device-wrap { margin-top: 1rem; max-width: 220px; justify-self: start; }
  .product-desc { font-size: 1.1875rem; }
  .principles { grid-template-columns: 1fr; gap: 1.5rem; }
  .about p { font-size: 1.1875rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand img { height: 52px; }
  .footer-bottom {
    flex-direction: column; gap: 0.5rem; align-items: flex-start;
  }
}

/* ------------------------------------------------------------------
   Product pages (/koda and its legal and support pages).
   Same tokens as the studio page; these rules only add what long-form
   and product content needs.
   ------------------------------------------------------------------ */

/* Secondary nav under the studio nav: Koda / Privacy / Terms / Support. */
.subnav {
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
}
.subnav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0.75rem 2rem;
  display: flex; align-items: center; gap: 1.75rem;
  font-family: var(--font-mono); font-size: 0.8125rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  overflow-x: auto; scrollbar-width: none;
}
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav a {
  color: var(--text-tertiary); text-decoration: none; white-space: nowrap;
  padding: 0.25rem 0; border-bottom: 1px solid transparent;
  transition: color 150ms ease;
}
.subnav a:hover, .subnav a:focus-visible { color: var(--text); }
.subnav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.subnav .subnav-name { color: var(--text); font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.08em; }

/* Page header */
.page-head { padding: 4rem 0 3rem; }
.kicker {
  font-family: var(--font-mono); font-size: 0.8125rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-tertiary); margin-bottom: 1rem;
}
.page-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1;
  text-transform: uppercase; letter-spacing: 0.005em;
}
.page-lede {
  font-family: var(--font-serif); font-size: 1.375rem; line-height: 1.45;
  color: var(--text-secondary); max-width: 40ch; margin-top: 1.5rem;
}
.page-meta {
  font-family: var(--font-mono); font-size: 0.8125rem;
  color: var(--text-tertiary); margin-top: 1.25rem;
}

/* Koda hero */
.koda-hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 4rem;
  align-items: center; padding: 4rem 0 5rem;
}
.koda-hero .device-wrap { justify-self: end; max-width: 300px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; margin-top: 2.25rem; }

/* App Store button. Drawn in CSS rather than Apple's badge artwork so it
   follows the page palette; swap for the official badge if preferred. */
.appstore {
  display: inline-flex; align-items: center; gap: 0.75rem;
  background: var(--button-bg); color: var(--button-fg); text-decoration: none;
  padding: 0.7rem 1.25rem 0.7rem 1rem; border-radius: 12px;
  transition: opacity 150ms ease;
}
.appstore:hover, .appstore:focus-visible { opacity: 0.85; }
.appstore svg { flex: none; }
.appstore-text { display: grid; line-height: 1.15; }
.appstore-small { font-size: 0.6875rem; letter-spacing: 0.02em; opacity: 0.85; }
.appstore-big { font-size: 1.125rem; font-weight: 600; }
.cta-note { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-tertiary); }

/* Feature list: label column + prose, matching the studio section grid. */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem 3rem; }
.feature { border-top: 1px solid var(--hairline); padding-top: 1.25rem; }
.feature-label {
  font-family: var(--font-display); font-weight: 500; font-size: 1.3125rem;
  letter-spacing: 0.03em; text-transform: uppercase; margin-bottom: 0.5rem;
  display: flex; align-items: baseline; gap: 0.75rem;
}
.tag {
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 400;
  letter-spacing: 0.08em; color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.4); border-radius: 100px;
  padding: 0.1rem 0.5rem;
}
.feature p { font-size: 1rem; line-height: 1.6; color: var(--text-secondary); }
.section-intro {
  font-family: var(--font-serif); font-size: 1.25rem; line-height: 1.55;
  color: var(--text-secondary); max-width: 52ch; margin-bottom: 2.5rem;
}

/* Long-form prose for privacy, terms, and support. */
.prose { max-width: 68ch; padding-bottom: 2rem; }
.prose h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.625rem; letter-spacing: 0.02em; text-transform: uppercase;
  margin: 3.5rem 0 1rem; padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  scroll-margin-top: 7rem;
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.prose h3 {
  font-size: 1.0625rem; font-weight: 600;
  margin: 2rem 0 0.5rem;
}
.prose p, .prose li { font-size: 1.0625rem; line-height: 1.65; color: var(--text); }
.prose p + p { margin-top: 1rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0.75rem 0 1rem; display: grid; gap: 0.5rem; }
.prose li::marker { color: var(--text-tertiary); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose code { font-family: var(--font-mono); font-size: 0.9em; background: var(--bg-alt); padding: 0.05em 0.35em; border-radius: 4px; }
.prose .muted { color: var(--text-tertiary); font-size: 0.9375rem; }
.prose .callout {
  background: var(--bg-alt); border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem; margin: 1.5rem 0; border-radius: 0 6px 6px 0;
}

/* On-page table of contents for the long pages. */
.toc {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem;
  font-family: var(--font-mono); font-size: 0.8125rem;
  padding: 1rem 0 2.5rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
}
.toc a { color: var(--text-secondary); text-decoration: none; }
.toc a:hover, .toc a:focus-visible { color: var(--accent); }

/* 404 */
.notfound { padding: 6rem 0 4rem; }

@media (max-width: 800px) {
  .subnav-inner { padding: 0.75rem 1.25rem; gap: 1.25rem; }
  .page-head { padding: 2.5rem 0 2rem; }
  .page-lede { font-size: 1.1875rem; }
  .koda-hero { grid-template-columns: 1fr; gap: 2.5rem; padding: 2.5rem 0 3rem; }
  .koda-hero .device-wrap { justify-self: start; max-width: 240px; }
  .features { grid-template-columns: 1fr; gap: 1.75rem; }
  .prose h2 { font-size: 1.375rem; margin-top: 2.5rem; }
}

.hero-meta-sub a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--hairline-strong); }
.hero-meta-sub a:hover, .hero-meta-sub a:focus-visible { border-color: var(--accent); }
.feature p a, .about p a, .page-lede a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Screenshot strip on /koda. Scrolls sideways on narrow screens. */
.screens-wrap { padding: 0 0 4rem; }
.screens {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr);
  gap: 1.5rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 0.75rem; scrollbar-width: thin;
}
.screens figure { margin: 0; scroll-snap-align: start; }
.screens img {
  width: 100%; height: auto; display: block; border-radius: 24px;
  box-shadow: 0 0 0 1px var(--screen-ring), 0 1px 2px rgba(var(--shadow-rgb), calc(0.04 * var(--shadow-strength))), 0 8px 24px rgba(var(--shadow-rgb), calc(0.08 * var(--shadow-strength)));
}
.screens figcaption {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-tertiary); margin-top: 0.75rem;
}
@media (max-width: 800px) {
  .screens { grid-auto-columns: 62%; gap: 1rem; }
}
.device-wrap picture { display: block; }
