/* Syrenthix — schema atelier
   Tokens first. Surfaces are charcoal planes; ink lines do the drawing. */

:root {
  --bg: #0b0d10;
  --bg-elevated: #12161a;
  --bg-subtle: #181e24;
  --fg: #eceff1;
  --fg-muted: #8d97a0;
  --fg-subtle: #6a737b;
  --accent: #a8b6be;
  --accent-fg: #0b0d10;
  --line: #6f9aa3;
  --border: color-mix(in oklab, var(--fg) 12%, transparent);
  --border-strong: color-mix(in oklab, var(--fg) 22%, transparent);
  --danger: #c98980;
  --ok: #8eae9a;

  --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --text-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.82rem + 0.25vw, 0.9375rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --text-2xl: clamp(2rem, 1.35rem + 2.1vw, 3.15rem);
  --text-3xl: clamp(2.4rem, 1.5rem + 3.2vw, 4.25rem);

  --leading-tight: 1.12;
  --leading-snug: 1.28;
  --leading-normal: 1.55;

  --tracking-tight: -0.03em;
  --tracking-display: -0.034em;
  --tracking-label: 0.14em;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;

  --shadow-border: 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-border-hover: 0 0 0 1px rgba(255, 255, 255, 0.16);
  --shadow-lift: 0 18px 40px -24px rgba(0, 0, 0, 0.55);

  --wrap: min(1120px, calc(100% - 40px));
  --header-h: 72px;

  --motion-quick: 150ms;
  --motion-fast: 250ms;
  --motion-slow: 400ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--fg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--bg) 88%, #152026) 0%, var(--bg) 42%),
    var(--bg);
  color: var(--fg);
  min-height: 100vh;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(to right, color-mix(in oklab, var(--line) 9%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklab, var(--line) 9%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(1200px 700px at 80% -10%, #000 20%, transparent 72%);
  opacity: 0.45;
}

img {
  max-width: 100%;
  display: block;
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--fg);
}

p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

button:not(:disabled),
[role="button"]:not(:disabled),
.btn {
  cursor: pointer;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--fg);
  color: var(--bg);
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus {
  left: 12px;
  top: 12px;
}

.wrap {
  width: var(--wrap);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--line);
  font-weight: 500;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 8;
  height: var(--header-h);
  backdrop-filter: blur(14px);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  box-shadow: 0 1px 0 var(--border);
}

.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.nav a {
  text-decoration: none;
  color: var(--fg-muted);
  font-size: var(--text-sm);
  font-weight: 500;
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--fg);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--fg);
  padding: 0;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px 0 16px;
  border-radius: 999px;
  border: 0;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--motion-quick) var(--ease-out),
    background var(--motion-quick) var(--ease-out),
    color var(--motion-quick) var(--ease-out),
    box-shadow var(--motion-quick) var(--ease-out);
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible {
  outline: 2px solid var(--line);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--fg);
  color: var(--accent-fg);
}
.btn-primary:hover { background: #fff; color: var(--accent-fg); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  box-shadow: var(--shadow-border);
}
.btn-ghost:hover { box-shadow: var(--shadow-border-hover); }

.btn-line {
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

/* Hero */

.hero {
  padding: var(--space-5) 0 var(--space-4);
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--space-6);
  align-items: center;
}

.hero h1 {
  margin: 10px 0 12px;
  font-size: clamp(1.85rem, 1.2rem + 2.2vw, 3rem);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  font-weight: 600;
}

.lede {
  color: var(--fg-muted);
  font-size: var(--text-lg);
  max-width: 46ch;
  margin: 0 0 var(--space-5);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--space-5);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
}

.hero-frame {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 10px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-border), var(--shadow-lift);
}

.hero-frame img {
  width: 100%;
  height: min(280px, 36vh);
  aspect-ratio: auto;
  object-fit: cover;
  border-radius: calc(var(--radius-xl) - 10px);
}

.title-block {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding: 12px 6px 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-subtle);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Sections */

.section {
  position: relative;
  z-index: 1;
  padding: var(--space-8) 0;
}

#catalog {
  scroll-margin-top: calc(var(--header-h) + 8px);
  padding-top: var(--space-6);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.section h2 {
  margin: 8px 0 0;
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
}

.section-head p {
  margin: 0;
  max-width: 36ch;
  color: var(--fg-muted);
}

.rule {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 0;
}

/* Mission */

.mission {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--space-7);
  align-items: center;
}

.mission img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.mission h2 { margin-top: 0; }

.mission p {
  color: var(--fg-muted);
  margin-top: 0;
}

/* Catalogue */

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.plate {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 10px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-border);
  transition: box-shadow var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out);
  min-height: 100%;
}
.plate:hover {
  box-shadow: var(--shadow-border-hover), var(--shadow-lift);
  transform: translateY(-2px);
}

.plate-image {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #0a0c0e;
}

.plate-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  outline: none;
  filter: brightness(1.12) contrast(1.04);
}

.plate-code {
  position: absolute;
  left: 10px;
  top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  color: var(--fg);
}

.plate-body {
  padding: 14px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.plate-body h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
}

.plate-body p {
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--text-sm);
  flex: 1;
}

.plate-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.price-free { color: var(--line); }
.level-tag { color: var(--fg-subtle); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

/* Benefits */

.benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.benefit {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 20px 18px 18px;
  box-shadow: var(--shadow-border);
}

.benefit svg {
  width: 22px;
  height: 22px;
  color: var(--line);
  display: block;
  margin-bottom: 14px;
}

.benefit h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

.benefit p {
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

/* Free callout */

.freeband {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: var(--space-6);
  align-items: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-border);
}

.freeband h2 { margin: 8px 0 12px; font-size: var(--text-xl); }
.freeband p { color: var(--fg-muted); margin: 0 0 18px; max-width: 52ch; }

.freeband-visual {
  border-radius: calc(var(--radius-xl) - 12px);
  overflow: hidden;
  min-height: 180px;
}
.freeband-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  outline: none;
}

/* FAQ */

.faq {
  display: grid;
  gap: 8px;
}

.faq details {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-border);
  padding: 4px 16px;
}

.faq summary {
  list-style: none;
  cursor: pointer;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--fg-subtle);
  font-size: 18px;
}
.faq details[open] summary::after { content: "–"; }
.faq details p {
  margin: 0 0 16px;
  color: var(--fg-muted);
}

/* Product page */

.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--space-7);
  align-items: start;
  padding-top: var(--space-7);
}

.product-cover {
  border-radius: var(--radius-xl);
  padding: 10px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-border);
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.product-cover img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: calc(var(--radius-xl) - 10px);
  filter: brightness(1.16) contrast(1.04);
}

.crumb {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-subtle);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.crumb a { color: var(--fg-muted); text-decoration: none; }
.crumb a:hover { color: var(--fg); }

.product-hero h1 {
  margin: 8px 0 10px;
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-tight);
}

.buy-box {
  margin-top: 20px;
  padding: 18px;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-border);
}

.buy-price {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tight);
  margin: 0 0 4px;
}

.buy-note {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  margin: 0 0 16px;
}

.buy-box .btn { width: 100%; }

.stack { display: grid; gap: var(--space-5); margin-top: var(--space-7); }

.panel {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-border);
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.panel p, .panel li { color: var(--fg-muted); }

.modules { display: grid; gap: 10px; }
.module {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.module:first-child { border-top: 0; padding-top: 0; }
.mod-n {
  font-family: var(--font-mono);
  color: var(--line);
  font-size: var(--text-sm);
}
.module h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--fg);
}
.module p { margin: 0; font-size: var(--text-sm); }

.ticks { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ticks li {
  padding-left: 18px;
  position: relative;
  color: var(--fg-muted);
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 1px;
  background: var(--line);
}

/* Loading */

.loading-stage {
  min-height: calc(100vh - var(--header-h) - 180px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--space-8) 0;
}

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  border-top-color: var(--line);
  margin: 0 auto 18px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.fallback {
  max-width: 42ch;
  margin-inline: auto;
}

.fallback h1 { font-size: var(--text-xl); margin: 0 0 12px; }
.fallback p { color: var(--fg-muted); }

/* Forms / legal */

.prose {
  max-width: 68ch;
}
.prose h1 {
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 8px;
}
.prose h2 {
  font-size: 1.15rem;
  margin: 28px 0 8px;
}
.prose p, .prose li { color: var(--fg-muted); }
.prose a { color: var(--fg); }

.form {
  display: grid;
  gap: 14px;
  max-width: 520px;
}
.form label {
  display: grid;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 500;
}
.form input,
.form textarea {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  padding: 10px 12px;
  font: inherit;
}
.form textarea { min-height: 140px; resize: vertical; }
.form input:focus,
.form textarea:focus {
  outline: 2px solid var(--line);
  outline-offset: 1px;
}

.notice {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-border);
}

/* Footer */

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: var(--space-8);
  padding: var(--space-7) 0 var(--space-6);
  box-shadow: 0 -1px 0 var(--border);
  background: color-mix(in oklab, var(--bg) 92%, #000);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr;
  gap: var(--space-6);
}

.site-footer h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin: 0 0 12px;
  font-weight: 500;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.site-footer a {
  text-decoration: none;
  color: var(--fg-muted);
  font-size: var(--text-sm);
}
.site-footer a:hover { color: var(--fg); }

.socials {
  display: flex;
  gap: 10px;
}
.socials a {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-border);
  color: var(--fg);
}
.socials a:hover { box-shadow: var(--shadow-border-hover); }
.socials svg { width: 18px; height: 18px; }

.footer-end {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.error {
  padding: var(--space-8) 0;
  text-align: center;
}
.error h1 { margin-bottom: 10px; }
.error p { color: var(--fg-muted); }

@media (max-width: 900px) {
  .hero-grid,
  .mission,
  .freeband,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .product-hero {
    grid-template-columns: 1fr;
  }
  .product-cover {
    position: static;
    order: 2;
  }
  .benefits { grid-template-columns: 1fr 1fr; }
  .section-head { flex-direction: column; align-items: start; }
}

@media (max-width: 720px) {
  :root { --wrap: min(1120px, calc(100% - 28px)); --header-h: 64px; }
  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 20px;
    gap: 4px;
    box-shadow: var(--shadow-border), var(--shadow-lift);
  }
  .nav.open { display: flex; }
  .nav a, .nav .btn { min-height: 44px; display: flex; align-items: center; }
  .nav-toggle { display: grid; place-items: center; }
  .catalog-grid,
  .benefits { grid-template-columns: 1fr; }
  .hero { padding-top: var(--space-6); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
