/* ==========================================================================
   WIE IS DE MOL? — EFTELING EDITIE
   main.css — design tokens, reset, typography, layout, atmosphere
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Forest — the base of the whole world */
  --forest-abyss: #050907;
  --forest-950: #0a1310;
  --forest-900: #0e1c16;
  --forest-850: #11241b;
  --forest-800: #163023;
  --emerald-800: #143528;
  --emerald-700: #1b4232;
  --emerald-500: #2c6b4f;
  --emerald-300: #5ba983;

  /* Burgundy — seals, warnings, suspicion */
  --burgundy-900: #260d15;
  --burgundy-800: #3d1420;
  --burgundy-700: #591a29;
  --burgundy-500: #8c2438;
  --burgundy-300: #c25366;

  /* Gold — candlelight, ornament, focus */
  --gold-700: #7d621f;
  --gold-600: #a8842c;
  --gold-500: #c9a227;
  --gold-400: #e2c268;
  --gold-200: #f3e0a8;

  /* Parchment — documents, dossiers, notes */
  --parchment-100: #f6edd8;
  --parchment-200: #e9dcbc;
  --parchment-400: #c8b287;
  --parchment-600: #97815a;
  --ink: #2a2015;
  --ink-soft: #58472f;

  /* Night blue — moonlight, depth */
  --night-900: #070c17;
  --night-700: #101a2e;

  /* Semantic text */
  --text: #ece6d6;
  --text-dim: rgba(236, 230, 214, 0.66);
  /* 0.55 is the lowest alpha that still clears 4.5:1 on --forest-900 */
  --text-faint: rgba(236, 230, 214, 0.55);
  --text-ink: var(--ink);

  /* Lines & surfaces */
  --line: rgba(201, 162, 39, 0.22);
  --line-soft: rgba(236, 230, 214, 0.1);
  --surface: rgba(14, 28, 22, 0.72);
  --surface-raised: rgba(19, 38, 29, 0.82);

  /* Radii */
  --r-xs: 3px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* Elevation & light */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, 0.5);
  --shadow-deep: 0 26px 70px rgba(0, 0, 0, 0.62);
  --glow-gold: 0 0 28px rgba(201, 162, 39, 0.28);
  --glow-emerald: 0 0 34px rgba(44, 107, 79, 0.35);

  /* Type */
  --font-display: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
  --font-body: "Spectral", Georgia, "Times New Roman", serif;
  --font-hand: "Caveat", "Segoe Script", cursive;

  /* Rhythm */
  --sp-1: 0.35rem;
  --sp-2: 0.6rem;
  --sp-3: 0.9rem;
  --sp-4: 1.3rem;
  --sp-5: 1.9rem;
  --sp-6: 2.6rem;
  --sp-7: 3.8rem;

  --shell: 1140px;
  --header-h: 68px;

  /* Paper grain, reused by every parchment surface */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--forest-abyss);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: var(--gold-400);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--gold-200);
}

/* Focus is always visible — the site is used one-handed, in the dark. */
:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

::selection {
  background: var(--gold-600);
  color: var(--forest-abyss);
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 3.1rem);
}

h2 {
  font-size: clamp(1.4rem, 3.4vw, 2rem);
}

h3 {
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
}

p {
  max-width: 68ch;
}

/* Small engraved label — used everywhere above numbers and sections. */
.eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-500);
}

.eyebrow--dim {
  color: var(--text-faint);
}

.lede {
  font-size: 1.08rem;
  color: var(--text-dim);
}

.whisper {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--parchment-400);
  letter-spacing: 0.01em;
}

.muted {
  color: var(--text-dim);
}

.faint {
  color: var(--text-faint);
}

.gold {
  color: var(--gold-400);
}

.numeral {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   4. Atmosphere — fixed background layers behind all content
   -------------------------------------------------------------------------- */
.atmos {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(31, 74, 56, 0.55) 0%, transparent 58%),
    radial-gradient(80% 60% at 84% 12%, rgba(16, 26, 46, 0.6) 0%, transparent 62%),
    radial-gradient(90% 70% at 12% 92%, rgba(61, 20, 32, 0.42) 0%, transparent 66%),
    linear-gradient(180deg, var(--forest-950) 0%, var(--forest-abyss) 62%, #040706 100%);
}

/* A pale moon, low behind the treeline. */
.atmos__moon {
  position: absolute;
  top: -120px;
  left: 50%;
  width: 460px;
  height: 460px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 194, 104, 0.16) 0%, rgba(226, 194, 104, 0.05) 42%, transparent 70%);
  filter: blur(8px);
}

.atmos__fog {
  position: absolute;
  left: -30%;
  width: 160%;
  height: 60vh;
  background: radial-gradient(ellipse at center, rgba(120, 165, 140, 0.09) 0%, transparent 68%);
  filter: blur(28px);
}

.atmos__fog--a {
  bottom: -12vh;
  animation: fog-drift 68s ease-in-out infinite;
}

.atmos__fog--b {
  top: 18vh;
  opacity: 0.55;
  animation: fog-drift 92s ease-in-out infinite reverse;
}

/* Silhouetted treeline + castle, drawn with gradients only (no assets). */
.atmos__treeline {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 34vh;
  min-height: 190px;
}

.atmos__silhouette {
  width: 100%;
  height: 100%;
}

.atmos__castle {
  fill: #060d0a;
  opacity: 0.9;
}

.atmos__pennant {
  fill: var(--burgundy-700);
  opacity: 0.55;
}

.atmos__trees {
  fill: #030706;
}

/* Haze between the castle and the trees, and a soft fade into the page. */
.atmos__treeline::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 19, 16, 0.95) 0%, rgba(10, 19, 16, 0.35) 34%, transparent 62%);
}

.atmos__dust {
  position: absolute;
  inset: 0;
}

.atmos__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, transparent 42%, rgba(0, 0, 0, 0.58) 100%);
}

.atmos__grain {
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: 0.035;
  mix-blend-mode: overlay;
}

/* --------------------------------------------------------------------------
   5. Layout shell
   -------------------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.shell--narrow {
  max-width: 780px;
}

.shell--wide {
  max-width: 1320px;
}

.page {
  padding-block: var(--sp-6) var(--sp-7);
}

.page-head {
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}

.page-head__title {
  margin-top: var(--sp-2);
}

.page-head__sub {
  margin-top: var(--sp-2);
  color: var(--text-dim);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.stack--tight {
  gap: var(--sp-2);
}

.stack--loose {
  gap: var(--sp-5);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

.row--between {
  justify-content: space-between;
}

.row--end {
  justify-content: flex-end;
}

.grid {
  display: grid;
  gap: var(--sp-4);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid--sidebar {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

@media (max-width: 860px) {
  .grid--sidebar {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --------------------------------------------------------------------------
   6. Site header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(180deg, rgba(6, 12, 9, 0.95) 0%, rgba(6, 12, 9, 0.82) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
}

.brand__mark {
  flex: none;
  width: 34px;
  height: 34px;
  color: var(--gold-500);
  filter: drop-shadow(0 0 8px rgba(201, 162, 39, 0.4));
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand__sub {
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-600);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.nav__link {
  position: relative;
  padding: 0.5rem 0.8rem;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-radius: var(--r-sm);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav__link:hover {
  color: var(--gold-200);
  background: rgba(201, 162, 39, 0.08);
}

.nav__link[aria-current="page"] {
  color: var(--gold-400);
}

.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 0.8rem;
  bottom: 0.15rem;
  left: 0.8rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
}

.nav__user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-left: 0.8rem;
  border-left: 1px solid var(--line);
}

.nav__name {
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Mobile navigation toggle */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--gold-400);
  background: rgba(201, 162, 39, 0.07);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-2) clamp(1rem, 4vw, 2rem) var(--sp-4);
    background: linear-gradient(180deg, rgba(8, 16, 12, 0.99), rgba(6, 12, 9, 0.99));
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }

  .nav[hidden] {
    display: none;
  }

  .nav__link {
    padding: 0.85rem 0.4rem;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--line-soft);
    border-radius: 0;
  }

  .nav__link[aria-current="page"]::after {
    display: none;
  }

  .nav__user {
    flex-wrap: wrap;
    padding: var(--sp-3) 0.4rem 0;
    padding-left: 0.4rem;
    border-left: 0;
  }
}

/* --------------------------------------------------------------------------
   7. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: var(--sp-7);
  padding-block: var(--sp-5);
  border-top: 1px solid var(--line-soft);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.site-footer__motto {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  color: var(--parchment-600);
}

/* --------------------------------------------------------------------------
   8. Utilities
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  color: var(--forest-abyss);
  background: var(--gold-400);
  border-radius: 0 0 var(--r-sm) var(--r-sm);
}

.skip-link:focus {
  top: 0;
  color: var(--forest-abyss);
}

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

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }

.full { width: 100%; }
.nowrap { white-space: nowrap; }

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  border: 0;
}

/* Ornamental divider with a diamond in the middle. */
.ornament {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--gold-600);
}

.ornament::before,
.ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.ornament__glyph {
  font-size: 0.7rem;
  letter-spacing: 0.4em;
}
