/* Chroma Eye site. Ink tokens (chroma-design-system), system font, mobile first. */

:root {
  --bg: #E6ECEF;
  --surface: #F5F9FA;
  --surface-high: #D7E0E5;
  --text: #111A22;
  --text-muted: #4F5E6D;
  --primary: #141B22;
  --on-primary: #FFFFFF;
  --overlay: #FFFFFF;
  --keyline: rgb(11 15 20 / 0.6);

  --sp-2: 2px;
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-24: 24px;
  --sp-32: 32px;
  --sp-48: 48px;
  --sp-64: 64px;

  --radius-card: 24px;
  --radius-inner: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1317;
    --surface: #161D24;
    --surface-high: #222B33;
    --text: #EEF2F6;
    --text-muted: #A6B2C0;
    --primary: #EDF1F5;
    --on-primary: #0B0F14;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0D1317;
  --surface: #161D24;
  --surface-high: #222B33;
  --text: #EEF2F6;
  --text-muted: #A6B2C0;
  --primary: #EDF1F5;
  --on-primary: #0B0F14;
  color-scheme: dark;
}

@media (min-width: 960px) {
  :root {
    --radius-card: 28px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

[id] {
  scroll-margin-top: var(--sp-64);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

.wrap {
  max-width: 1120px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

@media (min-width: 1152px) {
  .wrap {
    max-width: calc(1120px + 2 * var(--sp-16));
  }
}

.label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  min-height: 56px;
  padding: 0 var(--sp-32);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-tonal {
  background: var(--surface-high);
  color: var(--text);
}

.btn:active {
  transform: scale(0.98);
}

.btn-block {
  width: 100%;
}

/* Launch state: one attribute on <html> picks the call to action. */

.cta {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-12);
}

[data-launch="notify"] .cta-notify,
[data-launch="preregister"] .cta-preregister,
[data-launch="live"] .cta-live {
  display: flex;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding-inline: var(--sp-8);
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
}

.badge img {
  display: block;
  height: 48px;
  width: auto;
}

.badge-play img {
  height: 72px;
  margin: -12px;
}

/* Top bar: solid, never glass, because colour areas scroll under it. */

.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--bg);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-16);
  min-height: 64px;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-12);
  min-height: 48px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.topbar-brand img {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.nav {
  display: flex;
  gap: var(--sp-4);
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding-inline: var(--sp-12);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.nav a:hover {
  background: var(--surface-high);
  color: var(--text);
}

@media (max-width: 479px) {
  .topbar-brand span {
    display: none;
  }

  .nav a {
    padding-inline: var(--sp-8);
  }
}

/* Hero */

.hero {
  padding-block: var(--sp-32) var(--sp-48);
}

.hero-grid {
  display: grid;
  gap: var(--sp-32);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-16);
  min-width: 0;
}

.facts {
  display: grid;
  gap: var(--sp-8);
  padding: 0;
  margin: 0;
  list-style: none;
}

.facts li {
  display: flex;
  align-items: baseline;
  gap: var(--sp-12);
}

.facts li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transform: translateY(-2px);
}

.hero h1 {
  font-size: clamp(40px, 9vw, 72px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero-line {
  max-width: 34em;
  font-size: 20px;
  color: var(--text-muted);
}

.hero-copy .cta {
  margin-top: var(--sp-8);
}

@media (min-width: 960px) {
  .hero {
    padding-block: var(--sp-64);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--sp-64);
    align-items: center;
  }

  .hero-copy {
    gap: var(--sp-24);
  }
}

/* Taster. Colour areas get nothing on or around them but the reticle and slider thumb. */

.taster {
  display: grid;
  gap: var(--sp-16);
  min-width: 0;
}

.taster-head {
  display: grid;
  gap: var(--sp-4);
}

.taster-hint {
  font-size: 15px;
  color: var(--text-muted);
}

.hint-touch {
  display: none;
}

@media (pointer: coarse) {
  .hint-touch {
    display: inline;
  }

  .hint-mouse {
    display: none;
  }
}

.frames {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-12);
}

.frame {
  margin: 0;
  display: grid;
  gap: var(--sp-12);
  padding: var(--sp-8) var(--sp-8) var(--sp-12);
  background: var(--surface);
  border-radius: var(--radius-card);
}

.swatch {
  aspect-ratio: 4 / 3;
  max-width: 100%;
  border-radius: var(--radius-inner);
}

.swatch-target {
  background: rgb(232, 96, 60);
}

.swatch-yours {
  background: rgb(51, 204, 204);
}

.frame figcaption {
  display: grid;
  padding-inline: var(--sp-8);
  line-height: 1.3;
}

.frame figcaption strong {
  font-weight: 600;
}

.frame figcaption span {
  font-size: 13px;
  color: var(--text-muted);
}

.stage {
  display: grid;
}

.stage > * {
  grid-area: 1 / 1;
  min-width: 0;
}

.controls {
  display: grid;
  gap: var(--sp-12);
}

.controls[aria-hidden="true"],
.result[aria-hidden="true"] {
  visibility: hidden;
}

/* Hue wheel: angle = hue with red at the top, clockwise; distance from the centre = saturation, linear.
   Stops every 60° and a grey-to-clear radial blend give exact HSL at the current lightness. */
.wheel-pad {
  width: 100%;
  max-width: calc(360px + 2 * var(--sp-12));
  margin: calc(-1 * var(--sp-12)) auto;
  padding: var(--sp-12);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: crosshair;
}

.wheel {
  --l: 50%;
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, hsl(0, 0%, var(--l)), hsl(0 0% var(--l) / 0)),
    conic-gradient(
      hsl(0, 100%, var(--l)),
      hsl(60, 100%, var(--l)),
      hsl(120, 100%, var(--l)),
      hsl(180, 100%, var(--l)),
      hsl(240, 100%, var(--l)),
      hsl(300, 100%, var(--l)),
      hsl(360, 100%, var(--l))
    );
}

.reticle {
  position: absolute;
  left: 50%;
  top: 80%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid var(--overlay);
  border-radius: 50%;
  box-shadow:
    0 0 0 1px var(--keyline),
    inset 0 0 0 1px var(--keyline);
  pointer-events: none;
}

.slider-row {
  display: flex;
  justify-content: space-between;
  padding-inline: var(--sp-4);
}

.slider-row output {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 15px;
}

.pill-range {
  --track: linear-gradient(to right, #000000, hsl(180, 60%, 50%), #FFFFFF);
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 48px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.pill-range::-webkit-slider-runnable-track {
  height: 32px;
  border-radius: 999px;
  background: var(--track);
}

.pill-range::-moz-range-track {
  height: 32px;
  border-radius: 999px;
  background: var(--track);
}

.pill-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 40px;
  height: 24px;
  margin-top: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--overlay);
  box-shadow: 0 0 0 1px var(--keyline);
}

.pill-range::-moz-range-thumb {
  width: 40px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: var(--overlay);
  box-shadow: 0 0 0 1px var(--keyline);
}

.pill-range:disabled {
  cursor: default;
}

.result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-12);
  padding: var(--sp-24) var(--sp-16);
  background: var(--surface);
  border-radius: var(--radius-card);
  text-align: center;
}

.stars {
  display: flex;
  gap: var(--sp-8);
  font-size: 56px;
  font-weight: 300;
  line-height: 1;
  color: var(--surface-high);
}

.stars .on {
  color: var(--text);
}

.result-line {
  font-size: 22px;
  font-weight: 600;
}

.result .btn {
  margin-top: var(--sp-12);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .stars .on {
    animation: star-in 420ms cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
  }

  .stars .on:nth-child(2) {
    animation-delay: 140ms;
  }

  .stars .on:nth-child(3) {
    animation-delay: 280ms;
  }
}

@keyframes star-in {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
}

/* Sections */

.section {
  padding-block: var(--sp-48);
}

.section-head {
  display: grid;
  gap: var(--sp-12);
  max-width: 640px;
  margin-bottom: var(--sp-32);
}

.section h2 {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.section-head p {
  font-size: 19px;
  color: var(--text-muted);
}

@media (min-width: 960px) {
  .section {
    padding-block: var(--sp-64);
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: fade-up linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

.cards {
  display: grid;
  gap: var(--sp-12);
  padding: 0;
  margin: 0;
  list-style: none;
}

.card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-16);
  padding: var(--sp-12);
  background: var(--surface);
  border-radius: var(--radius-card);
}

.card h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}

.card p {
  color: var(--text-muted);
}

.card-text {
  display: grid;
  gap: var(--sp-4);
  min-width: 0;
  padding-right: var(--sp-8);
}

.art {
  position: relative;
  height: 96px;
  border-radius: var(--radius-inner);
  overflow: hidden;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-16);
  }

  .card {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    align-content: start;
    padding: var(--sp-12) var(--sp-12) var(--sp-24);
  }

  .card-text {
    padding-inline: var(--sp-12);
  }

  .art {
    height: 144px;
  }

  .card-wide {
    grid-column: span 2;
  }
}

@media (min-width: 960px) {
  .cards-modes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cards-days {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cards-days .card-wide {
    grid-column: auto;
  }
}

/* Mode art: colour drawn in CSS. */

.art-spectrum {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-8);
}

.art-target {
  border-radius: var(--radius-inner);
  background: hsl(220, 70%, 55%);
}

.art-wheel {
  position: relative;
  height: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, hsl(0, 0%, 50%), hsl(0 0% 50% / 0)),
    conic-gradient(
      hsl(0, 100%, 50%),
      hsl(60, 100%, 50%),
      hsl(120, 100%, 50%),
      hsl(180, 100%, 50%),
      hsl(240, 100%, 50%),
      hsl(300, 100%, 50%),
      hsl(360, 100%, 50%)
    );
}

.art-wheel i {
  position: absolute;
  left: 27.5%;
  top: 76.8%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 3px solid var(--overlay);
  border-radius: 50%;
  box-shadow:
    0 0 0 1px var(--keyline),
    inset 0 0 0 1px var(--keyline);
}

.art-stripes {
  display: grid;
  align-content: center;
  gap: var(--sp-8);
  padding-inline: var(--sp-4);
}

.art-stripes span {
  position: relative;
  height: 20px;
  border-radius: 999px;
}

.art-stripes i {
  position: absolute;
  top: 2px;
  width: 28px;
  height: 16px;
  margin-left: -14px;
  border-radius: 999px;
  background: var(--overlay);
  box-shadow: 0 0 0 1px var(--keyline);
}

.st-r {
  background: linear-gradient(to right, #000000, #FF0000);
}

.st-g {
  background: linear-gradient(to right, #000000, #00FF00);
}

.st-b {
  background: linear-gradient(to right, #000000, #0000FF);
}

.art-sliders .st-r i {
  left: 72%;
}

.art-sliders .st-g i {
  left: 35%;
}

.art-sliders .st-b i {
  left: 58%;
}

.art-expert .st-r i {
  left: 40%;
}

.art-expert .st-g i {
  left: 81%;
}

.art-expert .st-b i {
  left: 22%;
  background: transparent;
  border: 3px solid var(--overlay);
  box-shadow:
    0 0 0 1px var(--keyline),
    inset 0 0 0 1px var(--keyline);
}

.art-memory {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-8);
}

.art-memory span {
  position: relative;
  border-radius: var(--radius-inner);
  background: var(--surface-high);
}

.art-memory span:first-child {
  background: #2FB37A;
}

.art-memory i {
  position: absolute;
  left: var(--sp-8);
  bottom: var(--sp-8);
  width: 55%;
  height: 4px;
  border-radius: 999px;
  background: var(--overlay);
  box-shadow: 0 0 0 1px var(--keyline);
}

.art-gradient {
  background: linear-gradient(to right, #3A7BD5, #E0565B);
}

.art-mesh {
  background:
    radial-gradient(circle at 18% 28%, #F06A4A, rgb(240 106 74 / 0) 45%),
    radial-gradient(circle at 82% 22%, #4A8CF0, rgb(74 140 240 / 0) 45%),
    radial-gradient(circle at 50% 55%, #B04AF0, rgb(176 74 240 / 0) 40%),
    radial-gradient(circle at 20% 85%, #3FC28E, rgb(63 194 142 / 0) 45%),
    radial-gradient(circle at 80% 85%, #F0D04A, rgb(240 208 74 / 0) 45%),
    #4B3F6B;
}

.art-race {
  display: grid;
  place-items: center;
}

.art-race span {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: conic-gradient(
    from 20deg,
    #F0643A,
    #F0D04A 15%,
    #3FC28E 30%,
    #2EC5D3 42%,
    #4A8CF0 52%,
    #8A5CF0 62%,
    var(--surface-high) 62%
  );
  -webkit-mask: radial-gradient(circle, transparent 23px, #000000 24px);
  mask: radial-gradient(circle, transparent 23px, #000000 24px);
}

@media (min-width: 640px) {
  .art-race span {
    width: 112px;
    height: 112px;
    -webkit-mask: radial-gradient(circle, transparent 33px, #000000 34px);
    mask: radial-gradient(circle, transparent 33px, #000000 34px);
  }
}

.art-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: var(--sp-4);
}

.art-row span {
  border-radius: 8px;
}

.art-daily span:nth-child(1) { background: #E8603C; }
.art-daily span:nth-child(2) { background: #F2B53A; }
.art-daily span:nth-child(3) { background: #3FB27F; }
.art-daily span:nth-child(4) { background: #3A86D9; }
.art-daily span:nth-child(5) { background: #9B59D0; }
.art-weekly span:nth-child(1) { background: #0B3C5D; }
.art-weekly span:nth-child(2) { background: #1D6F8C; }
.art-weekly span:nth-child(3) { background: #2FA3A8; }
.art-weekly span:nth-child(4) { background: #7FD1C7; }
.art-weekly span:nth-child(5) { background: #D8F1EC; }

.art-code {
  display: grid;
  place-items: center;
  background: var(--surface-high);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 640px) {
  .art-code {
    font-size: 17px;
  }
}

/* FAQ */

.faq {
  display: grid;
  gap: var(--sp-8);
  max-width: 760px;
}

.faq details {
  background: var(--surface);
  border-radius: var(--radius-card);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-16);
  min-height: 64px;
  padding: var(--sp-12) var(--sp-24);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

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

.faq summary::after {
  content: "+";
  flex: none;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  color: var(--text-muted);
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details p {
  max-width: 65ch;
  padding: 0 var(--sp-24) var(--sp-24);
  color: var(--text-muted);
}

/* Note and footer */

.note {
  padding-block: var(--sp-32);
  font-size: 15px;
  color: var(--text-muted);
}

.footer {
  padding-block: var(--sp-48) var(--sp-64);
  background: var(--surface);
}

.footer-inner {
  display: grid;
  gap: var(--sp-32);
}

.footer-brand {
  display: grid;
  gap: var(--sp-16);
}

.footer-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8) var(--sp-24);
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 15px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

.copyright {
  font-size: 13px;
  color: var(--text-muted);
}

/* Subpages: legal texts, challenge, 404 */

.nav a[aria-current="page"] {
  background: var(--surface-high);
  color: var(--text);
}

.page {
  padding-block: var(--sp-32) var(--sp-64);
}

.page-head {
  display: grid;
  gap: var(--sp-12);
  max-width: 720px;
}

.page-head h1 {
  font-size: clamp(36px, 7vw, 56px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.page-head p {
  font-size: 19px;
  color: var(--text-muted);
}

.prose {
  max-width: 720px;
  margin-top: var(--sp-32);
}

.prose h2 {
  margin-top: var(--sp-48);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.prose h3 {
  margin-top: var(--sp-24);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}

.prose p,
.prose ul {
  margin-top: var(--sp-12);
}

.prose ul {
  padding-left: var(--sp-24);
}

.prose li + li {
  margin-top: var(--sp-8);
}

.prose a {
  overflow-wrap: anywhere;
}

.panel {
  padding: var(--sp-24);
  background: var(--surface);
  border-radius: var(--radius-card);
}

.panel > :first-child {
  margin-top: 0;
}

.panel ul {
  margin-top: 0;
}

.page .cta {
  margin-top: var(--sp-32);
}

/* Challenge page */

.challenge {
  display: grid;
  gap: var(--sp-24);
  max-width: 640px;
}

.challenge-head {
  display: grid;
  gap: var(--sp-12);
}

.code-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-16);
  padding: var(--sp-16) var(--sp-16) var(--sp-16) var(--sp-24);
  background: var(--surface);
  border-radius: var(--radius-card);
}

.code-box .code {
  display: grid;
  gap: var(--sp-4);
  min-width: 0;
}

.code-box output {
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.challenge-hint {
  display: grid;
  gap: var(--sp-8);
  color: var(--text-muted);
}

.challenge .cta {
  margin-top: 0;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-12);
  margin-top: var(--sp-32);
}

@media (max-width: 479px) {
  .topbar:not(:has(nav)) .topbar-brand span {
    display: inline;
  }
}
