@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Playfair+Display:wght@500;700;800&family=Source+Serif+4:opsz,wght@8..60,300;8..60,400;8..60,600&display=swap');

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #4a4a4a;
  --line: rgba(17, 17, 17, .16);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --serif: "Times New Roman", Times, serif;
  --blog-head: "Playfair Display", "Times New Roman", Times, serif;
  --blog-body: "Source Serif 4", "Times New Roman", Times, serif;
  --blog-bg: #f8f6f1;
  --blog-ink: #121212;
  --blog-accent: #c8102e;
  --blog-rule: rgba(18, 18, 18, .18);
  --blog-shadow: rgba(0, 0, 0, .08);
  --blog-logo-filter: invert(0);
}

:root[data-theme="dark"] {
  --bg: #0b0c0f;
  --fg: #f2f2f2;
  --muted: rgba(242, 242, 242, .72);
  --line: rgba(242, 242, 242, .18);
  --blog-bg: #0b0c0f;
  --blog-ink: #f2f2f2;
  --blog-accent: #e31837;
  --blog-rule: rgba(242, 242, 242, .2);
  --blog-shadow: rgba(0, 0, 0, .35);
  --blog-logo-filter: invert(1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.blog {
  background: var(--blog-bg);
  color: var(--blog-ink);
  font-family: var(--blog-body);
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:visited {
  color: var(--fg);
}

a:hover {
  opacity: .72;
}

.wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 48px 18px;
}

.blog-wrap {
  place-items: center;
  padding: 28px 18px 80px;
}

.card {
  width: min(680px, 90vw);
  text-align: left;
  padding: 34px 22px 18px;
  margin-left: 12px;
  /* optical centering */
  opacity: 0;
  transform: translateY(10px);
  animation: enter .75s ease forwards;
}

.blog-card {
  width: min(1320px, 96vw);
  margin-left: 0;
  padding: 0;
}

.blog-shell {
  background: color-mix(in srgb, var(--blog-bg) 88%, #ffffff 12%);
  border: 1px solid var(--blog-rule);
  box-shadow: 0 12px 30px var(--blog-shadow);
  padding: 32px 34px 34px;
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
}

.blog-nav {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.blog-nav a {
  text-decoration: none;
  color: var(--blog-ink);
}

.blog-controls {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.blog-controls button {
  all: unset;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  cursor: pointer;
  text-transform: uppercase;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blog-rule);
  transition: background 0.2s ease, color 0.2s ease;
}

.blog-controls button svg {
  display: block;
}


.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--blog-ink);
  margin-bottom: 6px;
}

.blog-back::before {
  content: "←";
}

.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.blog-post {
  border: 1px solid var(--blog-rule);
  background: color-mix(in srgb, var(--blog-bg) 90%, #ffffff 10%);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.blog-post img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border: 1px solid var(--blog-rule);
}

.blog-post figure {
  margin: 18px 0;
}

.blog-post figure img {
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: cover;
  border: 1px solid var(--blog-rule);
}

.blog-post figcaption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--blog-ink) 65%, transparent);
  margin-top: 8px;
}

.blog-post h3,
.blog-post h1 {
  font-family: var(--blog-head);
  margin: 0;
}

.blog-post h3 {
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.05;
}

.blog-post h1 {
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
}

.blog-post p {
  margin: 0;
  color: color-mix(in srgb, var(--blog-ink) 70%, transparent);
  font-size: 16px;
  line-height: 1.7;
}

.blog-post a {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  text-decoration: none;
  color: var(--blog-ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.blog-post a::after {
  content: "→";
}

.blog-detail {
  display: grid;
  gap: 20px;
}

.blog-detail .blog-post {
  border: none;
  padding: 0;
  background: transparent;
}

.blog-detail .blog-post img {
  height: auto;
  max-height: 520px;
}

.blog-footer {
  border-top: 1px solid var(--blog-rule);
  margin-top: 28px;
  padding-top: 18px;
}

.blog-footer .row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.blog-footer a {
  text-decoration: none;
  color: var(--blog-ink);
}

.blog-footer .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.blog-footer .brand img {
  width: 28px;
  height: 28px;
  filter: var(--blog-logo-filter);
}

.blog-footer .legal {
  display: inline-flex;
  gap: 14px;
  flex-wrap: wrap;
}

body.blog,
body.blog .blog-shell,
body.blog .blog-post,
body.blog .blog-aside {
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

@media (max-width: 980px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }
}

/* When loading screen is active, pause all content animations */
body.is-loading .card,
body.is-loading .stagger,
body.is-loading .rule {
  animation-play-state: paused;
}

@keyframes enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger {
  opacity: 0;
  transform: translateY(6px);
  animation: fadeUp .6s ease forwards;
}

.d1 {
  animation-delay: .05s;
}

.d2 {
  animation-delay: .12s;
}

.d3 {
  animation-delay: .18s;
}

.d4 {
  animation-delay: .24s;
}

.d5 {
  animation-delay: .30s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.term {
  font-size: clamp(56px, 8vw, 88px);
  line-height: 1;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 14px;
}

.meta {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.pron {
  font-style: italic;
  color: var(--fg);
}

.pos {
  font-style: italic;
  color: var(--muted);
}

.rule {
  height: 1px;
  background: var(--line);
  width: 100%;
  margin: 18px 0;
  transform-origin: left;
  transform: scaleX(.92);
  animation: ruleGrow .7s ease forwards;
  animation-delay: .18s;
  opacity: 0;
}

@keyframes ruleGrow {
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

.def {
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
  max-width: 60ch;
}

.example {
  margin-top: 14px;
  font-size: 18px;
  line-height: 1.7;
  font-style: italic;
  color: var(--muted);
  max-width: 60ch;
}

.example b {
  font-weight: 700;
  color: var(--fg);
  font-style: italic;
}

.links {
  margin-top: 26px;
  display: grid;
  gap: 10px;
  justify-items: start;
}

.linkrow {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .02em;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}


/* ── LOADING SCREEN ── */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0b0c0f;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

#loading-screen.done {
  opacity: 0;
  pointer-events: none;
}

#loading-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  /* force white */
  animation: logoSpin 2.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes logoSpin {
  0% {
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }

  15% {
    transform: rotate(90deg) scale(1);
    opacity: 1;
  }

  /* gentle warm-up */
  35% {
    transform: rotate(300deg) scale(1.05);
    opacity: 1;
  }

  /* accelerating */
  55% {
    transform: rotate(660deg) scale(1.08);
    opacity: 1;
  }

  /* peak speed */
  75% {
    transform: rotate(960deg) scale(1.03);
    opacity: 1;
  }

  /* easing down */
  90% {
    transform: rotate(1060deg) scale(1);
    opacity: 1;
  }

  /* nearly stopped */
  100% {
    transform: rotate(1080deg) scale(1);
    opacity: 1;
  }

  /* 3 full turns, upright */
}

@media (max-width: 900px) {
  .split-layout {
    flex-direction: column;
    align-items: center;
  }

  .card {
    text-align: left;
    margin-left: 0;
  }
}

/* LEGAL */
body.legal .legal-container {
  width: min(860px, 92vw);
  margin: 0 auto;
  padding: 56px 18px 36px;
}

body.legal h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 4vw, 44px);
  letter-spacing: -0.02em;
  font-weight: 700;
  text-transform: lowercase;
}

body.legal .meta {
  margin: 0 0 26px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--muted);
}

body.legal h2 {
  margin: 26px 0 10px;
  font-size: 16px;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--fg);
  text-transform: lowercase;
}

body.legal p,
body.legal li {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 16px;
}

body.legal hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 24px 0;
}

/* FOOTER */
.footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  width: 100%;
}

.footer .row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
}

.footer .left,
.footer .right {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}

.footer .legal,
.footer .controls,
.footer .meta2 {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .01em;
}

.footer button {
  all: unset;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
}

.footer .meta2 {
  margin-top: 10px;
}

/* HEADER (Minecart LCD only here) */
@font-face {
  font-family: "Minecart LCD";
  src: url("/assets/fonts/Minecart%20LCD.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header .inner {
  width: min(960px, 92vw);
  margin: 0 auto;
  padding: 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-header .logo {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
  transform: none !important;
}

.site-header .title {
  font-family: "Minecart LCD", var(--mono);
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg);
  line-height: 1;
}

.site-header .right {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.site-header button {
  all: unset;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--fg) 35%, transparent);
  outline-offset: 4px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {

  .card,
  .stagger,
  .rule {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  #loading-logo {
    animation: none !important;
  }

  #loading-screen {
    display: none;
  }
}

/* ── COOKIE CONSENT BANNER ── */
#consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .01em;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease;
}

#consent-banner.consent-visible {
  transform: translateY(0);
  opacity: 1;
}

#consent-banner.consent-hidden {
  transform: translateY(100%);
  opacity: 0;
}

#consent-banner .consent-text {
  max-width: 480px;
}

#consent-banner .consent-text a {
  color: var(--fg);
  text-underline-offset: 3px;
}

#consent-banner .consent-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

#consent-banner button {
  all: unset;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 14px;
  border: 1px solid var(--fg);
  color: var(--fg);
  transition: background 0.15s, color 0.15s;
}

#consent-banner button:hover {
  background: var(--fg);
  color: var(--bg);
}

#consent-banner button[data-consent-accept] {
  background: var(--fg);
  color: var(--bg);
}

#consent-banner button[data-consent-accept]:hover {
  opacity: .85;
}
.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: start;
  flex: 1;
}

.blog-aside {
  border: 1px solid var(--blog-rule);
  padding: 16px;
  background: color-mix(in srgb, var(--blog-bg) 92%, #ffffff 8%);
}

.blog-aside h3 {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--blog-rule);
  padding-bottom: 10px;
}

.blog-latest {
  display: grid;
  gap: 14px;
}

.blog-latest a {
  text-decoration: none;
  color: var(--blog-ink);
  font-family: var(--blog-head);
  font-size: 18px;
  line-height: 1.2;
}

.blog-latest span {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--blog-ink) 65%, transparent);
  margin-bottom: 4px;
}

.blog-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--blog-ink) 70%, transparent);
  margin-top: 6px;
}

.blog-meta strong {
  color: var(--blog-ink);
}
.blog-theme-float {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.blog-theme-float button {
  all: unset;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blog-rule);
  background: color-mix(in srgb, var(--blog-bg) 88%, #ffffff 12%);
  color: var(--blog-ink);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.blog-theme-float button svg {
  display: block;
}
