:root {
  --background: #fefcf7;
  --text: #242424;
  --muted: #65635e;
  --rule: #dedbd3;
  --link-default: #222288;

  /* Each shared class colours both a navigation link and its heading. */
  --home-colour: #4c0078;
  --contact-colour: #250baa;
  --games-colour: #008b1e;
  --work-colour: #bda90d;
  --about-colour: #c36b00;
  --talks-colour: #a52b10;
  --awards-colour: #6b1f5e;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.35;
}

a { color: var(--link-default); text-decoration: none; }

a:focus-visible, summary:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 6px;
}

a:hover { text-decoration: underline; text-underline-offset: .2em; }

.section-home { color: var(--home-colour); }
.section-about { color: var(--about-colour); }
.section-games { color: var(--games-colour); }
.section-work { color: var(--work-colour); }
.section-contact { color: var(--contact-colour); }
.section-talks { color: var(--talks-colour); }
.section-awards { color: var(--awards-colour); }

#home a { color: var(--home-colour); }
#about a { color: var(--about-colour); }
#games a { color: var(--games-colour); }
#work a { color: var(--work-colour); }
#contact a { color: var(--contact-colour); }
#talks a { color: var(--talks-colour); }
#awards a { color: var(--awards-colour); }

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 30;
  padding: .5rem 1rem;
  background: var(--background);
  transform: translateY(-200%);
}

.skip-link:focus { transform: translateY(0); }

/* Small screens use a single column that fits within the viewport. */
.page-layout {
  width: calc(100% - 3rem);
  margin-inline: auto;
}

.sidebar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  pointer-events: none;
}

.navigation { pointer-events: auto; }

.menu-toggle {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 1rem;
  background: var(--background);
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  list-style: none;
}

.menu-toggle::-webkit-details-marker { display: none; }

.hamburger { display: grid; gap: 5px; }
.hamburger span { width: 22px; height: 2px; background: var(--text); }

.nav-panel {
  padding: 2rem 1.5rem;
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  background: var(--background);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 12px 24px rgb(36 36 36 / 8%);
  color: inherit;
}

.site-name {
  display: inline-block;
  margin-bottom: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links { display: grid; gap: 0rem; margin: 0; padding: 0; list-style: none; }
.nav-links a { font-weight: 500; text-decoration: none; }
.nav-links a:hover { text-decoration: underline; text-underline-offset: .3em; }

main { min-width: 0; padding-block: 6rem 4rem; }

.eyebrow { margin: 0 0 2rem; font-size: .875rem; letter-spacing: .12em; text-transform: uppercase; }

h1, h2 { margin: 0; font-weight: 700; line-height: 1.08; letter-spacing: -.035em; }
h1 { font-size: clamp(2rem, 2.5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 2vw, 2.5rem); }
p { max-width: 60ch; }
.intro { margin-top: 1.5rem; color: var(--muted); font-size: 1.2rem; }
.portrait { width: 120px; height: 120px; margin-top: 2rem; border-radius: 40%; }

.hero, .content-section { scroll-margin-top: 6rem; }
.content-section { padding-block: 1.5rem; }
.content-section p { margin-top: 1.5rem; }

.horizontal-content
{
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
}

.horizontal-content p {
  flex-grow: 1;
  margin-right: 1rem;
}

ul { margin-left: 0; padding-left: 1rem; }
ul.contact-list { margin: 0; padding: 0; list-style: none; }
ul.work-list { margin: 0; padding: 0; list-style: none; }
ul.bullet-list { font-size: 0.9rem; }
li { margin-top: 0.75rem; }

.content-section .sub-heading {
  font-weight: 500;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.small-details { font-size: 0.75rem;}

.games-table {
  width: 100%;
  table-layout: fixed;
  font-size: 0.85rem;
}

.games-table .title { width: 35%; }
.games-table .year { width: 15%; }
.games-table .platforms { width: 50%; }
.games-table td { vertical-align: top; }

/* Combined width: 70% of the viewport, constrained to 600–1000px. */
@media (min-width: 768px) {
  .page-layout {
    display: grid;
    grid-template-columns: 25% 75%;
    width: clamp(600px, 50vw, 1000px);
  }

  .sidebar { position: relative; inset: auto; z-index: 10; }
  .navigation { position: sticky; top: 0; }
  .menu-toggle { display: none; }
  .nav-panel {
    padding: 4rem 3rem 3rem 0;
    max-height: 100dvh;
    border: 0;
    box-shadow: none;
  }
  main { padding-top: 4rem; }
  
  .portrait { width: 200px; height: 200px; margin-top: 2rem; border-radius: 40%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
