/* joelcorbo.com — "Spectral" design */
:root {
  --bg: #f6f7fa; --surface: #ffffff; --text: #141a29; --muted: #5a6374; --line: #e2e5ec;
  --spectrum: linear-gradient(90deg, #0fa898 0%, #84cc16 34%, #f59e0b 66%, #e8456b 100%);
  --c1: #0d9488; --c2: #65a30d; --c3: #d97706; --c4: #db2777; --c5: #4f46e5; --c6: #0284c7;
  --link: #0b7f74; --glow: 0 0 0 transparent;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-text: "Newsreader", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1d; --surface: #111829; --text: #e6e9f2; --muted: #98a1b5; --line: #222b40;
    --spectrum: linear-gradient(90deg, #2dd4bf 0%, #a3e635 34%, #fbbf24 66%, #fb7185 100%);
    --c1: #2dd4bf; --c2: #a3e635; --c3: #fbbf24; --c4: #f472b6; --c5: #a5b4fc; --c6: #7dd3fc;
    --link: #5eead4; --glow: 0 0 40px rgba(45, 212, 191, .18); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1d; --surface: #111829; --text: #e6e9f2; --muted: #98a1b5; --line: #222b40;
  --spectrum: linear-gradient(90deg, #2dd4bf 0%, #a3e635 34%, #fbbf24 66%, #fb7185 100%);
  --c1: #2dd4bf; --c2: #a3e635; --c3: #fbbf24; --c4: #f472b6; --c5: #a5b4fc; --c6: #7dd3fc;
  --link: #5eead4; --glow: 0 0 40px rgba(45, 212, 191, .18); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.15rem/1.65 var(--font-text); font-optical-sizing: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--c1); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 68rem; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--text); color: var(--bg); padding: .5rem 1rem; border-radius: 8px; }
.skip:focus { left: 8px; }

/* Header */
header.site { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; min-height: 64px; flex-wrap: wrap; padding-top: .5rem; padding-bottom: .5rem; }
header.site::after { content: ""; display: block; height: 3px; background: var(--spectrum); }
.brand { font: 700 1.15rem/1 var(--font-display); letter-spacing: -.01em; color: var(--text); text-decoration: none; }
nav.main { margin-left: auto; display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; font: 500 .95rem/1 var(--font-display); }
nav.main a { color: var(--muted); text-decoration: none; padding: .55rem .7rem; border-radius: 8px; position: relative; }
nav.main a:hover { color: var(--text); background: var(--line); }
nav.main a[aria-current] { color: var(--text); }
nav.main a[aria-current]::after { content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .2rem; height: 2px; background: var(--spectrum); border-radius: 2px; }
.theme-toggle { margin-left: -.5rem; width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 1.5px solid var(--line); background: transparent; color: var(--text); cursor: pointer; padding: 0; }
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .i-moon { fill: currentColor; stroke: none; }
.theme-toggle .i-sun, :root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
}

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 15rem) 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
.hero--noimage { grid-template-columns: 1fr; }
.hero img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 20px; box-shadow: var(--glow); display: block; }
.hero h1 { font: 800 clamp(2.6rem, 7vw, 5.2rem)/.95 var(--font-display); letter-spacing: -.035em; margin: 0 0 1rem; width: fit-content;
  background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0 .12em .06em 0; margin-right: -.12em; }
.hero .role { font: 500 clamp(1.05rem, 2vw, 1.3rem)/1.4 var(--font-display); color: var(--muted); margin: 0 0 1.25rem; max-width: 40rem; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; font: 600 .95rem/1 var(--font-display); }
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .75rem 1.1rem; border-radius: 999px; text-decoration: none; }
.btn-primary { color: var(--bg); background: var(--text); }
.btn-primary:hover { background: color-mix(in srgb, var(--text) 85%, var(--c1)); }
.btn-ghost { color: var(--text); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--muted); }

/* Page titles and sections */
.page-title { font: 800 clamp(2.2rem, 5.5vw, 3.6rem)/1 var(--font-display); letter-spacing: -.03em; margin: clamp(2rem, 6vw, 4rem) 0 1.5rem; }
.back { display: inline-block; margin-top: 2rem; font: 500 .95rem/1 var(--font-display); text-decoration: none; }
.back + .page-title { margin-top: 1rem; }
.section { padding: 2rem 0 1rem; }
.section > h2 { font: 700 clamp(1.6rem, 3.4vw, 2.2rem)/1.1 var(--font-display); letter-spacing: -.02em; margin: 0 0 1.25rem; display: flex; align-items: center; gap: .75rem; }
.section > h2::before { content: ""; width: 1.6rem; height: 4px; border-radius: 4px; background: var(--spectrum); flex: none; }
main > .prose:first-child, main > .page-title + .prose { margin-top: 0; }

/* Rich text */
.prose { max-width: 42rem; }
.prose p { margin: 0 0 1.1rem; }
.prose h3 { font: 700 1.3rem/1.25 var(--font-display); letter-spacing: -.01em; margin: 2rem 0 .6rem; }
.prose h4 { font: 600 1.1rem/1.3 var(--font-display); margin: 1.5rem 0 .4rem; }
.prose ul, .prose ol { margin: 0 0 1.25rem; padding-left: 1.4rem; }
.prose li { margin-bottom: .6rem; padding-left: .2rem; }
.prose ul { list-style: none; padding-left: 1.2rem; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: ""; position: absolute; left: -1.05rem; top: .68em; width: .42rem; height: .42rem; border-radius: 50%; background: var(--c1); }
.prose ul > li:nth-child(4n+2)::before { background: var(--c2); }
.prose ul > li:nth-child(4n+3)::before { background: var(--c3); }
.prose ul > li:nth-child(4n+4)::before { background: var(--c4); }
.prose ol > li::marker { font: 600 .9rem var(--font-display); color: var(--muted); font-variant-numeric: tabular-nums; }
.prose blockquote { margin: 1.5rem 0; padding: .25rem 0 .25rem 1.25rem; border-left: 3px solid var(--c1); color: var(--muted); font-style: italic; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2rem 0; }
.prose b, .prose strong { font-weight: 600; }
.prose a { overflow-wrap: anywhere; }

.contact .email-line { font-style: italic; color: var(--muted); }
.contact .email a { font-style: normal; }

/* Table of contents */
.toc { margin: 0 0 1.5rem; }
.toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.toc a { display: inline-block; font: 500 .95rem/1 var(--font-display); padding: .6rem .9rem; border-radius: 999px; border: 1.5px solid var(--line); color: var(--text); text-decoration: none; }
.toc a:hover { border-color: var(--c1); color: var(--link); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 0 0 1.5rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem 1.25rem 1.1rem; position: relative; overflow: hidden; --accent: var(--c1); }
.card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.card:nth-child(4n+2) { --accent: var(--c2); } .card:nth-child(4n+3) { --accent: var(--c3); } .card:nth-child(4n+4) { --accent: var(--c4); }
.card h3 { font: 700 1.15rem/1.25 var(--font-display); margin: 0 0 .4rem; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card:has(a):hover { border-color: var(--accent); }
.card p { margin: 0; font-size: 1rem; color: var(--muted); line-height: 1.5; }

/* Figures */
.figure { margin: 1.5rem 0; }
.figure img { border-radius: 14px; display: block; }
.figure--text { max-width: 42rem; } .figure--small { max-width: 20rem; }
.figure figcaption { font-size: .9rem; color: var(--muted); margin-top: .5rem; }

/* Games table */
.games-meta { color: var(--muted); font-size: 1rem; margin: 0 0 1.25rem; }
.games-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
.games-table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: .98rem; }
.games-table th { font: 600 .78rem/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  text-align: left; padding: .8rem .6rem; border-bottom: 2px solid var(--line); vertical-align: bottom; position: sticky; top: 0; background: var(--bg); }
.games-table th button { all: unset; cursor: pointer; display: inline-flex; gap: .25rem; align-items: baseline; }
.games-table th button:focus-visible { outline: 2px solid var(--c1); outline-offset: 3px; border-radius: 3px; }
.games-table th button:hover { color: var(--text); }
.games-table th[aria-sort="ascending"], .games-table th[aria-sort="descending"] { color: var(--text); }
.games-table .g-arrow { color: var(--c1); min-width: .7em; }
.games-table td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.games-table tbody tr:hover { background: var(--surface); }
.games-table .g-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.games-table th.g-num button { justify-content: flex-end; }
.games-table .g-thumb { width: 68px; min-width: 68px; }
.games-table .g-name { min-width: 13rem; }
.games-table .g-thumb img { width: 56px; height: 56px; object-fit: cover; display: block; max-width: none; border-radius: 10px; background: var(--line); }
.games-table .g-name a { color: var(--text); font-weight: 500; text-decoration: none; }
.games-table .g-name a:hover { color: var(--link); text-decoration: underline; }
.g-exp { font-size: .88rem; color: var(--muted); max-width: 28rem; }
.g-exp summary { cursor: pointer; font: 600 .74rem/1.9 var(--font-display); text-transform: uppercase; letter-spacing: .05em; width: fit-content; }
.g-cat { font: 600 .78rem/1 var(--font-display); padding: .3rem .55rem; border-radius: 999px; border: 1.5px solid currentColor; white-space: nowrap; color: var(--muted); }
.g-cat[data-cat="strategy"] { color: var(--c1); } .g-cat[data-cat="party"] { color: var(--c4); }
.g-cat[data-cat="casual"] { color: var(--c2); } .g-cat[data-cat="coopteam"] { color: var(--c6); }
.g-cat[data-cat="social"] { color: var(--c3); } .g-cat[data-cat="abstract"] { color: var(--c5); }

footer.site { border-top: 1px solid var(--line); margin-top: 4rem; padding: 2rem 0 2.5rem; color: var(--muted); font-size: .95rem; }

@media (max-width: 640px) {
  body { font-size: 1.08rem; }
  header.site { position: static; }
  html { scroll-padding-top: 16px; }
  header.site .wrap { display: grid; grid-template-columns: 1fr auto; padding-top: .75rem; padding-bottom: .25rem; }
  .theme-toggle { margin-left: 0; grid-column: 2; grid-row: 1; }
  nav.main { grid-column: 1 / -1; flex-wrap: nowrap; justify-content: space-between; overflow-x: auto; margin: 0 -.3rem; padding: 0 0 .35rem; scrollbar-width: none; }
  nav.main::-webkit-scrollbar { display: none; }
  nav.main a { white-space: nowrap; padding: .55rem .3rem; font-size: .9rem; }
  nav.main a[aria-current]::after { left: .3rem; right: .3rem; }
  .hero { grid-template-columns: 1fr; padding-top: 2rem; }
  .hero img { max-width: 12rem; }
  .games-table th { position: static; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print {
  header.site, .theme-toggle, footer.site { display: none; }
  body { background: #fff; color: #000; }
}
@media (max-width: 380px) { nav.main a { font-size: .84rem; padding-left: .22rem; padding-right: .22rem; } }
