/* ─────────────────────────────────────────────────────────────────────────
   Tuma Energy
   One stylesheet for the whole site. Tokens first, then layout, then parts.
   Two services share the page: Games carries the ember accent, Skiza the teal.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --paper:        #F2F4F3;
  --surface:      #FFFFFF;
  --surface-2:    #E9EDEB;
  --ink:          #10171A;
  --ink-2:        #35474C;
  --muted:        #61767B;
  --rule:         #D6DEDB;
  --rule-strong:  #B8C4C1;

  --ember:        #D14A26;
  --ember-ink:    #A63616;
  --ember-soft:   #FAE6DF;
  --teal:         #13645A;
  --teal-ink:     #0C4D45;
  --teal-soft:    #DCEDE9;

  --good:         #2C6E3F;
  --good-soft:    #DDEFE1;
  --warn-soft:    #F8ECD2;
  --warn-ink:     #8A5A08;

  --accent:       var(--ember);
  --accent-ink:   var(--ember-ink);
  --accent-soft:  var(--ember-soft);

  --shadow:       0 1px 2px rgb(16 23 26 / 6%), 0 8px 24px -12px rgb(16 23 26 / 18%);
  --radius:       14px;
  --radius-sm:    9px;
  --wrap:         1120px;

  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:       #0B1113;
    --surface:     #131B1E;
    --surface-2:   #1B2528;
    --ink:         #E7EEEC;
    --ink-2:       #BCCBC8;
    --muted:       #8AA09F;
    --rule:        #263437;
    --rule-strong: #38494D;

    --ember:       #FF7A52;
    --ember-ink:   #FFA183;
    --ember-soft:  #3A1A10;
    --teal:        #46BFAB;
    --teal-ink:    #7FD9C9;
    --teal-soft:   #0F2E2A;

    --good:        #7FCB92;
    --good-soft:   #14301C;
    --warn-soft:   #3A2E12;
    --warn-ink:    #E6BC6A;

    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 30px -14px rgb(0 0 0 / 70%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper:       #0B1113;
  --surface:     #131B1E;
  --surface-2:   #1B2528;
  --ink:         #E7EEEC;
  --ink-2:       #BCCBC8;
  --muted:       #8AA09F;
  --rule:        #263437;
  --rule-strong: #38494D;

  --ember:       #FF7A52;
  --ember-ink:   #FFA183;
  --ember-soft:  #3A1A10;
  --teal:        #46BFAB;
  --teal-ink:    #7FD9C9;
  --teal-soft:   #0F2E2A;

  --good:        #7FCB92;
  --good-soft:   #14301C;
  --warn-soft:   #3A2E12;
  --warn-ink:    #E6BC6A;

  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 30px -14px rgb(0 0 0 / 70%);
  color-scheme: dark;
}

/* Skiza pages and panels swap the accent wholesale rather than overriding per rule. */
.theme-skiza {
  --accent: var(--teal);
  --accent-ink: var(--teal-ink);
  --accent-soft: var(--teal-soft);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.45rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.12rem; }

p { margin: 0 0 1rem; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(18px, 5vw, 32px);
}

.skip {
  position: absolute;
  left: -9999px;
  background: var(--surface);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
}
.skip:focus { left: 16px; top: 12px; z-index: 60; }

/* ── Header ───────────────────────────────────────────────────────────── */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.site-head__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand__mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ember);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
}
:root[data-theme="dark"] .brand__mark,
:root:not([data-theme="light"]) .brand__mark { color: #11181A; }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.4vw, 26px);
}

.nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.theme-toggle {
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink-2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.theme-toggle:hover { border-color: var(--rule-strong); color: var(--ink); }

/* ── Buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}
:root[data-theme="dark"] .btn,
:root:not([data-theme="light"]) .btn { color: #10181A; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn--ghost {
  background: transparent;
  border-color: var(--rule-strong);
  color: var(--ink);
}
.btn--ghost:hover { background: var(--surface); }

.btn--wide { width: 100%; }
.btn--sm { padding: 8px 15px; font-size: 0.9rem; }

.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent-ink);
  text-decoration: underline;
  cursor: pointer;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  padding-block: clamp(40px, 8vw, 84px) clamp(28px, 5vw, 52px);
}

.hero__eyebrow {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.hero p.lede {
  font-size: clamp(1.02rem, 2.2vw, 1.2rem);
  color: var(--ink-2);
  max-width: 54ch;
  margin-top: 18px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

/* ── Service split ────────────────────────────────────────────────────── */

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
  padding-block: clamp(24px, 4vw, 40px);
}

.service {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.service::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent);
}

.service__price {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  align-self: flex-start;
}

.service p { color: var(--ink-2); margin: 0; }
.service ul { margin: 4px 0 0; padding-left: 18px; color: var(--ink-2); }
.service li { margin-bottom: 5px; }
.service .btn { margin-top: auto; align-self: flex-start; }
.service--skiza { --accent: var(--teal); --accent-ink: var(--teal-ink); --accent-soft: var(--teal-soft); }

/* ── Generic sections ─────────────────────────────────────────────────── */

.section { padding-block: clamp(34px, 6vw, 64px); }
.section__head { max-width: 62ch; margin-bottom: 26px; }
.section__head p { color: var(--ink-2); margin-top: 10px; }
.section--tint { background: var(--surface-2); }

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent-ink);
  background: var(--accent-soft);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}
.steps h3 { margin-bottom: 4px; }
.steps p { color: var(--ink-2); font-size: 0.96rem; margin: 0; }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pill {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 5px 13px;
}
.pill--good { background: var(--good-soft); border-color: transparent; color: var(--good); }
.pill--warn { background: var(--warn-soft); border-color: transparent; color: var(--warn-ink); }

.prose { max-width: 68ch; }
.prose h2 { margin-top: 34px; }
.prose h3 { margin-top: 24px; }
.prose ul { padding-left: 20px; color: var(--ink-2); }
.prose li { margin-bottom: 8px; }
.prose dt { font-weight: 600; margin-top: 16px; }
.prose dd { margin: 4px 0 0; color: var(--ink-2); }
.prose code, .mono { font-family: var(--mono); font-size: 0.92em; }

.callout {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  padding: 16px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 22px 0;
}
.callout p:last-child { margin-bottom: 0; }

/* ── Skiza storefront ─────────────────────────────────────────────────── */

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.search {
  position: relative;
  flex: 1 1 260px;
  display: flex;
  align-items: center;
}
.search svg {
  position: absolute;
  left: 13px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.search input,
.pick select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 11px 16px 11px 40px;
}
.pick select { padding-left: 16px; }
.pick { flex: 0 1 200px; }
.search input::placeholder { color: var(--muted); }

.tunes {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.tune {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule);
}
.tune:last-child { border-bottom: 0; }
.tune:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }

.tune__play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.tune__play:hover { border-color: var(--accent); }
.tune__play[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: transparent; }
:root[data-theme="dark"] .tune__play[aria-pressed="true"],
:root:not([data-theme="light"]) .tune__play[aria-pressed="true"] { color: #10181A; }
.tune__play[disabled] { opacity: 0.4; cursor: default; }

.tune__meta { min-width: 0; }
.tune__title {
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tune__sub {
  margin: 2px 0 0;
  font-size: 0.87rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tune__code { font-family: var(--mono); }

.state {
  text-align: center;
  color: var(--muted);
  padding: 30px 10px;
}

/* ── Sheet ────────────────────────────────────────────────────────────── */

.sheet[hidden] { display: none !important; }
.sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  align-items: end;
  justify-items: center;
}
@media (min-width: 640px) { .sheet { align-items: center; } }

.sheet__scrim {
  position: absolute;
  inset: 0;
  background: rgb(8 14 16 / 55%);
}

.sheet__panel {
  position: relative;
  width: min(460px, 100%);
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 26px 24px 24px;
  box-shadow: var(--shadow);
  max-height: 92vh;
  overflow-y: auto;
}
@media (min-width: 640px) { .sheet__panel { border-radius: var(--radius); } }

.sheet__x {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.field { margin-top: 16px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.field .hint { font-size: 0.82rem; color: var(--muted); margin: 6px 0 0; }
.field .error { font-size: 0.85rem; color: var(--ember-ink); margin: 6px 0 0; }

.terms {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 18px;
  font-size: 0.87rem;
  color: var(--ink-2);
}
.terms input { margin-top: 3px; flex: none; }

.summary {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 4px;
}
.summary dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 0.9rem;
}
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Toast ────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 18px);
  background: var(--ink);
  color: var(--paper);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 90;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── Footer ───────────────────────────────────────────────────────────── */

.site-foot {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  padding-block: 34px 28px;
  margin-top: clamp(40px, 7vw, 76px);
}

.site-foot__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 26px;
}
.site-foot h4 {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--body);
  font-weight: 600;
  margin-bottom: 10px;
}
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: 7px; }
.site-foot a { color: var(--ink-2); text-decoration: none; font-size: 0.93rem; }
.site-foot a:hover { color: var(--ink); text-decoration: underline; }
.site-foot__legal {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}
.site-foot__legal p { margin: 0 0 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
