/* ColorSort website. Colors, radii and type mirror the app's design system. */
:root {
  --bg: #080b18;
  --bg-2: #10172b;
  --card: #151e35;
  --line: rgba(255, 255, 255, .13);
  --text: #fff;
  --muted: #9ba8c7;
  --cyan: #00e5ff;
  --blue: #4d7cfe;
  --purple: #9b5cff;
  --magenta: #ff4fd8;
  --mint: #35e0a1;
  --gold: #ffc857;
  --gutter: 20px;
  --display: "Orbitron", "Exo 2", system-ui, sans-serif;
  /* Orbitron's only zero is slashed, so anything with digits uses Exo 2. */
  --numeric: "Exo 2", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--body);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--cyan); text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h2 { font: 700 clamp(26px, 4vw, 36px)/1.2 var(--display); letter-spacing: .02em; }
h3 { font: 600 18px/1.3 var(--body); }
p { margin: 0; }
.wrap { width: min(1120px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--muted); }
.num { font-family: var(--numeric); font-weight: 800; }
.skip {
  position: absolute; left: -999px; top: 8px; z-index: 10;
  padding: 8px 14px; background: var(--card); border-radius: 8px;
}
.skip:focus { left: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(8, 11, 24, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { 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; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.wordmark {
  font: 800 17px/1 var(--display);
  letter-spacing: .08em;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--purple), var(--magenta));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.site-nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 8px 0; }
.site-nav a:hover { color: var(--text); }

/* Hero */
.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(700px 480px at 12% 0%, rgba(155, 92, 255, .26), transparent 70%),
    radial-gradient(640px 460px at 95% 90%, rgba(0, 229, 255, .13), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.eyebrow { font: 600 13px/1 var(--body); letter-spacing: .24em; color: var(--muted); margin-bottom: 18px; }
.hero h1 { font: 800 clamp(38px, 7vw, 68px)/1.04 var(--display); letter-spacing: .01em; }
.gradient {
  background: linear-gradient(90deg, var(--cyan), var(--blue) 40%, var(--purple) 70%, var(--magenta));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.lead { margin-top: 20px; max-width: 34em; font-size: clamp(18px, 2.2vw, 20px); color: #c7d0e6; }
.cta { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 12px 28px;
  border-radius: 999px;
  font: 600 16px/1.2 var(--body);
  text-decoration: none;
  border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(120deg, var(--cyan), var(--blue), var(--purple));
  color: var(--bg);
  box-shadow: 0 12px 30px -10px rgba(77, 124, 254, .7);
}
.btn-soon { background: rgba(255, 255, 255, .06); border-color: var(--line); color: var(--text); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--cyan); }
.stats { list-style: none; margin: 36px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 28px; }
.stats b { display: block; font: 800 30px/1.1 var(--numeric); }
.stats span { font-size: 14px; color: var(--muted); }

/* The animated hero tubes: pure CSS, with the rack sitting behind a phone shot. */
.rack { display: flex; justify-content: center; align-items: flex-end; gap: clamp(14px, 3vw, 26px); }
.tube {
  --unit: 25%;
  position: relative; width: clamp(60px, 9vw, 86px); aspect-ratio: 1 / 3.3;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, .6);
  border-radius: 10px 10px 999px 999px;
  background: rgba(255, 255, 255, .05);
}
.tube::after {
  /* Rounded glass: darker edges and a soft sheen. */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.28), transparent 28%, rgba(255,255,255,.14) 42%, transparent 68%, rgba(0,0,0,.34));
}
.tube i { position: absolute; left: 0; right: 0; height: 22.75%; }
.tube i:nth-child(1) { bottom: 0; }
.tube i:nth-child(2) { bottom: 22.75%; }
.tube i:nth-child(3) { bottom: 45.5%; }
.tube i:nth-child(4) { bottom: 68.25%; }
.c-cyan { background: var(--cyan); }
.c-blue { background: #3d6bff; }
.c-purple { background: var(--purple); }
.c-magenta { background: var(--magenta); }
.c-mint { background: var(--mint); }
.c-gold { background: #ffd93d; }
.tube.lift { animation: bob 3.2s ease-in-out infinite; box-shadow: 0 0 34px -6px rgba(0, 229, 255, .7); border-color: var(--cyan); }
.tube.two { animation-delay: 1.1s; box-shadow: 0 0 30px -8px rgba(255, 79, 216, .6); border-color: var(--magenta); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

/* Sections */
section { padding: clamp(52px, 7vw, 84px) 0; }
.band { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-head { max-width: 40em; margin-bottom: 32px; }
.section-head p { margin-top: 12px; color: var(--muted); }

/* Screenshots */
.shots {
  display: flex; gap: 18px;
  margin: 0; padding: 4px var(--gutter) 18px; list-style: none;
  overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-color: var(--line) transparent;
}
.shots li { flex: 0 0 auto; width: clamp(210px, 22vw, 250px); scroll-snap-align: center; }
.shots img { width: 100%; aspect-ratio: 9 / 20; object-fit: cover; object-position: top; border-radius: 22px; border: 1px solid var(--line); background: var(--card); }
.shots figcaption { margin-top: 10px; text-align: center; font-size: 14px; color: var(--muted); }
.shots figure { margin: 0; }
.shots-wrap { width: min(1400px, 100%); margin-inline: auto; }
/* Auto margins center the row when it fits, without cutting off the start when it doesn't. */
.shots li:first-child { margin-left: auto; }
.shots li:last-child { margin-right: auto; }

/* Steps and features */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.steps li {
  counter-increment: step;
  padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 18px;
}
.steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 36px; height: 36px; margin-bottom: 14px;
  font: 800 17px/1 var(--numeric); color: var(--bg);
  background: linear-gradient(120deg, var(--cyan), var(--purple));
  border-radius: 50%;
}
.steps p, .features p { margin-top: 6px; color: var(--muted); font-size: 16px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; list-style: none; margin: 0; padding: 0; }
.features li { padding: 24px; background: linear-gradient(135deg, rgba(28, 39, 68, .9), rgba(18, 26, 48, .85)); border: 1px solid var(--line); border-radius: 18px; }
.features svg { width: 28px; height: 28px; margin-bottom: 12px; }

/* Chapters */
.chapters { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.chapters li {
  --accent: var(--cyan);
  padding: 16px; background: var(--card); border: 1px solid var(--line);
  border-top: 3px solid var(--accent); border-radius: 14px;
}
.chapters b { display: block; font: 600 16px/1.3 var(--body); }
.chapters span { font: 600 13px/1.4 var(--numeric); color: var(--muted); }

/* FAQ */
.faq { max-width: 780px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 18px 28px 18px 0; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 2px; top: 13px; font-size: 24px; color: var(--cyan); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 0 18px; color: var(--muted); }

/* Footer */
.site-footer { padding: 32px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }

/* Legal pages */
.doc { padding: clamp(36px, 6vw, 64px) 0; }
.doc .wrap { max-width: 780px; }
.doc h1 { font: 800 clamp(30px, 6vw, 44px)/1.1 var(--display); }
.doc .meta { margin-top: 12px; color: var(--muted); font-size: 15px; }
.doc h2 { margin-top: 38px; font: 600 22px/1.3 var(--body); letter-spacing: 0; }
.doc p, .doc ul { margin: 12px 0 0; color: #c7d0e6; }
.doc li { margin-top: 6px; }
.summary { margin-top: 28px; padding: 22px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.summary ul { margin: 8px 0 0; padding-left: 20px; }
.table-scroll { overflow-x: auto; margin-top: 14px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc th, .doc td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; color: #c7d0e6; }
.doc th { color: var(--text); font-weight: 600; }

/* Not found */
.notfound { min-height: 62vh; display: grid; place-items: center; text-align: center; padding: 40px 0; }
.notfound h1 { font: 800 clamp(30px, 6vw, 44px)/1.1 var(--display); margin-bottom: 14px; }
.notfound .btn { margin-top: 24px; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .steps, .features { grid-template-columns: 1fr; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .chapters { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .features { grid-template-columns: 1fr; }
  .nav-optional { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tube.lift { animation: none; }
}
