/* Cravolio site. Colours come from the app's AppColor tokens. */

@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-600-700.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallback so the headline does not shift when the font loads. */
@font-face {
  font-family: "Serif Fallback";
  src: local("Georgia");
  size-adjust: 97%;
  ascent-override: 104%;
  descent-override: 34%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light;
  --bg: #F7F2EA;
  --surface: #FFFDF8;
  --surface-2: #EFE7DA;
  --text: #2A211A;
  --muted: #6B5D4F;
  --hairline: #E6DFD4;
  --field-border: #8A7B6B;
  --accent: #D96524;
  --accent-text: #B14C12;
  --accent-btn: #B85016;
  --on-accent: #FFFFFF;
  --error: #A8321D;
  --card-shadow: 0 8px 24px rgba(42, 33, 26, .14);
  --phone-shadow: 0 2px 4px rgba(42, 33, 26, .18), 0 28px 60px -8px rgba(42, 33, 26, .34);
  --serif: "Source Serif 4", "Serif Fallback", "New York", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --surface: #1A1A1E;
    --surface-2: #1E1E1E;
    --text: #F5F2EC;
    --muted: #A9A49C;
    --hairline: #2C2C2C;
    --field-border: #77726B;
    --accent: #E06C1F;
    --accent-text: #F08A45;
    --accent-btn: #E06C1F;
    --on-accent: #1A0D04;
    --error: #FF8A73;
    --card-shadow: none;
    --phone-shadow: 0 30px 70px -10px rgba(0, 0, 0, .9);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1A1A1E;
  --surface-2: #1E1E1E;
  --text: #F5F2EC;
  --muted: #A9A49C;
  --hairline: #2C2C2C;
  --field-border: #77726B;
  --accent: #E06C1F;
  --accent-text: #F08A45;
  --accent-btn: #E06C1F;
  --on-accent: #1A0D04;
  --error: #FF8A73;
  --card-shadow: none;
  --phone-shadow: 0 30px 70px -10px rgba(0, 0, 0, .9);
}

*, *::before, *::after { box-sizing: border-box; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; animation-timing-function: ease; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, figure, fieldset { margin: 0; padding: 0; }
ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; border-radius: 6px; }

[hidden] { display: none !important; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 20;
  background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 10px;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); }
.narrow { max-width: 760px; }
.center { text-align: center; }

/* ── Type ── */
h1, .h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 10.5vw, 4.5rem); line-height: 1.02; }
h1 em { font-style: normal; color: var(--accent-text); }
.h2 { font-size: clamp(1.85rem, 6.4vw, 2.9rem); line-height: 1.08; }
h3 { font-size: 1.3rem; line-height: 1.2; }
p { text-wrap: pretty; }
.eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: 14px;
}
.lede { font-size: 1.16rem; line-height: 1.5; color: var(--muted); margin-top: 20px; max-width: 34em; }
.fineprint { font-size: .88rem; color: var(--muted); margin-top: 14px; }

/* ── Header ── */
.site-header { position: relative; z-index: 5; }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }
.brand img { border-radius: 8px; }
.bar-nav { display: flex; align-items: center; gap: 4px; }
.nav-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: .95rem; font-weight: 500; text-decoration: none; border-radius: 10px; }
.nav-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }

/* ── App Store badge (Apple's artwork, unmodified) ── */
.badge { display: inline-block; margin-top: 28px; border-radius: 10px; line-height: 0; }
.badge img { width: 180px; height: 60px; }
.badge-on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge-on-dark { display: block; }
  :root:not([data-theme="light"]) .badge-on-light { display: none; }
}
:root[data-theme="dark"] .badge-on-dark { display: block; }
:root[data-theme="dark"] .badge-on-light { display: none; }

/* ── Hero ── */
.hero { padding: 20px 0 8px; overflow: hidden; }
.hero-grid { display: grid; gap: 28px; }
.hero-visual { position: relative; margin-inline: calc(-1 * max(20px, env(safe-area-inset-left))); }

/* ── Carousel: the app's paywall carousel, rebuilt with transform + opacity only ── */
.carousel {
  --cw: clamp(140px, 46vw, 230px);
  position: relative;
  height: calc(var(--cw) * 2.26);
  overflow: hidden;
  contain: layout paint;
  isolation: isolate;
}
.carousel::before, .carousel::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 9%; z-index: 6; pointer-events: none;
}
.carousel::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.carousel::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.track { position: absolute; inset: 0; }
.card {
  position: absolute; left: 50%; top: 50%;
  width: var(--cw); aspect-ratio: 275 / 600;
  margin: calc(var(--cw) * -1.0909) 0 0 calc(var(--cw) * -.5);
  font-size: calc(var(--cw) / 10);
  border-radius: .62em; overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--card-shadow);
  backface-visibility: hidden;
  will-change: transform, opacity;
  animation: drift 12s linear infinite;
  animation-delay: calc(var(--k) * -2s);
}
.card img { width: 100%; height: 100%; object-fit: cover; }
.card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.9) 0%, rgba(0,0,0,.8) 9%, rgba(0,0,0,0) 50%);
  border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
}
.label { position: absolute; left: .75em; right: .75em; bottom: .75em; z-index: 1; color: #fff; display: grid; gap: .15em; }
.label b { font: 700 1.05em/1.1 var(--serif); letter-spacing: -0.01em; white-space: nowrap; }
.label span { font: 400 .62em/1.2 var(--serif); font-weight: 600; opacity: .9; }

/* Each card rests 0.8s in a slot, then glides 1.2s to the next (sine ease), like the app. */
@keyframes drift {
  0%, 6.667%  { transform: translate3d(0, 0, 0) perspective(34em) rotateY(0deg) scale(1); opacity: 1; animation-timing-function: cubic-bezier(.37, 0, .63, 1); }
  16.667%     { transform: translate3d(8.8em, .22em, 0) perspective(34em) rotateY(-19deg) scale(.89); opacity: 1; }
  23.333%     { transform: translate3d(8.8em, .22em, 0) perspective(34em) rotateY(-19deg) scale(.89); opacity: 1; animation-timing-function: cubic-bezier(.37, 0, .63, 1); }
  33.333%     { transform: translate3d(17.6em, .37em, 0) perspective(34em) rotateY(-32deg) scale(.82); opacity: 1; }
  40%         { transform: translate3d(17.6em, .37em, 0) perspective(34em) rotateY(-32deg) scale(.82); opacity: 1; animation-timing-function: cubic-bezier(.37, 0, .63, 1); }
  49.99%      { transform: translate3d(26.8em, .37em, 0) perspective(34em) rotateY(-32deg) scale(.82); opacity: 0; animation-timing-function: step-end; }
  50%, 56.667% { transform: translate3d(-26.8em, .37em, 0) perspective(34em) rotateY(32deg) scale(.82); opacity: 0; animation-timing-function: cubic-bezier(.37, 0, .63, 1); }
  66.667%     { transform: translate3d(-17.6em, .37em, 0) perspective(34em) rotateY(32deg) scale(.82); opacity: 1; }
  73.333%     { transform: translate3d(-17.6em, .37em, 0) perspective(34em) rotateY(32deg) scale(.82); opacity: 1; animation-timing-function: cubic-bezier(.37, 0, .63, 1); }
  83.333%     { transform: translate3d(-8.8em, .22em, 0) perspective(34em) rotateY(19deg) scale(.89); opacity: 1; }
  90%         { transform: translate3d(-8.8em, .22em, 0) perspective(34em) rotateY(19deg) scale(.89); opacity: 1; animation-timing-function: cubic-bezier(.37, 0, .63, 1); }
  100%        { transform: translate3d(0, 0, 0) perspective(34em) rotateY(0deg) scale(1); opacity: 1; }
}
/* Stacking order. A small script keeps it in step with the motion, so the
   animation itself only ever touches transform and opacity (GPU-only). */
.card:nth-child(1) { z-index: 3; }
.card:nth-child(2), .card:nth-child(6) { z-index: 2; }
.card:nth-child(3), .card:nth-child(5) { z-index: 1; }
.carousel.is-paused .card { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .card { animation-play-state: paused; }
  html { scroll-behavior: auto; }
}

.motion-btn {
  display: grid; place-items: center; width: 44px; height: 44px; margin: 0 max(12px, env(safe-area-inset-right)) 0 auto;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; opacity: .7;
}
.motion-btn:hover { opacity: 1; background: var(--surface-2); }
.motion-btn .motion-play, .motion-btn[aria-pressed="true"] .motion-pause { display: none; }
.motion-btn[aria-pressed="true"] .motion-play { display: block; }
@media (prefers-reduced-motion: reduce) { .motion-btn { display: none; } }

/* ── Sections ── */
.section { padding: 72px 0; }
.section p { color: var(--muted); }
.section .h2 + p, .section .eyebrow + .h2 + p { margin-top: 18px; }

.steps { display: grid; gap: 14px; margin-top: 36px; }
.steps li { background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; padding: 24px; }
.num {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-btn); color: var(--on-accent); font-weight: 700; font-size: .95rem; margin-bottom: 16px;
}
.steps h3 { margin-bottom: 8px; }

.features { padding-top: 8px; overflow: hidden; overflow: clip; }
.feature { display: grid; gap: 32px; padding: 44px 0; }
.feature-copy { max-width: 30em; }

/* iPhone frame: titanium edge, black bezel, Dynamic Island, side buttons.
   Everything is sized in em from the phone's width, so it scales as one piece. */
.phone {
  --pw: min(72vw, 300px);
  position: relative; width: var(--pw); margin-inline: auto;
  font-size: calc(var(--pw) / 30);
  padding: .2em; border-radius: 5em;
  background: linear-gradient(135deg, #8E8A84 0%, #3A3836 18%, #1B1A19 42%, #2B2927 62%, #77736D 100%);
  box-shadow: var(--phone-shadow);
}
.phone picture {
  display: block; position: relative; padding: .95em; border-radius: 4.8em;
  background: #050505; box-shadow: inset 0 0 0 .07em rgba(255, 255, 255, .09);
}
.phone picture::after {           /* Dynamic Island */
  content: ""; position: absolute; left: 50%; top: 1.75em; width: 8.6em; height: 2.5em;
  margin-left: -4.3em; border-radius: 1.25em; background: #000;
}
.phone::after {                   /* volume buttons (left) and side button (right) */
  content: ""; position: absolute; left: -.16em; top: 10.5em; width: .2em; height: 3.1em;
  border-radius: .1em 0 0 .1em; background: #55524E;
  box-shadow: 0 4.1em 0 #55524E, calc(var(--pw) + .12em) 1.6em 0 #55524E, calc(var(--pw) + .12em) 3em 0 #55524E;
}
.phone::before {
  content: ""; position: absolute; inset: -14% -32%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 26%, transparent), transparent);
}
.feature { isolation: isolate; }
.phone img { border-radius: 3.85em; width: 100%; height: auto; background: #000; }
.feature .phone { margin-bottom: 8px; }

.facts { background: var(--surface); border-block: 1px solid var(--hairline); }
.big { font-size: clamp(1.15rem, 3.6vw, 1.4rem); line-height: 1.5; }
.facts .h2 { font-size: clamp(2.1rem, 7.4vw, 3.6rem); }

.segmented {
  display: inline-grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin-top: 28px; padding: 4px;
  background: var(--surface-2); border-radius: 14px;
}
.segmented button {
  min-height: 44px; min-width: 76px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent;
  font-weight: 600; font-size: .95rem; cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--accent-btn); color: var(--on-accent); }

/* The appearance band always wears the opposite theme, so both modes are on screen at once. */
.appearance {
  --bg: #000000; --surface-2: #1E1E1E; --text: #F5F2EC; --muted: #A9A49C; --hairline: #2C2C2C;
  --accent-text: #F08A45; --accent-btn: #E06C1F; --on-accent: #1A0D04;
  background: var(--bg); color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .appearance {
    --bg: #F7F2EA; --surface-2: #EFE7DA; --text: #2A211A; --muted: #6B5D4F; --hairline: #E6DFD4;
    --accent-text: #B14C12; --accent-btn: #B85016; --on-accent: #FFFFFF;
  }
}
:root[data-theme="dark"] .appearance {
  --bg: #F7F2EA; --surface-2: #EFE7DA; --text: #2A211A; --muted: #6B5D4F; --hairline: #E6DFD4;
  --accent-text: #B14C12; --accent-btn: #B85016; --on-accent: #FFFFFF;
}
.appearance .h2 { font-size: clamp(2.1rem, 7.4vw, 3.6rem); }
.appearance p { max-width: 30em; margin-inline: auto; }

/* ── Creators form ── */
.creators { background: var(--surface); border-top: 1px solid var(--hairline); }
.creators-grid { display: grid; gap: 32px; }
.form-card { background: var(--bg); border: 1px solid var(--hairline); border-radius: 24px; padding: 24px 20px; }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
label, legend { font-weight: 600; font-size: .95rem; color: var(--text); }
legend { padding: 0; font-size: 1rem; }
.hint { font-size: .88rem; margin: 4px 0 16px; }
.group { margin: 26px 0 4px; }
input[type="text"], input[type="email"] {
  width: 100%; height: 50px; padding: 0 14px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1px solid var(--field-border); border-radius: 12px;
  appearance: none; -webkit-appearance: none;
}
input::placeholder { color: var(--muted); opacity: .75; }
input:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 1px; border-radius: 12px; }
input[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.section .error { color: var(--error); font-size: .9rem; font-weight: 500; }
#e-socials { margin: -6px 0 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; margin-top: 8px;
  padding: 0 28px; border: 0; border-radius: 14px; background: var(--accent-btn); color: var(--on-accent);
  font-weight: 700; font-size: 1.05rem; cursor: pointer; transition: transform .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: default; }
.consent { font-size: .84rem; line-height: 1.45; margin-top: 14px; }
.consent a { color: var(--text); text-underline-offset: 3px; }
.form-error { margin-top: 12px; }
.thanks { text-align: center; padding: 36px 8px; color: var(--text); }
.thanks svg { margin: 0 auto 16px; color: var(--accent-text); }
.thanks h3 { margin-bottom: 8px; }
.thanks:focus { outline: none; }

/* ── Closing + footer ── */
.closing-icon { margin: 0 auto 22px; border-radius: 15px; }
.closing .wrap { display: grid; justify-items: center; }
.closing .badge { margin-top: 30px; }
.closing .fineprint { max-width: 34em; font-size: .8rem; margin-top: 18px; }

.site-footer { border-top: 1px solid var(--hairline); padding: 36px 0 calc(44px + env(safe-area-inset-bottom)); font-size: .9rem; color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 12px; margin-left: -4px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--text); font-weight: 500; text-underline-offset: 4px; }
.legal { font-size: .8rem; line-height: 1.5; margin-top: 12px; max-width: 70ch; }

/* ── Legal / support pages ── */
.doc { padding: 40px 0 80px; }
.doc h1 { font-size: clamp(2.1rem, 8vw, 3.2rem); margin-bottom: 24px; }
.doc h2 { font: 600 1.4rem/1.2 var(--serif); margin: 36px 0 10px; }
.doc p, .doc li { color: var(--muted); margin-bottom: 14px; }
.doc a { color: var(--text); text-underline-offset: 3px; overflow-wrap: anywhere; }
.doc ul { margin: 0 0 14px; padding-left: 1.3em; }
.doc li { margin-bottom: 8px; }
.doc h1 + p { font-size: .95rem; }
.site-footer a { color: var(--text); text-underline-offset: 3px; }
.site-footer p > a { display: inline-flex; align-items: center; min-height: 44px; }
/* ── Tablet ── */
@media (min-width: 640px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .form-card { padding: 32px; }
  .section { padding: 96px 0; }
}

/* ── Desktop: its own composition ── */
@media (min-width: 900px) {
  body { font-size: 18px; }
  .hero { padding: 36px 0 24px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 24px; }
  h1 { font-size: clamp(3rem, 4.5vw, 3.75rem); }
  .hero .badge { margin-top: 36px; }
  .hero-visual { margin-inline: 0; }
  .carousel { --cw: clamp(190px, 17.5vw, 228px); height: calc(var(--cw) * 2.3); }
  .carousel::before, .carousel::after { width: 12%; }
  .motion-btn { margin-right: 4px; }
  .lede { font-size: 1.25rem; }
  .badge img { width: 204px; height: 68px; }

  .feature { grid-template-columns: 1fr 1fr; align-items: center; gap: 64px; padding: 64px 0; }
  .feature .phone { --pw: 300px; margin-bottom: 0; }
  .feature.flip .feature-copy { order: 2; }
  .feature-copy { justify-self: center; }

  .creators-grid { grid-template-columns: 5fr 6fr; gap: 72px; align-items: start; }
  .creators-copy { position: sticky; top: 40px; }
  .section { padding: 120px 0; }
  .features { padding-top: 24px; }
}
/* ── Large desktop: scale the whole composition up instead of leaving empty margins ── */
@media (min-width: 1600px) {
  body { font-size: 19px; }
  .wrap { max-width: 1480px; }
  .narrow { max-width: 820px; }
  h1 { font-size: 4.6rem; }
  .carousel { --cw: 272px; }
  .badge img { width: 228px; height: 76px; }
  .feature .phone { --pw: 330px; }
}
@media (max-width: 350px) {
  .wrap { padding-inline: 16px; }
  .nav-link { padding: 0 8px; font-size: .9rem; }
  .segmented button { min-width: 0; padding: 0 12px; }
}
