/* jouret.dev — shared design system */

@font-face {
  font-family: 'Geist';
  src: url('../assets/fonts/geist.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('../assets/fonts/geist-mono.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('../assets/fonts/instrument-serif.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('../assets/fonts/instrument-serif-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #06070b;
  --bg-raised: #0c0f16;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9ebf1;
  --text-dim: #a3abbd;
  --text-faint: #6b7385;
  --accent: #7fd8ff;
  --accent-ink: #04141c;
  --warm: #ffb46b;
  --ok: #6ee7a8;

  --serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;

  --wrap: 1140px;
  --gutter: clamp(20px, 4vw, 40px);
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: rgba(127, 216, 255, 0.3); }

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

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

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ---------- Type ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
}

.display em { font-style: italic; color: var(--accent); }

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-dim);
  line-height: 1.55;
  max-width: 38em;
}

.mono { font-family: var(--mono); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.8em 1.3em;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 13, 20, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text);
  font: 500 0.95rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.3); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { background: #a6e5ff; border-color: #a6e5ff; }
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Navigation ---------- */

.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  transition: background 0.3s, border-color 0.3s, -webkit-backdrop-filter 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.site-nav.is-solid {
  background: rgba(6, 7, 11, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  width: 26px;
  height: 26px;
  flex: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-hover); }
.nav-links a[aria-current='true'] { color: var(--text); }
.nav-links .nav-cta {
  margin-left: 8px;
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(10, 13, 20, 0.6);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: calc(64px + env(safe-area-inset-top, 0px));
    left: 12px;
    right: 12px;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    background: rgba(10, 12, 18, 0.96);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  }
  .nav-links[hidden] { display: none; }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
  .nav-links .nav-cta { margin: 6px 0 0; text-align: center; }
}
@media (min-width: 821px) {
  .nav-links[hidden] { display: flex !important; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}
.hero-fallback {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(60% 70% at 72% 50%, rgba(61, 143, 184, 0.35), transparent 70%),
    radial-gradient(30% 40% at 78% 45%, rgba(169, 228, 255, 0.25), transparent 70%),
    var(--bg);
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(6, 7, 11, 0.92) 0%, rgba(6, 7, 11, 0.7) 32%, rgba(6, 7, 11, 0.05) 62%),
    linear-gradient(0deg, var(--bg) 0%, rgba(6, 7, 11, 0) 24%);
}
.hero-content {
  padding-block: 120px 140px;
}
.hero .eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 26px;
}
.hero .eyebrow span + span::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 14px;
  border-radius: 50%;
  background: var(--text-faint);
  vertical-align: middle;
}
.hero h1 {
  font-size: clamp(3.6rem, 11vw, 9.5rem);
  margin-bottom: 30px;
}
.hero .lede { margin: 0 0 38px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-caption {
  position: absolute;
  right: var(--gutter);
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: right;
}
.hero-caption a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
}
.hero-caption a:hover { border-color: var(--accent); color: var(--accent); }
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(110, 231, 168, 0.5);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 231, 168, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(110, 231, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(110, 231, 168, 0); }
}
.scroll-cue {
  position: absolute;
  left: var(--gutter);
  bottom: 28px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-decoration: none;
}

@media (max-width: 820px) {
  .hero { align-items: flex-end; }
  .hero::after {
    background:
      linear-gradient(0deg, rgba(6, 7, 11, 0.97) 0%, rgba(6, 7, 11, 0.85) 45%, rgba(6, 7, 11, 0.1) 80%);
  }
  .hero-content { padding-block: 140px 150px; }
  .hero-caption { left: var(--gutter); right: auto; text-align: left; bottom: 32px; flex-wrap: wrap; }
  .scroll-cue { display: none; }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(80px, 12vw, 150px);
  border-top: 1px solid var(--line);
}
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-bottom: clamp(40px, 6vw, 70px);
}
.section-index {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  letter-spacing: 0.08em;
}
.section-index b { color: var(--accent); font-weight: 500; }
.section-head h2 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
}
.section-head p { margin: 0; }

@media (min-width: 900px) {
  .section-head {
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: baseline;
  }
  .section-head > :not(.section-index) { grid-column: 2; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 34px calc(34px + env(safe-area-inset-bottom, 0px));
  font-size: 0.85rem;
  color: var(--text-faint);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 30px;
}
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* Reveal on scroll (enabled by site.js) */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .live-dot { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ---------- Simple pages (404, lab subpages) ---------- */

.page-head {
  padding-block: 140px 50px;
}
.page-head h1 { font-size: clamp(3rem, 8vw, 6rem); margin: 16px 0 22px; }
.back-link {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
}
.back-link:hover { color: var(--accent); }

