:root {
  color-scheme: dark;
  --bg: #171512;
  --bg-soft: #211d17;
  --panel: rgba(36, 31, 24, 0.82);
  --panel-strong: rgba(44, 37, 28, 0.94);
  --text: #fff8ea;
  --muted: #d7cbb5;
  --line: rgba(255, 236, 192, 0.18);
  --hair: #f4c84f;
  --skin: #f2b990;
  --hoodie: #4fb69a;
  --ink: #2a2219;
  --amber: #e9a83a;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(23, 21, 18, 0.9), rgba(23, 21, 18, 1)),
    var(--bg);
  color: var(--text);
}

#space-scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9;
  pointer-events: none;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(90deg, rgba(23, 21, 18, 0.97), rgba(23, 21, 18, 0.66) 56%, rgba(23, 21, 18, 0.42));
  pointer-events: none;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: rgba(23, 21, 18, 0.76);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

nav a {
  color: var(--muted);
  padding: 8px 10px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
}

nav a:hover,
nav a:focus-visible {
  color: var(--hair);
}

.guide-dialogue {
  position: fixed;
  right: clamp(138px, 18vw, 300px);
  bottom: clamp(220px, 36vh, 360px);
  z-index: 12;
  width: min(315px, calc(100vw - 36px));
  padding: 18px 20px;
  border: 1px solid rgba(244, 200, 79, 0.35);
  border-radius: 8px;
  background: rgba(40, 33, 24, 0.9);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  transform-origin: right bottom;
  transition: transform 180ms ease, border-color 180ms ease;
}

.guide-dialogue.is-talking {
  border-color: rgba(244, 200, 79, 0.9);
  transform: translateY(-5px);
}

.guide-dialogue::after {
  position: absolute;
  right: 24px;
  bottom: -10px;
  width: 18px;
  height: 18px;
  content: "";
  background: rgba(40, 33, 24, 0.9);
  border-right: 1px solid rgba(244, 200, 79, 0.35);
  border-bottom: 1px solid rgba(244, 200, 79, 0.35);
  transform: rotate(45deg);
}

#guide-mood {
  display: block;
  margin-bottom: 7px;
  color: var(--hair);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

#guide-text {
  margin: 0;
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.55;
}

main {
  position: relative;
  z-index: 5;
}

.hero {
  min-height: 92vh;
  display: grid;
  align-items: center;
  padding: 120px clamp(18px, 6vw, 86px) 56px;
}

.hero-copy {
  max-width: 720px;
  position: relative;
  z-index: 6;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--hair);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 6.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.45rem);
  line-height: 1;
}

h3 {
  margin-bottom: 10px;
  color: #fff0c9;
  font-size: 1.1rem;
}

p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 620px;
  font-size: clamp(1rem, 2vw, 1.22rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button,
button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary {
  color: var(--ink);
  background: var(--hair);
  border-color: var(--hair);
}

.secondary,
button {
  color: var(--text);
  background: rgba(255, 248, 234, 0.08);
}

.primary:hover,
.primary:focus-visible {
  background: #ffd968;
}

.secondary:hover,
.secondary:focus-visible,
button:hover,
button:focus-visible {
  border-color: var(--hoodie);
  color: #bff7e7;
}

.content-band {
  min-height: 72vh;
  padding: 86px clamp(18px, 6vw, 86px);
  border-top: 1px solid var(--line);
  background: rgba(23, 21, 18, 0.6);
}

.content-band.muted {
  background: rgba(33, 29, 23, 0.72);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 28px;
}

.intro-grid,
.skill-grid,
.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 980px;
}

.skill-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

article,
.game-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 22px;
  backdrop-filter: blur(12px);
}

article:hover {
  border-color: rgba(244, 200, 79, 0.45);
}

article span {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--amber);
  font-size: 0.8rem;
  font-weight: 800;
}

article p,
.game-panel p,
footer p {
  margin-bottom: 0;
}

.game-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-direction: column;
  gap: 24px;
  max-width: 640px;
  position: relative;
  z-index: 14;
  background: var(--panel-strong);
}

.game-panel div {
  max-width: 720px;
}

.game-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 10px;
  position: relative;
  z-index: 15;
  min-width: 260px;
}

.game-hud {
  position: fixed;
  right: clamp(18px, 5vw, 74px);
  top: 94px;
  z-index: 12;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(244, 200, 79, 0.34);
  border-radius: 8px;
  background: rgba(40, 33, 24, 0.86);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.game-hud.is-visible {
  display: inline-flex;
}

.game-hud span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.game-hud strong {
  color: var(--hair);
  font-size: 1.15rem;
}

footer {
  padding: 28px clamp(18px, 6vw, 86px);
  border-top: 1px solid var(--line);
  background: rgba(23, 21, 18, 0.9);
}

@media (max-width: 980px) {
  body::before {
    background: linear-gradient(180deg, rgba(23, 21, 18, 0.78), rgba(23, 21, 18, 0.92));
  }

  .guide-dialogue {
    right: 18px;
    bottom: 28px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: 86vh;
    padding-top: 156px;
  }

  .intro-grid,
  .skill-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .game-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-controls {
    width: 100%;
  }
}

@media (max-width: 620px) {
  nav a {
    padding: 6px 4px;
    font-size: 0.84rem;
  }

  h1 {
    font-size: 2.78rem;
  }

  .button,
  button {
    width: 100%;
  }

  .guide-dialogue {
    position: fixed;
    right: 14px;
    bottom: 14px;
    top: auto;
    width: calc(100% - 36px);
    max-height: 150px;
    margin: 0;
    overflow: auto;
    padding: 14px 16px;
  }

  .game-hud {
    top: 112px;
    right: 14px;
  }

  .game-controls {
    grid-template-columns: 1fr;
  }

  #guide-text {
    font-size: 0.9rem;
    line-height: 1.45;
  }
}
