@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg: #0f0f13;
  --surface: #18181f;
  --surface2: #22222d;
  --border: #2a2a3a;
  --accent: #f9dc5c;
  --accent-dim: rgba(249, 220, 92, 0.1);
  --text: #e2e2ee;
  --text-muted: #7878a0;
  --radius: 18px;
  --radius-sm: 10px;
  --nav-h: 52px;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── NAVBAR ── */
nav#main-navbar {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  padding: 0 16px;
  height: var(--nav-h);
  background: rgba(15, 15, 19, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

nav#main-navbar a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875em;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

nav#main-navbar a:hover {
  color: var(--text);
  background: var(--surface2);
}

nav#main-navbar a.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── PAGE TITLE ── */
h1 {
  width: 100%;
  max-width: 640px;
  padding: 36px 24px 4px;
  margin: 0;
  font-size: 1.55em;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ── CONTENT BOX ── */
.box {
  width: 100%;
  max-width: 640px;
  padding: 12px 24px 56px;
  margin: 0 auto;
  line-height: 1.8;
}

.box h2 {
  font-size: 1.2em;
  font-weight: 600;
  margin: 2.2em 0 0.5em;
  color: var(--text);
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4em;
}

.box h3 {
  font-size: 0.95em;
  font-weight: 600;
  margin: 1.6em 0 0.35em;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.box p {
  color: #bbbbd4;
  margin: 0.4em 0 0.9em;
}

.box ul, .box ol {
  padding-left: 1.4em;
  color: #bbbbd4;
  margin: 0.4em 0 0.9em;
}

.box li {
  margin-bottom: 0.45em;
}

.box a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.box a:hover {
  border-bottom-color: var(--accent);
}

.box strong, .box b {
  color: var(--text);
  font-weight: 600;
}

.box em {
  color: var(--text-muted);
  font-style: italic;
}

.box code {
  font-family: 'Courier New', monospace;
  font-size: 0.82em;
  background: var(--surface2);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 5px;
}

/* ── SIMULATOR ── */
#container {
  position: relative;
  width: 90vw;
  max-width: 420px;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1px var(--border), 0 12px 48px rgba(0, 0, 0, 0.55);
  background: var(--surface);
  margin: 24px auto 20px;
}

#display-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 auto 20px;
  max-width: 460px;
  padding: 0 16px;
}

.buttons button {
  padding: 8px 18px;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85em;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.buttons button.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(249, 220, 92, 0.4);
}

#status {
  display: block;
  text-align: center;
  font-size: 0.82em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── MOBILE ── */
@media (max-width: 480px) {
  h1 { font-size: 1.25em; padding: 24px 16px 4px; }
  .box { padding: 8px 16px 40px; }
  #display-canvas { width: 96vw; }
  nav#main-navbar a { font-size: 0.8em; padding: 5px 9px; }
  .buttons { padding: 0 8px; }
}
