/* ============================================================
   Cheveyo Interactive — studio site
   Brand: the 2DCraft night-industrial palette. Committed dark.
   ============================================================ */
:root {
  --bg: #0b0d14;
  --surface: #12151e;
  --surface2: #171b27;
  --ink: #e8eaf0;
  --dim: #97a0b5;
  --line: rgba(255, 255, 255, .08);
  --amber: #e8863c;
  --gold: #ffd23c;
  --good: #5fd47f;
  --bad: #e0524f;
  --sans: 'Segoe UI', Roboto, 'Helvetica Neue', system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --maxw: 1100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

/* ---------------- nav ---------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(18px, 4vw, 40px);
  background: linear-gradient(180deg, rgba(11, 13, 20, .92), rgba(11, 13, 20, .75) 70%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  background: linear-gradient(135deg, var(--gold), var(--amber) 70%);
  box-shadow: 0 0 14px rgba(255, 210, 60, .35);
}
.brand-name { font-size: 14px; font-weight: 400; letter-spacing: .22em; color: var(--dim); }
.brand-name b { font-weight: 800; color: var(--ink); }
.nav-links { display: flex; gap: clamp(12px, 2.5vw, 26px); }
.nav-links a {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em;
  color: var(--dim); text-decoration: none; padding: 8px 2px;
  border-bottom: 1px solid transparent; transition: color .15s ease, border-color .15s ease;
}
.nav-links a:hover { color: var(--gold); border-bottom-color: var(--gold); }
@media (max-width: 560px) { .brand-name { display: none; } }

/* ---------------- hero ---------------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(90% 70% at 28% 42%, rgba(11, 13, 20, .82), rgba(11, 13, 20, .45) 55%, rgba(11, 13, 20, .18)),
    linear-gradient(180deg, rgba(11, 13, 20, .55), transparent 30%, transparent 62%, var(--bg) 96%);
}
.hero-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: 120px clamp(18px, 4vw, 40px) 90px;
}
.eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: .08em;
  color: var(--amber); margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(44px, 8.5vw, 96px); font-weight: 850; line-height: .98;
  letter-spacing: -.025em; max-width: 11ch; text-wrap: balance; margin-bottom: 26px;
}
.hero .lede { font-size: clamp(16px, 2vw, 19.5px); color: var(--dim); max-width: 58ch; margin-bottom: 40px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-hint {
  position: absolute; z-index: 2; bottom: 26px; left: clamp(18px, 4vw, 40px);
  display: flex; align-items: center; gap: 12px; opacity: .55;
}
.hint-line { width: 44px; height: 1px; background: var(--gold); }
.hint-mono { font-family: var(--mono); font-size: 11px; letter-spacing: .05em; color: var(--dim); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 11px 26px; border-radius: 10px;
  font-family: var(--sans); font-size: 15px; font-weight: 700; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, filter .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-solid { background: linear-gradient(180deg, #ffdd5e, #f0a929); color: #16130a; box-shadow: 0 6px 26px rgba(240, 169, 41, .28); }
.btn-solid:hover { filter: brightness(1.06); }
.btn-ghost { border-color: rgba(255, 255, 255, .22); color: var(--ink); background: rgba(255, 255, 255, .03); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-mini { min-height: 38px; padding: 7px 16px; font-size: 13px; border-radius: 8px; border-color: rgba(255,255,255,.2); color: var(--ink); background: rgba(255,255,255,.05); }

/* ---------------- sections ---------------- */
.section {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(70px, 11vw, 130px) clamp(18px, 4vw, 40px) 0;
}
.section h2 {
  font-size: clamp(32px, 5vw, 54px); font-weight: 850; letter-spacing: -.02em;
  line-height: 1.04; margin-bottom: 20px; text-wrap: balance;
}
.body-max { color: var(--dim); font-size: clamp(15.5px, 1.8vw, 17.5px); max-width: 68ch; }

/* studio values */
.value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 48px; }
@media (max-width: 800px) { .value-grid { grid-template-columns: 1fr; } }
.value {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 26px 24px;
  transition: border-color .2s ease, transform .2s ease;
}
.value:hover { border-color: rgba(255, 210, 60, .35); transform: translateY(-3px); }
.value-glyph {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  font-size: 19px; color: var(--gold); background: rgba(255, 210, 60, .09);
  border: 1px solid rgba(255, 210, 60, .22); margin-bottom: 16px;
}
.value h3 { font-size: 17.5px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 8px; }
.value p { font-size: 14.5px; color: var(--dim); }

/* craft: code + stats */
.craft-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-top: 48px; align-items: stretch; }
@media (max-width: 860px) { .craft-grid { grid-template-columns: 1fr; } }
.code-card {
  background: #0d1017; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}
.code-head {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .025);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.d1 { background: #e0524f; } .d2 { background: #f0b429; } .d3 { background: #5fd47f; }
.code-file { font-family: var(--mono); font-size: 11.5px; color: var(--dim); margin-left: 8px; letter-spacing: .03em; }
.code-card pre { padding: 20px 22px; overflow-x: auto; }
.code-card code { font-family: var(--mono); font-size: 12.8px; line-height: 1.75; color: #c7cfdd; white-space: pre; }
.code-card .cm { color: #5b667c; font-style: italic; }
.code-card .kw { color: var(--amber); }
.code-card .fn { color: var(--gold); }
.code-card .nu { color: #7fd4a8; }
.stat-col { display: grid; grid-template-rows: repeat(4, 1fr); gap: 16px; }
@media (max-width: 860px) { .stat-col { grid-template-columns: repeat(2, 1fr); grid-template-rows: none; } }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 22px; display: flex; flex-direction: column; justify-content: center;
}
.stat-n {
  font-family: var(--mono); font-size: clamp(28px, 3.4vw, 38px); font-weight: 700;
  color: var(--gold); letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat-l { font-size: 13px; color: var(--dim); margin-top: 4px; }

/* game */
.game-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.game-head h2 { margin-bottom: 0; }
.game-sub { font-size: 13.5px; color: var(--amber); letter-spacing: .12em; }
.feat-list { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 30px 0 40px; padding: 0; }
.feat-list li {
  font-family: var(--mono); font-size: 12.5px; color: var(--ink);
  padding: 9px 16px; border-radius: 999px;
  background: rgba(232, 134, 60, .09); border: 1px solid rgba(232, 134, 60, .3);
}
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .shots { grid-template-columns: 1fr; } }
.shot { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.shot-wide { grid-column: 1 / -1; }
.shot img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.shot-wide img { aspect-ratio: 21 / 9; }
.shot figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 18px 12px; font-family: var(--mono); font-size: 12px; color: rgba(255, 255, 255, .85);
  background: linear-gradient(180deg, transparent, rgba(5, 7, 12, .78));
}
.game-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 34px; }
.game-note { font-size: 12px; color: var(--dim); }

/* contact */
#contact { padding-bottom: 20px; }
.email-link {
  display: inline-block; margin-top: 26px; font-size: clamp(18px, 3vw, 26px); color: var(--gold);
  text-decoration: none; border-bottom: 1.5px dashed rgba(255, 210, 60, .4); padding-bottom: 4px;
}
.email-link:hover { border-bottom-style: solid; }

/* footer */
.footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(60px, 8vw, 100px) clamp(18px, 4vw, 40px) 34px;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  color: var(--dim); font-size: 13.5px; border-top: 1px solid transparent;
}
.footer .mono { font-size: 12px; }

/* ============================================================
   Admin editor (?edit)
   ============================================================ */
.hidden { display: none !important; }

[data-c].editable {
  outline: 1.5px dashed rgba(255, 210, 60, .45); outline-offset: 4px;
  border-radius: 3px; cursor: text; transition: outline-color .15s ease;
}
[data-c].editable:hover, [data-c].editable:focus { outline-color: var(--gold); outline-style: solid; }
[data-c].dirty { outline-color: var(--good); outline-style: solid; }

.admin-bar { position: fixed; z-index: 100; left: 0; right: 0; bottom: 0; pointer-events: none; }
.admin-tools {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  max-width: 720px; margin: 0 auto 18px;
  padding: 10px 14px; border-radius: 14px;
  background: rgba(13, 16, 24, .96); border: 1px solid rgba(255, 210, 60, .35);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
}
.admin-status { flex: 1; font-size: 12px; color: var(--dim); }
.admin-login {
  pointer-events: auto; position: fixed; inset: 0; display: grid; place-items: center;
  background: rgba(5, 7, 12, .8); backdrop-filter: blur(6px);
}
.admin-login-inner {
  width: min(440px, 92vw); background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 26px;
}
.admin-login-inner h3 { font-size: 19px; margin-bottom: 8px; }
.admin-login-inner p { font-size: 13.5px; color: var(--dim); margin-bottom: 16px; }
.admin-login-inner input {
  width: 100%; padding: 12px 14px; border-radius: 10px; font-family: var(--mono); font-size: 13px;
  background: #0d1017; color: var(--ink); border: 1px solid var(--line); margin-bottom: 14px;
}
.admin-login-inner input:focus { border-color: var(--gold); outline: none; }
.admin-row { display: flex; gap: 10px; }
.admin-err { color: var(--bad); font-size: 13px; margin-top: 12px; }

#json-modal {
  position: fixed; inset: 0; z-index: 110; display: grid; place-items: center;
  background: rgba(5, 7, 12, .82); backdrop-filter: blur(6px);
}
#json-modal .jm-inner {
  width: min(760px, 94vw); background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
#json-modal textarea {
  width: 100%; height: min(50vh, 420px); resize: vertical;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  background: #0d1017; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 14px;
}
#json-modal textarea:focus { border-color: var(--gold); outline: none; }

.toast {
  position: fixed; z-index: 120; left: 50%; bottom: 92px; transform: translateX(-50%);
  padding: 12px 22px; border-radius: 12px; font-size: 14px; font-weight: 600;
  background: #10131c; border: 1px solid rgba(95, 212, 127, .5); color: var(--ink);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
}
.toast.err { border-color: rgba(224, 82, 79, .6); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
