/* Gukmeong site. Dark like the notch, orange like the portals. Contrast: --text and
   --muted on --bg and --surface are 7:1 or more; --accent-ink on --accent is 9:1. */

@font-face {
  font-family: "Pixelify Sans";
  src: url("fonts/PixelifySans.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b0c10;
  --surface: #14161d;
  --surface-2: #1b1e28;
  --line: #2a2d3a;
  --text: #f4f1ea;
  --muted: #a9acba;
  --accent: #ff9a2e;
  --accent-ink: #1a0d02;
  --focus: #ffd36b;
  --radius: 14px;
  --pixel: "Pixelify Sans", ui-monospace, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--focus);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.1rem);
  letter-spacing: 0.01em;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
}

h3 {
  font-size: 1.1rem;
}

section,
.site-header,
.site-footer {
  width: min(1080px, 100% - 32px);
  margin-inline: auto;
}

section {
  padding-block: clamp(48px, 8vw, 96px);
}

/* ---- header ---------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand img {
  image-rendering: pixelated;
  border-radius: 6px;
}

.site-header ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--text);
}

/* ---- hero ------------------------------------------------------------------ */

.hero {
  text-align: center;
  padding-top: clamp(32px, 6vw, 72px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.sprite {
  display: inline-block;
  width: 36px;
  height: 27px;
  vertical-align: middle;
}

.sprite.flip svg {
  transform: scaleX(-1);
}

.lede,
.section-lede {
  max-width: 62ch;
  margin: 0 auto 16px;
  color: var(--muted);
  font-size: 1.1rem;
}

.say {
  color: var(--muted);
  margin: 0 auto 32px;
}

.say em {
  color: var(--text);
}

.cta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  color: var(--text);
  border-color: var(--muted);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-size: 1.1rem;
  box-shadow: 0 0 32px rgba(255, 154, 46, 0.35);
}

.button.primary:hover {
  background: var(--focus);
  border-color: var(--focus);
  color: var(--accent-ink);
}

.glyph {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.1em;
}

.glyph svg {
  width: 100%;
  height: 100%;
}

.meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.meta [data-version],
.meta [data-size] {
  font-family: var(--pixel);
  color: var(--text);
}

/* ---- demo ------------------------------------------------------------------ */

.demo {
  text-align: center;
}

.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  margin: 8px 0 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.tabs [role="tab"],
.demo-controls button,
.demo-controls select,
.code button {
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 14px;
  min-height: 40px;
  cursor: pointer;
}

.tabs [role="tab"][aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.tabs [role="tab"]:not([aria-selected="true"]):hover {
  background: var(--surface-2);
}

/* A laptop's top edge: bezel around the screen, the canvas draws the rest. */
.screen,
.demo-controls {
  max-width: 880px;
  margin-inline: auto;
}

.screen {
  padding: 10px 10px 0;
  background: #050506;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.screen canvas {
  width: 100%;
  border-radius: 12px 12px 0 0;
  touch-action: manipulation;
}

.demo-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  text-align: left;
}

.pets-panel h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.count {
  font-family: var(--pixel);
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}

.pet-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.pet-list li {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 2px 2px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.pet-list span {
  margin-right: 4px;
}

.pet-list button {
  min-height: 36px;
  padding: 4px 10px;
  color: var(--muted);
}

.demo-controls button:hover,
.code button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.add {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.demo-controls select {
  background: var(--surface-2);
  border-color: var(--line);
}

.demo-controls [data-add] {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.demo-controls [data-add]:hover {
  background: var(--focus);
  color: var(--accent-ink);
}

.demo-controls [data-add]:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}

.pause {
  border-color: var(--line) !important;
}

.demo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status {
  min-height: 1.6em;
  color: var(--muted);
  margin: 12px 0 0;
}

/* ---- features ---------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card.wide {
  grid-column: 1 / -1;
}

.card img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 16px;
  background: #1a1b2b;
}

/* The snapshots are the whole 640 × 200 panel; closed states only use its top. */
.card img.crop-closed {
  aspect-ratio: 760 / 96;
  object-fit: cover;
  object-position: center top;
}

.card img.crop-hud {
  aspect-ratio: 900 / 96;
  object-fit: cover;
  object-position: center top;
}

.card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card h3 .glyph {
  color: var(--accent);
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

/* ---- install --------------------------------------------------------------- */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding: 20px 20px 20px 72px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 20px;
  top: 18px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-family: var(--pixel);
  font-size: 1.2rem;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 8px;
}

.steps p {
  color: var(--muted);
  margin: 0 0 12px;
}

.steps p:last-child {
  margin-bottom: 0;
}

.code {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  background: #050506;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
}

.code code {
  flex: 1;
  font: 0.9rem/1.5 var(--mono);
  color: var(--text);
  white-space: nowrap;
}

.code button {
  flex: none;
  border-color: var(--line);
}

/* ---- faq ----------------------------------------------------------------------- */

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}

.faq summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 600;
  font-size: 1.05rem;
}

.faq details p {
  color: var(--muted);
  margin: 0 0 16px;
  max-width: 70ch;
}

.faq .code {
  margin-bottom: 16px;
}

/* ---- footer ---------------------------------------------------------------------- */

.site-footer {
  padding-block: 40px 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.site-footer .sprite {
  margin-right: 6px;
}

.site-footer .small {
  font-size: 0.85rem;
}

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

  * {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 600px) {
  .steps > li {
    padding-left: 20px;
    padding-top: 64px;
  }

  .demo-controls {
    flex-direction: column;
  }
}
