/* ========================================================================
   Kaigan — Design tokens & base styles
   Implementerer DESIGN.md. Tokens er kilden til alt visuelt.
   ======================================================================== */

:root {
  /* Fundament */
  --bg:           #0f1c2e;
  --bg-elevated:  #1a2840;
  --bg-soft:      #142235;

  /* Tekst */
  --fg:           #f4ede0;
  --fg-muted:     #a8b3c1;
  --fg-faint:     rgba(244, 237, 224, 0.5);

  /* Linjer */
  --line:         rgba(244, 237, 224, 0.12);
  --line-strong:  rgba(244, 237, 224, 0.24);

  /* Accenter */
  --sand:         #c9b18a;
  --amber:        #b87a3d;
  --amber-soft:   rgba(184, 122, 61, 0.15);

  /* Typografi */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.5rem;
  --text-2xl:  2rem;
  --text-3xl:  3rem;
  --text-4xl:  clamp(3.5rem, 8vw, 5.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-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --container: 1200px;
  --reading:   65ch;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* Layout primitives */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
@media (min-width: 768px) {
  .container { padding: 0 var(--space-12); }
}

/* Typografi */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
h1 {
  font-size: var(--text-4xl);
  font-variation-settings: 'opsz' 144;
  line-height: 1;
  letter-spacing: -0.02em;
}
h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-variation-settings: 'opsz' 72;
}
h3 {
  font-size: var(--text-xl);
  font-variation-settings: 'opsz' 36;
}

p { max-width: var(--reading); }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fg-faint);
}

.kanji {
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: 'opsz' 144;
  color: var(--sand);
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-muted); }

/* Komponenter */

/* Card */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: var(--space-8);
  transition: border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  height: 100%;
}
.card:hover { border-color: var(--line-strong); }
.card[href]:hover .card__title { color: var(--sand); }
.card__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  font-variation-settings: 'opsz' 36;
  line-height: 1.15;
  transition: color 0.2s ease;
}
.card__desc { color: var(--fg-muted); font-size: var(--text-base); }
.card__meta { margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--line); }

/* Knap */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--sand);
  background: transparent;
  color: var(--fg);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
}
.btn:hover { background: var(--sand); color: var(--bg); }
.btn--primary { background: var(--amber); border-color: var(--amber); color: var(--bg); }
.btn--primary:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }

/* Divider */
.divider {
  width: 3rem;
  height: 1px;
  background: var(--sand);
  opacity: 0.6;
  border: 0;
}

/* Sektion */
section { padding: var(--space-24) 0; }
@media (max-width: 767px) {
  section { padding: var(--space-16) 0; }
}

/* Header / nav */
.site-header {
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  font-variation-settings: 'opsz' 36;
}
.brand .kanji {
  font-size: var(--text-xl);
  opacity: 0.7;
}
.nav { display: flex; gap: var(--space-8); }
.nav a {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  transition: color 0.2s;
}
.nav a:hover { color: var(--fg); }
@media (max-width: 640px) {
  .nav { display: none; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-12) 0;
  margin-top: var(--space-24);
  color: var(--fg-muted);
  font-size: var(--text-sm);
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-6);
}
.site-footer a:hover { color: var(--sand); }
