/* ---------------------------------------------------------------
   Tildabettinafi — constructivist-techno
   warm paper / near-black ink / one red — Syne display, mono codes
   ---------------------------------------------------------------- */

@font-face {
  font-family: "Syne";
  src: url("/fonts/syne-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Syne";
  src: url("/fonts/syne-latin-ext-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Syne";
  src: url("/fonts/syne-latin-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Syne";
  src: url("/fonts/syne-latin-ext-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #f1efe9;
  --ink: #171512;
  --muted: #6d675c;
  --red: #d81f1f;
  --dot: rgba(23, 21, 18, 0.16);
  --code-bg: #e6e3da;
  --line: rgba(23, 21, 18, 0.25);
  --font-display: "Syne", "Arial Black", sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #14120f;
  --ink: #e9e6df;
  --muted: #948d80;
  --red: #ff5245;
  --dot: rgba(233, 230, 223, 0.14);
  --code-bg: #1f1c17;
  --line: rgba(233, 230, 223, 0.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
  line-height: 1.65;
}

::selection { background: var(--red); color: var(--paper); }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { color: var(--red); }

:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: none;
}
.skip-link:focus { left: 0.5rem; }

/* ---------------- header ---------------- */

.site-header {
  position: relative;
  padding-top: 0.75rem;
}

.wordmark {
  display: inline-block;
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.35rem, 4.5vw, 2rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 0.12s ease;
}
.wordmark::before {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--red);
  transform: translate(3px, 3px);
  z-index: -1;
  transition: transform 0.12s ease;
}
.wordmark:hover { color: var(--ink); transform: rotate(-1.5deg) translate(-1px, -1px); }
.wordmark:hover::before { transform: translate(5px, 5px); }

.tagline {
  margin: 0.6rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 0;
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: box-shadow 0.12s ease, transform 0.12s ease;
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--ink);
}
.theme-toggle:active { transform: translate(3px, 3px); box-shadow: none; }

main { margin-top: 2.75rem; }

/* ---------------- home: poster treatment ---------------- */

.hero {
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 2.25rem 0.75rem;
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.2px);
  background-size: 7px 7px;
}

.hero-title {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.1rem, 8vw, 4rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  transform: rotate(-1deg);
}
.hero-title::before {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--red);
  transform: translate(4px, 4px);
  z-index: -1;
}

.hero-sub {
  margin: 1.25rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.index-label {
  margin: 2.5rem 0 0.5rem;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
}
.post-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1.1rem 0.25rem;
  border-top: 1px solid var(--line);
}
.post-list .idx {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.post-list a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  line-height: 1.15;
  text-decoration: none;
  transition: text-shadow 0.12s ease, transform 0.12s ease;
}
.post-list a:hover {
  transform: translate(-1px, -1px);
  text-shadow: 3px 3px 0 var(--red);
}
.post-list time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------------- post page: calm column ---------------- */

.post-head { border-bottom: 2px solid var(--ink); padding-bottom: 1.25rem; }
.post-head h1 {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.post-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.post-body { max-width: 38rem; font-size: 1.02rem; }
.post-body h2, .post-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 2rem 0 0.5rem;
}
.post-body h2 { font-size: 1.4rem; }
.post-body h3 { font-size: 1.15rem; }
.post-body p img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2rem auto;
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--red);
}
.post-body figure { margin: 2rem 0; }
.post-body figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--red);
}
.post-body figcaption {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.post-body blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 4px solid var(--red);
}
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
}
.post-body pre {
  background: var(--code-bg);
  border: 1px solid var(--ink);
  padding: 1rem 1.1rem;
  overflow-x: auto;
}
.post-body pre code { background: none; padding: 0; font-size: 0.85rem; }
.post-body hr { border: 0; border-top: 2px solid var(--ink); margin: 2.5rem 0; }

.back { margin: 2.5rem 0 0; font-family: var(--font-mono); font-size: 0.8rem; }
.back a { text-decoration: none; }
.back a:hover { text-decoration: underline; text-decoration-color: var(--red); }

/* ---------------- footer ---------------- */

.site-footer { margin-top: 4rem; }
.halftone-band {
  height: 12px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.2px);
  background-size: 7px 7px;
}
.footer-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.footer-code { letter-spacing: 0.12em; }

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