/* anthonysullivan.net — matches the approved mockup.
   Headers: Silkscreen. Body: IBM Plex Sans. Labels/code: IBM Plex Mono.
   Fonts are self-hosted from /fonts (Latin subsets, SIL Open Font License — see /fonts/OFL.txt). */

@font-face { font-family: 'Silkscreen'; src: url('/fonts/silkscreen-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('/fonts/ibm-plex-sans-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('/fonts/ibm-plex-sans-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('/fonts/ibm-plex-sans-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('/fonts/ibm-plex-sans-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/fonts/ibm-plex-mono-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/fonts/ibm-plex-mono-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --ground: #F6F6F3;
  --ink: #16181D;
  --ink-2: #24272D;
  --muted: #4A4D55;
  --subtle: #5C5F66;
  --rule: #DEDED8;
  --rule-strong: #C9CAC4;
  --placeholder: #E4E4DF;
  --accent: #0E6B66;
  --accent-hover: #0E5E5A;

  --dark-ground: #16181D;
  --dark-panel: #23262D;
  --dark-rule: #34373E;
  --dark-text: #F6F6F3;
  --dark-muted: #C3C5CB;
  --dark-subtle: #8A8D94;
  --dark-accent: #7FD1C9;

  --font-pixel: 'Silkscreen', 'IBM Plex Sans', system-ui, sans-serif;
  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video, iframe { max-width: 100%; display: block; }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; color: #fff; }

h1, h2 { font-family: var(--font-pixel); font-weight: 400; letter-spacing: 0; margin: 0; }
h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.15; }
h2 { font-size: clamp(24px, 3.5vw, 30px); line-height: 1.2; }
h3 { font-size: 19px; font-weight: 600; margin: 0; line-height: 1.35; }
p { margin: 0; }

.container { max-width: 1120px; margin: 0 auto; padding-inline: 24px; }

/* ---------- Header / footer ---------- */

.site-header { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; padding-block: 28px; }
.site-name { font-family: var(--font-pixel); font-size: 18px; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: 15px; }
.site-nav a { text-decoration: none; padding-block: 12px; }
.site-nav a[aria-current="page"] { text-decoration: underline; font-weight: 500; }

.site-footer { border-top: 1px solid var(--rule); font-size: 14px; color: var(--subtle); }
.footer-row { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; padding-block: 40px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--subtle); }

/* ---------- Shared bits ---------- */

.eyebrow { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.muted-eyebrow { color: var(--subtle); font-size: 12px; }
.lede { font-size: clamp(17px, 2vw, 19px); line-height: 1.6; color: var(--muted); max-width: 620px; }
.muted { color: var(--muted); }

.button-row { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border: 1px solid var(--rule-strong); border-radius: 6px; text-decoration: none; font-weight: 500;
}
.button-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.button-primary:hover { background: var(--ink-2); color: #fff; }

.placeholder {
  background: var(--placeholder); border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; color: var(--subtle); text-align: center; padding: 16px;
}

.band { border-top: 1px solid var(--rule); padding-block: 88px; }
.band.dark { background: var(--dark-ground); color: var(--dark-text); border-top: 0; }

.split { display: flex; flex-wrap: wrap; gap: 48px; }
.split-intro { flex: 1 1 260px; display: flex; flex-direction: column; gap: 12px; }
.split > :last-child:not(.split-intro) { flex: 999 1 560px; min-width: 0; }
.more-link { font-weight: 500; padding-top: 8px; }

/* ---------- Home: hero ---------- */

.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding-block: 96px 112px; }
.hero-text { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.hero h1 { max-width: 800px; }
.headshot { flex: 1 1 280px; max-width: 340px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.headshot img { width: 100%; height: auto; aspect-ratio: 5 / 6; object-fit: cover; border-radius: var(--radius); }
.headshot figcaption { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--subtle); }

/* ---------- Home: work timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; flex-wrap: wrap; gap: 8px 32px; padding-block: 24px; border-bottom: 1px solid var(--rule); }
.timeline li > div { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; }
.timeline li > div > p:last-child:not(.where) { margin-top: 6px; color: #34373E; }
.timeline .where { font-size: 15px; color: var(--subtle); }
.timeline .timeline-more { border-bottom: 0; }
.when { flex: 0 0 160px; font-family: var(--font-mono); font-size: 14px; color: var(--subtle); padding-top: 3px; }

/* ---------- Home: games ---------- */

.stack-lg { display: flex; flex-direction: column; gap: 40px; }
.games-head { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; align-items: flex-end; }
.games-head .split-intro { flex-basis: 520px; }
.dark .eyebrow { color: var(--dark-accent); }
.dark .muted { color: var(--dark-muted); }
.dark a { color: var(--dark-text); }
.dark .button { border-color: #4A4D55; }
.dark .placeholder { background: var(--dark-panel); color: var(--dark-subtle); }

.media { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.media > .placeholder, .media > iframe, .media > img, .media > video { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); }
.media figcaption { font-size: 14px; color: var(--dark-subtle); }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.shot, .grid-3 > img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; border-radius: var(--radius); }
.card { border: 1px solid var(--dark-rule); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.card .eyebrow { font-size: 12px; letter-spacing: 0.06em; }
.card .muted { font-size: 15px; }

/* ---------- Home: screenshot gallery ---------- */

.gallery { display: flex; flex-direction: column; gap: 16px; }
.gallery-head { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.dark .gallery-count { color: var(--dark-subtle); letter-spacing: 0.06em; }
.gallery-nav { display: flex; gap: 8px; }
.gallery-nav[hidden] { display: none; }

.icon-button {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%;
  border: 1px solid #4A4D55; background: transparent; color: var(--dark-text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-button:hover:not(:disabled) { border-color: var(--dark-accent); color: var(--dark-accent); }
.icon-button:disabled { opacity: 0.35; cursor: default; }
.icon-button[hidden] { display: none; }

.gallery-track {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-auto-flow: column; gap: 16px;
  /* three across, with a sliver of the next one peeking in */
  grid-auto-columns: calc((100% - 3 * 16px) / 3.25);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track li { scroll-snap-align: start; }
.gallery-item { display: block; border-radius: var(--radius); overflow: hidden; background: var(--dark-panel); cursor: zoom-in; }
.gallery-item img { width: 100%; aspect-ratio: 16 / 10; height: auto; object-fit: cover; transition: transform 0.2s ease; }
.gallery-item:hover img { transform: scale(1.02); }

.gallery-dots { display: flex; gap: 6px; justify-content: center; padding-top: 4px; }
.gallery-dots span { width: 8px; height: 8px; border-radius: 2px; background: #4A4D55; }
.gallery-dots span.is-active { background: var(--dark-accent); }

.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 48px 24px;
  border: 0; background: rgba(10, 11, 14, 0.94); color: var(--dark-text);
}
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }
.lightbox::backdrop { background: rgba(10, 11, 14, 0.6); }
.lightbox-close { position: absolute; top: 24px; right: 24px; }
.lightbox-stage { display: flex; align-items: center; gap: 20px; width: 100%; max-width: 1180px; }
.lightbox figure { flex: 1 1 auto; min-width: 0; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 220px); width: auto; height: auto; border-radius: var(--radius); }
.lightbox figcaption { font-size: 15px; color: var(--dark-muted); text-align: center; }
.lightbox-count { font-family: var(--font-mono); font-size: 13px; color: var(--dark-subtle); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .gallery-track { scroll-behavior: auto; }
  .gallery-item img { transition: none; }
}

/* ---------- Post lists ---------- */

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-bottom: 1px solid var(--rule); }
.post-list li:first-child { border-top: 1px solid var(--rule); }
.post-row { display: flex; flex-wrap: wrap; gap: 6px 32px; padding-block: 24px; text-decoration: none; }
.post-row .when { flex-basis: 120px; }
.post-row-text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; }
.post-row-title { font-size: 19px; font-weight: 600; }
.post-row:hover .post-row-title { text-decoration: underline; }
.post-row .muted { font-size: 15px; color: var(--subtle); }
.tag-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); padding-top: 4px; }

/* ---------- Contact ---------- */

.contact { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-end; }
.contact > div { display: flex; flex-direction: column; gap: 12px; }
.contact-link { font-size: clamp(20px, 3vw, 28px); font-weight: 600; overflow-wrap: anywhere; }
.link-row { display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: 15px; }
.link-row a { padding-block: 12px; }

/* ---------- Writing index ---------- */

.page-stack { display: flex; flex-direction: column; gap: 56px; padding-block: 72px 96px; }
.page-stack.narrow { max-width: 720px; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; align-items: flex-end; }
.page-head .split-intro { flex-basis: 520px; gap: 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--rule-strong); text-decoration: none; font-weight: 500; font-size: 14px;
}
.chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-small { min-height: 36px; padding: 0 12px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 400; }

.year-group { display: flex; flex-wrap: wrap; gap: 16px 48px; }
.year { flex: 0 0 160px; padding-top: 24px; color: var(--subtle); }
.year-group .post-list { flex: 999 1 560px; min-width: 0; }
.year-group .post-row-title { font-size: 20px; }

/* ---------- Post page ---------- */

.article { max-width: 720px; margin: 0 auto; padding: 56px 24px 80px; display: flex; flex-direction: column; gap: 32px; }
.back-link { align-self: flex-start; font-size: 15px; text-decoration: none; color: var(--muted); padding-block: 12px; }
.article-head { display: flex; flex-direction: column; gap: 18px; }
.article-head .lede { font-size: clamp(18px, 2.2vw, 21px); line-height: 1.55; }
.cover { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.cover img { width: 100%; border-radius: var(--radius); }
.cover figcaption, .prose figcaption { font-size: 14px; color: var(--subtle); }

.prose { font-size: 18px; line-height: 1.7; color: var(--ink-2); }
.prose > * + * { margin-top: 24px; }
.prose h2 { font-size: 26px; line-height: 1.25; margin-top: 48px; }
.prose h3 { font-size: 20px; margin-top: 32px; }
.prose h2 + *, .prose h3 + * { margin-top: 16px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 8px; }
.prose strong { font-weight: 600; }
.prose blockquote { margin-inline: 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--accent); font-size: 22px; line-height: 1.5; color: #34373E; }
.prose code { font-family: var(--font-mono); font-size: 0.85em; background: #E9E9E4; padding: 2px 6px; border-radius: 4px; }
.prose pre { background: var(--dark-ground); color: #E6E7EA; border-radius: var(--radius); padding: 20px 24px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.prose pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.prose img, .prose iframe, .prose video { width: 100%; border-radius: var(--radius); }
.prose iframe { aspect-ratio: 16 / 9; height: auto; border: 0; }
.prose figure { margin-inline: 0; display: flex; flex-direction: column; gap: 10px; }
.prose hr { border: 0; border-top: 1px solid var(--rule); }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 8px 12px; text-align: left; }

.article-foot { border-top: 1px solid var(--rule); padding-top: 28px; display: flex; flex-wrap: wrap; gap: 16px 24px; justify-content: space-between; align-items: center; }
.prev-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.prev-next-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; }
.prev-next-card.next { text-align: right; grid-column: -2 / -1; }
.prev-next-card .post-row-title { font-size: 17px; }

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .band { padding-block: 64px; }
  .gallery-track { grid-auto-columns: 82%; }
  .lightbox-stage { flex-wrap: wrap; justify-content: center; }
  .lightbox-stage figure { order: -1; flex-basis: 100%; }
  .hero { padding-block: 48px 72px; }
  .when, .post-row .when, .year { flex-basis: 100%; }
  .prev-next-card.next { grid-column: auto; }
}
