/* ==========================================================
   Portfolio - shared styles
   Change the colours here and the whole site follows.
   ========================================================== */
/* Figtree, self-hosted (SIL Open Font License). A free font close to the look of Steam's Motiva Sans. */
@font-face {
  font-family: "Figtree";
  src: url("../assets/fonts/Figtree-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}


:root {
  /* Palette: black, gray and green, after the classic Steam store */
  --bg: #1c1c1c;          /* page background */
  --bg-alt: #151515;      /* every other section: a darker band for rhythm */
  --header: #0c0c0c;      /* top bar and footer */
  --surface: #292929;     /* cards, placeholders */
  --border: #3c3c3c;
  --text: #ffffff;
  --muted: #b3b3b3;
  --accent: #a4d007;      /* lime green: labels, links, highlights */
  --on-accent: #111111;   /* text on top of the accent colour */
  --green: #5c9a1c;       /* main call-to-action button */
  --green-hover: #6cb024;

  --radius: 2px;
  --max-width: 920px;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}

img, video, iframe { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.4em; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 2.8rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
p  { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.muted { color: var(--muted); }

/* ---------- Header ---------- */

.site-header { background: var(--header); border-bottom: 1px solid #000; }

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.logo { color: var(--text); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.95rem; white-space: nowrap; }
.logo:hover { text-decoration: none; }

.nav { display: flex; gap: 24px; }
.nav a { color: #b3b3b3; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- Home page sections (centered) ---------- */

section { padding: 80px 0; }

/* Hero, Experience and Contact sit on the darker band */
main > section:nth-of-type(odd) { background: var(--bg-alt); }

.centered { text-align: center; }
.centered .section-intro { margin-left: auto; margin-right: auto; }

/* Home page section titles: small uppercase, like Steam's "FEATURED & RECOMMENDED" */
.centered h2 {
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.centered h2::after {
  content: "";
  display: block;
  width: 100%;
  max-width: 920px;
  height: 1px;
  margin: 14px auto 0;
  background: var(--border);
}

.section-intro { color: var(--muted); max-width: 560px; margin: 16px 0 36px; }
.centered h2 + .section-intro { margin-top: 16px; }

.hero { padding: 88px 0 96px; }
.hero h1 { font-size: 3.6rem; margin-bottom: 8px; }
.hero .role { font-size: 1.4rem; font-weight: 600; color: var(--accent); margin-bottom: 24px; }
.hero .bio { max-width: 600px; margin: 0 auto; color: var(--muted); font-size: 1.05rem; }
.hero .status { margin-top: 20px; font-size: 1rem; font-weight: 600; color: var(--text); }

/* ---------- Buttons ---------- */

.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }

/* Main button: green. Secondary buttons: gray. */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--radius);
  border: 0;
  background: var(--green);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}
.btn:hover { text-decoration: none; background: var(--green-hover); }

.btn-outline { background: #555; color: #fff; }
.btn-outline:hover { background: #666; color: #fff; }

/* ---------- Cards (projects + experience) ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  text-align: left;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
}
a.card:hover { text-decoration: none; background: #333; border-color: #555; }

.card-body { padding: 16px 18px 18px; }
.card-body h3 { font-size: 1.2rem; }
.card-body p { color: var(--muted); font-size: 0.92rem; margin-bottom: 12px; }

/* Tech / team line under a card, shown like Steam's user tags */
.meta { color: var(--accent); font-size: 0.8rem; font-weight: 600; margin: 0; }
.card-body p.meta {
  display: inline-block;
  margin-bottom: 0;
  padding: 3px 8px;
  background: rgba(164, 208, 7, 0.13);
  color: var(--accent);
  border-radius: 2px;
}
.card-body h3 + .meta { margin-bottom: 10px; }

/* 16:9 thumbnail. Replace the placeholder <div> with an <img> later,
   keep every thumbnail 16:9 so the grid stays consistent. */
.thumb {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  background: #232323;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- About ---------- */

.photo {
  width: 160px;
  height: 160px;
  margin: 0 auto 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.about-photo { display: block; width: 100%; max-width: 340px; height: auto; margin: 24px auto; border-radius: var(--radius); border: 1px solid var(--border); }
.about-text { max-width: 600px; margin: 0 auto; color: var(--muted); }
.contact-mail { margin: 24px 0 0; font-size: 0.95rem; }

.skills { list-style: none; padding: 0; margin: 28px auto 0; max-width: 600px; }
.skills li { margin-bottom: 6px; color: var(--muted); }
.skills strong { color: var(--text); font-weight: 600; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--header);
  border-top: 1px solid #000;
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Project detail pages ---------- */

.back { display: inline-block; margin-top: 32px; color: var(--muted); font-size: 0.9rem; }
.back:hover { color: var(--text); }

.project-header { padding: 24px 0 28px; }
.project-header p { color: var(--muted); font-size: 1.1rem; max-width: 640px; margin: 0; }
.project-header .status { font-size: 0.9rem; margin-bottom: 8px; }

/* 16:9 slot for the main gameplay video (YouTube / Vimeo embed). */
.video {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  overflow: hidden;
}
.video iframe { width: 100%; height: 100%; border: 0; }
.video img { width: 100%; height: 100%; object-fit: contain; }   /* non-16:9 images show whole */

/* Steam-style media viewer: main view (.video) + thumbnail strip */
[hidden] { display: none !important; }

.media-strip { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

.media-thumbs { display: flex; gap: 8px; flex: 1; overflow-x: auto; scrollbar-width: thin; }

.media-thumb {
  position: relative;
  flex: 0 0 calc((100% - 3 * 8px) / 4);   /* 4 thumbnails visible, scroll for more */
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
}
.media-thumb:hover { opacity: 1; }
.media-thumb.is-active { border-color: #fff; opacity: 1; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Play icon on the video thumbnail */
.media-thumb .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  background: rgba(0, 0, 0, 0.35);
}

.media-arrow {
  flex: 0 0 32px;
  height: 72px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}
.media-arrow:hover { border-color: var(--muted); }

.project-layout li { margin-bottom: 8px; }
.project-layout strong { color: var(--text); font-weight: 600; }

code {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 0.9em;
  color: var(--text);
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 3px;
}

.project-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 40px;
  padding: 40px 0 64px;
}
.project-layout p, .project-layout li { color: var(--muted); }
/* Section headings like Steam's "ABOUT THIS GAME" */
.project-layout h2 {
  margin: 36px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.project-layout h2:first-child { margin-top: 0; }

/* Sub-headings and code blocks in technical write-ups */
.project-layout > div { min-width: 0; }   /* lets wide code blocks scroll instead of stretching the grid */
.project-layout h3 { margin: 24px 0 8px; color: var(--text); }
.project-layout pre {
  margin: 0 0 1em;
  padding: 12px 14px;
  overflow-x: auto;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.5;
}
.project-layout pre code { background: none; padding: 0; font-size: inherit; color: #d4d4d4; }

/* Before / after tables in technical write-ups */
.table-wrap { margin: 0 0 1em; overflow-x: auto; }
.project-layout table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}
.project-layout th,
.project-layout td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  color: var(--muted);
}
.project-layout th { color: var(--text); font-weight: 600; }
.project-layout tr:last-child td { border-bottom: none; }
.project-layout td + td,
.project-layout th + th { text-align: right; white-space: nowrap; }

/* Details panel, like Steam's right-hand game info box */
.facts { align-self: start; background: var(--bg-alt); padding: 16px 16px 12px; }
.facts dl { margin: 0; }
.facts dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #8a8a8a; }
.facts dd { margin: 2px 0 14px; color: #d6d6d6; font-size: 0.92rem; }
.facts .btn { display: block; margin-top: 4px; text-align: center; }


/* ---------- Phone / tablet ---------- */

@media (max-width: 760px) {
  section { padding: 48px 0; }
  .hero { padding: 64px 0 56px; }
  h1, .hero h1 { font-size: 2.3rem; }
  h2 { font-size: 1.5rem; }
  .grid, .project-layout { grid-template-columns: 1fr; }
  .media-thumb { flex-basis: calc((100% - 2 * 8px) / 3); }
  .media-arrow { height: 54px; }
}

@media (max-width: 560px) {
  /* Name on top, menu on its own row underneath */
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .nav { gap: 18px; }
}

/* A lone last card (odd count) sits centered under the others */
.grid > .card:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 12px); }
@media (max-width: 760px) { .grid > .card:last-child:nth-child(odd) { width: 100%; } }


/* ---------- Gradients (the only places; everything else is flat) ---------- */

/* Home page intro and the top of project pages fade from gray into the page black */
main > section.hero { background: linear-gradient(180deg, #3b3b3b 0%, #1c1c1c 100%); }
body:has(main.container) { background: linear-gradient(180deg, #3b3b3b 0, #1c1c1c 520px) no-repeat, var(--bg); }

/* Buttons: green main button, gray secondary button */
.btn { background: linear-gradient(90deg, #75b022 5%, #588a1b 95%); }
.btn:hover { background: linear-gradient(90deg, #8ac92a 5%, #66a21f 95%); }
.btn-outline { background: linear-gradient(90deg, #666 5%, #444 95%); color: #fff; }
.btn-outline:hover { background: linear-gradient(90deg, #787878 5%, #525252 95%); color: #fff; }

/* Details panel gets darker towards the bottom; hovered cards get a lighter top */
.facts { background: linear-gradient(180deg, #232323 0%, #111 100%); }
a.card:hover { background: linear-gradient(180deg, #3a3a3a 0%, #303030 100%); border-color: #555; }

/* ---------- Code excerpts (technical breakdown) ---------- */
pre.code {
  margin: 12px 0 8px;
  padding: 14px 16px;
  background: #101010;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.55;
  tab-size: 4;
}
pre.code code { background: none; padding: 0; color: #d4d4d4; font-size: inherit; }
pre.code .c { color: #7f8a7a; }   /* comments */
pre.code .k { color: #a4d007; }   /* keywords */
pre.code .t { color: #c9e26b; }   /* types */
