:root {
  --bg: #0f0f0e;
  --text: #e4dfd5;
  --text-soft: #cdc8be;
  --muted: #9c968b;
  --line: #2a2926;
  --green: #2e3a2f;
  --accent: #c9a86a;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
}
a { color: var(--text); }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- header ---------- */
.site-header {
  padding: 44px 0 26px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.site-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 8vw, 76px);
  letter-spacing: -0.02em;
  line-height: 1;
}
.site-name a { text-decoration: none; }
.site-sub {
  margin: 12px 0 0;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

main { flex: 1; }

/* ---------- carousel ---------- */
.carousel { margin-top: 36px; }
.viewport {
  overflow: hidden;
  border-radius: 6px;
  background: var(--green);
}
.track {
  display: flex;
  transition: transform 450ms ease;
}
.slide {
  position: relative;
  flex: 0 0 100%;
  aspect-ratio: 16 / 7;
  background: var(--green);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
}
.slide-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 44px 56px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(8, 8, 7, 0.5);
}
.slide .meta {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b8b2a6;
}
.slide .title {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.05;
  max-width: 820px;
}
.slide .cta { font-size: 16px; font-weight: 500; color: var(--accent); }
.slide:hover .title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }

.controls {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.bars { display: flex; flex-wrap: wrap; }
.bar {
  width: 44px; height: 44px;
  border: 0; padding: 0;
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.bar span { display: block; width: 32px; height: 3px; border-radius: 2px; background: #3a3834; }
.bar[aria-current="true"] span { background: var(--text); }
.nav { display: flex; align-items: center; gap: 14px; }
.counter { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.arrow {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid #3d3b37;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.arrow:hover { border-color: var(--muted); }

.empty { margin: 80px 0; text-align: center; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 64px;
  padding: 24px 0 36px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- post page ---------- */
.post {
  display: grid;
  grid-template-columns: minmax(0, 45%) minmax(0, 1fr);
  min-height: 100vh;
}
.post-photo {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--green);
}
.post-photo img { width: 100%; height: 100%; object-fit: cover; }
.post-text {
  padding: 56px clamp(24px, 6vw, 96px) 80px;
  max-width: 820px;
}
.back { display: inline-block; min-height: 44px; font-size: 15px; color: var(--muted); text-decoration: none; }
.post-text .meta {
  margin: 40px 0 12px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-text h1 {
  margin: 0 0 28px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.prose { font-size: 19px; line-height: 1.75; color: var(--text-soft); }
.prose p { margin: 0 0 1.2em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--serif); font-weight: 500; color: var(--text); line-height: 1.2; margin: 1.6em 0 0.6em; }
.prose blockquote { margin: 1.4em 0; padding-left: 20px; border-left: 2px solid var(--line); color: var(--muted); }
.prose img { margin: 1.4em 0; border-radius: 4px; }
.prose a { color: var(--accent); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.extra-photos { display: grid; gap: 16px; margin-top: 32px; }
.extra-photos figure { margin: 0; }
.extra-photos img { width: 100%; border-radius: 4px; }
.post-nav {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.post-nav a { display: flex; flex-direction: column; text-decoration: none; font-family: var(--serif); font-size: 18px; max-width: 45%; }
.post-nav a span { font-family: var(--sans); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.post-nav .newer { text-align: right; margin-left: auto; }

/* ---------- archive ---------- */
.archive h2 {
  margin: 48px 0 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.archive ul { list-style: none; margin: 0; padding: 0; }
.archive li a {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.a-date { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.a-title { font-family: var(--serif); font-size: 24px; line-height: 1.2; }
.a-tag { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .site-header { padding: 32px 0 20px; }
  .carousel { margin-top: 20px; }
  .slide { aspect-ratio: 4 / 5; }
  .caption { padding: 24px 22px; }
  .controls { flex-wrap: wrap; }
  .bar { width: 36px; }
  .bar span { width: 24px; }
  .post { grid-template-columns: 1fr; }
  .post-photo { position: relative; height: auto; aspect-ratio: 4 / 5; }
  .post-photo.no-photo { display: none; }
  .post-text { padding: 24px 16px 56px; }
  .post-text .meta { margin-top: 24px; }
  .prose { font-size: 18px; }
  .archive li a { grid-template-columns: 1fr; gap: 4px; }
  .a-tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .track { transition: none; }
}

/* ---------- menu ---------- */
.menu {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 20;
}
.menu-toggle { display: none; }
.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
}
.menu-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.menu-list a:hover { color: var(--text); }
.menu-list a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 8px; text-decoration-thickness: 1px; }

/* ---------- section pages ---------- */
.section { padding-top: 96px; }
.section-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 8vw, 76px);
  letter-spacing: -0.02em;
  line-height: 1;
}

@media (max-width: 760px) {
  .menu { top: 10px; right: 10px; }
  .site-header { padding-top: 64px; }
  .menu-toggle {
    display: block;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid #3d3b37;
    border-radius: 999px;
    background: rgba(15, 15, 14, 0.85);
    color: var(--text);
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
  }
  .menu-list {
    display: none;
    position: absolute;
    top: 52px;
    right: 0;
    min-width: 180px;
    flex-direction: column;
    gap: 0;
    padding: 8px;
    background: #171716;
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  .menu.open .menu-list { display: flex; }
  .menu-list a { width: 100%; padding: 0 12px; }
  .section { padding-top: 80px; }
}

/* ---------- arcade: checkers ---------- */
.game { margin-top: 48px; }
.game-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
}
.game-note { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.game-body {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.cb-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #d6d0c3;
  border-radius: 6px;
  overflow: hidden;
  touch-action: manipulation;
}
.cb-tile {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  background: var(--green);
  cursor: pointer;
}
.cb-piece {
  position: absolute;
  width: 10%;
  height: 10%;
  margin: 1.25% 0 0 1.25%;
  padding: 0;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  transition: top 0.2s ease, left 0.2s ease, box-shadow 0.15s;
}
.cb-piece { background: center / cover no-repeat; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45); }
.cb-pieces-1 .cb-piece { background-color: #1b1b19; background-image: url("/arcade/checkers/piece-dark.png"); }
.cb-pieces-2 .cb-piece { background-color: #e4dfd5; background-image: url("/arcade/checkers/piece-light.png"); }
.cb-piece.selected { outline: 3px solid var(--accent); outline-offset: 3px; }
.cb-piece.king { box-shadow: 0 0 0 3px var(--accent), 0 3px 6px rgba(0, 0, 0, 0.45); }
.cb-piece.king::after {
  content: "\2654";
  position: absolute;
  top: -14%;
  right: -14%;
  width: 42%;
  height: 42%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #1b1b19;
  font-size: clamp(10px, 2.2vw, 16px);
  line-height: 1;
}
.cb-panel { display: flex; flex-direction: column; gap: 16px; }
.cb-turn { margin: 0; font-family: var(--serif); font-size: 28px; }
.cb-message { margin: 0; min-height: 1.6em; color: var(--accent); font-size: 15px; }
.cb-score { display: grid; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cb-label { display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.cb-captured { display: flex; flex-wrap: wrap; gap: 4px; min-height: 16px; margin-top: 8px; }
.cb-dot { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: center / cover no-repeat; }
.cb-dot-1 { background-color: #1b1b19; background-image: url("/arcade/checkers/piece-dark.png"); }
.cb-dot-2 { background-color: #e4dfd5; background-image: url("/arcade/checkers/piece-light.png"); }
.cb-reset {
  align-self: flex-start;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid #3d3b37;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.cb-reset:hover { border-color: var(--muted); }
.game-credit { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.game-credit a { color: var(--muted); }

@media (max-width: 760px) {
  .game { margin-top: 32px; }
  .game-body { grid-template-columns: 1fr; gap: 20px; }
  .cb-turn { font-size: 24px; }
}

/* ---------- arcade: index + chess ---------- */
.game-index { display: flex; gap: 8px; margin-top: 16px; }
.game-index a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid #3d3b37; border-radius: 999px;
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
}
.game-index a:hover { color: var(--text); border-color: var(--muted); }
.game + .game { margin-top: 72px; padding-top: 48px; border-top: 1px solid var(--line); }
.game { scroll-margin-top: 24px; }
.cs-board-wrap { width: 100%; max-width: 560px; }
#chessboard .board-b72b1 { border: 0; border-radius: 6px; overflow: hidden; }
#chessboard .white-1e1d7 { background-color: #d6d0c3; color: #2e3a2f; }
#chessboard .black-3c85d { background-color: var(--green); color: #d6d0c3; }
#chessboard .square-55d63 { position: relative; touch-action: none; }
#chessboard .cs-selected { box-shadow: inset 0 0 0 4px var(--accent); }
#chessboard .cs-target::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 26%; height: 26%; transform: translate(-50%, -50%);
  border-radius: 50%; background: rgba(201, 168, 106, 0.75); pointer-events: none;
}
.cs-last { margin: 0; color: var(--muted); font-size: 15px; }
.cs-buttons { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- checkers difficulty toggle ---------- */
.cb-level {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px;
  border: 1px solid #3d3b37;
  border-radius: 999px;
}
.cb-level button {
  min-height: 40px;
  min-width: 76px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.cb-level button:hover { color: var(--text); }
.cb-level button[aria-pressed="true"] { background: var(--green); color: var(--text); }

/* ---------- posts page ---------- */
.post-list { list-style: none; margin: 40px 0 0; padding: 0; }
.pl-item {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.post-list li:first-child .pl-item { border-top: 1px solid var(--line); }
.pl-thumb { display: block; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--green); }
.pl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pl-text { display: flex; flex-direction: column; gap: 6px; }
.pl-meta { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pl-title { font-family: var(--serif); font-size: clamp(24px, 3vw, 32px); line-height: 1.15; }
.pl-excerpt { color: var(--text-soft); font-size: 16px; }
.pl-item:hover .pl-title { color: var(--accent); }
@media (max-width: 760px) {
  .pl-item { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 16px 0; }
  .pl-excerpt { display: none; }
}

/* ---------- homepage: carousel (2/3) + featured banner (1/3) ---------- */
.hero {
  margin-top: 36px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.hero .carousel { margin-top: 0; }
.hero .slide { aspect-ratio: 4 / 3; }
.hero .caption { padding: 32px 40px; }
.feature-card {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;          /* same height as the carousel beside it */
  border-radius: 6px;
  overflow: hidden;
  background: var(--green);
  color: var(--text);
  text-decoration: none;
}
.feature-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature-card .caption { padding: 28px 28px 30px; }
.feature-card .meta { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: #b8b2a6; }
.feature-card .title { font-family: var(--serif); font-size: clamp(24px, 2.4vw, 34px); line-height: 1.08; }
.feature-card .cta { font-size: 15px; font-weight: 500; color: var(--accent); }
.feature-card:hover .title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.feature-label {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 8, 7, 0.55);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
}
.hero-single { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin-left: auto; margin-right: auto; }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 20px; }
  .hero .slide { aspect-ratio: 4 / 5; }
  .hero .caption { padding: 24px 22px; }
  .feature-card { aspect-ratio: 4 / 5; }
}

/* 3/4 carousel + 1/4 featured banner */
.hero { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
.feature-card { aspect-ratio: 4 / 9; }   /* matches the 4:3 carousel beside it */
.feature-card .caption { padding: 20px 20px 22px; gap: 8px; }
.feature-card .title { font-size: clamp(20px, 1.8vw, 26px); }
.feature-card .meta { font-size: 11px; letter-spacing: 0.14em; }
.feature-card .cta { font-size: 14px; }
.feature-label { top: 12px; left: 12px; font-size: 10px; padding: 5px 10px; }
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .feature-card { aspect-ratio: 4 / 5; }
  .feature-card .caption { padding: 24px 22px; }
  .feature-card .title { font-size: 28px; }
}
.hero .slide { aspect-ratio: 16 / 10; }
.feature-card { aspect-ratio: 8 / 15; }  /* matches the 16:10 carousel beside it */
@media (max-width: 900px) {
  .hero .slide, .feature-card { aspect-ratio: 4 / 5; }
}

/* Keep the homepage banners within one screen on computers:
   about 60% of the window height, never taller than 580px. */
@media (min-width: 901px) {
  .hero { --hero-h: clamp(340px, 60vh, 580px); }
  .hero .slide { aspect-ratio: auto; height: var(--hero-h); }
  .feature-card { aspect-ratio: auto; height: var(--hero-h); }
  .hero .caption { padding: 26px 34px; }
  .hero .slide .title { font-size: clamp(28px, 3vw, 44px); }
}

/* small smiley, top-left of the homepage */
.home-smiley { position: absolute; top: 24px; left: 24px; width: 34px; height: 34px; z-index: 20; }
@media (max-width: 760px) { .home-smiley { top: 16px; left: 16px; width: 30px; height: 30px; } }
