/* =========================================================
   Phill-Up — Design System
   Fraunces (display serif) + Inter (body/UI)
   Warm cream / brand blue / terracotta amber, AAA polish
   ========================================================= */

/* Inter is self-hosted (Latin subset). Fraunces still loads from Google Fonts. */
@font-face{
  font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap;
  src:url('../assets/fonts/inter-latin-400.woff') format('woff');
}
@font-face{
  font-family:'Inter'; font-style:normal; font-weight:500; font-display:swap;
  src:url('../assets/fonts/inter-latin-500.woff') format('woff');
}
@font-face{
  font-family:'Inter'; font-style:normal; font-weight:600; font-display:swap;
  src:url('../assets/fonts/inter-latin-600.woff') format('woff');
}
@font-face{
  font-family:'Inter'; font-style:normal; font-weight:700; font-display:swap;
  src:url('../assets/fonts/inter-latin-700.woff') format('woff');
}

:root{
  color-scheme: light;

  /* ---- Palette (light) ---- */
  --bg: #FBF7EE;
  --bg-alt: #F3EDDF;
  --surface: #FFFFFF;
  --surface-2: #FAF6EC;
  --ink: #1A1A14;
  --ink-soft: #55534A;
  --ink-faint: #8C897A;

  --green-900: #0F1E3A;
  --green-700: #1D3E72;
  --green-600: #2A5CC4;
  --green-500: #4576D6;
  --green-200: #C9D9F5;
  --green-100: #E6EDFB;
  --green-050: #F2F6FD;

  --amber-700: #B85E2A;
  --amber-600: #D97B3F;
  --amber-500: #E39257;
  --amber-100: #FBEADD;
  --amber-050: #FDF3E9;

  --red-600: #B34A3C;
  --red-100: #F6E3DF;

  --line: #E7E0D0;
  --line-strong: #D8CFBA;

  --shadow-color: 27 27 22;
  --shadow-sm: 0 1px 2px rgb(var(--shadow-color) / 0.06), 0 1px 1px rgb(var(--shadow-color) / 0.04);
  --shadow-md: 0 6px 20px -6px rgb(var(--shadow-color) / 0.14), 0 2px 6px -2px rgb(var(--shadow-color) / 0.08);
  --shadow-lg: 0 24px 60px -16px rgb(var(--shadow-color) / 0.22), 0 8px 20px -8px rgb(var(--shadow-color) / 0.12);
  --shadow-inset: inset 0 1px 0 rgb(255 255 255 / 0.5);

  /* ---- Type ---- */
  --font-display: 'Fraunces', ui-serif, Georgia, serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* ---- Scale ---- */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;

  --container: 1180px;
  --container-narrow: 780px;

  --ease: cubic-bezier(.22,.85,.32,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
}

@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme: dark;
    --bg: #131310;
    --bg-alt: #1B1B15;
    --surface: #1E1E17;
    --surface-2: #201F19;
    --ink: #F3EFE3;
    --ink-soft: #C6C1B1;
    --ink-faint: #8F8B7B;

    --green-900: #E8EFFC;
    --green-700: #C3D6F7;
    --green-600: #8FB3F2;
    --green-500: #6E9BE8;
    --green-200: #22334F;
    --green-100: #1C2A42;
    --green-050: #182238;

    --amber-700: #F0A468;
    --amber-600: #E6924F;
    --amber-500: #D97B3F;
    --amber-100: #3A2A1C;
    --amber-050: #2A2015;

    --red-600: #E08F7E;
    --red-100: #3A2420;

    --line: #33322A;
    --line-strong: #423F33;

    --shadow-color: 0 0 0;
  }
}
:root[data-theme="dark"]{
  color-scheme: dark;
  --bg: #131310;
  --bg-alt: #1B1B15;
  --surface: #1E1E17;
  --surface-2: #201F19;
  --ink: #F3EFE3;
  --ink-soft: #C6C1B1;
  --ink-faint: #8F8B7B;
  --green-900: #E8EFFC;
  --green-700: #C3D6F7;
  --green-600: #8FB3F2;
  --green-500: #6E9BE8;
  --green-200: #22334F;
  --green-100: #1C2A42;
  --green-050: #182238;
  --amber-700: #F0A468;
  --amber-600: #E6924F;
  --amber-500: #D97B3F;
  --amber-100: #3A2A1C;
  --amber-050: #2A2015;
  --red-600: #E08F7E;
  --red-100: #3A2420;
  --line: #33322A;
  --line-strong: #423F33;
  --shadow-color: 0 0 0;
}

/* ---------------- Reset ---------------- */
*, *::before, *::after{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .25s var(--ease), color .25s var(--ease);
  position: relative;
}
/* Subtle film-grain texture — fixed, decorative, ignored by hit-testing.
   Kept out of body::before's own stacking so it never dims real content. */
body::before{
  content:'';
  position: fixed; inset:0;
  pointer-events:none;
  z-index: 1;
  opacity: .5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.14 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::before{ mix-blend-mode: overlay; opacity:.35; }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) body::before{ mix-blend-mode: overlay; opacity:.35; }
}
img, svg, video{ display:block; max-width: 100%; }
a{ color: inherit; text-decoration: none; }
button{ font: inherit; color: inherit; }
ul, ol{ margin:0; padding:0; list-style:none; }
h1,h2,h3,h4,p{ margin:0; }
:focus-visible{ outline: 2.5px solid var(--amber-600); outline-offset: 3px; border-radius: 4px; }
::selection{ background: var(--amber-100); color: var(--green-900); }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *, *::before, *::after{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------------- Layout ---------------- */
.container{ width:100%; max-width: var(--container); margin-inline:auto; padding-inline: 24px; }
.container-narrow{ width:100%; max-width: var(--container-narrow); margin-inline:auto; padding-inline: 24px; }
.section{ padding-block: clamp(64px, 9vw, 128px); }
.section-tight{ padding-block: clamp(40px, 6vw, 80px); }
.grid{ display:grid; gap: 24px; }
@media (min-width: 860px){
  .grid-2{ grid-template-columns: repeat(2, 1fr); }
  .grid-3{ grid-template-columns: repeat(3, 1fr); }
  .grid-4{ grid-template-columns: repeat(4, 1fr); }
}

/* ---------------- Type ---------------- */
.eyebrow{
  display:inline-flex; align-items:center; gap:8px;
  font-family: var(--font-body); font-weight:700; font-size: 12.5px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--green-600);
}
.eyebrow::before{ content:''; width:6px; height:6px; border-radius:50%; background: var(--amber-600); }

h1, .h1{
  font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em;
  font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1.04; color: var(--ink);
}
h2, .h2{
  font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em;
  font-size: clamp(1.9rem, 3.4vw, 2.9rem); line-height: 1.1; color: var(--ink);
}
h3, .h3{
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.25rem, 1.8vw, 1.6rem); line-height: 1.25; color: var(--ink);
}
.lede{ font-size: clamp(1.05rem, 1.4vw, 1.25rem); color: var(--ink-soft); line-height: 1.55; }
.muted{ color: var(--ink-soft); }
.faint{ color: var(--ink-faint); }
.italic{ font-style: italic; }
.text-amber{ color: var(--amber-700); }
.text-green{ color: var(--green-600); }

/* ---------------- Buttons ---------------- */
.btn{
  --btn-fg: var(--ink);
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 13px 24px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 15px; white-space: nowrap;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .35s var(--ease-spring), box-shadow .3s var(--ease), background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
  will-change: transform;
}
.btn:active{ transform: scale(.97); }
.btn-lg{ padding: 16px 30px; font-size: 16px; }
.btn-sm{ padding: 9px 18px; font-size: 13.5px; }

.btn-primary{ background: var(--ink); color: var(--bg); box-shadow: var(--shadow-sm); }
.btn-primary:hover{ background: var(--green-700); box-shadow: var(--shadow-md); transform: translateY(-2px); }

.btn-accent{ background: var(--amber-600); color: #241206; box-shadow: var(--shadow-sm); }
.btn-accent:hover{ background: var(--amber-700); box-shadow: var(--shadow-md); transform: translateY(-2px); }

.btn-outline{ background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover{ border-color: var(--ink); background: var(--surface); transform: translateY(-2px); }

.btn-ghost{ background: transparent; color: var(--ink-soft); padding-inline: 10px; }
.btn-ghost:hover{ color: var(--ink); }

.btn-block{ width:100%; }

/* ---------------- Nav ---------------- */
.site-header{
  position: sticky; top:0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.site-header.is-scrolled{ border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.nav-row{ display:flex; align-items:center; justify-content:space-between; height: 76px; gap: 24px; }
.brand{ display:flex; align-items:center; gap:10px; font-family: var(--font-display); font-size: 20px; font-weight:600; color: var(--ink); white-space:nowrap; flex-shrink:0; }
.brand-mark{ height:30px; width:auto; display:flex; align-items:center; flex-shrink:0; }
.brand-mark img{ height:100%; width:auto; object-fit:contain; display:block; }
.brand-tag{ font-size: 10.5px; letter-spacing:.14em; color: var(--ink-faint); font-family: var(--font-body); font-weight:700; display:block; margin-top:-2px; }

.nav-links{ display:none; align-items:center; gap: 4px; }
.nav-link{ padding: 9px 9px; border-radius: var(--radius-pill); font-size: 13.5px; font-weight:600; color: var(--ink-soft); transition: color .2s, background-color .2s; white-space:nowrap; }
@media (min-width: 1140px){
  .nav-link{ padding: 9px 11px; }
}
@media (min-width: 1260px){
  .nav-link{ padding: 9px 14px; font-size: 14.5px; }
}
.nav-link:hover{ color: var(--ink); background: var(--bg-alt); }
.nav-link.is-active{ color: var(--ink); background: var(--green-100); }
.nav-actions{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
.nav-toggle{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; background:none; border:1.5px solid var(--line-strong); border-radius: 10px; padding:8px; flex-shrink:0; width:38px; height:38px; }
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1){ transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2){ opacity:0; }
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3){ transform: translateY(-5.5px) rotate(-45deg); }
@media (min-width: 1100px){
  .nav-links{ display:flex; }
  .nav-toggle{ display:none; }
}
@media (max-width: 639px){
  .nav-row{ gap: 10px; height: 68px; }
  .brand{ font-size: 17px; gap:8px; min-width:0; }
  .brand-mark{ height:26px; }
  .brand-tag{ font-size:9px; letter-spacing:.12em; }
  .nav-actions{ gap: 6px; }
  .nav-actions .btn-primary{ display:none; }
}

.mobile-menu{ display:none; flex-direction:column; gap:2px; padding: 10px 0 20px; border-top:1px solid var(--line); }
.mobile-menu.is-open{ display:flex; }
.mobile-menu a{ padding: 13px 4px; font-weight:600; font-size:15.5px; border-bottom:1px solid var(--line); }

/* ---------------- Card ---------------- */
.card{
  background: var(--surface); border:1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-sm);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.card-hover:hover{ transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.panel{ background: var(--surface); border:1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }

.icon-tile{
  width:46px; height:46px; border-radius: 13px; display:flex; align-items:center; justify-content:center;
  background: var(--green-100); color: var(--green-700); margin-bottom: 18px; flex-shrink:0;
}
.icon-tile svg{ width:22px; height:22px; }
.icon-tile.amber{ background: var(--amber-100); color: var(--amber-700); }

/* ---------------- Badge / Pill ---------------- */
.badge{ display:inline-flex; align-items:center; gap:6px; padding:6px 13px; border-radius: var(--radius-pill); font-size:12.5px; font-weight:700; letter-spacing:.02em; background: var(--green-100); color: var(--green-700); }
.badge.amber{ background: var(--amber-100); color: var(--amber-700); }
.badge-dot{ width:7px; height:7px; border-radius:50%; background: currentColor; }
.badge-dot.live{ background:#3FAE5C; box-shadow: 0 0 0 3px rgb(63 174 92 / .22); animation: pulse-dot 1.8s infinite; }
@keyframes pulse-dot{ 0%,100%{ box-shadow:0 0 0 3px rgb(63 174 92 / .22);} 50%{ box-shadow:0 0 0 6px rgb(63 174 92 / .1);} }

/* ---------------- Footer ---------------- */
.site-footer{ background: var(--green-900); color: var(--green-050); padding-block: 64px 32px; margin-top: 40px; }
.site-footer a{ color: var(--green-100); opacity:.82; transition: opacity .2s; }
.site-footer .brand-tag{ color: var(--green-200); opacity:.8; }
.site-footer a:hover{ opacity:1; }
.footer-grid{ display:grid; gap:40px; grid-template-columns: 1.4fr repeat(3, 1fr); }
.footer-col-title{ font-weight:700; font-size:12.5px; letter-spacing:.1em; text-transform:uppercase; color: var(--green-500); margin-bottom:16px; }
.footer-links{ display:flex; flex-direction:column; gap:11px; font-size:14.5px; }
.footer-bottom{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; margin-top:48px; padding-top:24px; border-top:1px solid rgb(255 255 255 / .1); font-size:13px; color: var(--green-500); }
@media (max-width: 860px){ .footer-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .footer-grid{ grid-template-columns: 1fr; } }

/* ---------------- Misc components ---------------- */
.divider{ height:1px; background: var(--line); border:0; margin: 0; }

.stat-value{ font-family: var(--font-display); font-size: clamp(2rem, 3vw, 2.6rem); color: var(--ink); }
.stat-label{ font-size: 13px; color: var(--ink-faint); font-weight:600; letter-spacing:.04em; text-transform:uppercase; margin-top:4px; }

.chat-bubble{ background: var(--bg-alt); border-radius: 16px; padding: 14px 16px; font-size: 14.5px; line-height:1.5; }
.chat-bubble strong{ color: var(--amber-700); }

.reveal{ opacity:0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible{ opacity:1; transform:none; }
.reveal-stagger > *{ transition-delay: calc(var(--i, 0) * 70ms); }

.table-compare{ width:100%; border-collapse: separate; border-spacing:0; }
.table-compare th, .table-compare td{ padding: 16px 18px; text-align:left; vertical-align:top; font-size:14.5px; border-bottom:1px solid var(--line); }
.table-compare thead th{ font-family: var(--font-display); font-size:17px; font-weight:500; }
.table-compare tbody tr:last-child td{ border-bottom:none; }
.table-compare .col-win{ background: var(--green-050); }

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

.marquee-track{ display:flex; gap:14px; width:max-content; animation: marquee 34s linear infinite; }
.marquee-wrap{ overflow:hidden; -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent); mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent); }
.marquee-wrap:hover .marquee-track{ animation-play-state: paused; }
@keyframes marquee{ from{ transform: translateX(0);} to{ transform: translateX(-50%);} }

.theme-toggle{ width:38px; height:38px; border-radius:50%; border:1.5px solid var(--line-strong); background: var(--surface); display:flex; align-items:center; justify-content:center; cursor:pointer; transition: border-color .2s, transform .3s var(--ease-spring); }
.theme-toggle:hover{ border-color: var(--ink); transform: rotate(-12deg); }
.theme-toggle svg{ width:17px; height:17px; }

.back-to-top{ position:fixed; right:22px; bottom:22px; width:46px; height:46px; border-radius:50%; background: var(--ink); color: var(--bg); display:flex; align-items:center; justify-content:center; box-shadow: var(--shadow-md); opacity:0; pointer-events:none; transform: translateY(10px); transition: opacity .3s, transform .3s; z-index: 90; }
.back-to-top.is-visible{ opacity:1; pointer-events:auto; transform:none; }

.skeleton{ background: linear-gradient(90deg, var(--bg-alt) 25%, var(--surface-2) 37%, var(--bg-alt) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes shimmer{ 0%{ background-position:100% 50%;} 100%{ background-position:0 50%;} }

.toast{ position:fixed; left:50%; bottom:28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding:14px 22px; border-radius: var(--radius-pill); font-size:14px; font-weight:600; box-shadow: var(--shadow-lg); opacity:0; pointer-events:none; transition: all .4s var(--ease-spring); z-index:200; display:flex; align-items:center; gap:10px; }
.toast.is-visible{ opacity:1; transform: translateX(-50%) translateY(0); }
.toast-dot{ width:8px; height:8px; border-radius:50%; background:#3FAE5C; }

.theme-toggle .icon-sun{ display:block; }
.theme-toggle .icon-moon{ display:none; }
:root[data-theme="dark"] .theme-toggle .icon-sun{ display:none; }
:root[data-theme="dark"] .theme-toggle .icon-moon{ display:block; }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .theme-toggle .icon-sun{ display:none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon{ display:block; }
}

.hamburger-line{ display:block; width:19px; height:1.6px; background: currentColor; transition: transform .3s var(--ease), opacity .3s var(--ease); }

::-webkit-scrollbar{ width:12px; height:12px; }
::-webkit-scrollbar-track{ background: var(--bg); }
::-webkit-scrollbar-thumb{ background: var(--line-strong); border-radius:8px; border:3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover{ background: var(--ink-faint); }
