/* ==========================================================================
   spelalfabet.nl — style-v2.css
   2026 redesign. Paired with /assets/js/speller.js
   ========================================================================== */

:root {
  --ink: #0b0d12;
  --ink-soft: #1a1d24;
  --paper: #f6f2e8;
  --paper-warm: #ede5d1;
  --accent: #c2410c;
  --accent-soft: #e8c4a8;
  --rule: #d6cdb8;
  --muted: #6b6554;
  --focus: #0c5e6e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.sa-header {
  border-bottom: 1px solid var(--rule);
  padding: 1.1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
  background: var(--paper);
}
.sa-logo {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 0.15em;
}
.sa-logo:hover { text-decoration: none; }
.sa-logo-mark { color: var(--accent); font-style: italic; font-weight: 500; }
.sa-logo-dot { color: var(--muted); font-weight: 400; font-size: 0.7em; margin-left: 0.1em; }
.sa-nav ul { display: flex; gap: 1.4rem; list-style: none; font-size: 0.92rem; margin: 0; padding: 0; }
.sa-nav a {
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.sa-nav a:hover { border-color: var(--accent); text-decoration: none; }
.sa-nav a.active { border-color: var(--accent); }

/* Hero */
.sa-hero { max-width: 1100px; margin: 0 auto; padding: 5rem 2rem 3rem; position: relative; z-index: 2; }
.sa-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.4rem;
}
.sa-eyebrow::before { content: '— '; color: var(--accent); }
.sa-hero h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 1.6rem;
  max-width: 16ch;
}
.sa-hero h1 em { font-style: italic; font-weight: 500; color: var(--accent); }
.sa-lede { font-size: 1.15rem; max-width: 52ch; color: var(--ink-soft); margin-bottom: 2.5rem; }
.sa-lang-hero {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.6rem;
}

/* Tool */
.sa-tool { max-width: 1100px; margin: 2rem auto; padding: 0 2rem; position: relative; z-index: 2; }
.sa-tool-frame {
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  padding: 2.5rem;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.25);
  position: relative;
}
.sa-tool-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.sa-lang-switch { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.sa-lang-switch button {
  background: none;
  border: 1px solid rgba(242,233,216,0.2);
  color: var(--paper);
  padding: 0.3rem 0.7rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}
.sa-lang-switch button:hover { border-color: var(--accent-soft); }
.sa-lang-switch button.active { background: var(--accent); border-color: var(--accent); }

.sa-lang-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.sa-lang-select-wrap label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
}
.sa-lang-select {
  background: rgba(242,233,216,0.06);
  border: 1px solid rgba(242,233,216,0.2);
  color: var(--paper);
  padding: 0.35rem 2rem 0.35rem 0.7rem;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.88rem;
  border-radius: 2px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23e8c4a8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  min-width: 200px;
}
.sa-lang-select:focus { outline: none; border-color: var(--accent); }
.sa-lang-select optgroup { color: var(--accent-soft); font-style: italic; background: var(--ink); }
.sa-lang-select option { color: var(--ink); background: var(--paper); }
.sa-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(242,233,216,0.3);
  color: var(--paper);
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.4rem);
  padding: 0.5rem 0 1rem;
  outline: none;
  letter-spacing: -0.02em;
  transition: border-color 0.2s;
}
.sa-input:focus { border-color: var(--accent); }
.sa-input::placeholder { color: rgba(242,233,216,0.25); font-style: italic; }
.sa-output {
  margin-top: 2rem;
  min-height: 80px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  align-items: baseline;
}
.sa-letter-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.6rem 0.9rem;
  background: rgba(242,233,216,0.06);
  border-left: 2px solid var(--accent);
  border-radius: 2px;
  animation: sa-slide-in 0.25s ease-out backwards;
  min-width: 60px;
}
@keyframes sa-slide-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sa-letter-card .sa-ltr {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--accent-soft);
  text-transform: uppercase;
}
.sa-letter-card .sa-word { font-family: 'Fraunces', Georgia, serif; font-size: 1.15rem; font-weight: 500; }
.sa-letter-card .sa-word em { font-size: 0.75em; opacity: 0.6; font-style: italic; font-weight: 400; }
.sa-letter-card .sa-word.sa-muted { color: rgba(242,233,216,0.4); }
.sa-space { width: 1rem; }
.sa-tool-actions { margin-top: 2rem; display: flex; gap: 0.8rem; flex-wrap: wrap; }
.sa-btn {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.7rem 1.2rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  line-height: 1;
}
.sa-btn-primary { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.sa-btn-primary:hover { background: #9e3409; border-color: #9e3409; color: var(--paper); text-decoration: none; }
.sa-btn-ghost { background: transparent; color: var(--paper); border-color: rgba(242,233,216,0.25); }
.sa-btn-ghost:hover { border-color: var(--paper); color: var(--paper); text-decoration: none; }

/* Reference */
.sa-reference { max-width: 1100px; margin: 4rem auto; padding: 0 2rem; position: relative; z-index: 2; }
.sa-section-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.sa-section-title::before { content: ''; width: 40px; height: 1px; background: var(--accent); flex-shrink: 0; }

.sa-sub-title {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2.5rem 0 1rem 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}
.sa-languages .sa-sub-title:first-of-type { margin-top: 0.5rem; }
.sa-languages .sa-lang-grid + .sa-sub-title { margin-top: 3rem; }
.sa-ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.sa-ref-row {
  padding: 1rem 1.2rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.sa-ref-letter {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--accent);
  min-width: 2ch;
  letter-spacing: -0.02em;
}
.sa-ref-word { font-family: 'Instrument Sans', sans-serif; font-size: 1rem; color: var(--ink); }
.sa-ref-word .sa-alt { color: var(--muted); font-size: 0.88rem; display: block; margin-top: 2px; }

/* Shop */
.sa-shop {
  max-width: 1100px;
  margin: 5rem auto 3rem;
  padding: 3rem 2rem;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.sa-shop-copy h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 2.4rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
}
.sa-shop-copy h2 em { font-style: italic; color: var(--accent); font-weight: 500; }
.sa-shop-copy p { font-size: 1.05rem; color: var(--ink-soft); margin-bottom: 1.5rem; }
.sa-shop-preview {
  background: var(--paper-warm);
  aspect-ratio: 4/5;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 20px 40px -15px rgba(0,0,0,0.15);
  transform: rotate(-1.5deg);
  position: relative;
}
.sa-shop-preview::before { content: ''; position: absolute; inset: 12px; border: 1px solid var(--rule); pointer-events: none; }
.sa-preview-name {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-style: italic;
  font-size: 2.4rem;
  color: var(--accent);
  margin-bottom: 1.4rem;
  letter-spacing: -0.02em;
}
.sa-preview-spell {
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.85rem;
  line-height: 2;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.sa-preview-spell strong { color: var(--accent); font-weight: 600; }
.sa-preview-tag {
  margin-top: 1.4rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Language grid */
.sa-languages { max-width: 1100px; margin: 4rem auto; padding: 0 2rem; position: relative; z-index: 2; }
.sa-lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.sa-lang-card {
  padding: 1.6rem 1.4rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
}
.sa-lang-card:hover { background: var(--paper-warm); text-decoration: none; }
.sa-lang-card .sa-flag {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.sa-lang-card .sa-name {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin-top: 0.3rem;
  color: var(--ink);
}
.sa-lang-card .sa-sample { font-family: 'Instrument Sans', sans-serif; font-size: 0.85rem; color: var(--muted); margin-top: 0.8rem; }
.sa-lang-card.featured { background: var(--ink); color: var(--paper); }
.sa-lang-card.featured .sa-flag { color: var(--accent-soft); }
.sa-lang-card.featured .sa-name { color: var(--paper); }
.sa-lang-card.featured .sa-sample { color: rgba(242,233,216,0.6); }
.sa-lang-card.featured:hover { background: var(--ink-soft); }

/* Download section */
.sa-download {
  max-width: 1100px;
  margin: 4rem auto;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}
.sa-download-inner {
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  padding: 2.5rem 2.5rem 2.2rem;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
  align-items: center;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.25);
}
.sa-download-copy .sa-eyebrow { margin-bottom: 0.8rem; color: var(--accent-soft); }
.sa-download-copy h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 0.9rem;
  color: var(--paper);
}
.sa-download-copy h2 em { font-style: italic; color: var(--accent-soft); font-weight: 500; }
.sa-download-copy p {
  color: rgba(242,233,216,0.75);
  font-size: 0.98rem;
  margin-bottom: 0;
  max-width: 42ch;
}
.sa-download-actions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: stretch;
}
.sa-download-actions .sa-btn {
  justify-content: center;
  padding: 0.95rem 1.4rem;
  font-size: 0.95rem;
}
.sa-btn-dark {
  background: transparent;
  color: var(--paper);
  border-color: rgba(242,233,216,0.3);
}
.sa-btn-dark:hover {
  background: rgba(242,233,216,0.08);
  border-color: var(--paper);
  color: var(--paper);
  text-decoration: none;
}
.sa-download-hint {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(242,233,216,0.5);
  text-align: center;
  margin-top: 0.4rem;
}

/* Explainer */
.sa-explainer { max-width: 720px; margin: 5rem auto; padding: 0 2rem; position: relative; z-index: 2; }
.sa-explainer p { font-size: 1.08rem; margin-bottom: 1.2rem; color: var(--ink-soft); }
.sa-explainer p strong { color: var(--ink); font-weight: 600; }
.sa-explainer h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 1rem;
}

/* Footer */
.sa-footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 2rem;
  margin-top: 4rem;
  position: relative;
  z-index: 2;
  background: var(--paper-warm);
}
.sa-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.sa-footer a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--muted); }
.sa-footer a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.sa-footer-meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

/* Responsive */
@media (max-width: 720px) {
  .sa-shop { grid-template-columns: 1fr; gap: 2.5rem; padding: 2.5rem 1.5rem; }
  .sa-nav ul { gap: 0.9rem; font-size: 0.85rem; }
  .sa-header { padding: 1rem 1.2rem; }
  .sa-hero, .sa-tool, .sa-languages, .sa-explainer, .sa-reference, .sa-download { padding-left: 1.2rem; padding-right: 1.2rem; }
  .sa-tool-frame { padding: 1.8rem 1.4rem; }
  .sa-tool-label { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
  .sa-download-inner { grid-template-columns: 1fr; padding: 1.8rem 1.4rem; gap: 2rem; }
}

/* Print */
@media print {
  .sa-header, .sa-footer, .sa-shop, .sa-tool-actions, .sa-nav { display: none; }
  body::before { display: none; }
  body { background: white; color: black; }
  .sa-tool-frame { background: white; color: black; box-shadow: none; border: 1px solid #000; }
  .sa-letter-card { border-left-color: #000; background: #f5f5f5; }
  .sa-letter-card .sa-ltr, .sa-letter-card .sa-word { color: black; }
  .sa-ref-letter { color: black; }
  a { color: black; text-decoration: none; }
}
