/* SweetTreatz — main stylesheet */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(/assets/fonts/fraunces-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/dmsans-latin.woff2) format('woff2');
}

:root {
  --bg: #FFF6EC;
  --surface: #FFFFFF;
  --surface-2: #FFEEDC;
  --ink: #2E1A16;
  --ink-2: #6E544C;
  --line: #F0DCCB;
  --brand: #D2386A;
  --brand-hover: #B32656;
  --brand-ink: #FFFFFF;
  --brand-soft: #FFE1EA;
  --good: #2D8A57;
  --warn: #B4532A;
  --shadow: 0 1px 2px rgba(46, 26, 22, .06), 0 8px 24px -8px rgba(46, 26, 22, .14);
  --radius: 22px;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --f-berry: linear-gradient(140deg, #FFE5ED, #FFC9D8);
  --f-pistachio: linear-gradient(140deg, #EEF9E6, #D3EEC2);
  --f-mango: linear-gradient(140deg, #FFF2DB, #FFDCA2);
  --f-blue: linear-gradient(140deg, #E5F6FE, #C2E9FB);
  --f-choc: linear-gradient(140deg, #F6E8DE, #E4C8B4);
  --f-vanilla: linear-gradient(140deg, #FFF9EA, #FFEBC0);
  --f-lime: linear-gradient(140deg, #EEFBE6, #D2F3BF);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1B1311;
    --surface: #261B18;
    --surface-2: #2F221E;
    --ink: #FBEFE6;
    --ink-2: #CFB9AC;
    --line: #443029;
    --brand: #FF7DA2;
    --brand-hover: #FF9DB8;
    --brand-ink: #2A1014;
    --brand-soft: #4A2230;
    --good: #7FD6A4;
    --warn: #FFB08A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -10px rgba(0, 0, 0, .6);

    --f-berry: linear-gradient(140deg, #4B2632, #5E2E3F);
    --f-pistachio: linear-gradient(140deg, #2D3D27, #37502F);
    --f-mango: linear-gradient(140deg, #4A3720, #5C4423);
    --f-blue: linear-gradient(140deg, #1F3A4A, #24485C);
    --f-choc: linear-gradient(140deg, #3D2A20, #4D3427);
    --f-vanilla: linear-gradient(140deg, #4A4030, #5A4D36);
    --f-lime: linear-gradient(140deg, #2A4223, #33542A);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Top bar & header ---------- */
.topbar { background: var(--ink); color: var(--bg); font-size: .8rem; padding: 7px 0; text-align: center; }
.topbar a { color: inherit; font-weight: 600; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 12px 28px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font: 800 1.55rem/1 var(--display); letter-spacing: -.02em; }
.logo:hover { color: var(--ink); }
.logo svg { width: 34px; height: 34px; }
.logo em { font-style: italic; color: var(--brand); }

.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; padding: 8px 13px; border-radius: 999px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
@media (max-width: 899px) {
  .nav { margin: 0 -16px; padding: 0 16px 2px; width: calc(100% + 32px); }
}

.crumbs { font-size: .85rem; color: var(--ink-2); padding-top: 18px; }
.crumbs a { color: var(--ink-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 .98rem/1 var(--body); text-decoration: none;
  padding: 14px 20px; border-radius: 999px; border: 2px solid transparent;
  transition: background .15s, transform .15s, color .15s;
  min-height: 48px;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 15px; height: 15px; }
.btn-primary, .btn-amazon { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover, .btn-amazon:hover { background: var(--brand-hover); color: var(--brand-ink); }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 40px; }
.hero-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } .hero { padding: 72px 0 56px; } }
.hero h1 em { font-style: italic; color: var(--brand); }
.lede { font-size: 1.18rem; color: var(--ink-2); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-art { position: relative; aspect-ratio: 1 / .82; max-width: 520px; width: 100%; margin: 0 auto; }
.hero-art .blob { position: absolute; border-radius: 32px; box-shadow: var(--shadow); display: grid; place-items: center; }
.hero-art .blob svg { width: 92%; }
.hero-art .b1 { inset: 0 34% 30% 0; background: var(--f-berry); transform: rotate(-4deg); }
.hero-art .b2 { inset: 8% 0 34% 52%; background: var(--f-blue); transform: rotate(5deg); }
.hero-art .b3 { inset: 52% 18% 0 22%; background: var(--f-vanilla); transform: rotate(-1deg); }
.trust { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 26px; padding: 0; list-style: none; font-size: .92rem; color: var(--ink-2); }
.trust li::before { content: "✓"; color: var(--good); font-weight: 700; margin-right: 6px; }

.page-hero { padding: 28px 0 8px; }
.page-hero .lede { margin-bottom: 18px; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.jump a { display: inline-block; text-decoration: none; font-weight: 600; font-size: .92rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; }
.jump a:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Sections ---------- */
.section { padding: 44px 0; }
.section-alt { background: var(--surface-2); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px; margin-bottom: 24px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--ink-2); max-width: 38em; }
.kicker { display: inline-block; font: 700 .78rem/1 var(--body); text-transform: uppercase; letter-spacing: .12em; color: var(--brand); margin-bottom: 10px; }

.aff-note { font-size: .86rem; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; margin: 0 0 22px; }

/* ---------- Category tiles ---------- */
.cats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.cat { position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s; }
.cat:hover { transform: translateY(-3px); color: var(--ink); }
.cat .art-panel { aspect-ratio: 16 / 10; }
.cat-body { padding: 16px 18px 20px; }
.cat-body h3 { margin-bottom: 4px; }
.cat-body p { margin: 0; color: var(--ink-2); font-size: .95rem; }

/* ---------- Product cards ---------- */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.art-panel { position: relative; display: grid; place-items: center; aspect-ratio: 200 / 128; }
.art-panel .art { width: 78%; height: auto; display: block; }
.flav-berry { background: var(--f-berry); }
.flav-pistachio { background: var(--f-pistachio); }
.flav-mango { background: var(--f-mango); }
.flav-blue { background: var(--f-blue); }
.flav-choc { background: var(--f-choc); }
.flav-vanilla { background: var(--f-vanilla); }
.flav-lime { background: var(--f-lime); }
.badge { position: absolute; top: 14px; left: 14px; background: var(--ink); color: var(--bg); font: 700 .76rem/1 var(--body); letter-spacing: .02em; padding: 7px 11px; border-radius: 999px; z-index: 1; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin-bottom: 8px; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 6px; }
.best-for { font-size: .95rem; background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.specs { list-style: none; padding: 0; margin: 0 0 16px; font-size: .94rem; }
.specs li { position: relative; padding-left: 22px; margin-bottom: 6px; }
.specs li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.proscons { display: grid; gap: 12px; margin-bottom: 18px; font-size: .92rem; }
.proscons h4 { font: 700 .8rem/1 var(--body); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 8px; }
.proscons ul { list-style: none; padding: 0; margin: 0; }
.proscons li { position: relative; padding-left: 22px; margin-bottom: 4px; }
.pros li::before { content: "+"; position: absolute; left: 2px; font-weight: 800; color: var(--good); }
.cons li::before { content: "–"; position: absolute; left: 2px; font-weight: 800; color: var(--warn); }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.card-foot .btn { flex: 1 1 auto; }
.tier { font: 800 1.05rem/1 var(--display); letter-spacing: .06em; }
.tier span { color: var(--line); }
.tier span.on { color: var(--ink); }

.compact .card-body { padding-bottom: 18px; }
.compact .best-for { margin-bottom: 14px; }

/* ---------- Chooser ---------- */
.chooser { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.choice { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; transition: border-color .15s, transform .15s; }
.choice:hover { border-color: var(--ink); transform: translateY(-2px); color: var(--ink); }
.choice .ico { flex: 0 0 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; }
.choice .ico svg { width: 100%; }
.choice strong { display: block; font-family: var(--display); font-size: 1.12rem; margin-bottom: 2px; }
.choice span { font-size: .93rem; color: var(--ink-2); }
.choice em { font-style: normal; color: var(--brand); font-weight: 700; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: .94rem; }
th, td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { background: var(--surface-2); font-family: var(--display); font-size: 1rem; }
tbody th { font-weight: 700; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
td a { font-weight: 700; white-space: nowrap; }
.yes { color: var(--good); font-weight: 700; }
.no { color: var(--ink-2); }

/* ---------- Explore tiles ---------- */
.explore { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.tile { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px 10px 10px; transition: border-color .15s; }
.tile:hover { border-color: var(--ink); color: var(--ink); }
.tile-art { flex: 0 0 64px; height: 64px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; }
.tile-art svg { width: 100%; }
.tile-text { flex: 1; line-height: 1.3; }
.tile-text strong { display: block; font-size: .98rem; }
.tile-text span { font-size: .86rem; color: var(--ink-2); }
.tile-go { font-weight: 700; color: var(--brand); }

/* ---------- Prose / guides ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.split { display: grid; gap: 28px; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 40px; } }
.callout { background: var(--brand-soft); border-radius: 18px; padding: 20px 22px; margin: 24px 0; }
.callout h3 { margin-top: 0; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 0; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 800 1rem/1 var(--display); margin-bottom: 10px; }
.steps strong { display: block; font-family: var(--display); font-size: 1.08rem; margin-bottom: 4px; }
.steps p { margin: 0; font-size: .94rem; color: var(--ink-2); }

.verdict { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 24px 0; }
.verdict > div { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.verdict h3 { margin-top: 0; }
.verdict p:last-child { margin-bottom: 0; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0 20px; }
.faq summary { cursor: pointer; list-style: none; font-weight: 700; padding: 16px 28px 16px 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 12px; font: 700 1.5rem/1 var(--display); color: var(--brand); }
.faq details[open] summary::after { content: "–"; }
.faq-a { padding: 0 0 16px; color: var(--ink-2); }
.faq-a p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 56px; background: var(--ink); color: color-mix(in srgb, var(--bg) 82%, transparent); padding: 44px 0 28px; font-size: .92rem; }
.site-footer a { color: var(--bg); }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-grid > div:first-child { grid-column: span 1; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h2 { font: 700 .8rem/1 var(--body); text-transform: uppercase; letter-spacing: .1em; color: var(--bg); margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.logo-footer { color: var(--bg); margin-bottom: 12px; }
.logo-footer:hover { color: var(--bg); }
.legal { margin-top: 32px; padding-top: 22px; border-top: 1px solid color-mix(in srgb, var(--bg) 18%, transparent); font-size: .82rem; }
.legal strong { color: var(--bg); }

@media (prefers-color-scheme: dark) {
  .site-footer { background: #120C0B; }
  .site-footer, .site-footer a, .site-footer h2, .logo-footer, .legal strong { color: var(--ink); }
  .site-footer { color: var(--ink-2); }
  .topbar { background: #120C0B; color: var(--ink-2); }
  .topbar a { color: var(--ink); }
}

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 64px 0; }
.notfound .art { width: 220px; margin: 0 auto 16px; display: block; }
.more { font-size: .9rem; font-weight: 600; margin: 0 0 4px; }
.more a { text-decoration: none; }
.more a:hover { text-decoration: underline; }
.grid-compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.grid-compact .card-foot .btn { flex-basis: 100%; }
.btn { white-space: nowrap; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
@media (min-width: 900px) {
  .grid-2 .art-panel { aspect-ratio: 16 / 7; }
  .grid-2 .art-panel .art { width: 42%; }
  .grid-2 .proscons { grid-template-columns: 1fr 1fr; gap: 20px; }
  .grid-2 .card-foot .btn { flex: 0 1 auto; }
}
