/* neur0tide.com — themes match the iOS app (Relax light / Sleep dark) */

:root {
  --radius-card: 1.25rem;
  --radius-pill: 999px;
  --font-rounded: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "SF Pro Text", system-ui, sans-serif;
}

/* Bright — Relax wave (light mode in app) */
html[data-theme="light"] {
  color-scheme: light;
  --bg-0: #f5f5f5;
  --bg-1: #eff4f1;
  --bg-2: #e8f0ee;
  --paper: #000028;
  --paper-muted: rgba(0, 0, 40, 0.7);
  --surface: rgba(0, 0, 40, 0.06);
  --surface-border: rgba(0, 0, 40, 0.12);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(0, 0, 40, 0.1);
  --accent: #4e9c92;
  --accent-soft: #4faea0;
  --glow-a: rgba(79, 174, 160, 0.28);
  --glow-b: rgba(124, 205, 190, 0.22);
  --btn-fill: #000028;
  --btn-text: #f5f5f5;
  --icon-shadow: 0 18px 48px rgba(0, 0, 40, 0.14);
}

/* Dark — Sleep wave (dark mode in app) */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg-0: #05071c;
  --bg-1: #080e24;
  --bg-2: #0c122a;
  --paper: #f5f5f5;
  --paper-muted: rgba(245, 245, 245, 0.72);
  --surface: rgba(255, 255, 255, 0.1);
  --surface-border: rgba(255, 255, 255, 0.14);
  --glass: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.16);
  --accent: #b3b8f1;
  --accent-soft: #8a93e6;
  --glow-a: rgba(138, 147, 230, 0.22);
  --glow-b: rgba(98, 115, 214, 0.18);
  --btn-fill: #f5f5f5;
  --btn-text: #000028;
  --icon-shadow: 0 22px 56px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-rounded);
  background:
    radial-gradient(ellipse 85% 55% at 15% -5%, var(--glow-a), transparent 58%),
    radial-gradient(ellipse 75% 50% at 95% 105%, var(--glow-b), transparent 55%),
    linear-gradient(165deg, var(--bg-0), var(--bg-1) 45%, var(--bg-2));
  color: var(--paper);
  line-height: 1.55;
  transition: background 0.45s ease, color 0.35s ease;
}

/* Liquid-glass theme toggle (top left) */
.theme-toggle {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  left: max(1rem, env(safe-area-inset-left));
  z-index: 100;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.45);
  -webkit-backdrop-filter: blur(22px) saturate(1.45);
  color: var(--paper);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, background 0.35s ease, border-color 0.35s ease;
}

.theme-toggle:hover {
  transform: scale(1.04);
}

.theme-toggle:active {
  transform: scale(0.96);
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.theme-toggle .icon-sun,
html[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: block;
}

main {
  width: 100%;
  max-width: 42rem;
  margin-inline: auto;
  padding: 4.5rem 1.35rem 4rem;
}

/* Brand block: icon above name */
.brand-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2.25rem;
}

.brand-hero--compact {
  margin-bottom: 1.75rem;
}

.brand-hero--compact .brand-logo {
  height: 5.2rem;
  max-width: none;
  margin-bottom: 0.35rem;
}

.brand-hero--compact .brand-name {
  font-size: clamp(2rem, 7vw, 2.6rem);
}

.brand-hero--compact:has(.brand-tagline:first-of-type) {
  margin-bottom: 2.25rem;
}

.brand-hero--compact .brand-tagline:first-of-type {
  margin-top: 1.15rem;
}

/* Transparent button glyph — no icon plate */
.brand-logo {
  display: block;
  width: auto;
  height: 8.5rem;
  max-width: min(92vw, 22rem);
  object-fit: contain;
  margin-inline: auto;
  margin-bottom: 0.85rem;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 40, 0.14));
  transition: filter 0.35s ease;
}

html[data-theme="dark"] .brand-logo {
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.42));
}

.brand-name {
  margin: 0;
  padding: 0;
  width: 100%;
  font-size: clamp(2.6rem, 9vw, 3.75rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  color: var(--paper);
  text-align: center;
}

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

.site-credit {
  text-align: center;
}

.site-credit__line {
  margin: 0;
  font-size: clamp(1.05rem, 3.5vw, 1.2rem);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--paper-muted);
}

.brand-tagline {
  margin: 0;
  max-width: 34rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--paper-muted);
  line-height: 1.5;
}

.brand-tagline + .brand-tagline {
  margin-top: 1rem;
}

a.brand-link {
  display: block;
  width: 100%;
  text-decoration: none;
  color: inherit;
}

.page-title {
  font-size: clamp(1.65rem, 5vw, 2.1rem);
  font-weight: 800;
  margin: 0 0 0.5rem;
  text-align: center;
}

.lede {
  color: var(--paper-muted);
  margin: 0 0 1.75rem;
  text-align: center;
  font-weight: 500;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-section {
  margin: 2.1rem 0 0;
}

.home-section > .eyebrow {
  text-align: center;
}

/* Glass pill nav — same vocabulary as the app */
.nav-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.nav-row--compact {
  margin-top: 0.25rem;
  margin-bottom: 2rem;
}

.glass-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.35rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--paper);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}

.glass-pill:hover {
  transform: translateY(-1px);
}

.glass-pill--primary {
  background: var(--btn-fill);
  border-color: transparent;
  color: var(--btn-text);
}

.glass-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  padding: 1.3rem 1.4rem;
  margin: 1rem 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.glass-card h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 0.65rem;
  color: var(--paper);
}

.glass-card p,
.glass-card li {
  color: var(--paper-muted);
  margin: 0 0 0.75rem;
}

.glass-card ul {
  margin: 0;
  padding-left: 1.2rem;
}

.glass-card li {
  margin-bottom: 0.5rem;
}

.glass-card p:last-child,
.glass-card li:last-child {
  margin-bottom: 0;
}

.post-list {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0 0;
}

.article-card {
  display: block;
  padding: 1.2rem 1.25rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.18s ease, border-color 0.25s ease, background 0.25s ease;
}

.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.article-card--home {
  max-width: 36rem;
  margin-inline: auto;
}

.article-kicker,
.article-meta {
  display: block;
  color: var(--paper-muted);
  font-size: 0.83rem;
  font-weight: 700;
}

.article-kicker {
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.article-title {
  margin: 0;
  color: var(--paper);
  font-size: clamp(1.25rem, 4.5vw, 1.7rem);
  font-weight: 850;
  line-height: 1.16;
}

.article-summary {
  margin: 0.65rem 0 0.75rem;
  color: var(--paper-muted);
  font-size: 0.98rem;
  font-weight: 500;
}

.article-main {
  max-width: 48rem;
}

.article-header {
  margin-bottom: 2rem;
  text-align: left;
}

.article-header h1 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(2rem, 7vw, 3.1rem);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: 0;
}

.article-deck {
  max-width: 42rem;
  margin: 1rem 0 0;
  color: var(--paper-muted);
  font-size: 1.08rem;
  font-weight: 600;
}

.article-body {
  font-size: 1.02rem;
}

.article-body h2 {
  margin: 2.3rem 0 0.75rem;
  color: var(--paper);
  font-size: clamp(1.35rem, 4.5vw, 1.75rem);
  line-height: 1.18;
}

.article-body p {
  margin: 0 0 1rem;
  color: var(--paper-muted);
}

.article-body a {
  color: var(--accent);
  font-weight: 700;
}

.article-body pre {
  overflow-x: auto;
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  border: 1px solid var(--surface-border);
  border-radius: 0.75rem;
  background: var(--surface);
}

.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.25rem;
  border: 1px solid var(--surface-border);
  border-radius: 0.75rem;
}

.article-body table {
  width: 100%;
  min-width: 24rem;
  border-collapse: collapse;
  color: var(--paper-muted);
}

.article-body th,
.article-body td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--surface-border);
  text-align: left;
}

.article-body th {
  color: var(--paper);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.article-body tr:last-child td {
  border-bottom: 0;
}

.wellness-note {
  margin-top: 2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--paper-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

a.inline {
  color: var(--accent);
  font-weight: 600;
}

footer.site-credit {
  margin-top: 2.5rem;
}

footer.site-credit .site-credit__line {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--paper-muted);
}

.site-email {
  margin: 0.45rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--paper-muted);
}

.site-email a {
  color: inherit;
  text-decoration: none;
}

.site-email a:hover {
  color: var(--paper);
}

.back-row {
  text-align: center;
  margin-top: 1.5rem;
}
