/* ==========================================================================
   Jellyspot — jellyspot.com
   Design tokens, layout, components. No dependencies, no build step.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Brand — sampled from the app icon and Assets.xcassets */
  --mark:         #F74F21; /* icon background, graphics only            */
  --brand:        #C54716; /* JSinopia — passes AA on paper for text    */
  --brand-strong: #A33215; /* JRufous  — accent (light)                 */
  --brand-bright: #E75C16; /* JPersimmon — large text and graphics      */
  --brand-soft:   #FCEFE8;
  --btn-fill:       #C54716;
  --btn-fill-hover: #A33215;
  --mint:         #0E8F63;
  --mint-soft:    #E4F7EF;

  /* Surfaces and ink */
  --paper:   #FBF8F6;
  --surface: #FFFFFF;
  --sunken:  #F3EDE8;
  --ink:     #1B1513;
  --ink-2:   #5B514C;
  --ink-3:   #7A6F69;
  --line:    rgba(27, 21, 19, 0.12);
  --line-2:  rgba(27, 21, 19, 0.07);

  --shadow-sm: 0 1px 2px rgba(27, 21, 19, .06), 0 4px 12px rgba(27, 21, 19, .05);
  --shadow-lg: 0 2px 6px rgba(27, 21, 19, .07), 0 24px 60px rgba(27, 21, 19, .13);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;

  /* Rhythm */
  --wrap: 1140px;
  --gutter: clamp(20px, 5vw, 40px);
  --section: clamp(72px, 11vw, 132px);
  --radius: 20px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand:        #FF8A52;
    --brand-strong: #FFA274;
    --brand-bright: #FF7A3D;
    --brand-soft:   rgba(247, 79, 33, .15);
    --btn-fill:       #C54716;
    --btn-fill-hover: #E1521C;
    --mint:         #4BD6A4;
    --mint-soft:    rgba(75, 214, 164, .14);

    --paper:   #131110;
    --surface: #1D1A18;
    --sunken:  #262220;
    --ink:     #F6F1ED;
    --ink-2:   #A99F98;
    --ink-3:   #8E837C;
    --line:    rgba(255, 255, 255, .14);
    --line-2:  rgba(255, 255, 255, .08);

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.3);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.4), 0 24px 60px rgba(0,0,0,.5);
  }
}

:root[data-theme="dark"] {
  --brand:        #FF8A52;
  --brand-strong: #FFA274;
  --brand-bright: #FF7A3D;
  --brand-soft:   rgba(247, 79, 33, .15);
  --btn-fill:       #C54716;
  --btn-fill-hover: #E1521C;
  --mint:         #4BD6A4;
  --mint-soft:    rgba(75, 214, 164, .14);

  --paper:   #131110;
  --surface: #1D1A18;
  --sunken:  #262220;
  --ink:     #F6F1ED;
  --ink-2:   #A99F98;
  --ink-3:   #8E837C;
  --line:    rgba(255, 255, 255, .14);
  --line-2:  rgba(255, 255, 255, .08);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.3);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.4), 0 24px 60px rgba(0,0,0,.5);
}

/* --- Base --------------------------------------------------------------- */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

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

h1, h2, h3, h4 { margin: 0; line-height: 1.08; letter-spacing: -0.03em; font-weight: 700; }
h1 { font-size: clamp(2.6rem, 6.6vw, 4.4rem); letter-spacing: -0.042em; }
h2 { font-size: clamp(2rem, 4.4vw, 3rem); letter-spacing: -0.035em; }
h3 { font-size: clamp(1.32rem, 2.3vw, 1.6rem); letter-spacing: -0.025em; }
h4 { font-size: 1.06rem; letter-spacing: -0.018em; }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand); text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

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

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

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

.lede { font-size: clamp(1.1rem, 2.1vw, 1.32rem); line-height: 1.55; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: .93rem; }

.eyebrow {
  display: inline-block;
  font-size: .78rem; font-weight: 650;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 1rem;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--surface); color: var(--ink);
  padding: 12px 18px; border-radius: 10px; z-index: 200;
}
.skip:focus { left: 16px; top: 16px; }

/* --- Header ------------------------------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line-2);
}
.nav-inner {
  display: flex; align-items: center; gap: 12px;
  min-height: 66px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 680; font-size: 1.08rem; letter-spacing: -0.028em;
  color: var(--ink); text-decoration: none; margin-right: auto;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a:not(.btn) {
  color: var(--ink-2); text-decoration: none;
  font-size: .945rem; font-weight: 520;
  padding: 8px 12px; border-radius: 9px;
}
.nav-links a:not(.btn):hover { color: var(--ink); background: var(--line-2); }
.nav-links a[aria-current="page"]:not(.btn) { color: var(--ink); font-weight: 600; }

@media (max-width: 720px) {
  .nav-links .hide-sm { display: none; }
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px; border-radius: 999px;
  font-size: 1rem; font-weight: 600; letter-spacing: -0.012em;
  text-decoration: none; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; max-width: 100%;
  transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.btn:active { transform: translateY(1px); }

/* Long labels must not push the page sideways on narrow phones. */
@media (max-width: 400px) {
  .btn { white-space: normal; text-align: center; }
}

/* The fill has its own token rather than reusing --brand: --brand lightens in
   dark mode for text legibility, which would drop white-on-fill to 2.3:1.
   #C54716 gives white 4.90:1 and still clears 3:1 against either page colour. */
.btn-primary {
  background: var(--btn-fill);
  box-shadow: 0 1px 2px rgba(27,21,19,.16), 0 8px 22px color-mix(in srgb, var(--btn-fill) 28%, transparent);
}
.btn-primary:hover { background: var(--btn-fill-hover); }
.btn.btn-primary { color: #fff; }

.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--line-2); }

.btn-sm { padding: 9px 17px; font-size: .93rem; }

.btn .glyph { width: 19px; height: 19px; flex: none; }

.cta-row {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
}
.cta-note { font-size: .9rem; color: var(--ink-3); }

/* --- Sections ----------------------------------------------------------- */

section { padding-block: var(--section); }
.section-tight { padding-block: clamp(48px, 7vw, 80px); }

.band { background: var(--surface); border-block: 1px solid var(--line-2); }

.band-dark {
  background: #17110E;
  color: #F4EDE8;
  border-block: none;
}
.band-dark h2, .band-dark h3 { color: #FFF7F2; }
.band-dark .muted, .band-dark p { color: #C3B6AE; }
.band-dark .eyebrow { color: #FF9366; }
.band-dark a { color: #FF9366; }
.band-dark .card { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.11); }
.band-dark .card h4 { color: #FFF7F2; }
.band-dark .card p { color: #C3B6AE; }

.section-head { max-width: 640px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 + p { margin-top: 1.1rem; }

/* --- Hero --------------------------------------------------------------- */

.hero {
  padding-top: clamp(56px, 8vw, 96px);
  padding-bottom: 0;
  text-align: center;
  position: relative;
}
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 620px;
  background:
    radial-gradient(60% 70% at 50% 0%, color-mix(in srgb, var(--mark) 13%, transparent) 0%, transparent 72%);
  pointer-events: none; z-index: -1;
}
.hero h1 { max-width: 15ch; margin-inline: auto; }
.hero .lede { max-width: 54ch; margin: 1.5rem auto 0; }
.hero .cta-row { justify-content: center; margin-top: 2.2rem; }

.hero-stage {
  margin-top: clamp(48px, 7vw, 80px);
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(14px, 3vw, 34px);
}
.hero-stage .phone-side { display: none; }
@media (min-width: 860px) {
  .hero-stage .phone-side { display: block; opacity: .92; }
}

/* --- Phone frame -------------------------------------------------------- */

.phone {
  --pw: 264px;
  width: var(--pw);
  flex: none;
  border-radius: calc(var(--pw) * .128);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.phone img { width: 100%; display: block; }
.phone-lg { --pw: clamp(240px, 68vw, 320px); }
.phone-side { --pw: clamp(200px, 22vw, 250px); margin-bottom: clamp(16px, 3vw, 34px); }

/* --- Feature rows ------------------------------------------------------- */

.feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(36px, 5vw, 64px);
  align-items: center;
  justify-items: center;
  text-align: center;
}
.feature + .feature { margin-top: clamp(72px, 10vw, 120px); }
.feature-copy { max-width: 34rem; }
.feature-copy h3 { margin-bottom: .8rem; }

@media (min-width: 880px) {
  .feature { grid-template-columns: 1fr 1fr; text-align: left; justify-items: start; }
  .feature .feature-media { justify-self: center; }
  .feature-reverse .feature-copy { order: 2; }
  .feature-reverse .feature-media { order: 1; }
}

.feature-list {
  list-style: none; margin: 1.4rem 0 0; padding: 0;
  display: grid; gap: .6rem;
  text-align: left;
}
.feature-list li {
  position: relative; padding-left: 28px;
  color: var(--ink-2); font-size: .985rem;
}
.feature-list li::before {
  content: ""; position: absolute; left: 4px; top: .55em;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-bright);
}

/* --- Cards -------------------------------------------------------------- */

.grid {
  display: grid; gap: clamp(16px, 2.2vw, 22px);
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
/* Four-card rows: 258px minimum only fits three across in the wrap, orphaning
   the fourth. 220px lets all four sit on one line on desktop. */
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 30px);
  box-shadow: var(--shadow-sm);
}
.card h4 { margin-bottom: .5rem; }
.card p { color: var(--ink-2); font-size: .97rem; }

.icon-badge {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 16px;
  background: var(--brand-soft); color: var(--brand);
}
.icon-badge svg { width: 22px; height: 22px; }
.icon-badge.mint { background: var(--mint-soft); color: var(--mint); }
.band-dark .icon-badge { background: rgba(255,147,102,.16); color: #FF9366; }

/* --- Pull quote --------------------------------------------------------- */

.quote {
  max-width: 24ch;
  margin-inline: auto;
  font-size: clamp(1.7rem, 4.2vw, 2.6rem);
  line-height: 1.22; letter-spacing: -0.032em; font-weight: 640;
  text-align: center; text-wrap: balance;
}
.quote em { font-style: normal; color: var(--brand-bright); }

/* --- Stats -------------------------------------------------------------- */

.stats { display: grid; gap: clamp(20px, 3vw, 34px); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); text-align: center; }
.stat-n { font-size: clamp(1.9rem, 3.6vw, 2.5rem); font-weight: 700; letter-spacing: -0.035em; color: var(--brand-bright); line-height: 1.1; }
.stat-l { color: var(--ink-2); font-size: .96rem; margin-top: .35rem; }

/* --- Prose (privacy, support) ------------------------------------------ */

.prose { max-width: 68ch; }
.prose h2 { font-size: clamp(1.5rem, 2.7vw, 1.85rem); margin-top: 2.6em; margin-bottom: .7em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.14rem; margin-top: 1.9em; margin-bottom: .5em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.35em; color: var(--ink-2); }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--brand-bright); }
.prose p { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 620; }

.page-head { padding-block: clamp(52px, 8vw, 88px) clamp(32px, 4vw, 48px); }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.page-head .lede { margin-top: 1.1rem; max-width: 60ch; }
.updated { font-size: .89rem; color: var(--ink-3); margin-top: 1rem; }

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand-bright);
  background: var(--surface);
  border-radius: 14px;
  padding: 20px 24px;
  margin: 2em 0;
}
.callout p { color: var(--ink-2); }
.callout strong { color: var(--ink); }

/* --- FAQ ---------------------------------------------------------------- */

.faq { display: grid; gap: 12px; max-width: 800px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.faq summary {
  list-style: none; cursor: pointer;
  padding: 18px 54px 18px 22px;
  font-weight: 600; letter-spacing: -0.018em;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 24px; top: 50%;
  width: 10px; height: 10px; margin-top: -6px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq summary:hover { background: var(--line-2); }
.faq .faq-body { padding: 0 22px 20px; color: var(--ink-2); }
.faq .faq-body p { font-size: .98rem; }

/* --- Download / asset list --------------------------------------------- */

.asset-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.asset {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.asset-preview {
  background: var(--sunken); padding: 20px;
  display: grid; place-items: center; min-height: 190px;
}
.asset-preview img { max-height: 240px; width: auto; border-radius: 10px; }
.asset-meta { padding: 16px 18px; border-top: 1px solid var(--line-2); }
.asset-meta h4 { font-size: .98rem; }
.asset-meta p { font-size: .85rem; color: var(--ink-3); margin: 2px 0 10px; }

.swatches { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
.swatch { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.swatch-chip { height: 74px; }
.swatch-meta { padding: 10px 13px; }
.swatch-meta b { display: block; font-size: .9rem; letter-spacing: -0.015em; }
.swatch-meta span { font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* --- Footer ------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(48px, 6vw, 68px) 40px;
  background: var(--surface);
}
.footer-top {
  display: grid; gap: 40px;
  grid-template-columns: 1fr;
  margin-bottom: 44px;
}
@media (min-width: 760px) {
  .footer-top { grid-template-columns: 1.5fr 1fr 1fr; }
}
.footer h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); margin-bottom: 14px; font-weight: 650; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer ul a { color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.footer ul a:hover { color: var(--brand); }
.footer-blurb { color: var(--ink-2); font-size: .95rem; max-width: 34ch; margin-top: 14px; }
.footer-bottom {
  border-top: 1px solid var(--line-2); padding-top: 24px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  color: var(--ink-3); font-size: .88rem;
}
