/* ==========================================================================
   Coloroid AI — landing page
   Dark-only by design: the palette is lifted straight from the app icon.
   ========================================================================== */

:root {
  --ink:        #0B0A14;
  --ink-2:      #12101C;
  --surface:    #15131F;
  --surface-2:  #1D1A2B;
  --line:       #2A2640;
  --text:       #F5F3FF;
  --muted:      #A5A0BC;

  --amber:      #FFB43C;
  --magenta:    #F0459B;
  --blue:       #2E5BE0;
  --violet:     #B388FF;
  --grad: linear-gradient(100deg, var(--amber) 0%, var(--magenta) 48%, var(--blue) 100%);
  /* The app's own accent (AccentColor.colorset in the iOS project). */
  --accent-brand: #9C51F9;
  --accent-brand-hi: #AA69FA;

  --wrap: 1180px;
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 30px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
          Inter, Roboto, Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* height:auto is not optional next to max-width — without it an <img> carrying
   width/height attributes keeps its intrinsic height while the width shrinks. */
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

h1, h2, h3 { margin: 0; letter-spacing: -.03em; line-height: 1.08; font-weight: 700; }
h1 { font-size: clamp(2.6rem, 6.2vw, 4.4rem); }
h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
h3 { font-size: 1.16rem; letter-spacing: -.01em; line-height: 1.3; }
p  { margin: 0; }

.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; }
.wrap--narrow { max-width: 760px; }

.skip-link {
  position: absolute; left: -9999px; top: 10px; z-index: 200;
  background: var(--surface-2); color: var(--text);
  padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none;
}
.skip-link:focus { left: 16px; }

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ── buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px 24px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: .98rem; font-weight: 600; text-decoration: none;
  transition: transform .25s var(--ease), opacity .25s var(--ease), background-color .25s var(--ease);
}
.btn--sm { padding: 10px 18px; font-size: .92rem; }
.btn--solid { background: var(--accent-brand); color: var(--text); font-weight: 700; }
.btn--solid:hover { background: var(--accent-brand-hi); }
.btn--ghost { border-color: var(--line); background: rgba(255,255,255,.03); color: var(--text); }
.btn--ghost:hover { background: rgba(255,255,255,.07); }
.btn:hover { transform: translateY(-2px); }

.appstore { display: inline-block; transition: transform .25s var(--ease), filter .25s var(--ease); }
.appstore img { height: 52px; width: auto; }
.appstore:hover { transform: translateY(-2px); filter: drop-shadow(0 12px 28px rgba(240,69,155,.28)); }
.appstore--lg img { height: 60px; }

.link {
  color: var(--violet); text-decoration: none;
  border-bottom: 1px solid rgba(179,136,255,.35);
  transition: border-color .2s var(--ease);
}
.link:hover { border-color: var(--violet); }

/* ── nav ─────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,10,20,.72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); background: rgba(11,10,20,.9); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand__icon { border-radius: 10px; }
.brand__name { font-weight: 700; font-size: 1.08rem; letter-spacing: -.02em; }
.brand__ai {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.nav__menu { display: flex; align-items: center; gap: 30px; }
.nav__menu a { color: var(--muted); text-decoration: none; font-size: .95rem; transition: color .2s var(--ease); }
.nav__menu a:hover { color: var(--text); }
.nav__menu .btn--solid { color: var(--text); }

.nav__toggle {
  display: none; width: 42px; height: 42px; padding: 0;
  background: none; border: 1px solid var(--line); border-radius: 11px;
  cursor: pointer; gap: 5px;
  /* place-content, not place-items: the bars must be centred as a group,
     otherwise the rows stack from the top and the X never converges. */
  place-content: center; justify-items: center;
}
.nav__bar {
  display: block; width: 17px; height: 2px; border-radius: 2px; background: var(--text);
  transition: transform .3s var(--ease), opacity .2s var(--ease);
}

@media (max-width: 860px) {
  .nav__toggle { display: grid; }
  .nav__menu {
    position: absolute; inset: 70px 0 auto; display: none;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 16px 22px 24px;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu a { padding: 12px 4px; font-size: 1.05rem; }
  .nav__menu .btn { margin-top: 10px; justify-content: center; }
  .nav__toggle[aria-expanded="true"] .nav__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .nav__bar:nth-child(2) { opacity: 0; }
  .nav__toggle[aria-expanded="true"] .nav__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ── hero ────────────────────────────────────────────────────────────────── */
.hero { position: relative; padding: clamp(48px, 8vw, 104px) 0 clamp(56px, 8vw, 110px); overflow: hidden; }
.hero__glow {
  position: absolute; inset: -30% -10% auto; height: 780px; pointer-events: none;
  background:
    radial-gradient(46% 52% at 22% 42%, rgba(255,180,60,.20), transparent 68%),
    radial-gradient(44% 50% at 58% 32%, rgba(240,69,155,.26), transparent 68%),
    radial-gradient(46% 54% at 84% 56%, rgba(46,91,224,.26), transparent 70%);
  filter: blur(28px);
}
.hero__inner {
  position: relative;
  display: grid; grid-template-columns: 1.02fr .98fr; gap: clamp(32px, 5vw, 68px);
  align-items: center;
}

.chip {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 15px; margin-bottom: 26px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
  border-radius: 999px; font-size: .86rem; color: var(--muted);
}
.chip strong { color: var(--text); }
.chip__stars { color: var(--amber); letter-spacing: 1px; font-size: .8rem; }

.hero__title { margin-bottom: 22px; }
.hero__sub { max-width: 33ch; font-size: clamp(1.04rem, 1.5vw, 1.18rem); color: var(--muted); }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 34px; }

.hero__visual { display: grid; justify-items: center; gap: 16px; }
.hero__hint { font-size: .82rem; color: var(--muted); opacity: .75; }

/* The frame is Apple's own device render with a transparent screen cut-out;
   the slider sits behind it and shows through. Percentages below are measured
   off iphone.png (1350x2760, screen at x 72-1277, y 78-2690). */
.phone { position: relative; width: min(320px, 78vw); }
.phone__frame { position: relative; z-index: 2; width: 100%; pointer-events: none; }
.phone__screen {
  position: absolute; z-index: 1;
  left: 5.33%; top: 2.83%; width: 89.26%; height: 94.64%;
  overflow: hidden; border-radius: 9% / 4.2%;
  background: var(--ink-2);
}
.phone__screen .ba { width: 100%; height: 100%; aspect-ratio: auto; background: var(--ink); }
/* A 2:3 photo in a 9:19.5 screen: cover would crop everything but a strip of
   cheek, so let it letterbox the way the app itself shows a portrait. */
.phone__screen .ba__img { object-fit: contain; }

/* ── before / after slider ───────────────────────────────────────────────── */
.ba {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  background: var(--surface-2); cursor: ew-resize; touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
}
.ba__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba__img--after { clip-path: inset(0 0 0 var(--pos, 50%)); }

.ba__handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%);
  width: 2px; margin-left: -1px; background: rgba(255,255,255,.92);
  box-shadow: 0 0 18px rgba(0,0,0,.5); z-index: 2;
}
.ba__grip {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.94); color: #0B0A14;
  display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
.ba__tag {
  position: absolute; bottom: 12px; z-index: 2;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(11,10,20,.72); backdrop-filter: blur(8px);
  font-size: .72rem; font-weight: 600; letter-spacing: .02em; color: var(--text);
  pointer-events: none;
}
.ba__tag--before { left: 12px; }
.ba__tag--after  { right: 12px; }

/* ── sections ────────────────────────────────────────────────────────────── */
.sec { padding: clamp(64px, 9vw, 118px) 0; }
.sec--alt { background: var(--ink-2); border-block: 1px solid var(--line); }

.sec__head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 60px); }
.kicker {
  margin-bottom: 14px; font-size: .78rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { margin-top: 18px; color: var(--muted); font-size: 1.06rem; }

/* ── gallery ─────────────────────────────────────────────────────────────── */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  margin: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.card:hover { border-color: var(--accent, #3A3358); transform: translateY(-3px); }
.card .ba { aspect-ratio: 240 / 414; }
.card figcaption { padding: 20px 22px 24px; font-size: .89rem; color: var(--muted); line-height: 1.5; }
.card figcaption b { display: block; margin-bottom: 6px; color: var(--text); font-size: 1.06rem; letter-spacing: -.01em; }

/* Accent per card comes from the app's own RestorationType colours. */
.card__tag {
  display: inline-block; margin-bottom: 12px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--accent, var(--line));
  color: var(--accent, var(--muted));
  font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
}

/* ── features ────────────────────────────────────────────────────────────── */
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feat {
  padding: 30px 28px 32px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.feat:hover { border-color: #3A3358; transform: translateY(-3px); }
.feat__ico {
  width: 30px; height: 30px; margin-bottom: 20px;
  fill: none; stroke: var(--violet); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.feat h3 { margin-bottom: 10px; }
.feat p { color: var(--muted); font-size: .95rem; }

/* ── steps ───────────────────────────────────────────────────────────────── */
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin: 0; padding: 0; list-style: none; counter-reset: none;
}
.step { position: relative; padding: 34px 28px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.step__n {
  display: grid; place-items: center;
  width: 44px; height: 44px; margin-bottom: 20px;
  border-radius: 50%; background: var(--grad); color: #100C1A;
  font-weight: 800; font-size: 1.05rem;
}
.step h3 { margin-bottom: 10px; }
.step p { color: var(--muted); font-size: .95rem; }

/* ── privacy ─────────────────────────────────────────────────────────────── */
.privacy {
  display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: start;
  max-width: 860px; padding: clamp(28px, 4vw, 44px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.privacy__ico {
  width: 44px; height: 44px; flex: none;
  fill: none; stroke: var(--violet); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.privacy h2 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); margin-bottom: 14px; }
.privacy p { color: var(--muted); }
.privacy p + p { margin-top: 16px; }

/* ── faq ─────────────────────────────────────────────────────────────────── */
.faq { display: grid; gap: 12px; }
.qa {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); overflow: hidden;
  transition: border-color .25s var(--ease);
}
.qa[open] { border-color: #3A3358; }
.qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 19px 22px; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 1.01rem; letter-spacing: -.01em;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+"; flex: none;
  font-size: 1.5rem; font-weight: 400; line-height: 1; color: var(--muted);
  transition: transform .25s var(--ease), color .25s var(--ease);
}
.qa[open] summary::after { transform: rotate(45deg); color: var(--violet); }
.qa__body { padding: 0 22px 22px; color: var(--muted); font-size: .96rem; }

/* ── final cta ───────────────────────────────────────────────────────────── */
.cta { padding: clamp(64px, 9vw, 116px) 0; }
.cta__inner {
  position: relative; overflow: hidden;
  display: grid; justify-items: center; gap: 22px;
  max-width: 940px; padding: clamp(46px, 7vw, 78px) 30px;
  text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.cta__inner::before {
  content: ""; position: absolute; inset: -60% 10% auto; height: 420px; pointer-events: none;
  background:
    radial-gradient(46% 60% at 26% 50%, rgba(255,180,60,.20), transparent 70%),
    radial-gradient(44% 58% at 54% 40%, rgba(240,69,155,.24), transparent 70%),
    radial-gradient(46% 60% at 80% 56%, rgba(46,91,224,.24), transparent 70%);
  filter: blur(26px);
}
.cta__inner > * { position: relative; }
.cta__inner p { color: var(--muted); }

/* ── reveal ──────────────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn:hover, .appstore:hover, .card:hover, .feat:hover { transform: none; }
}

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1020px) {
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .feats   { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .gallery { grid-template-columns: 1fr; gap: 18px; max-width: 420px; margin-inline: auto; }
}

@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__copy  { display: grid; justify-items: center; }
  .hero__sub   { max-width: 46ch; }
  .hero__cta   { justify-content: center; }
  .hero__visual { order: 2; }
  .steps       { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .feats   { grid-template-columns: 1fr; }
  .privacy { grid-template-columns: 1fr; gap: 18px; }
  .hero__cta { flex-direction: column; align-items: stretch; }
}

/* ==========================================================================
   Sub-pages — /privacy, /terms, /contact
   Same shell as the landing page (nav, footer, palette); only the article
   column and the form below are specific to them.
   ========================================================================== */

/* ── page head ───────────────────────────────────────────────────────────── */
.page-hero {
  position: relative; overflow: hidden;
  padding: clamp(46px, 7vw, 86px) 0 clamp(28px, 4vw, 44px);
}
.page-hero::before {
  content: ""; position: absolute; inset: -70% 20% auto; height: 520px; pointer-events: none;
  background:
    radial-gradient(48% 58% at 24% 46%, rgba(255,180,60,.14), transparent 70%),
    radial-gradient(46% 56% at 56% 36%, rgba(240,69,155,.18), transparent 70%),
    radial-gradient(48% 58% at 82% 54%, rgba(46,91,224,.18), transparent 72%);
  filter: blur(28px);
}
.page-hero > * { position: relative; }
.page-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); }
.page-hero .lead { max-width: 56ch; }
.page-hero__meta { margin-top: 16px; font-size: .84rem; color: var(--muted); opacity: .8; }

/* ── legal article ───────────────────────────────────────────────────────── */
.legal { padding-bottom: clamp(60px, 8vw, 104px); }
.legal__body {
  padding: clamp(26px, 4vw, 44px) clamp(22px, 3.4vw, 42px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  color: var(--muted); font-size: .98rem;
}
.legal__body > *:first-child { margin-top: 0; }
.legal__body h2 {
  margin: 42px 0 14px; padding-top: 26px;
  border-top: 1px solid var(--line);
  color: var(--text); font-size: clamp(1.32rem, 2.4vw, 1.62rem);
}
.legal__body > h2:first-child { padding-top: 0; border-top: 0; }
.legal__body h3 { margin: 28px 0 10px; color: var(--text); font-size: 1.06rem; }
.legal__body h4 {
  margin: 22px 0 8px; color: var(--violet);
  font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.legal__body p { margin: 0 0 14px; }
.legal__body ul { margin: 0 0 16px; padding-left: 20px; }
.legal__body li { margin-bottom: 8px; }
.legal__body li > strong, .legal__body p > strong { color: var(--text); font-weight: 600; }
.legal__body a { color: var(--violet); text-decoration: none; border-bottom: 1px solid rgba(179,136,255,.35); }
.legal__body a:hover { border-bottom-color: var(--violet); }

/* Pulled-out definition list used by the Definitions block. */
.legal__body dl { margin: 0 0 18px; }
.legal__body dt { margin-top: 14px; color: var(--text); font-weight: 600; }
.legal__body dd { margin: 4px 0 0; }

/* ── contact form ────────────────────────────────────────────────────────── */
.contact { max-width: 760px; padding-bottom: clamp(60px, 8vw, 104px); }

.form {
  padding: clamp(24px, 3.4vw, 36px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field label { font-size: .86rem; font-weight: 600; color: var(--text); }
.field__hint { font-size: .78rem; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 13px 15px;
  background: var(--ink-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font: inherit; font-size: .96rem;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.field textarea { min-height: 148px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #6E688A; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent-brand); background: var(--surface-2);
}
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--magenta); }
.field textarea:disabled { opacity: .5; border-color: var(--line); cursor: default; }

/* Bot bait: named like a real field, hidden from people and from assistive
   tech. Anything that fills it in gets a silent 200 and goes nowhere. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__submit { width: 100%; margin-top: 4px; }
.form__submit[disabled] { opacity: .55; pointer-events: none; }

.form__status {
  margin-top: 16px; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: .9rem; color: var(--muted);
}
.form__status:empty { display: none; }
.form__status--ok { border-color: rgba(127,242,98,.4); color: #BFF5AE; background: rgba(127,242,98,.06); }
.form__status--err { border-color: rgba(240,69,155,.45); color: #FFB7D6; background: rgba(240,69,155,.07); }

/* ── footer ──────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); background: var(--ink-2); }
.footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 18px; padding-block: 34px;
}
.footer__links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer__links a { color: var(--muted); text-decoration: none; font-size: .9rem; transition: color .2s var(--ease); }
.footer__links a:hover { color: var(--text); }
.footer__copy { color: var(--muted); font-size: .85rem; opacity: .8; }

@media (max-width: 780px) {
  .footer__inner { flex-direction: column; align-items: flex-start; }
}
