/* Gameskrift. Light: parchment, ink and brass. Dark: night sky, gold and frost. */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/static/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --bg: #fbf8f2;
  --bg-alt: #f3ece0;
  --surface: #ffffff;
  --line: #e4d9c6;
  --line-strong: #cdbb9b;
  --text: #241c16;
  --heading: #241c16;
  --muted: #65584a;
  --accent: #a8792a;
  --accent-2: #9c4b26;
  --link: #2c7a6b;
  --link-hover: #9c4b26;
  --btn-bg: #2a221c;
  --btn-fg: #f3dc9f;
  --btn-hover: #4a3b2f;
  --hero-glow:
    radial-gradient(55% 70% at 80% 35%, rgba(217, 180, 95, .18), transparent 70%),
    radial-gradient(40% 50% at 10% 0%, rgba(44, 122, 107, .06), transparent 70%);
  --card-bg:
    radial-gradient(circle at 10px 10px, #d9b45f 0 2.5px, transparent 3px),
    radial-gradient(circle at calc(100% - 10px) 10px, #d9b45f 0 2.5px, transparent 3px),
    radial-gradient(circle at 10px calc(100% - 10px), #d9b45f 0 2.5px, transparent 3px),
    radial-gradient(circle at calc(100% - 10px) calc(100% - 10px), #d9b45f 0 2.5px, transparent 3px),
    #ffffff;
  --shadow: 0 1px 2px rgba(42, 34, 28, .06), 0 10px 30px rgba(42, 34, 28, .07);
  --header-bg: rgba(251, 248, 242, .88);
  --display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --display-scale: 1.12;
  --radius: 8px;
  color-scheme: light;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --wrap: 1120px;
  --narrow: 760px;
  --gutter: clamp(16px, 4vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f1d;
    --bg-alt: #0f1628;
    --surface: #151d33;
    --line: #26304a;
    --line-strong: #34405f;
    --text: #ece8dd;
    --heading: #ece8dd;
    --muted: #a3aabd;
    --accent: #d9b23a;
    --accent-2: #8fd3ff;
    --link: #8fd3ff;
    --link-hover: #c4e9ff;
    --btn-bg: #d9b23a;
    --btn-fg: #1a1405;
    --btn-hover: #ebc54f;
    --hero-glow:
      radial-gradient(40% 30% at 70% 20%, rgba(94, 230, 176, .18), transparent 70%),
      radial-gradient(35% 28% at 85% 35%, rgba(155, 140, 255, .16), transparent 70%),
      radial-gradient(45% 35% at 30% 0%, rgba(143, 211, 255, .10), transparent 70%);
    --card-bg: #151d33;
    --shadow: none;
    --header-bg: rgba(10, 15, 29, .82);
    --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --display-scale: 1;
    --radius: 14px;
    color-scheme: dark;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0 0 .5em; color: var(--heading); }
h1 { font-size: calc(clamp(2.4rem, 6vw, 4.2rem) * var(--display-scale)); letter-spacing: -.01em; }
h2 { font-size: calc(clamp(1.8rem, 4vw, 2.7rem) * var(--display-scale)); }
h3 { font-size: calc(1.3rem * var(--display-scale)); }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: var(--narrow); }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--btn-bg); color: var(--btn-fg); padding: 8px 14px; border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 12px; }

.eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .9em;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--heading); text-decoration: none;
  font-family: var(--display); font-size: calc(1.3rem * var(--display-scale)); font-weight: 600; letter-spacing: .02em;
}
.brand:hover { color: var(--heading); }
.brand-mark { width: 28px; height: 28px; color: var(--accent); }
.site-header nav ul { display: flex; gap: clamp(12px, 3vw, 28px); list-style: none; margin: 0; padding: 0; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.site-header nav a:hover { color: var(--heading); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none; line-height: 1.2;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover { background: var(--btn-hover); color: var(--btn-fg); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--heading); }
.btn-ghost:hover { border-color: var(--accent); color: var(--heading); }
.btn-lg { font-size: 1.15rem; padding: 16px 30px; overflow-wrap: anywhere; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(40px, 7vw, 88px) 0 clamp(40px, 6vw, 72px);
  background: var(--hero-glow);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center; gap: clamp(24px, 4vw, 56px);
}
.hero .lede { font-size: 1.2rem; }
.hero-art { margin: 0; }
.hero-art img { width: 100%; height: auto; }

/* Sections */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-tight { padding-top: 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { margin-bottom: clamp(32px, 5vw, 52px); }
.section-head-row { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head-row h2 { margin: 0; }
.more { font-weight: 600; text-decoration: none; }
.page-head { padding-bottom: clamp(32px, 5vw, 48px); }

.pillars, .post-list { list-style: none; margin: 0; padding: 0; }

.pillars li, .facts div, .post-list a {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.pillars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.pillars li { padding: 28px; position: relative; }
.pillars li::before {
  content: ""; position: absolute; left: 28px; top: -1px; width: 44px; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 0 0 3px 3px;
}
.pillars p { color: var(--muted); margin: 0; }

/* Technology */
.studio { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.studio p { color: var(--muted); max-width: 60ch; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.facts div { padding: 18px 20px; }
.facts dt { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.facts dd { margin: 0; font-family: var(--display); font-size: calc(1.15rem * var(--display-scale)); color: var(--heading); }

/* Post lists */
.post-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.post-list a {
  display: block; height: 100%; padding: 24px; text-decoration: none; color: var(--text);
  transition: border-color .15s ease, transform .15s ease;
}
.post-list a:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-list time { display: block; font-size: .85rem; color: var(--accent); margin-bottom: 8px; }
.post-list h2, .post-list h3 { font-size: calc(1.3rem * var(--display-scale)); margin-bottom: .4em; }
.post-list p { color: var(--muted); margin: 0; font-size: .97rem; }
.post-list-full { grid-template-columns: minmax(0, 1fr); max-width: var(--narrow); }
.post-list-full a { padding: 28px; }
.post-list-full h2 { font-size: calc(1.6rem * var(--display-scale)); }

/* Post */
.post-head { margin-bottom: 40px; }
.post-head h1 { font-size: calc(clamp(2.1rem, 5vw, 3.2rem) * var(--display-scale)); }
.post-foot { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }

.prose { font-size: 1.06rem; }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose h2 { font-size: calc(1.75rem * var(--display-scale)); margin: 2em 0 .2em; }
.prose h3 { font-size: calc(1.3rem * var(--display-scale)); margin: 1.6em 0 .2em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--heading); }
.prose img, .prose video { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #000; }
.prose video { aspect-ratio: 16 / 9; }
.prose code {
  font-family: var(--mono); font-size: .9em;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 6px; padding: .1em .35em;
}
.prose pre { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px; padding: 16px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose blockquote {
  margin-left: 0; margin-right: 0; padding: 14px 20px;
  border-left: 3px solid var(--link); background: var(--bg-alt); border-radius: 0 10px 10px 0;
}
.prose blockquote > :first-child { margin-top: 0; }
.prose blockquote[class^="markdown-alert-"]::before {
  display: block; margin-bottom: .3em; font-weight: 700; font-size: .78rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--link);
}
.prose .markdown-alert-note::before { content: "Note"; }
.prose .markdown-alert-tip::before { content: "Tip"; }
.prose .markdown-alert-important::before { content: "Important"; color: var(--accent-2); }
.prose .markdown-alert-warning::before { content: "Warning"; color: var(--accent); }
.prose .markdown-alert-caution::before { content: "Caution"; color: #c94f4f; }
.prose .markdown-alert-important { border-left-color: var(--accent-2); }
.prose .markdown-alert-warning { border-left-color: var(--accent); }
.prose .markdown-alert-caution { border-left-color: #c94f4f; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }

/* Contact */
.contact { text-align: center; }
.contact .lede { margin: 0 auto 28px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .88rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--heading); }

/* Responsive */
@media (max-width: 960px) {
  .post-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .hero-inner, .studio { grid-template-columns: minmax(0, 1fr); }
  .hero-art { max-width: 420px; justify-self: center; }
}
@media (max-width: 760px) {
  .pillars { grid-template-columns: minmax(0, 1fr); }
  .site-header nav ul li:first-child, .site-header nav ul li:last-child { display: none; }
}
@media (max-width: 520px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
  .pillars li { padding: 24px 20px; }
  .pillars li::before { left: 20px; }
}

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