/* DScape theme ------------------------------------------------------------ */

@font-face { font-family: "Archivo"; font-weight: 500; font-display: swap; src: url("../fonts/archivo-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 600; font-display: swap; src: url("../fonts/archivo-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 700; font-display: swap; src: url("../fonts/archivo-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; unicode-range: U+0370-03FF; src: url("../fonts/ibm-plex-sans-greek-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; unicode-range: U+0370-03FF; src: url("../fonts/ibm-plex-sans-greek-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --bg: #F5F3EF;
  --fg: #14171B;
  --muted: #535B64;
  --line: #D3D0CA;
  --accent: #F0A43A;        /* fills: active chips, primary button */
  --accent-ink: #111316;    /* text on accent fills */
  --accent-text: #9A5A00;   /* accent as text on the light ground */
  --globe-sea: #ECE9E3;
  --globe-land: #C3BDB2;

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;

  --wrap: 1280px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 4px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0F1216;
  --fg: #ECEAE5;
  --muted: #A2AAB3;
  --line: #2C333B;
  --accent-text: #F0A43A;
  --globe-sea: #161B21;
  --globe-land: #3A424B;
  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(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.01em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--fg); color: var(--bg); padding: 8px 14px; z-index: 10; }
.skip-link:focus { left: 8px; }

/* Header ---------------------------------------------------------------- */
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 24px; }
.brand { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.brand:hover { text-decoration: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -0.01em; }
.brand-tagline { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; font-size: 15px; }
.site-nav > a { padding-block: 10px; }
.site-nav > a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.icon-links { display: flex; gap: 2px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: none; color: inherit; cursor: pointer; border-radius: 99px; }
.icon-btn:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); }

/* Shared pieces ----------------------------------------------------------- */
.label { font-family: var(--font-mono); font-size: 13px; color: var(--accent-text); }
.meta-line { display: block; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.lead { margin: 0; font-size: 18px; color: var(--muted); max-width: 62ch; }
.data-list { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; font-size: 14px; line-height: 1.45; }
.data-list dt { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); padding-top: 1px; }
.data-list dd { margin: 0; }
.coords { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.badge { flex: none; font-family: var(--font-mono); font-size: 11.5px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); }
.button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--fg); font: 500 14px/1 var(--font-body); cursor: pointer; }
.button:hover { text-decoration: none; border-color: var(--fg); }
.button-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button-accent:hover { border-color: var(--accent-ink); }
.tile-placeholder { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 2; width: 100%; border: 1px dashed var(--line); border-radius: var(--radius); font-family: var(--font-mono); font-size: 13px; color: var(--muted); }

/* Home: hero ------------------------------------------------------------- */
.hero { display: flex; flex-direction: column; gap: 22px; padding-top: 4px; }
.hero-image img { display: block; width: 100%; aspect-ratio: 1200 / 628; object-fit: cover; border-radius: var(--radius); }
.hero-body { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px 48px; }
.hero-text { display: flex; flex-direction: column; gap: 10px; flex: 1 1 520px; max-width: 780px; }
.hero-title { margin: 0; font-weight: 700; font-size: clamp(36px, 5vw, 58px); line-height: 1.02; letter-spacing: -0.02em; }
.hero .data-list { flex: 0 1 auto; }

/* Home: grid ------------------------------------------------------------- */
.section { padding-top: clamp(56px, 8vw, 88px); }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 24px; margin-bottom: 28px; }
.section-head h2 { margin: 0; font-weight: 600; font-size: 28px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--fg); font: 14px var(--font-body); cursor: pointer; }
.chip:hover { border-color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 48px 32px; }
.tile a { display: flex; flex-direction: column; gap: 12px; }
.tile a:hover { text-decoration: none; }
.tile a:hover .tile-title { text-decoration: underline; text-underline-offset: 3px; }
.tile img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.tile-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.tile-title { font-family: var(--font-display); font-weight: 600; font-size: 23px; line-height: 1.2; }
.empty { color: var(--muted); }
.more { margin-top: 48px; }
.more a { text-decoration: underline; text-underline-offset: 3px; }

/* Post ------------------------------------------------------------------- */
.back-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; color: var(--muted); }
.post-hero { margin: 8px 0 0; }
.post-hero img { display: block; width: 100%; border-radius: var(--radius); }
.post-hero figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 10px; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.post-hero figcaption a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.post-columns { display: flex; flex-wrap: wrap; gap: 48px 64px; padding-top: 44px; }
.post-main { flex: 999 1 560px; min-width: 0; max-width: 720px; }
.post-title { margin: 8px 0 6px; font-weight: 700; font-size: clamp(34px, 4.6vw, 52px); line-height: 1.04; letter-spacing: -0.02em; }
.post-date { margin: 0 0 24px; font-size: 14px; color: var(--muted); }
.details { flex: 1 1 300px; align-self: flex-start; display: flex; flex-direction: column; gap: 22px; padding: 24px; border: 1px solid var(--line); border-radius: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.locator { margin: 0; }
.locator-map { display: flex; justify-content: center; min-height: 220px; }
.locator-map svg { display: block; max-width: 100%; height: auto; }
.globe-sphere { fill: var(--globe-sea); }
.globe-graticule { fill: none; stroke: var(--line); stroke-width: 0.6; }
.globe-land { fill: var(--globe-land); }
.globe-outline { fill: none; stroke: var(--line); stroke-width: 1.2; }
.globe-halo { fill: color-mix(in srgb, var(--accent) 30%, transparent); }
.globe-dot { fill: var(--accent); stroke: var(--accent-ink); stroke-width: 1; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 0; padding: 0; }
.tag { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 13px; }
.tag:hover { border-color: var(--fg); text-decoration: none; }
.post-nav { margin-top: 96px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 32px; }
.post-nav-link { display: flex; align-items: center; gap: 20px; }
.post-nav-link img { flex: none; width: 150px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.post-nav-next { justify-content: flex-end; text-align: right; }
.post-nav-title { display: block; font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.25; }

/* Prose ------------------------------------------------------------------ */
.prose { font-size: 18px; line-height: 1.65; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 28px; margin: 1.6em 0 0.5em; }
.prose h3 { font-size: 22px; margin: 1.5em 0 0.4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose img { display: block; border-radius: var(--radius); margin: 8px 0; }
.prose p:has(> img) em { display: block; font-style: normal; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.prose blockquote { margin: 1.4em 0; padding-left: 18px; border-left: 2px solid var(--line); color: var(--muted); }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 15px; margin: 1.4em 0; }
.prose th, .prose td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.prose code { font-family: var(--font-mono); font-size: 0.88em; }
.prose pre { overflow-x: auto; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }

/* Pages and archive ----------------------------------------------------- */
.page, .archive { max-width: 760px; padding-top: 24px; }
.page-title { font-weight: 700; font-size: clamp(34px, 4.6vw, 48px); margin: 0 0 28px; letter-spacing: -0.02em; }
.archive-year h2 { font-size: 24px; margin: 36px 0 8px; }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li { display: grid; grid-template-columns: 70px 1fr auto; gap: 4px 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.archive-list time { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.archive-list a { font-weight: 500; }
.filter-note { color: var(--muted); }
.filter-note a { color: var(--fg); text-decoration: underline; }
@media (max-width: 560px) {
  .archive-list li { grid-template-columns: 60px 1fr; }
  .archive-list .meta-line { grid-column: 2; }
}

/* Footer ----------------------------------------------------------------- */
.site-footer { margin-top: 120px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; padding-block: 40px 56px; color: var(--muted); font-size: 15px; }
.footer-inner p { margin: 0; max-width: 560px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 24px; color: var(--fg); }
.footer-links a { padding-block: 10px; }
.footer-small { flex-basis: 100%; font-size: 13px; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* Component: before/after compare ----------------------------------------- */
.compare { margin: 32px 0; }
.compare-stage { position: relative; overflow: hidden; border-radius: var(--radius); line-height: 0; user-select: none; touch-action: pan-y; }
.prose .compare-stage img, .compare-stage img { display: block; width: 100%; margin: 0; border-radius: 0; }
.compare-before { position: absolute; inset: 0; height: 100%; object-fit: cover; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35); pointer-events: none; }
.compare-handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 0.4);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36'%3E%3Cpath d='M14 12l-6 6 6 6M22 12l6 6-6 6' fill='none' stroke='%2314171B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.compare-label { position: absolute; top: 12px; padding: 4px 10px; border-radius: 99px; background: rgb(20 23 27 / 0.72); color: #fff; font: 12.5px/1.4 var(--font-mono); pointer-events: none; }
.compare-label-before { left: 12px; }
.compare-label-after { right: 12px; }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.compare-stage:has(.compare-range:focus-visible) .compare-handle::after { outline: 3px solid var(--accent); outline-offset: 2px; }
.compare:not(.is-ready) .compare-range { display: none; }
.compare figcaption { margin-top: 10px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5; color: var(--muted); }
