:root {
  --bg: #f6f3ec;
  --ink: #1c1915;
  --muted: #5e574c;
  --line: #e4dccf;
  --card: #fffdf8;
  --accent: #8c3d2a;
  --accent-soft: #f3e6df;
  --nav: #2c2824;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.6 "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
}

a { color: var(--accent); }

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 760px);
  gap: 2.5rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

nav {
  position: sticky;
  top: 1rem;
  align-self: start;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.86rem;
  line-height: 1.35;
}

nav p {
  margin: 0 0 0.6rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

nav a {
  display: block;
  color: var(--nav);
  text-decoration: none;
  padding: 0.28rem 0;
  border-top: 1px solid transparent;
}

nav a:hover { color: var(--accent); }

.kicker {
  font-family: "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

h1 {
  font-size: 2.15rem;
  line-height: 1.15;
  margin: 0.35rem 0 0.6rem;
  font-weight: 650;
}

.lede { font-size: 1.12rem; margin-top: 0; }

h2 {
  font-size: 1.45rem;
  margin: 2.2rem 0 0.5rem;
  scroll-margin-top: 1rem;
}

h3 { font-size: 1.12rem; margin: 1.4rem 0 0.3rem; }

blockquote {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  background: var(--card);
  border-left: 4px solid var(--accent);
}

blockquote p { margin: 0.4rem 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--card);
  margin: 1rem 0 1.2rem;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
}

th { font-family: "Segoe UI", sans-serif; font-size: 0.8rem; }

.note {
  background: var(--accent-soft);
  padding: 0.8rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
}

footer, .src {
  font-size: 0.92rem;
  color: var(--muted);
}

.src p { margin: 0 0 0.85rem; }

.src em { color: var(--ink); }

.corner {
  position: fixed; bottom: 14px; z-index: 10;
  font-family: "Courier New", Courier, monospace; font-size: 0.78rem;
  color: var(--muted); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.3rem 0.7rem; text-decoration: none; cursor: pointer;
  opacity: 0.55; transition: opacity 0.2s ease, color 0.2s ease;
}
.corner:hover, .corner:focus-visible { opacity: 1; color: var(--accent); }
.corner-left { left: 14px; }
.corner-right { right: 14px; }
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 20; padding: 1rem;
  background: rgba(28, 25, 21, 0.55); align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  position: relative; background: var(--card); border-radius: 16px;
  max-width: 640px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 2rem;
}
.modal h2 { margin: 0 0 0.5rem; font-size: 1.4rem; }
.modal > p { color: var(--muted); font-size: 0.92rem; margin: 0 0 1.2rem; }
.modal-close {
  position: absolute; top: 1rem; right: 1rem; background: none; border: none;
  font-size: 1.4rem; line-height: 1; color: var(--muted); cursor: pointer;
}
.tech-section-title {
  font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin: 1.2rem 0 0.7rem; font-family: "Segoe UI", sans-serif;
}
.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.tech-card h3 { font-size: 0.95rem; margin: 0 0 0.3rem; font-family: "Segoe UI", sans-serif; }
.tech-card p { font-size: 0.85rem; line-height: 1.5; margin: 0; }
.tech-card code { background: #eef0f3; border-radius: 4px; padding: 0.05rem 0.3rem; font-size: 0.82em; }
@media (max-width: 640px) {
  .tech-grid { grid-template-columns: 1fr; }
  .modal { padding: 1.4rem; }
}
@media print { .corner, .modal-overlay { display: none; } }

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; gap: 0.5rem; }
  nav {
    position: static;
    display: flex;
    gap: 0.7rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--line);
  }
  nav p { display: none; }
  nav a { white-space: nowrap; border-top: 0; }
  h1 { font-size: 1.7rem; }
}

.uppslag { margin: 1rem 0 1.2rem; }
.uppslag img {
  width: 100%;
  max-width: 520px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.uppslag figcaption {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

.cards { display: grid; gap: 0.8rem; margin: 1rem 0 1.4rem; }
.card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 0.85rem 1rem; text-decoration: none; color: var(--ink);
}
.card span {
  display: block; font-family: "Segoe UI", sans-serif; font-size: 0.72rem;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
}
.card strong { display: block; margin: 0.15rem 0; font-size: 1.05rem; }
.card em { display: block; font-style: normal; color: var(--muted); font-size: 0.95rem; }
.card:hover { border-color: var(--accent); }
