/* ============================================================
   PROFESSIONAL THEME — nicodev.info
   Gruvbox-warm editorial. Wordmark = "Nico Toé"; shows the
   contact links, hides the social-icon set.
   ============================================================ */
:root {
  --brand: "Nico Toé";

  --bg: #504945;
  --bg-2: #3c3836;
  --bg-deep: #282828;
  --ink: #ebdbb2;
  --ink-soft: #d5c4a1;
  --ink-faint: #a89984;
  --rule: #7c6f64;
  --rule-soft: #665c54;
  --accent: #fe8019;
  --accent-ink: #282828;
  --radius: 12px;
  --radius-sm: 8px;

  --font-display: "Rubik", system-ui, sans-serif;
  --font-body: "Rubik", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(235,219,178,0.05) 1px, transparent 1.2px);
  background-size: 24px 24px;
  z-index: 1;
  opacity: 0.45;
}

.shell {
  position: relative;
  z-index: 3;
  max-width: 1680px;
  margin: 0 auto;
  padding: 32px clamp(20px, 4vw, 72px) 80px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 20;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
}

/* ---------- Header ---------- */
.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "identity links"
    "nav      links";
  align-items: center;
  gap: 14px clamp(20px, 3vw, 36px);
  padding-bottom: 22px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--rule-soft);
}
.identity { grid-area: identity; min-width: 0; }
.site-nav { grid-area: nav; justify-self: start; }
.header-links { grid-area: links; align-self: end; justify-self: end; }

.brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
}
.brand::after { content: var(--brand); }

.role {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 8px 0 0;
}

.site-nav {
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 4px;
  background: rgba(40,40,40,0.25);
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 999px;
  transition: color .15s, background .15s;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--accent-ink);
  background: var(--accent);
}

/* show contact, hide social */
.social-links { display: none; }
.contact-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .14s;
}
.contact-links a:hover { color: var(--accent); }
.contact-links svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--ink-faint); }

@media (max-width: 820px) {
  .site-header {
    grid-template-columns: 1fr;
    grid-template-areas: "identity" "nav" "links";
  }
  .header-links { justify-self: start; }
  .contact-links { justify-content: flex-start; }
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr) minmax(260px, 330px);
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
}
.about-portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: var(--ink);
  padding: 3px;
  overflow: hidden;
}
.about-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 3px);
}
.about-body h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 5.5vw, 60px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin: 0 0 22px;
}
.about-body p {
  font-size: 17.5px;
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 0 0 16px;
}

.about-side { display: flex; flex-direction: column; gap: 26px; }
.about-latest { display: flex; flex-direction: column; gap: 16px; }
.latest-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
  transition: border-color .14s, transform .14s;
}
.latest-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.latest-media { aspect-ratio: 16 / 9; background: var(--bg-deep); overflow: hidden; }
.latest-media img, .latest-media video {
  display: block; width: 100%; height: 100%; object-fit: cover;
}
.latest-info { display: flex; flex-direction: column; gap: 5px; padding: 16px 18px; }
.latest-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.latest-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.latest-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

@media (max-width: 1080px) {
  .about { grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); }
  .about-side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .about-latest { flex: 2 1 320px; flex-direction: row; }
  .about-latest .latest-card { flex: 1 1 0; }
  .now-playing { flex: 1 1 220px; }
}
@media (max-width: 560px) {
  .about { grid-template-columns: 1fr; }
  .about-side { flex-direction: column; }
  .about-latest { flex-direction: column; }
  .about-portrait { max-width: 240px; margin: 0 auto; aspect-ratio: 1 / 1; }
}

/* ---------- Now playing (sidebar) ---------- */
.now-playing {
  padding-top: 0;
}
.now-playing img { width: 100%; max-width: 260px; }
.now-playing h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 14px;
}
.now-playing img { display: block; border-radius: var(--radius-sm); }

/* ---------- Games ---------- */
.games-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(380px, 500px);
  gap: clamp(16px, 2vw, 36px);
  align-items: start;
}

.games-list { list-style: none; margin: 0; padding: 0; }
.games-list li {
  padding: 14px 16px;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: color .14s, background .14s, border-color .14s;
}
.games-list li a {
  display: block;
  text-decoration: none;
  color: inherit;
}
.games-list li .title-text {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.games-list li .role-text {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-top: 5px;
}
.games-list li:hover,
.games-list li:focus-within,
.games-list li.active {
  color: var(--ink);
  background: var(--bg-2);
  border-color: var(--rule);
}
.games-list li.active .title-text { color: var(--ink); }
.games-list li.active .role-text { color: var(--accent); }

/* Detail + media: shown by default (single game pages); the index stacks
   below override this to drive the pure-CSS hover-swap. */
.game-detail {
  padding: 4px 4px 24px;
  min-width: 0;
  min-height: 380px;
}
.game-detail .year {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.game-detail .year::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
  max-width: 80px;
}
.game-detail h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(30px, 4.2vw, 56px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  color: var(--ink);
}
.game-detail .role-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.game-detail .role-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
}
.game-detail .desc {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 50ch;
  margin: 0 0 16px;
}
.game-detail p {
  font-size: 15.5px;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 0 16px;
}
.game-post-card { max-width: 400px; margin: 6px 0 26px; }
.game-detail .meta-rows {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 16px;
  max-width: 460px;
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}
.game-detail .meta-rows dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 2px;
}
.game-detail .meta-rows dd {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
}

.game-media {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.media-card {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
}
.media-card.steam-widget {
  aspect-ratio: auto;
  height: 190px;
  background: var(--bg-deep);
}
.media-card .inner { position: absolute; inset: 0; }
.media-card iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.media-card .gif-slot { background: var(--ink); }
.media-card .gif-slot img,
.media-card .gif-slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Pure-CSS hover-swap (games index): the list, detail stack and media stack
   are in matching document order. Hovering or keyboard-focusing list item N
   reveals detail/media N. The :nth-child reveal rules outrank the
   "default first" rules by specificity, so hovering the first item keeps it
   shown. No JavaScript. */
.game-detail-stack .game-detail { display: none; }
.game-media-stack .game-media { display: none; }
.game-detail-stack .game-detail:first-child { display: block; }
.game-media-stack .game-media:first-child { display: flex; }

.games-grid:has(.games-list li:is(:hover, :focus-within)) .game-detail-stack .game-detail:first-child,
.games-grid:has(.games-list li:is(:hover, :focus-within)) .game-media-stack .game-media:first-child { display: none; }

.games-grid:has(.games-list li:nth-child(1):is(:hover, :focus-within)) .game-detail-stack .game-detail:nth-child(1),
.games-grid:has(.games-list li:nth-child(2):is(:hover, :focus-within)) .game-detail-stack .game-detail:nth-child(2),
.games-grid:has(.games-list li:nth-child(3):is(:hover, :focus-within)) .game-detail-stack .game-detail:nth-child(3),
.games-grid:has(.games-list li:nth-child(4):is(:hover, :focus-within)) .game-detail-stack .game-detail:nth-child(4),
.games-grid:has(.games-list li:nth-child(5):is(:hover, :focus-within)) .game-detail-stack .game-detail:nth-child(5),
.games-grid:has(.games-list li:nth-child(6):is(:hover, :focus-within)) .game-detail-stack .game-detail:nth-child(6) { display: block; }

.games-grid:has(.games-list li:nth-child(1):is(:hover, :focus-within)) .game-media-stack .game-media:nth-child(1),
.games-grid:has(.games-list li:nth-child(2):is(:hover, :focus-within)) .game-media-stack .game-media:nth-child(2),
.games-grid:has(.games-list li:nth-child(3):is(:hover, :focus-within)) .game-media-stack .game-media:nth-child(3),
.games-grid:has(.games-list li:nth-child(4):is(:hover, :focus-within)) .game-media-stack .game-media:nth-child(4),
.games-grid:has(.games-list li:nth-child(5):is(:hover, :focus-within)) .game-media-stack .game-media:nth-child(5),
.games-grid:has(.games-list li:nth-child(6):is(:hover, :focus-within)) .game-media-stack .game-media:nth-child(6) { display: flex; }

/* On the index, the first item reads as active until another is hovered. */
.games-grid:has(.game-detail-stack):not(:has(.games-list li:is(:hover, :focus-within))) .games-list li:first-child {
  color: var(--ink);
  background: var(--bg-2);
  border-color: var(--rule);
}
.games-grid:has(.game-detail-stack):not(:has(.games-list li:is(:hover, :focus-within))) .games-list li:first-child .role-text { color: var(--accent); }

@media (max-width: 1180px) {
  .games-grid { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); }
  .game-media {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 8px;
  }
  .game-media .media-card { flex: 1 1 320px; }
  .game-media .media-card.steam-widget { flex: 1 1 100%; height: 190px; }
  .games-grid:has(.games-list li:nth-child(1):is(:hover, :focus-within)) .game-media-stack .game-media:nth-child(1),
  .games-grid:has(.games-list li:nth-child(2):is(:hover, :focus-within)) .game-media-stack .game-media:nth-child(2),
  .games-grid:has(.games-list li:nth-child(3):is(:hover, :focus-within)) .game-media-stack .game-media:nth-child(3),
  .games-grid:has(.games-list li:nth-child(4):is(:hover, :focus-within)) .game-media-stack .game-media:nth-child(4),
  .games-grid:has(.games-list li:nth-child(5):is(:hover, :focus-within)) .game-media-stack .game-media:nth-child(5),
  .games-grid:has(.games-list li:nth-child(6):is(:hover, :focus-within)) .game-media-stack .game-media:nth-child(6),
  .game-media-stack .game-media:first-child { display: flex; }
}
@media (max-width: 720px) {
  .games-grid { grid-template-columns: 1fr; }
  .game-media { flex-direction: column; }
}

/* ---------- Blog ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: clamp(28px, 3.5vw, 56px);
}
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.post-list li {
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  transition: color .14s;
}
.post-list li a {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 16px 4px;
  transition: padding .14s;
}
.post-list li .post-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.post-list li .post-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  transition: color .14s;
}
.post-list li:hover,
.post-list li:focus-within,
.post-list li.active { color: var(--ink); }
.post-list li:hover a,
.post-list li:focus-within a,
.post-list li.active a { padding-left: 8px; }
.post-list li.active .post-title { color: var(--accent); }

.post-body { padding: 0 8px 24px; max-width: 64ch; }
.post-body-stack .post-body { min-height: 380px; }
.post-body h1, .post-body h2 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 8px;
}
.post-body h1 { font-size: clamp(36px, 4.5vw, 52px); }
.post-body h2 { font-size: clamp(22px, 2.6vw, 30px); margin-top: 32px; }
.post-body .meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 26px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.post-body .meta::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}
.post-body p { font-size: 17px; color: var(--ink-soft); margin: 0 0 16px; }
.post-body figure { margin: 24px 0; }
.post-body figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}
.post-body blockquote {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 18px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 28px 0;
}
.post-body blockquote p { font-size: inherit; color: inherit; margin: 0; }
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-deep);
  color: var(--ink);
  padding: 2px 6px;
  border-radius: 4px;
}
.post-body pre {
  background: var(--bg-deep);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 16px;
}
.post-body pre code { background: none; padding: 0; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }

/* Pure-CSS hover-swap (blog index), same mechanism as the games index. */
.post-body-stack .post-body { display: none; }
.post-body-stack .post-body:first-child { display: block; }
.blog-grid:has(.post-list li:is(:hover, :focus-within)) .post-body-stack .post-body:first-child { display: none; }
.blog-grid:has(.post-list li:nth-child(1):is(:hover, :focus-within)) .post-body-stack .post-body:nth-child(1),
.blog-grid:has(.post-list li:nth-child(2):is(:hover, :focus-within)) .post-body-stack .post-body:nth-child(2),
.blog-grid:has(.post-list li:nth-child(3):is(:hover, :focus-within)) .post-body-stack .post-body:nth-child(3),
.blog-grid:has(.post-list li:nth-child(4):is(:hover, :focus-within)) .post-body-stack .post-body:nth-child(4) { display: block; }
.blog-grid:has(.post-body-stack):not(:has(.post-list li:is(:hover, :focus-within))) .post-list li:first-child { color: var(--ink); }
.blog-grid:has(.post-body-stack):not(:has(.post-list li:is(:hover, :focus-within))) .post-list li:first-child a { padding-left: 8px; }
.blog-grid:has(.post-body-stack):not(:has(.post-list li:is(:hover, :focus-within))) .post-list li:first-child .post-title { color: var(--accent); }

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

/* ---------- Resume (PDF embed) ---------- */
.resume-embed { max-width: 1000px; margin: 0 auto; }
.resume-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.resume-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.resume-pdf-download {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background .14s, color .14s;
}
.resume-pdf-download:hover { background: var(--accent); color: var(--accent-ink); }
.resume-frame {
  width: 100%;
  height: clamp(640px, 82vh, 1200px);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
}
.resume-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.resume-pdf-fallback {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.resume-pdf-fallback a { color: var(--accent); }

/* ---------- Playables ---------- */
.playables { max-width: 1000px; margin: 0 auto; }
.playables h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 5.5vw, 60px);
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.playables-intro { font-size: 17px; color: var(--ink-soft); max-width: 62ch; margin: 0 0 32px; }
.playable { margin-bottom: 40px; }
.playable-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.playable-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.015em;
  margin: 0;
}
.playable-engine {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.playable-embed {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-deep);
  overflow: hidden;
}
.playable-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.playable-pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  text-align: center;
  padding: 24px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.playable-pending p { margin: 0; }
.playable-note { margin-top: 14px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); }
.playable-note kbd {
  font-family: var(--font-mono);
  background: var(--bg-deep);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--ink);
  font-size: 0.9em;
}
