:root {
  /* EDIT THESE to restyle the whole site. Colors are taken from the background photo:
     warm dark browns from the night sky, brass gold from the metal bars. */
  --bg-image: url("/assets/img/background.webp"); /* made from background.jpg, see CLAUDE.md */
  --bg-base: #0d0a07;                  /* page color behind the photo */
  --overlay: rgba(14, 10, 6, 0.56);    /* darkness over the photo; raise 0.56 for darker */
  --panel: rgba(28, 21, 14, 0.74);     /* card background */
  --topbar: rgba(16, 12, 8, 0.55);     /* top menu background */
  --text: #f2ebdd;
  --muted: #ad9f8a;
  --accent: #d6b05a;                   /* links, hover, highlights (brass gold) */
  --on-accent: #1c1409;                /* text on top of the accent color */
  --line: rgba(240, 222, 185, 0.18);   /* thin borders */
  --tile-strip: rgba(14, 10, 6, 0.78); /* dark strip behind the game name on hover */
  --topbar-h: 56px;                    /* height of the top menu */
  --radius: 16px;
  --page-width: 1496px;                /* fits 3 game tiles of 460px + gaps + paddings */
  --font-body: "Inter", system-ui, sans-serif;
  --font-head: "Space Grotesk", var(--font-body);
  color-scheme: dark;                  /* dark scrollbars and browser controls */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text); font-family: var(--font-body);
  background: var(--bg-base); line-height: 1.6;
}
/* Fixed full-screen photo with a dark overlay */
.bg {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(var(--overlay), var(--overlay)), var(--bg-image) center/cover no-repeat;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0 0 .5em; }
b, strong { font-weight: 600; }      /* the loaded Inter weight, so bold text is not faked */

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  height: var(--topbar-h); padding: 0 24px; backdrop-filter: blur(10px);
  background: var(--topbar);
}
.brand { color: var(--text); font-weight: 700; font-family: var(--font-head); }
nav a { margin-left: 22px; color: var(--text); }
nav a:hover { color: var(--accent); text-decoration: none; }

main { max-width: var(--page-width); margin: 0 auto; padding: 0 20px 60px; }
/* First screen: the intro (avatar + name + tagline, then About) starts near the top, so the
   Portfolio is already peeking in on load (no big empty areas above and below).
   Narrow screens: the header row sits above the About block.
   Wide screens (1000px and up): a profile card on the left (read first), About on the right. */
.first-screen { padding-top: 32px; }
.intro .panel { margin: 0; }
.hero { display: flex; align-items: center; justify-content: center; gap: 24px;
        padding: 12px 0 28px; }
.hero-text h1 { margin: 0 0 .1em; font-size: clamp(1.7rem, 3.2vw, 2.3rem); line-height: 1.2; }
.avatar { flex: none; width: 104px; height: 104px; border-radius: 12px; object-fit: cover;
          border: 3px solid var(--accent); }
.tagline { margin: 0; color: var(--muted); font-size: 1.15rem; }
@media (max-width: 600px) { .hero { flex-direction: column; gap: 12px; text-align: center; } }
@media (min-width: 1000px) {
  .intro { display: grid; grid-template-columns: clamp(300px, 28vw, 380px) minmax(0, 1fr); gap: 20px; }
  .intro #about { grid-column: 2; grid-row: 1; }
  .hero { grid-column: 1; grid-row: 1;               /* the profile card, same look as the panels */
          flex-direction: column; justify-content: center; gap: 20px; text-align: center;
          background: var(--panel); border-radius: var(--radius); padding: 24px;
          backdrop-filter: blur(6px); }
  .avatar { width: 180px; height: 180px; }
  .hero-text h1 { font-size: 1.8rem; }
  .tagline { font-size: 1.05rem; }
}

.panel { background: var(--panel); border-radius: var(--radius);
         padding: 24px; margin: 20px 0; backdrop-filter: blur(6px);
         scroll-margin-top: 80px; }

/* 3 tiles per row; at full page width each tile is exactly 460x215 */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
.tile { position: relative; display: block; border-radius: 12px; overflow: hidden;
        aspect-ratio: 460 / 215; transition: transform .2s; }
a.tile:hover { transform: translateY(-4px); text-decoration: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
/* Game without a cover: empty translucent tile (its name is always visible) */
.tile.no-image { background: rgba(255, 240, 210, .05); border: 1px dashed var(--line); }
/* Game name and job: a dark strip that slides up when you hover over (or tab to) the tile */
.tile-info { position: absolute; inset: auto 0 0 0; padding: 10px 14px;
             background: var(--tile-strip); backdrop-filter: blur(3px); color: #fff;
             opacity: 0; transform: translateY(100%);
             transition: opacity .2s ease, transform .2s ease; }
.tile:hover .tile-info, .tile:focus-visible .tile-info,
.tile.no-image .tile-info { opacity: 1; transform: none; }
/* Touch screens have no hover, so always show the text there */
@media (hover: none) { .tile-info { opacity: 1; transform: none; } }
.tile-info h4 { margin: 0; font-size: 1.05rem; }
.tile-info span { font-size: .85rem; color: #e3d6c0; }

/* Images inside blog posts: never wider than the text block, tall photos capped to the screen height */
.panel p > img { max-width: 100%; max-height: 80vh; height: auto; border-radius: 12px; }
.post-item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.back-link { margin: 0 0 14px; font-size: .9rem; }
/* "Page not found" page */
.not-found { max-width: 640px; margin: 12vh auto 0; text-align: center; }
.not-found p { color: var(--muted); }
time { color: var(--muted); font-size: .85rem; }
footer { text-align: center; color: var(--muted); padding: 30px; }

@media (max-width: 820px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { nav a { margin-left: 14px; } .panel { padding: 22px; } }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }
/* Portfolio: intro text, year tabs, one panel per year */
.portfolio-intro, .about-text { color: var(--muted); margin: 0 0 22px; max-width: 760px; }
/* About text: a bit larger and wider on wide screens, so it fills its block better */
@media (min-width: 1000px) { .about-text { font-size: 1.1rem; max-width: 860px; } }
.year-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.year-tab {
  font: inherit; color: var(--text); cursor: pointer;
  background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 16px; transition: all .15s;
}
.year-tab:hover { border-color: var(--accent); color: var(--accent); }
.year-tab.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.year-panel[hidden] { display: none; }
/* Year heading inside a panel: shown only without JavaScript (the tabs replace it) */
.year { color: var(--accent); margin: 28px 0 14px; padding-bottom: 6px;
        border-bottom: 1px solid var(--line); }
.tabs-on .year { display: none; }
/* Without JavaScript the tab buttons do nothing, so hide them */
#portfolio:not(.tabs-on) .year-tabs { display: none; }
/* Link buttons in the About block (Email, LinkedIn, ...) */
.socials { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.button {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 20px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent); transition: all .15s;
}
.button:hover { background: var(--accent); color: var(--on-accent); text-decoration: none; }
/* The main button (Email): filled gold; on hover it turns into the outlined style */
.button.primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.button.primary:hover { background: transparent; color: var(--accent); }
/* Icon = the SVG file used as a mask, painted with the text color, so it always matches
   the button (gold, and dark on the gold hover background). The file is set per button
   through the --icon variable in index.html. */
.icon {
  flex: none; width: 1.15em; height: 1.15em; background-color: currentColor;
  transform: translateY(var(--icon-shift, 0));
  -webkit-mask: var(--icon) center / contain no-repeat;
          mask: var(--icon) center / contain no-repeat;
}

/* Keyboard users: a clear outline on whatever has focus */
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tile:focus-visible { outline-offset: -2px; }

/* People who asked their system for less motion: no smooth scrolling or animations */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
