:root {
  color-scheme: dark;
  --bg: #09090b;
  --bg-elevated: rgba(18, 18, 24, 0.88);
  --bg-soft: rgba(255, 255, 255, 0.04);
  --text: #f7f5ef;
  --muted: #b6b2aa;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  --accent: #f06d4f;
  --accent-strong: #ffd166;
  --surface-radius: 28px;
  --content-width: 1180px;
  --transition: 220ms ease;
  --font-display: "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Trebuchet MS", "Segoe UI", sans-serif;
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f5efe3;
  --bg-elevated: rgba(255, 251, 244, 0.9);
  --bg-soft: rgba(53, 37, 21, 0.06);
  --text: #171411;
  --muted: #5d564d;
  --line: rgba(23, 20, 17, 0.12);
  --shadow: 0 20px 60px rgba(60, 44, 30, 0.12);
  --accent: #b4492d;
  --accent-strong: #234d89;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(255, 209, 102, 0.15), transparent 32%),
    radial-gradient(circle at 85% 10%, rgba(240, 109, 79, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 25%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color var(--transition), color var(--transition);
}

body.lock-scroll {
  overflow: hidden;
  touch-action: none;
}

body.cursor-hidden,
body.cursor-hidden * {
  cursor: none !important;
}

a,
button,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

button,
select {
  font: inherit;
}

/* ── Page shell ── */
.page-shell {
  width: min(calc(100% - 2rem), var(--content-width));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

/* ── Top utility bar (theme toggle) ── */
.top-bar {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 0.6rem;
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  backdrop-filter: blur(12px);
  color: var(--muted);
  cursor: pointer;
  transition:
    border-color var(--transition),
    color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.theme-btn:hover,
.theme-btn:focus-visible {
  outline: none;
  border-color: rgba(255, 209, 102, 0.55);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

/* Icon visibility — sun in dark, moon in light */
.theme-btn .icon-light { display: none; }
.theme-btn[aria-pressed="true"] .icon-dark  { display: none; }
.theme-btn[aria-pressed="true"] .icon-light { display: block; }

/* ── Mobile / desktop content switching ── */
.show-on-mobile { display: none; }

/* ── Shared glass card surface ── */
.color-hero,
.about-copy,
.panel-card,
.benefits-section,
.faq-section {
  border: 1px solid var(--line);
  border-radius: var(--surface-radius);
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

/* ── HERO: color controls ── */
.color-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 4vw, 3.5rem);
}

.color-hero::before {
  content: "";
  position: absolute;
  inset: -20% auto auto -8%;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 109, 79, 0.16), transparent 64%);
  pointer-events: none;
}

.color-hero::after {
  content: "";
  position: absolute;
  inset: auto -6% -14% auto;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(35, 77, 137, 0.22), transparent 64%);
  pointer-events: none;
}

.hero-intro {
  position: relative;
  z-index: 1;
  max-width: 72ch;
  margin-bottom: 2rem;
}

.hero-sub {
  margin: 1rem 0 1.2rem;
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 64ch;
}

/* ── ABOUT SECTION (was hero) ── */
.about-section {
  display: grid;
  grid-template-columns: 1.4fr 0.95fr;
  gap: 1.5rem;
  align-items: stretch;
  margin-top: 1.5rem;
}

.about-copy {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 4vw, 4rem);
}

.about-copy::before {
  content: "";
  position: absolute;
  inset: auto -8% -18% auto;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(35, 77, 137, 0.28), transparent 64%);
  pointer-events: none;
}

/* ── Labels and kickers ── */
.eyebrow,
.section-kicker,
.panel-label {
  margin: 0 0 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.76rem;
  color: var(--accent-strong);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.05;
  margin: 0;
}

h1 {
  max-width: 13ch;
  font-size: clamp(2.8rem, 7.5vw, 5.8rem);
}

.about-copy h2,
.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  margin-bottom: 0.8rem;
}

.about-copy h2 {
  max-width: 22ch;
}

/* ── Text styles ── */
.hero-text,
.section-heading p,
.faq-item p,
.info-card p,
.session-status {
  color: var(--muted);
}

.hero-text {
  max-width: 56ch;
  margin: 1.5rem 0 2rem;
  font-size: 1.08rem;
}

/* ── Hero actions (CTA row) ── */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
}

.hero-link,
.chip-button,
.cycle-button,
.color-button {
  transition:
    transform var(--transition),
    border-color var(--transition),
    background-color var(--transition),
    color var(--transition),
    box-shadow var(--transition);
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.9rem 1.35rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #f7a04b);
  color: #fff8ef;
  text-decoration: none;
  font-weight: 700;
}

.hero-shortcut {
  font-size: 0.95rem;
  color: var(--muted);
}

/* ── Session panel ── */
.hero-panel {
  display: flex;
}

.panel-card {
  width: 100%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  color: var(--text);
}

select {
  width: 100%;
  min-height: 3.3rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-soft);
  color: var(--text);
  padding: 0.85rem 1rem;
  cursor: pointer;
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chip-button,
.cycle-button {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 999px;
  min-height: 3rem;
  padding: 0.85rem 1.15rem;
  cursor: pointer;
}

.chip-button[aria-pressed="true"],
.cycle-button[data-running="true"] {
  background: rgba(240, 109, 79, 0.18);
  border-color: rgba(240, 109, 79, 0.55);
}

.cycle-button {
  background: linear-gradient(135deg, rgba(240, 109, 79, 0.22), rgba(255, 209, 102, 0.14));
  font-weight: 700;
}

/* ── Benefits + FAQ sections ── */
.benefits-section,
.faq-section {
  margin-top: 1.5rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.section-heading {
  max-width: 62ch;
  margin-bottom: 1.5rem;
}

/* ── Color grid ── */
.color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.color-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 6rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  color: var(--text);
  padding: 1rem 1.15rem;
  text-align: left;
  cursor: pointer;
}

.color-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition);
}

.button-dot {
  flex: 0 0 1.3rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.swatch-black  { background: #000000; }
.swatch-white  { background: #ffffff; }
.swatch-red    { background: #ff3131; }
.swatch-green  { background: #2ad16f; }
.swatch-blue   { background: #2577ff; }
.swatch-purple { background: #8c4bff; }

.button-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.button-copy strong {
  font-size: 1.12rem;
}

.button-copy small {
  color: var(--muted);
}

/* ── Info cards (benefits) ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.info-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.35rem;
  background: var(--bg-soft);
}

.info-card h3 {
  margin-bottom: 0.65rem;
  font-size: 1.35rem;
}

/* ── FAQ ── */
.faq-list {
  display: grid;
  gap: 0.85rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--bg-soft);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.08rem;
  padding: 1.1rem 1.2rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  padding: 0 1.2rem 1.2rem;
  margin: 0;
}

/* ── Hover / focus states ── */
.hero-link:hover,
.chip-button:hover,
.cycle-button:hover,
.color-button:hover,
.hero-link:focus-visible,
.chip-button:focus-visible,
.cycle-button:focus-visible,
.color-button:focus-visible,
select:focus-visible,
.faq-item summary:focus-visible {
  outline: none;
  transform: translateY(-2px);
  border-color: rgba(255, 209, 102, 0.5);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
}

.color-button:hover::after,
.color-button:focus-visible::after {
  opacity: 1;
}

/* ── Fullscreen overlay ── */
.fullscreen-color {
  position: fixed;
  inset: 0;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 320ms ease, visibility 320ms ease;
  z-index: 9999;
}

.fullscreen-color.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.fullscreen-message {
  position: absolute;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 260ms ease;
}

.fullscreen-message.visible {
  opacity: 1;
}

/* ── Noscript ── */
.noscript-banner {
  margin: 1rem auto 2rem;
  width: min(calc(100% - 2rem), 60rem);
  padding: 1rem 1.2rem;
  border-radius: 18px;
  background: #fff3cd;
  color: #5f4500;
}

/* ────────────────────────────────────────────
   RESPONSIVE — tablet (≤ 980px)
──────────────────────────────────────────── */
@media (max-width: 980px) {
  .about-section {
    grid-template-columns: 1fr;
  }

  .about-copy h2 {
    max-width: 100%;
  }
}

/* ────────────────────────────────────────────
   RESPONSIVE — mobile (≤ 720px)
──────────────────────────────────────────── */
@media (max-width: 720px) {
  .hide-on-mobile { display: none !important; }
  .show-on-mobile { display: block !important; }
  .page-shell {
    width: min(calc(100% - 1rem), var(--content-width));
    padding-top: 0.5rem;
    padding-bottom: 3rem;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2.4rem, 15vw, 4rem);
  }

  .hero-intro {
    margin-bottom: 1.5rem;
  }

  .hero-sub {
    font-size: 1rem;
  }

  .color-grid {
    gap: 0.75rem;
  }

  .color-button {
    min-height: 5.25rem;
    border-radius: 20px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .color-hero,
  .about-copy,
  .panel-card,
  .benefits-section,
  .faq-section {
    border-radius: 22px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .hero-link {
    width: 100%;
    justify-content: center;
  }

  .toggle-row {
    gap: 0.6rem;
  }

  .chip-button {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    justify-content: center;
  }

  .fullscreen-message {
    width: calc(100% - 1.5rem);
    text-align: center;
    white-space: normal;
  }
}

/* ────────────────────────────────────────────
   RESPONSIVE — small phones (≤ 480px)
──────────────────────────────────────────── */
@media (max-width: 480px) {
  .page-shell {
    width: min(calc(100% - 0.75rem), var(--content-width));
  }

  .color-hero {
    padding: 1.5rem;
  }

  h1 {
    font-size: clamp(2rem, 13vw, 3.5rem);
  }

  .color-grid {
    grid-template-columns: 1fr;
  }

  .color-button {
    min-height: 4.75rem;
    border-radius: 18px;
  }

  .about-copy {
    padding: 1.5rem;
  }

  .panel-card {
    padding: 1.25rem;
  }

  .benefits-section,
  .faq-section {
    padding: 1.25rem;
  }

  .info-card {
    border-radius: 18px;
    padding: 1.1rem;
  }

  .faq-item {
    border-radius: 18px;
  }

  .faq-item summary {
    font-size: 1rem;
    padding: 1rem;
  }

  .faq-item p {
    padding: 0 1rem 1rem;
    font-size: 0.95rem;
  }

  .toggle-row {
    flex-direction: column;
  }

  .chip-button {
    flex: unset;
    width: 100%;
  }
}
