@font-face {
  font-family: "MatthiasCramerHandwriting";
  src: url("/assets/fonts/MatthiasCramerHandwriting.ttf") format("truetype");
  font-display: swap;
}

/* Palette: a modern take on the old #FF6 / #AA4 yellow-olive scheme. */
:root {
  --bg: #fbf9ea;
  --surface: #ffffff;
  --surface-2: #f3f0d6;
  --text: #24231a;
  --muted: #6b6955;
  --accent: #7b7b1e;
  --accent-strong: #5c5c12;
  --accent-soft: #ecec9a;
  --highlight: #ffff66;
  --border: #e2dfc1;
  --code-bg: #2a2a20;
  --code-text: #f4f2d8;
  --shadow: 0 1px 2px rgb(60 60 20 / 0.06), 0 4px 16px rgb(60 60 20 / 0.06);
  --radius: 12px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --hand: "MatthiasCramerHandwriting", var(--sans);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17170f;
    --surface: #212117;
    --surface-2: #2a2a1d;
    --text: #ecebd6;
    --muted: #a7a58a;
    --accent: #d6d66a;
    --accent-strong: #eded8a;
    --accent-soft: #3d3d1c;
    --highlight: #59591c;
    --border: #3a3a29;
    --code-bg: #0f0f0a;
    --code-text: #ecebd6;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 16px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17170f;
  --surface: #212117;
  --surface-2: #2a2a1d;
  --text: #ecebd6;
  --muted: #a7a58a;
  --accent: #d6d66a;
  --accent-strong: #eded8a;
  --accent-soft: #3d3d1c;
  --highlight: #59591c;
  --border: #3a3a29;
  --code-bg: #0f0f0a;
  --code-text: #ecebd6;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 16px rgb(0 0 0 / 0.25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, video { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--surface); padding: 8px 12px; z-index: 10;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand {
  font-family: var(--hand);
  font-weight: bold;
  font-size: 28px;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
  letter-spacing: 0.5px;
}
.brand::before {
  content: "";
  display: inline-block;
  width: 0.55em; height: 0.55em;
  margin-right: 0.35em;
  border-radius: 3px;
  background: var(--highlight);
  box-shadow: 0 0 0 2px var(--accent);
  vertical-align: 0.05em;
}
.icon-btn {
  font: inherit; font-size: 18px; line-height: 1;
  width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }

/* ---------- layout ---------- */
.shell {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 40px;
  padding: 28px 24px 48px;
}
main { min-width: 0; max-width: 780px; }

.sitenav { position: sticky; top: 84px; align-self: start; }
.sitenav ul { list-style: none; margin: 0; padding: 0; }
.sitenav .group { margin-bottom: 14px; }
.sitenav .group-label {
  display: block;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0 10px 4px;
}
.sitenav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
}
.sitenav .single > a { font-weight: 600; }
.sitenav a:hover { background: var(--surface-2); color: var(--text); }
.sitenav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.sitenav .ext { font-size: 12px; color: var(--muted); }
.nav-toggle { display: none; }

@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 20px 16px 40px; }
  .nav-toggle { display: inline-block; }
  .sitenav {
    display: none;
    position: static;
    margin: -4px 0 20px;
    padding: 14px 6px 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  .sitenav.open { display: block; }
  .sitenav > ul { columns: 2; column-gap: 12px; }
  .sitenav .group { break-inside: avoid; }
  .brand { font-size: 22px; white-space: nowrap; }
}
@media (max-width: 420px) {
  .sitenav > ul { columns: 1; }
}

/* ---------- typography ---------- */
h1, h2 { font-family: var(--hand); font-weight: bold; line-height: 1.15; }
h1 { font-size: clamp(32px, 6vw, 44px); margin: 0 0 16px; }
h1::after {
  content: ""; display: block; width: 64px; height: 5px;
  margin-top: 8px; border-radius: 3px; background: var(--highlight);
  box-shadow: 0 0 0 1px var(--accent);
}
h2 { font-size: 28px; margin: 36px 0 10px; }
h3 { font-size: 18px; margin: 26px 0 8px; }
p { margin: 0 0 14px; }
.lead { font-size: 18px; color: var(--text); }
.muted { color: var(--muted); }
small, .small { font-size: 14px; }
ul, ol { padding-left: 1.4em; }
li { margin: 3px 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
blockquote {
  margin: 0 0 18px; padding: 10px 16px;
  border-left: 4px solid var(--accent);
  background: var(--surface-2); border-radius: 0 8px 8px 0;
  font-style: italic;
}
code { font-family: var(--mono); font-size: 0.92em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

figure { margin: 0 0 18px; }
.code-wrap { position: relative; margin: 0 0 20px; }
.code-wrap pre.code { margin: 0; padding-right: 76px; white-space: pre-wrap; overflow-wrap: anywhere; }
pre.code {
  position: relative;
  margin: 0 0 20px;
  padding: 14px 16px;
  background: var(--code-bg); color: var(--code-text);
  border-radius: 10px;
  overflow-x: auto;
  font: 14px/1.55 var(--mono);
}
pre.code code { background: none; padding: 0; font-size: inherit; color: inherit; }
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  font: 12px var(--sans);
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid rgb(255 255 255 / 0.2);
  background: rgb(255 255 255 / 0.08);
  color: var(--code-text);
  cursor: pointer;
  opacity: 0; transition: opacity 0.15s;
}
.code-wrap:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
@media (hover: none) { .copy-btn { opacity: 1; } }

/* ---------- components ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card > :last-child { margin-bottom: 0; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 18px 0; }
.tile {
  display: block; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  transition: transform 0.12s, border-color 0.12s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); }
.tile strong { display: block; font-size: 17px; margin-bottom: 4px; }
.tile span { color: var(--muted); font-size: 14px; }

.links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.links li { margin: 0; }
.btn, .links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: 600 14px var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover, .links a:hover { border-color: var(--accent); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.primary:hover { background: var(--accent-strong); color: var(--bg); }
.btn:disabled { opacity: 0.6; cursor: progress; }

.tag {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 1px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--text);
  vertical-align: middle;
}
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 14px; margin-bottom: 10px; }

.float-right { float: right; margin: 0 0 12px 20px; max-width: 40%; }
@media (max-width: 560px) { .float-right { float: none; display: block; margin: 0 0 14px; max-width: 160px; } }

/* forms */
label { font-weight: 600; }
input[type="text"], input[type="search"], textarea, select {
  font: inherit;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
textarea { font: 13px/1.5 var(--mono); resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.form-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.form-row > input { flex: 1 1 240px; width: auto; }
.radio-row { display: flex; gap: 18px; margin-top: 10px; font-size: 15px; }
.radio-row label { font-weight: 400; }

/* tables */
.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv th, .kv td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.kv th { white-space: nowrap; color: var(--muted); font-weight: 600; width: 1%; }
.kv td { font-family: var(--mono); word-break: break-all; }
.kv td .copy-inline { float: right; margin-left: 8px; }
.copy-inline {
  font: 12px var(--sans); padding: 2px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer;
}
.notice { font-size: 14px; color: var(--muted); }
.error { color: #c0392b; }
:root[data-theme="dark"] .error { color: #ff8a7a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .error { color: #ff8a7a; } }

/* phone */
.phone-number { font-size: clamp(26px, 5vw, 34px); font-weight: 700; letter-spacing: 0.02em; text-decoration: none; }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 8px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; margin: 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.steps li::before {
  content: counter(s);
  flex: none; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  font: 700 15px var(--mono);
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent);
}

/* wallpapers */
.wallpaper img { display: block; border-radius: 8px; margin: 6px 0 4px; }

/* panoramas */
.pano-list { display: grid; gap: 10px; margin: 18px 0 24px; }
.pano-item {
  display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 14px;
  padding: 8px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none;
}
.pano-item:hover, .pano-item[aria-current="true"] { border-color: var(--accent); color: var(--text); }
.pano-item[aria-current="true"] { box-shadow: inset 0 0 0 1px var(--accent); }
.pano-item img { width: 220px; height: 60px; object-fit: cover; border-radius: 6px; display: block; }
@media (max-width: 560px) { .pano-item { grid-template-columns: 1fr; } .pano-item img { width: 100%; } }

.pano-viewer {
  position: relative;
  height: min(62vh, 460px);
  overflow: hidden;
  border-radius: var(--radius);
  background: #111;
  cursor: grab;
  touch-action: none;
  user-select: none;
  scroll-margin-top: 80px;
}
.pano-viewer.dragging { cursor: grabbing; }
.pano-viewer img {
  position: absolute; top: 0; left: 0;
  max-width: none; height: 100%; width: auto;
  transform-origin: 0 0;
  will-change: transform;
  pointer-events: none;
}
.pano-viewer .pano-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #ddd; font-size: 14px; }
.pano-controls {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; padding: 6px;
  background: rgb(0 0 0 / 0.55); border-radius: 12px; backdrop-filter: blur(6px);
}
.pano-controls button {
  width: 36px; height: 36px; border-radius: 8px; border: 0;
  background: rgb(255 255 255 / 0.12); color: #fff; font-size: 17px; cursor: pointer;
}
.pano-controls button:hover { background: rgb(255 255 255 / 0.25); }
.pano-controls button[aria-pressed="true"] { background: var(--accent); color: #111; }
.pano-title { position: absolute; top: 10px; left: 12px; color: #fff; font-size: 14px; background: rgb(0 0 0 / 0.5); padding: 3px 10px; border-radius: 8px; }

/* weather */
.cam { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 3; }
.cam img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cam-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.tl-player video { width: 100%; border-radius: var(--radius); background: #000; display: block; }
.tl-year { margin: 18px 0 6px; font-weight: 700; }
.tl-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.tl-months button {
  font: 600 14px var(--sans); padding: 8px 6px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.tl-months button:hover { border-color: var(--accent); }
.tl-months button[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* search */
.results { list-style: none; padding: 0; margin: 18px 0; }
.results li { margin: 0 0 14px; }
.results a { font-weight: 600; font-size: 17px; }
.results p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
mark { background: var(--highlight); color: inherit; padding: 0 1px; border-radius: 2px; }

/* csr */
.csr-out { margin-top: 18px; }
.csr-out h3 { margin-top: 18px; }

/* ---------- footer ---------- */
.footer {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}
.footer .barcode { height: 36px; width: auto; opacity: 0.85; }
:root[data-theme="dark"] .footer .barcode { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .footer .barcode { filter: invert(1); } }

/* publications */
.versions { list-style: none; padding: 0; margin: 14px 0 0; }
.versions > li { padding: 12px 0; border-top: 1px solid var(--border); margin: 0; }
.versions > li:first-child .tag { margin-left: 6px; }
.versions .links { margin-top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pano-viewer:fullscreen { height: 100vh; border-radius: 0; }
