/*
Theme Name: Ancel
Theme URI: https://ancelhealth.com
Author: Wonderboy Creative
Description: Marketing theme for Ancel — the adaptive nutrition tracker. Modular, swappable sections built for A/B testing. Brand-matched to the app (Plus Jakarta Sans, pink→violet gradient).
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ancel
*/

/* ============================================================= Fonts */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('assets/fonts/PlusJakartaSans-variable.woff2') format('woff2');
}

/* ============================================================= Tokens */
:root {
  --bg: #f7f6f9;
  --surface: #ffffff;
  --surface-2: #fbfafc;
  --border: #eceaf0;
  --text: #15131a;
  --dim: #5c5766;
  --faint: #9a94a6;
  --track: #f0eef4;
  --violet: #8b5cf6;
  --pink: #ff4d8d;
  --fat: #c057bd;
  --good: #1fb56b;
  --grad: linear-gradient(135deg, #ff4d8d, #8b5cf6);
  --grad-soft: linear-gradient(135deg, rgba(255,77,141,.12), rgba(139,92,246,.12));
  --shadow-sm: 0 2px 8px rgba(21,19,26,.04), 0 1px 2px rgba(21,19,26,.06);
  --shadow-md: 0 18px 40px -18px rgba(21,19,26,.18);
  --shadow-lg: 0 40px 80px -24px rgba(99,42,160,.32);
  --radius: 22px;
  --maxw: 1140px;
  --pad: 24px;
}

/* ============================================================= Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.08; letter-spacing: -0.02em; font-weight: 800; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid rgba(139,92,246,.5); outline-offset: 3px; border-radius: 6px; }

/* ============================================================= Layout */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.sec { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.sec-tight { padding: clamp(40px, 6vw, 72px) 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--violet);
  background: var(--grad-soft);
  padding: 7px 14px; border-radius: 999px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grad); }
.gtext {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.lead { color: var(--dim); font-size: clamp(17px, 2vw, 20px); line-height: 1.55; font-weight: 500; }
h2.sec-title { font-size: clamp(30px, 4.6vw, 46px); }
.sec-intro { max-width: 640px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ============================================================= Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 800; font-size: 16px; padding: 15px 26px; border-radius: 16px;
  border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 12px 26px -8px rgba(190,70,160,.5); }
.btn-grad:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -10px rgba(190,70,160,.6); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { transform: translateY(-2px); border-color: #ddd8e4; }
.btn-lg { padding: 17px 32px; font-size: 17px; }
.btn svg { width: 19px; height: 19px; }

/* ============================================================= Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  transition: background .25s ease, box-shadow .25s ease, backdrop-filter .25s ease;
}
.site-header.scrolled {
  background: rgba(247,246,249,.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.brand .mark svg { width: 19px; height: 19px; color: #fff; }
.brand .word { width: 96px; color: var(--text); }
.brand .word svg { width: 100%; height: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-weight: 700; font-size: 15.5px; color: var(--dim); transition: color .15s ease; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; }

/* ============================================================= Hero */
.hero { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(40px, 6vw, 64px); overflow: hidden; }
.hero-inner { text-align: center; max-width: 820px; margin: 0 auto; }
.hero h1 { font-size: clamp(40px, 6.6vw, 74px); letter-spacing: -0.035em; }
.hero .lead { margin: 22px auto 0; max-width: 600px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.hero-trust { margin-top: 20px; color: var(--faint); font-size: 14px; font-weight: 600; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.hero-trust span { display: inline-flex; align-items: center; gap: 7px; }
.hero-trust svg { width: 15px; height: 15px; color: var(--good); }

/* device row */
.devices {
  margin-top: clamp(40px, 6vw, 64px);
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(-40px, -3vw, 0px); position: relative;
}
.devices::before {
  content: ''; position: absolute; inset: -8% -10% 14%; z-index: 0;
  background: radial-gradient(60% 60% at 50% 40%, rgba(139,92,246,.22), rgba(255,77,141,.10) 55%, transparent 72%);
  filter: blur(8px);
}
.phone {
  position: relative; z-index: 1;
  width: clamp(180px, 24vw, 248px);
  border-radius: 42px; padding: 9px;
  background: linear-gradient(160deg, #2a2730, #15131a);
  box-shadow: var(--shadow-lg);
}
.phone img { border-radius: 33px; display: block; width: 100%; background: var(--bg); }
.phone.center { z-index: 2; width: clamp(208px, 28vw, 286px); margin: 0 clamp(-22px, -2.4vw, -14px); }
.phone.side { transform: translateY(26px) scale(.96); opacity: .98; }
.phone.side.left { transform: translateY(26px) rotate(-4deg) scale(.96); }
.phone.side.right { transform: translateY(26px) rotate(4deg) scale(.96); }

/* ============================================================= Feature blocks */
.feature { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(36px, 6vw, 80px); align-items: center; }
.feature.reverse .feature-media { order: 2; }
.feature + .feature { margin-top: clamp(72px, 10vw, 128px); }
.feature h2 { font-size: clamp(28px, 3.8vw, 40px); margin-top: 18px; }
.feature .lead { margin-top: 18px; }
.feature-media { display: flex; justify-content: center; position: relative; }
.feature-media .phone { width: clamp(220px, 30vw, 288px); }
.feature-media::after {
  content: ''; position: absolute; inset: 8% 12%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(139,92,246,.18), transparent);
  filter: blur(10px);
}
.flist { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.flist li { display: flex; gap: 13px; align-items: flex-start; font-weight: 600; color: var(--text); }
.flist .ic { flex: none; width: 28px; height: 28px; border-radius: 9px; background: var(--grad-soft); display: grid; place-items: center; margin-top: 1px; }
.flist .ic svg { width: 16px; height: 16px; color: var(--violet); }
.flist b { font-weight: 800; }
.flist span { color: var(--dim); font-weight: 500; }
.pill-note { display: inline-flex; gap: 9px; align-items: center; margin-top: 26px; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); font-size: 14.5px; font-weight: 600; color: var(--dim); }
.pill-note b { color: var(--text); }

/* ============================================================= How it works */
.how { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 52px; counter-reset: step; }
.step { position: relative; padding: 26px 22px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.step .num { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); color: #fff; font-weight: 800; font-size: 18px; display: grid; place-items: center; box-shadow: 0 8px 18px -6px rgba(190,70,160,.45); }
.step h3 { font-size: 18.5px; margin-top: 18px; }
.step p { margin-top: 9px; color: var(--dim); font-size: 15px; font-weight: 500; }
.step .connector { display: none; }

/* ============================================================= Pricing */
.price-card {
  max-width: 460px; margin: 48px auto 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 28px; padding: 38px 34px; box-shadow: var(--shadow-md); text-align: center; position: relative; overflow: hidden;
}
.price-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--grad); }
.price-badge { display: inline-block; font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--violet); background: var(--grad-soft); padding: 6px 13px; border-radius: 999px; }
.price-amount { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 20px 0 4px; }
.price-amount .amt { font-size: clamp(46px, 8vw, 60px); font-weight: 800; letter-spacing: -0.03em; }
.price-amount .per { color: var(--faint); font-weight: 700; font-size: 18px; }
.price-note { color: var(--dim); font-weight: 500; font-size: 15px; }
.price-feats { list-style: none; margin: 26px 0; padding: 0; display: grid; gap: 13px; text-align: left; }
.price-feats li { display: flex; gap: 11px; align-items: flex-start; font-weight: 600; font-size: 15.5px; }
.price-feats svg { flex: none; width: 20px; height: 20px; color: var(--good); margin-top: 1px; }
.price-card .btn { width: 100%; }

/* ============================================================= CTA band */
.cta-band { }
.cta-box {
  background: var(--grad); border-radius: 32px; padding: clamp(40px, 6vw, 72px) clamp(28px, 5vw, 64px);
  text-align: center; color: #fff; box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.cta-box::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 120% at 80% -20%, rgba(255,255,255,.22), transparent 50%); }
.cta-box > * { position: relative; z-index: 1; }
.cta-box h2 { font-size: clamp(28px, 4.4vw, 46px); color: #fff; }
.cta-box p { margin: 16px auto 0; max-width: 520px; color: rgba(255,255,255,.92); font-weight: 500; font-size: 18px; }
.cta-box .btn { margin-top: 30px; background: #fff; color: var(--text); }
.cta-box .btn:hover { transform: translateY(-2px); }

/* ============================================================= Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 64px 0 36px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.foot-brand .word { width: 108px; color: var(--text); display: block; }
.foot-brand p { margin-top: 16px; color: var(--dim); font-weight: 500; font-size: 15px; max-width: 320px; }
.foot-col h4 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 800; margin-bottom: 16px; }
.foot-col a { display: block; color: var(--dim); font-weight: 600; font-size: 15.5px; padding: 6px 0; transition: color .15s; }
.foot-col a:hover { color: var(--text); }
.foot-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--faint); font-size: 14px; font-weight: 600; }

/* ============================================================= Content pages (privacy, blog) */
.page-hero { padding: clamp(48px, 7vw, 88px) 0 0; }
.page-hero h1 { font-size: clamp(32px, 5vw, 52px); }
.page-hero .updated { margin-top: 14px; color: var(--faint); font-weight: 600; font-size: 14.5px; }
.prose { max-width: 760px; margin: 0 auto; }
.prose-wrap { padding: 40px 0 clamp(64px, 9vw, 110px); }
.prose h2 { font-size: clamp(22px, 3vw, 30px); margin: 44px 0 14px; }
.prose h3 { font-size: 19px; margin: 28px 0 10px; }
.prose p { margin: 0 0 16px; color: #2c2935; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; color: #2c2935; }
.prose li { margin: 0 0 9px; }
.prose a { color: var(--violet); font-weight: 700; }
.prose a:hover { text-decoration: underline; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 11px 14px; border: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 800; }
.prose strong { font-weight: 800; }
.callout { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--violet); border-radius: 14px; padding: 18px 20px; margin: 0 0 22px; box-shadow: var(--shadow-sm); }
.callout p { margin: 0; }

/* ============================================================= Blog */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 40px; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.post-card .thumb { aspect-ratio: 16/9; background: var(--grad-soft); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card .cat { font-size: 12.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--violet); }
.post-card h3 { font-size: 19px; }
.post-card .excerpt { color: var(--dim); font-size: 15px; font-weight: 500; }
.post-card .meta { margin-top: auto; color: var(--faint); font-size: 13.5px; font-weight: 600; }
.post-single { max-width: 740px; margin: 0 auto; }
.post-single .post-thumb { border-radius: var(--radius); overflow: hidden; margin: 28px 0; border: 1px solid var(--border); }
.empty-note { text-align: center; color: var(--dim); padding: 60px 0; font-weight: 600; }
.pager { display: flex; justify-content: center; gap: 12px; margin-top: 44px; }
.pager a, .pager span { padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: 15px; }

/* ============================================================= Reveal animation */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ============================================================= Responsive */
@media (max-width: 900px) {
  .feature, .feature.reverse .feature-media { grid-template-columns: 1fr; order: 0; }
  .feature-media { order: -1 !important; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .nav-links, .nav-cta .btn-ghost { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-links.open { display: flex; position: absolute; top: 76px; left: 0; right: 0; flex-direction: column; gap: 6px; background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px var(--pad) 20px; box-shadow: var(--shadow-md); }
  .nav-links.open a { padding: 10px 4px; font-size: 17px; }
  .devices { gap: 0; }
  .phone.side { display: none; }
  .phone.center { width: min(72vw, 300px); margin: 0; }
  .post-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
}

/* Mobile nav toggle button */
.nav-toggle { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); align-items: center; justify-content: center; color: var(--text); }
.nav-toggle svg { width: 22px; height: 22px; }
