/* ──────────────────────────────────────────────────────────
   Narrative Systems — corporate site
   Editorial-modernist: dark, monochrome, single warm-amber accent.
   Distinct from the Fabletide product brand.
   ────────────────────────────────────────────────────────── */

:root {
  --bg: #0a0a0a;
  --bg-elev: #111111;
  --text: #f5f5f4;
  --text-muted: #a1a1a1;
  --text-dim: #6b6b6b;
  --border: #262626;
  --border-strong: #3a3a3a;
  --accent: #d97706;
  --accent-hover: #f59e0b;

  --serif: "Newsreader", "Newsreader Fallback", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;

  --max: 1200px;
  --prose: 720px;
  --gutter-x: clamp(24px, 5vw, 64px);
  --section-y: clamp(80px, 12vw, 144px);
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  cursor: pointer;
}

html {
  scroll-behavior: smooth;
}

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

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 14px;
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 16px;
}

/* ─────────────── Navigation ─────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter-x);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.wordmark {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  display: inline-flex;
  align-items: baseline;
}
.wordmark .accent-dot {
  color: var(--accent);
  margin: 0 0.15em;
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}
.nav-links a.accent {
  color: var(--accent);
}
.nav-links a.accent:hover {
  color: var(--accent-hover);
}

/* ─────────────── Hero ─────────────── */
.hero {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(96px, 14vw, 192px) var(--gutter-x) var(--section-y);
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 60% 55% at 30% 28%,
    rgba(217, 119, 6, 0.18),
    rgba(217, 119, 6, 0) 70%
  );
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-eyebrow,
.footer-heading {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 24px;
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1;
  letter-spacing: -0.022em;
  margin: 0 0 32px;
  color: var(--text);
}

.lede {
  font-size: clamp(18px, 1.6vw, 20px);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 0 40px;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.lede a {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  transition: border-color 0.15s;
}
.lede a:hover {
  border-color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent);
  color: var(--bg);
}
.btn-text {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding-left: 0;
}
.btn-text:hover,
.btn-text:focus-visible {
  color: var(--text);
}

/* ─────────────── Products section ─────────────── */
.products,
.studio {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--section-y) var(--gutter-x);
  border-top: 1px solid var(--border);
}

.product-card {
  max-width: var(--prose);
  margin: 0 auto;
  padding: 56px 48px 48px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-elev);
  position: relative;
}

.product-index {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--text-dim);
  margin: 0 0 24px;
  letter-spacing: 0.04em;
}

.product-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
  color: var(--text);
}

.product-body {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 24px;
  max-width: 520px;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin: 0 0 40px;
}
.product-meta .dot {
  color: var(--border-strong);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.15s;
}
.card-link.accent {
  color: var(--accent);
}
.card-link.accent:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ─────────────── Studio section ─────────────── */
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  max-width: 640px;
  margin: 0 0 28px;
  color: var(--text);
}

.studio-body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: var(--prose);
  margin: 0 0 32px;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.studio-body strong {
  color: var(--text);
  font-weight: 500;
}

.text-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: border-color 0.15s;
}
.text-link:hover {
  border-color: var(--text);
}

/* ─────────────── Content pages ─────────────── */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 10vw, 144px) var(--gutter-x) var(--section-y);
}

.page-hero {
  max-width: var(--prose);
  margin: 0 auto;
  padding-bottom: clamp(48px, 6vw, 88px);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.018em;
  margin: 0 0 24px;
  color: var(--text);
}

.page-hero .lede {
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.page-body {
  max-width: var(--prose);
  margin: 0 auto;
  padding-top: clamp(48px, 6vw, 80px);
}

.prose h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin: 56px 0 20px;
  color: var(--text);
}
.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.4;
  margin: 40px 0 12px;
  color: var(--text);
}

.prose p {
  margin: 0 0 20px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.prose p strong {
  color: var(--text);
  font-weight: 500;
}
.prose p a {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  transition: border-color 0.15s;
}
.prose p a:hover {
  border-color: var(--accent);
}
.prose p a.accent {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.prose p a.accent:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

.prose ul,
.prose ol {
  margin: 0 0 24px;
  padding-left: 24px;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.7;
}
.prose li {
  margin-bottom: 10px;
}
.prose li::marker {
  color: var(--text-dim);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 56px 0;
}

.prose code {
  font-family: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 0.88em;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 6px;
  color: var(--text);
}

.prose .meta {
  display: block;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* Contact card */
.contact-card {
  margin-top: 40px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-elev);
}
.contact-card .label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 8px;
}
.contact-card .email {
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 26px);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.contact-card .email:hover {
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}
.contact-card .note {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--text-dim);
}

/* ─────────────── Footer ─────────────── */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 0;
  padding: clamp(64px, 8vw, 96px) var(--gutter-x) 32px;
  background: var(--bg);
}

.footer-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand {
  max-width: 320px;
}

.wordmark-footer {
  margin: 0 0 4px;
  font-size: 13px;
}

.footer-caption {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
}

.footer-col a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.15s;
  padding: 2px 0;
}
.footer-col a:hover {
  color: var(--text);
}

.footer-divider {
  max-width: var(--max);
  margin: 64px auto 24px;
  height: 1px;
  background: var(--border);
}

.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: var(--text-dim);
}
.footer-bottom p {
  margin: 0;
}
.footer-bottom a.accent {
  color: var(--accent);
}
.footer-bottom a.accent:hover {
  color: var(--accent-hover);
}

/* ─────────────── Responsive ─────────────── */
@media (max-width: 720px) {
  .nav {
    padding: 16px 20px;
  }
  .nav-links {
    gap: 18px;
  }
  .nav-links a {
    font-size: 13px;
  }
  .nav-links a[href*="products"],
  .nav-links a[href*="about"] {
    display: none;
  }

  h1 {
    font-size: clamp(40px, 12vw, 64px);
  }

  .product-card {
    padding: 40px 28px 32px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .footer-bottom {
    flex-direction: column;
  }
}

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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