/* ==========================================================================
   Intangibles design system v1.1
   Canonical tokens and components for every Intangibles product page.
   Design reference: the preserved export in "Intangibles design system/".
   Low-stimulus rules: soft warm neutrals, no pure white, gentle contrast
   (WCAG AA for text and controls), no motion beyond 0.2s ease transitions.
   ========================================================================== */

/* --- Fonts (self-hosted, latin subset) --- */

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/newsreader.woff2') format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/newsreader-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/source-sans-3.woff2') format('woff2');
}

/* --- Color tokens --- */

:root {
  color-scheme: light;
  --bg: #F4F2ED; --surface: #FBFAF7; --text: #33312C; --muted: #6F6A60;
  --accent: #4E7A70; --accent-strong: #3F655D; --on-accent: #F6F4EF;
  --link: #3F655D; --link-hover: #34544E;
  --button-bg: #3F655D; --button-hover: #34544E;
  --border: #E1DDD3; --control-border: #817B71;
  --shadow-sm: 0 1px 2px rgba(30,28,24,0.05);
  --shadow-md: 0 1px 2px rgba(30,28,24,0.04), 0 6px 20px rgba(30,28,24,0.06);
  --ok-fg: #3E6B4F; --ok-bg: #E2ECE2;
  --exp-fg: #7A5B2E; --exp-bg: #F0E8D6;
  --paused-fg: #625E55; --paused-bg: #EAE7DF;
  --grad-fg: #4F5B85; --grad-bg: #E3E7F1;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #211F1B; --surface: #2A2823; --text: #E5E1D6; --muted: #A29C8F;
  --accent: #8FB8AB; --accent-strong: #A6C9BD; --on-accent: #1E2724;
  --link: #8FB8AB; --link-hover: #A6C9BD;
  --button-bg: #8FB8AB; --button-hover: #A6C9BD;
  --border: #3B382F; --control-border: #817A6B;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
  --ok-fg: #A9C9AE; --ok-bg: #2C382D;
  --exp-fg: #D5B98A; --exp-bg: #3A3222;
  --paused-fg: #A29C8F; --paused-bg: #33312A;
  --grad-fg: #A6B1D8; --grad-bg: #2C3040;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #211F1B; --surface: #2A2823; --text: #E5E1D6; --muted: #A29C8F;
    --accent: #8FB8AB; --accent-strong: #A6C9BD; --on-accent: #1E2724;
    --link: #8FB8AB; --link-hover: #A6C9BD;
    --button-bg: #8FB8AB; --button-hover: #A6C9BD;
    --border: #3B382F; --control-border: #817A6B;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
    --ok-fg: #A9C9AE; --ok-bg: #2C382D;
    --exp-fg: #D5B98A; --exp-bg: #3A3222;
    --paused-fg: #A29C8F; --paused-bg: #33312A;
    --grad-fg: #A6B1D8; --grad-bg: #2C3040;
  }
}

/* --- Base --- */

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

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--text);
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* --- Layout: every page is a 640px column --- */

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 34px 0 0;
}

.wordmark {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 23px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.wordmark:hover { color: var(--text); text-decoration: none; }

/* --- Type --- */

.display {
  margin: 0;
  font-family: 'Newsreader', serif;
  font-weight: 500;
  font-size: clamp(31px, 5.5vw, 41px);
  line-height: 1.18;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  max-width: 54ch;
  text-wrap: pretty;
}

.kicker {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- Experiment card --- */

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--text);
}
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-name {
  font-family: 'Newsreader', serif;
  font-weight: 500;
  font-size: 22px;
}

.card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

.card-link {
  color: var(--link);
  font-size: 14.5px;
}

/* --- Status badges --- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: currentColor;
}
.badge-waitlist  { background: var(--ok-bg);     color: var(--ok-fg); }
.badge-experiment{ background: var(--exp-bg);    color: var(--exp-fg); }
.badge-paused    { background: var(--paused-bg); color: var(--paused-fg); }
.badge-graduated { background: var(--grad-bg);   color: var(--grad-fg); }

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 10px;
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  color: var(--on-accent);
  background: var(--button-bg);
  border: 1px solid transparent;
}
.btn-primary:hover { color: var(--on-accent); background: var(--button-hover); }

.btn-secondary {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--control-border);
}
.btn-secondary:hover { color: var(--text); border-color: var(--accent); }

/* --- Email signup (product subpages) --- */

.field {
  min-height: 44px;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: 10px;
  padding: 10px 14px;
}
.field:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.signup {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  color: var(--muted);
  font-size: 14px;
}

.signup-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}
.signup-row .field {
  flex: 1 1 180px;
  min-width: 0;
}

.form-help {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

/* --- Theme toggle --- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 17px; height: 17px; }

/* Icon swap: show the mode the button switches to. */
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon { display: none; }
  :root:not([data-theme="light"]) .icon-sun { display: block; }
}

/* --- Footer --- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0 44px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.site-footer span {
  font-size: 13.5px;
  color: var(--muted);
}

/* --- Product subpage composition --- */

.product-main {
  display: flex;
  flex-direction: column;
  gap: 64px;
  padding: 72px 0 88px;
}

.product-hero,
.product-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-signup {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 40px;
}

/* ==========================================================================
   Page-specific: intangibles.app apex index
   ========================================================================== */

.apex-main {
  display: flex;
  flex-direction: column;
  gap: 72px;
  padding: 88px 0 96px;
}

.apex-hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.apex-experiments {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.apex-more {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.apex-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 40px;
}
.apex-contact p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}
.apex-contact a { font-size: 15.5px; }
