/* =============================================
   CMS Games — Premium Minimal Redesign
   Design tokens + base layout
   ============================================= */

:root {
  /* Palette — neutral white, near-black, restrained accent */
  --paper: #ffffff;
  --paper-2: #f4f4f4;
  --surface: #ffffff;
  --ink: #111110;
  --ink-2: #5a5a57;
  --ink-3: #94938f;
  --ink-4: #c9c7c0;
  --rule: rgba(17, 17, 16, 0.09);
  --rule-2: rgba(17, 17, 16, 0.18);

  /* Accent — switchable via Tweaks */
  --accent: #c25a3a;          /* ember default */
  --accent-soft: rgba(194, 90, 58, 0.10);
  --on-accent: #ffffff;

  /* Typography */
  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-ui: "Geist", -apple-system, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", monospace;

  /* Spacing scale (8pt) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* Radii — very subtle, premium */
  --r-1: 3px;
  --r-2: 6px;
  --r-3: 10px;
  --r-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 180ms;
  --t-med: 320ms;
  --t-slow: 600ms;

  /* Container */
  --container: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
}

/* Accent tokens — toggled by [data-accent] on <html> */
html[data-accent="ember"]  { --accent: #c25a3a; --accent-soft: rgba(194,90,58,0.10); }
html[data-accent="ink"]    { --accent: #111110; --accent-soft: rgba(17,17,16,0.06); }
html[data-accent="studio"] { --accent: #2f4a8c; --accent-soft: rgba(47,74,140,0.10); }

/* Display font tokens — toggled by [data-display] */
html[data-display="serif"]   { --font-display: "Instrument Serif", "Times New Roman", serif; --display-leading: 0.95; --display-tracking: -0.01em; }
html[data-display="sans"]    { --font-display: "Geist", -apple-system, sans-serif; --display-leading: 0.92; --display-tracking: -0.04em; }
html[data-display="grotesk"] { --font-display: "Space Grotesk", sans-serif; --display-leading: 0.95; --display-tracking: -0.025em; }
html[data-display="oswald"]  { --font-display: "Oswald", sans-serif; --display-leading: 0.9; --display-tracking: -0.005em; }

/* =============================================
   Reset / base
   ============================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* =============================================
   Typography utilities
   ============================================= */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--display-leading, 0.95);
  letter-spacing: var(--display-tracking, -0.01em);
  color: var(--ink);
}
html[data-display="serif"] .display { font-weight: 400; }
html[data-display="sans"] .display,
html[data-display="grotesk"] .display { font-weight: 500; }
html[data-display="oswald"] .display { font-weight: 600; text-transform: uppercase; letter-spacing: -0.005em; }

.italic { font-style: italic; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow .dot {
  display: inline-block; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent);
  margin-right: 10px; vertical-align: 1px;
}

.lead { font-size: 18px; line-height: 1.55; color: var(--ink-2); }
.body { color: var(--ink-2); }
.muted { color: var(--ink-3); }

/* =============================================
   Layout primitives
   ============================================= */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(64px, 9vw, 128px) 0; }
.section-tight { padding: clamp(40px, 6vw, 72px) 0; }
.divider { border-top: 1px solid var(--rule); }
.row { display: flex; gap: var(--s-4); align-items: center; }
.stack { display: flex; flex-direction: column; }

/* =============================================
   Nav
   ============================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background var(--t-med) var(--ease), border-color var(--t-med) var(--ease), backdrop-filter var(--t-med) var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled,
.nav.force-solid {
  background: #fff;
  border-bottom-color: rgba(0,0,0,.12);
}
.nav.over-dark:not(.is-scrolled) { color: #fff; }
.nav.over-dark:not(.is-scrolled) .nav-link { color: rgba(255,255,255,0.85); }
.nav.over-dark:not(.is-scrolled) .nav-link:hover { color: #fff; }
.nav.over-dark:not(.is-scrolled) .btn-ghost { border-color: rgba(255,255,255,0.25); color: #fff; }

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  max-width: none;
  box-sizing: border-box;
}
.nav-left { display: flex; align-items: center; gap: 28px; }
.nav-logo { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--ink); text-decoration: none; }
.nav-logo img,
.nav-logo svg { height: 44px; width: auto; display: block; transition: filter var(--t-med); }
.nav.over-dark:not(.is-scrolled) .nav-logo img,
.nav.over-dark:not(.is-scrolled) .nav-logo svg { filter: brightness(0) invert(1); }

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-link {
  font-family: 'Oswald', sans-serif;
  font-size: 14pt;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  position: relative;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.nav-link:hover { color: var(--accent); }
.nav-link.active { color: var(--ink); }

.nav.over-dark:not(.is-scrolled) .nav-link.active { color: #fff; }

.nav-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.nav-right .btn {
  font-family: 'Oswald', sans-serif;
  font-size: 14pt;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 1.25rem;
  border-radius: 3px;
}

/* Cross-site link (between IP and Production) */
.nav-cross {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--t-fast);
}
.nav-cross:hover { color: var(--accent); }
.nav.over-dark:not(.is-scrolled) .nav-cross { color: rgba(255,255,255,0.55); }
.nav.over-dark:not(.is-scrolled) .nav-cross:hover { color: #fff; }

/* Sub-brand chip next to logo */
.nav-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid var(--rule-2);
  border-radius: var(--r-1);
  color: var(--ink-2);
  margin-left: 12px;
  transition: all var(--t-med);
  white-space: nowrap;
}
.nav.over-dark:not(.is-scrolled) .nav-sub {
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.85);
}

/* =============================================
   Buttons
   ============================================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 13px 22px;
  border-radius: var(--r-pill);
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #2a2a28; transform: translateY(-1px); }
.btn-paper { background: var(--paper); color: var(--ink); }
.btn-paper:hover { background: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(17,17,16,0.04); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { filter: brightness(0.92); transform: translateY(-1px); }
.btn-arrow svg { width: 12px; height: 12px; transition: transform var(--t-fast); }
.btn-arrow:hover svg { transform: translateX(3px); }

/* =============================================
   Status / Tags
   ============================================= */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 10px;
  border-radius: var(--r-1);
  background: rgba(17,17,16,0.05);
  color: var(--ink-2);
}
.tag-dot { width: 6px; height: 6px; border-radius: 50%; }
.tag-live   .tag-dot { background: #2f8f3f; box-shadow: 0 0 0 4px rgba(47,143,63,0.18); animation: pulse 2.4s infinite; }
.tag-dev    .tag-dot { background: #c25a3a; box-shadow: 0 0 0 4px rgba(194,90,58,0.18); animation: pulse 2.4s infinite; }
.tag-relaunch .tag-dot { background: #2f4a8c; }
.tag-archived .tag-dot { background: var(--ink-3); }
.tag-soon .tag-dot { background: #b88a1f; }

.tag-live { color: #1e6a2e; background: rgba(47,143,63,0.08); }
.tag-dev { color: #8b3d23; background: rgba(194,90,58,0.08); }
.tag-relaunch { color: #1f3768; background: rgba(47,74,140,0.08); }
.tag-archived { color: var(--ink-2); }
.tag-soon { color: #7a5a14; background: rgba(184,138,31,0.10); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* =============================================
   Footer
   ============================================= */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: clamp(56px, 7vw, 88px) 0 36px;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 56px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer .display {
  color: #fff;
  font-size: clamp(40px, 5vw, 64px);
  margin: 0 0 16px;
}
.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin: 0 0 18px;
}
.footer-col a {
  display: block; padding: 5px 0;
  color: rgba(255,255,255,0.78);
  font-size: 14px;
  transition: color var(--t-fast);
}
.footer-col a:hover { color: #fff; }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  flex-wrap: wrap; gap: 18px;
}
.footer-bottom .links { display: flex; gap: 22px; }
.footer-bottom .links a:hover { color: #fff; }

@media (max-width: 991.98px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .nav-inner { padding: 0 20px; }
  .nav-left { gap: 16px; }
  .nav-links { gap: 22px; }
  .nav-link { font-size: 13pt; }
  .nav-right .btn { font-size: 13pt; padding: 0.45rem 1rem; }
}
@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav-right .btn { font-size: 12pt; padding: 0.4rem 0.9rem; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* =============================================
   Page transition
   ============================================= */
.page-enter {
  animation: pageEnter 480ms var(--ease) both;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Reveal on scroll */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* =============================================
   Mentioned in source code as needed
   ============================================= */
.kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--rule-2);
  border-radius: 3px;
  color: var(--ink-2);
}

.scroll-cue {
  position: absolute;
  bottom: 36px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.7);
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  z-index: 4;
}
.scroll-cue .line {
  width: 1px; height: 36px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.7), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0%, 100% { transform: scaleY(1); transform-origin: top; }
  50% { transform: scaleY(0.3); transform-origin: bottom; }
}

/* Form */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}
.field input,
.field textarea {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 14px 16px;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  transition: border-color var(--t-fast);
  width: 100%;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
}
