/* ------------------------------------------------------------------
   LXNX — Neo-mystic editorial design system
   Deep ink × warm parchment × muted ember/brass.
------------------------------------------------------------------- */

:root {
  /* Color — nocturnal core */
  --ink-0: #07060A;          /* deepest void */
  --ink-1: #0E0D10;           /* primary background */
  --ink-2: #141318;           /* surface */
  --ink-3: #1B1A1F;           /* surface alt */
  --ink-4: #232128;           /* divider / hairline */
  --ink-5: #34323B;           /* muted border */

  --parchment-0: #F4ECD8;     /* highlight headline tint */
  --parchment-1: #E8DEC9;     /* primary text on dark */
  --parchment-2: #C9BFA8;     /* body text */
  --parchment-3: #8E8676;     /* muted text */
  --parchment-4: #5C564B;     /* faint text */

  --ember: #B98A4A;           /* brass / ember accent */
  --ember-bright: #D7A560;    /* hover */
  --ember-deep: #7E5B2C;      /* shadow side */
  --crimson: #8A2A2A;         /* doctrinal red — rare */

  /* Semantic roles */
  --bg: var(--ink-1);
  --bg-elev: var(--ink-2);
  --bg-elev-2: var(--ink-3);
  --hairline: var(--ink-4);
  --border: var(--ink-5);
  --text: var(--parchment-1);
  --text-body: var(--parchment-2);
  --text-muted: var(--parchment-3);
  --text-faint: var(--parchment-4);
  --accent: var(--ember);
  --accent-hover: var(--ember-bright);

  /* Type — fonts */
  --font-display: 'Fraunces', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, monospace;

  /* Type scale */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.18vw, 0.9rem);
  --text-base: clamp(1rem, 0.96rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.25rem);
  --text-xl: clamp(1.5rem, 1.3rem + 0.9vw, 1.875rem);
  --text-2xl: clamp(2rem, 1.6rem + 1.8vw, 2.75rem);
  --text-3xl: clamp(2.5rem, 1.9rem + 3vw, 4rem);
  --text-hero: clamp(3rem, 2rem + 5vw, 6.5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --space-40: 10rem;

  /* Layout */
  --container: 1200px;
  --container-narrow: 760px;
  --container-prose: 68ch;

  /* Radii — minimal, editorial */
  --radius-sm: 2px;
  --radius-md: 4px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur-base: 320ms;
  --dur-slow: 600ms;

  /* Shadows — restrained */
  --shadow-glow: 0 0 0 1px rgba(185, 138, 74, 0.18), 0 8px 30px -10px rgba(185, 138, 74, 0.18);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html, body { height: 100%; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(185, 138, 74, 0.06), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(138, 42, 42, 0.04), transparent 70%);
  background-attachment: fixed;
  font-feature-settings: 'ss01', 'ss02', 'kern';
  overflow-x: hidden;
}

/* Subtle film grain (sacred dust) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* Typography */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: 'opsz' 96, 'SOFT' 30;
  color: var(--text);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--text-3xl); font-weight: 350; letter-spacing: -0.02em; }
h2 { font-size: var(--text-2xl); font-weight: 380; }
h3 { font-size: var(--text-xl); font-weight: 420; line-height: 1.18; }
h4 { font-size: var(--text-lg); font-weight: 500; font-family: var(--font-body); letter-spacing: 0; line-height: 1.3; color: var(--text); }

p { line-height: 1.65; color: var(--text-body); text-wrap: pretty; }
p + p { margin-top: 1em; }

a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--accent-hover); }

::selection { background: rgba(185, 138, 74, 0.35); color: var(--parchment-0); }

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

/* Utility */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  font-weight: 500;
}
.eyebrow--muted { color: var(--text-muted); }

.lead {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 380;
  font-size: var(--text-lg);
  line-height: 1.45;
  color: var(--text);
  letter-spacing: 0.005em;
}

.numeral {
  font-family: var(--font-display);
  font-weight: 350;
  font-style: italic;
  color: var(--accent);
}

/* Grid container */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}
.container--narrow { max-width: var(--container-narrow); }
.container--prose { max-width: var(--container-prose); }

/* Section */
section { position: relative; z-index: 2; }
.section { padding-block: clamp(4rem, 9vw, 8rem); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }

/* Hairline divider */
.rule {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline) 18%, var(--hairline) 82%, transparent);
}

/* Sigil divider — sacred geometry hint */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  margin-block: var(--space-12);
  color: var(--ink-5);
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline));
  max-width: 200px;
}
.divider::after { background: linear-gradient(90deg, var(--hairline), transparent); }
.divider svg { color: var(--accent); opacity: 0.7; }

/* Buttons / links */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
  text-decoration: none;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  background: rgba(185, 138, 74, 0.04);
}
.btn--accent {
  border-color: var(--accent);
  color: var(--accent-hover);
}
.btn--accent:hover { background: rgba(185, 138, 74, 0.08); }

.link-inline {
  color: var(--accent);
  border-bottom: 1px solid rgba(185, 138, 74, 0.35);
  transition: all var(--dur-fast) var(--ease-out);
}
.link-inline:hover { color: var(--accent-hover); border-color: var(--accent-hover); }

/* Header / Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 13, 16, 0.78);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--hairline);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.1rem;
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.45em;
  text-transform: uppercase;
}
.nav__brand:hover { color: var(--accent-hover); }
.nav__brand svg { width: 28px; height: 28px; color: var(--accent); }

.nav__menu {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  list-style: none;
  padding: 0;
}
.nav__menu a {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  font-weight: 500;
  position: relative;
  padding-block: 0.4rem;
}
.nav__menu a:hover, .nav__menu a[aria-current="page"] { color: var(--text); }
.nav__menu a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.nav__toggle svg { width: 20px; height: 20px; }

@media (max-width: 760px) {
  .nav__menu { display: none; }
  .nav__menu.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ink-2);
    border-bottom: 1px solid var(--hairline);
    padding: 0.5rem 0;
    gap: 0;
    z-index: 60;
    box-shadow: 0 24px 48px -16px rgba(0,0,0,0.5);
  }
  .nav__menu.is-open li { border-top: 1px solid var(--hairline); }
  .nav__menu.is-open li:first-child { border-top: 0; }
  .nav__menu.is-open a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text);
  }
  .nav__menu.is-open a[aria-current="page"] { color: var(--accent); }
  .nav__menu.is-open a[aria-current="page"]::after { display: none; }
  .nav__toggle { display: inline-flex; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: var(--space-16) var(--space-10);
  margin-top: var(--space-24);
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(7, 6, 10, 0.6));
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}
@media (max-width: 760px) {
  .footer__grid { grid-template-columns: 1fr; gap: var(--space-8); }
}
.footer__brand .nav__brand { margin-bottom: 1rem; }
.footer__tagline {
  color: var(--text-muted);
  max-width: 36ch;
  font-size: var(--text-sm);
  line-height: 1.55;
}
.footer__col h5 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1rem;
}
.footer__col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.footer__col a { color: var(--text-body); font-size: var(--text-sm); }
.footer__col a:hover { color: var(--accent-hover); }
.footer__base {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--space-8);
  border-top: 1px solid var(--hairline);
  font-size: var(--text-xs);
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-wrap: wrap;
  gap: 1rem;
}

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

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