/* ==========================================================================
   CleartrackApps storefront — warm, calm, domestic. Mobile-first.
   ========================================================================== */

:root {
  /* type scale */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
  --text-base: clamp(1rem, 0.97rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.5vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1vw, 2.125rem);
  --text-2xl: clamp(2rem, 1.35rem + 2.6vw, 3.25rem);

  /* spacing */
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem; --space-20: 5rem;

  --font-display: 'Zodiak', Georgia, 'Times New Roman', serif;
  --font-body: 'General Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 14px;
  --radius-lg: 22px;
  --wrap: 68rem;
  --ease: cubic-bezier(.32, .72, .25, 1);
}

/* ---------- light theme ---------- */
:root, [data-theme='light'] {
  --color-bg: #faf6ef;
  --color-bg-alt: #f4eee3;
  --color-surface: #fffdf9;
  --color-surface-2: #f7f1e7;
  --color-border: #e3d9c8;
  --color-border-strong: #d3c6b0;
  --color-text: #2a2318;
  --color-text-muted: #6b6152;
  --color-inverse: #fdfaf4;
  --color-primary: #1c574a;
  --color-primary-hover: #14433a;
  --color-focus: #1c574a;

  --head-pad: 11px;
  --accent-pawfolio: #464191;
  --accent-pawfolio-soft: #ebe9f8;
  --accent-medical: #22617f;
  --accent-medical-soft: #e5f0f6;
  --accent-budget: #7f611a;
  --accent-budget-soft: #f6eed9;
  --accent-puzzlepig: #a63f63;
  --accent-puzzlepig-soft: #fae8ee;
  --accent-beauty: #74476f;
  --accent-beauty-soft: #f4e9f2;

  --shadow-sm: 0 1px 2px rgba(42, 35, 24, .06), 0 2px 10px -6px rgba(42, 35, 24, .14);
  --shadow-md: 0 2px 4px rgba(42, 35, 24, .07), 0 14px 32px -18px rgba(42, 35, 24, .3);
}

/* ---------- dark theme ---------- */
[data-theme='dark'] {
  --color-bg: #17140f;
  --color-bg-alt: #1d1913;
  --color-surface: #221e18;
  --color-surface-2: #2a251d;
  --color-border: #38322a;
  --color-border-strong: #4b4338;
  --color-text: #f3ece1;
  --color-text-muted: #a9a091;
  --color-inverse: #14110d;
  --color-primary: #7fd0bb;
  --color-primary-hover: #9adfcc;
  --color-focus: #7fd0bb;

  --accent-pawfolio: #a9a5ee;
  --accent-pawfolio-soft: #262346;
  --accent-medical: #8dc6e2;
  --accent-medical-soft: #1c3140;
  --accent-budget: #e0bf72;
  --accent-budget-soft: #3a2f16;
  --accent-puzzlepig: #eda2bc;
  --accent-puzzlepig-soft: #3d2029;
  --accent-beauty: #d7a9d1;
  --accent-beauty-soft: #33222f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 34px -20px rgba(0, 0, 0, .8);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --color-bg: #17140f;
    --color-bg-alt: #1d1913;
    --color-surface: #221e18;
    --color-surface-2: #2a251d;
    --color-border: #38322a;
    --color-border-strong: #4b4338;
    --color-text: #f3ece1;
    --color-text-muted: #a9a091;
    --color-inverse: #14110d;
    --color-primary: #7fd0bb;
    --color-primary-hover: #9adfcc;
    --color-focus: #7fd0bb;
    --accent-pawfolio: #a9a5ee;  --accent-pawfolio-soft: #262346;
    --accent-medical: #8dc6e2;   --accent-medical-soft: #1c3140;
    --accent-budget: #e0bf72;    --accent-budget-soft: #3a2f16;
    --accent-puzzlepig: #eda2bc; --accent-puzzlepig-soft: #3d2029;
    --accent-beauty: #d7a9d1;    --accent-beauty-soft: #33222f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 34px -20px rgba(0, 0, 0, .8);
  }
}

/* ---------- shell ---------- */
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.skip {
  position: absolute; left: var(--space-4); top: -3rem;
  background: var(--color-primary); color: var(--color-inverse);
  padding: var(--space-2) var(--space-4); border-radius: 0 0 var(--radius) var(--radius);
  font-size: var(--text-sm); font-weight: 500; z-index: 20; transition: top .18s var(--ease);
}
.skip:focus { top: 0; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.head-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
  /* the logo file is cropped tight to the ink, so without real padding here the
     wordmark sits almost against the top edge of the window */
  padding-block: var(--head-pad);
}
.brand {
  display: inline-flex; align-items: center; gap: var(--space-2);
  text-decoration: none; font-weight: 600; letter-spacing: -.01em;
}
/* Shauna's logo: two files, one shown per theme (the wordmark is dark slate,
   which disappears on the dark background, so the dark file lightens it). */
.logo { display: block; width: 100%; height: auto; flex: none; }
.lockup {
  position: relative; display: inline-block; flex: none;
}
.lockup .logo { width: var(--lw); }
.lockup .logo-on-light { display: block; }
.lockup .logo-on-dark { display: none; }
.logo-head { --lw: 134px; }
.logo-foot { --lw: 128px; }

[data-theme='dark'] .lockup .logo-on-light { display: none; }
[data-theme='dark'] .lockup .logo-on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .lockup .logo-on-light { display: none; }
  :root:not([data-theme='light']) .lockup .logo-on-dark { display: block; }
}

@media (max-width: 480px) {
  .logo-head { --lw: 124px; }
}

.brand-name { font-size: var(--text-sm); letter-spacing: .01em; }
.brand-thin { color: var(--color-text-muted); font-weight: 500; }

.theme-toggle {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--color-border); border-radius: 50%;
  color: var(--color-text-muted); background: var(--color-surface);
  transition: color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle:hover { color: var(--color-primary); border-color: var(--color-border-strong); transform: rotate(-12deg); }
.theme-toggle .t-moon { display: none; }
[data-theme='dark'] .theme-toggle .t-moon { display: block; }
[data-theme='dark'] .theme-toggle .t-sun,
[data-theme='dark'] .theme-toggle .t-rays { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .t-moon { display: block; }
  :root:not([data-theme='light']) .theme-toggle .t-sun,
  :root:not([data-theme='light']) .theme-toggle .t-rays { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 46px; padding: var(--space-3) var(--space-5);
  border-radius: 999px; font-size: var(--text-sm); font-weight: 600;
  text-decoration: none; text-align: center; border: 1.5px solid transparent;
  transition: background-color .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.btn-primary {
  background: var(--accent, var(--color-primary)); color: var(--color-inverse);
  box-shadow: var(--shadow-sm);
}
[data-theme='dark'] .btn-primary { color: #14110d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .btn-primary { color: #14110d; }
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent, var(--color-primary)) 86%, #000);
  transform: translateY(-1px); box-shadow: var(--shadow-md);
}
.btn-ghost {
  background: var(--color-surface); color: var(--color-text);
  border-color: var(--color-border-strong);
}
.btn-ghost:hover {
  border-color: var(--accent, var(--color-primary));
  color: var(--accent, var(--color-primary));
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn-lg { min-height: 50px; padding-inline: var(--space-6); }

/* ---------- hero ---------- */
.hero {
  padding-block: var(--space-12) var(--space-10);
  background:
    radial-gradient(120% 80% at 12% -10%, var(--color-bg-alt) 0%, transparent 62%),
    radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--accent-medical-soft) 70%, transparent) 0%, transparent 60%);
}
.eyebrow {
  font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase;
  color: var(--color-text-muted); font-weight: 500; margin-bottom: var(--space-4);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl); font-weight: 700; letter-spacing: -.02em;
  max-width: 26ch;
}
.lede {
  margin-top: var(--space-5); color: var(--color-text-muted);
  font-size: var(--text-base); max-width: 54ch;
}
.lede strong { color: var(--color-text); font-weight: 600; }
.hero-actions {
  display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8);
}
.hero-actions .btn { flex: 1 1 auto; min-width: 10rem; }
.promises {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4);
  margin-top: var(--space-8); font-size: var(--text-xs);
  color: var(--color-text-muted); letter-spacing: .01em;
}
.promises li { display: flex; align-items: center; gap: var(--space-2); }
.promises li::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  /* a marker, not decoration: 5px is too small to carry brand colour, and four
     bright dots compete with the orange in the logo. Kept at text-muted so the
     words lead and the dots only do the job of separating them. */
  background: var(--color-text-muted); flex: none;
}

/* ---------- section furniture ---------- */
/* keep anchored sections clear of the sticky header: logo height + its padding */
section { scroll-margin-top: calc(54px + var(--head-pad) * 2 + 10px); }
.sec-title {
  font-family: var(--font-display); font-size: var(--text-xl);
  letter-spacing: -.015em; max-width: 30ch;
}
.sec-sub {
  margin-top: var(--space-3); color: var(--color-text-muted);
  font-size: var(--text-sm); max-width: 52ch;
}

/* ---------- how it works ---------- */
.how {
  padding-block: var(--space-12);
  background: var(--color-bg-alt);
  border-block: 1px solid var(--color-border);
}
.steps {
  margin-top: var(--space-8); display: grid; gap: var(--space-4);
  counter-reset: step;
}
.step {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: var(--space-5);
  display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-4); row-gap: var(--space-1);
  box-shadow: var(--shadow-sm);
}
.step-num {
  grid-row: span 2; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-primary); color: var(--color-inverse);
  font-size: var(--text-xs); font-weight: 600;
}
[data-theme='dark'] .step-num { color: #14110d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .step-num { color: #14110d; }
}
.step-title { font-size: var(--text-base); font-weight: 600; align-self: center; }
.step-copy { font-size: var(--text-sm); color: var(--color-text-muted); }

/* ---------- app cards ---------- */
.apps { padding-block: var(--space-12); }
.card-grid { margin-top: var(--space-8); display: grid; gap: var(--space-5); }
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5) var(--space-5);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .22s var(--ease), transform .22s var(--ease), border-color .22s var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-head { display: flex; align-items: center; gap: var(--space-3); }
.card-icon {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.app-icon { width: 24px; height: 24px; }
.card-title { font-family: var(--font-display); font-size: var(--text-lg); letter-spacing: -.01em; }
.card-tag {
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .09em;
  color: var(--accent); font-weight: 500; margin-top: 2px;
}
.card-who {
  margin-top: var(--space-4); font-size: var(--text-sm); font-weight: 600;
  color: var(--color-text);
}
.card-blurb { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--color-text-muted); }
.card-features {
  margin-top: var(--space-4); display: grid; gap: var(--space-2);
  font-size: var(--text-sm); color: var(--color-text);
  padding-top: var(--space-4); border-top: 1px solid var(--color-border);
}
.card-features li { display: grid; grid-template-columns: 1rem 1fr; gap: var(--space-2); align-items: start; }
.card-features li::before {
  content: ''; width: 9px; height: 9px; margin-top: .45em; border-radius: 3px;
  background: var(--accent); opacity: .55;
}
.card-price { margin-top: var(--space-5); display: flex; align-items: baseline; gap: var(--space-2); }
.price { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; }
.price-note { font-size: var(--text-xs); color: var(--color-text-muted); }
.card-actions {
  margin-top: var(--space-4); display: grid; gap: var(--space-3);
}
.card-alt {
  margin-top: var(--space-3); font-size: var(--text-xs); text-align: center;
  color: var(--color-text-muted);
}
.card-alt a {
  color: var(--color-text-muted); text-decoration: underline;
  text-decoration-color: var(--color-border-strong); text-underline-offset: 3px;
  transition: color .18s var(--ease), text-decoration-color .18s var(--ease);
}
.card-alt a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ---------- comparison table ---------- */
.compare {
  padding-block: var(--space-12);
  background: var(--color-bg-alt); border-block: 1px solid var(--color-border);
}
.table-scroll {
  margin-top: var(--space-6); max-width: 100%;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  background: var(--color-surface); box-shadow: var(--shadow-sm);
}
.ctable { width: 100%; font-size: var(--text-sm); }

.ctable th, .ctable td {
  text-align: left; padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border); vertical-align: middle;
}
.ctable thead th {
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em;
  color: var(--color-text-muted); font-weight: 600; background: var(--color-surface-2);
}
.ctable tbody tr:last-child th, .ctable tbody tr:last-child td { border-bottom: 0; }
.ctable tbody tr:hover { background: var(--color-surface-2); }
.ctable tbody th { font-weight: 600; white-space: nowrap; }
.ctable tbody th a { text-decoration: none; }
.ctable tbody th a:hover { text-decoration: underline; text-underline-offset: 3px; }
.t-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: var(--space-2); }
.t-price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.t-demo {
  color: var(--color-primary); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.t-demo:hover { text-decoration: underline; text-underline-offset: 3px; }
.table-note { margin-top: var(--space-4); font-size: var(--text-xs); color: var(--color-text-muted); max-width: 60ch; }

/* stacked rows on small screens — no sideways scrolling */
@media (max-width: 39.999rem) {
  .ctable, .ctable tbody, .ctable tr, .ctable th, .ctable td { display: block; width: auto; }
  .ctable thead { display: none; }
  .ctable tbody tr { padding: var(--space-4); border-bottom: 1px solid var(--color-border); }
  .ctable tbody tr:last-child { border-bottom: 0; }
  .ctable tbody th, .ctable tbody td { border: 0; padding: 0; text-align: left; }
  .ctable tbody th { font-size: var(--text-base); margin-bottom: var(--space-2); white-space: normal; }
  .ctable tbody td {
    display: flex; justify-content: space-between; gap: var(--space-4);
    padding-block: var(--space-1); color: var(--color-text-muted);
  }
  .ctable tbody td::before {
    content: attr(data-label); font-size: var(--text-xs); text-transform: uppercase;
    letter-spacing: .08em; color: var(--color-text-muted); opacity: .8;
    flex: none; padding-top: 2px;
  }
}

/* ---------- faq ---------- */
.faq { padding-block: var(--space-12) var(--space-16); }
.faq-list { margin-top: var(--space-6); display: grid; gap: var(--space-3); }
.faq-item {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 0 var(--space-5);
}
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding-block: var(--space-4); cursor: pointer; list-style: none;
  font-weight: 600; font-size: var(--text-sm);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--color-primary); }
.chev { width: 18px; height: 18px; flex: none; color: var(--color-text-muted); transition: transform .2s var(--ease); }
.faq-item[open] .chev { transform: rotate(180deg); }
.faq-item > p {
  padding-bottom: var(--space-5); font-size: var(--text-sm); color: var(--color-text-muted);
  max-width: 62ch;
}
.faq-item strong { color: var(--color-text); }
.faq-item a { color: var(--color-primary); font-weight: 600; text-underline-offset: 3px; }

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  padding-block: var(--space-10);
}
.foot-brand { display: flex; align-items: flex-start; gap: var(--space-3); }
.foot-name { font-weight: 600; }
.foot-note { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; max-width: 40ch; }
.foot-links {
  margin-top: var(--space-6); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
}
.foot-links a {
  text-decoration: none; font-weight: 500; padding-block: var(--space-1);
  border-bottom: 1px solid transparent; transition: color .18s var(--ease), border-color .18s var(--ease);
}
.foot-links a:hover { color: var(--color-primary); border-color: var(--color-primary); }
.foot-fine { margin-top: var(--space-6); font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---------- larger screens ---------- */
@media (min-width: 40rem) {
  :root { --head-pad: 15px; }
  .wrap { padding-inline: var(--space-8); }
  .hero { padding-block: var(--space-20) var(--space-16); }
  .hero-actions .btn { flex: 0 0 auto; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .card-actions { grid-template-columns: 1fr 1fr; }
  .card-alt { text-align: left; }
  .head-inner { min-height: 64px; }
  .brand-name { font-size: var(--text-base); }
  .logo-mark { width: 30px; height: 30px; }
}

@media (min-width: 62rem) {
  .steps { grid-template-columns: repeat(4, 1fr); }
  .step { grid-template-columns: 1fr; }
  .step-num { grid-row: auto; margin-bottom: var(--space-3); }
  .card-grid { grid-template-columns: repeat(2, 1fr); align-items: start; }
  .card-grid > .card:nth-child(5) { grid-column: span 2; }
  .card-grid > .card:nth-child(5) .card-features { grid-template-columns: repeat(2, 1fr); column-gap: var(--space-6); }
  .card-grid > .card:nth-child(5) .card-actions { grid-template-columns: auto auto; justify-content: start; }
  .faq-wrap { display: grid; grid-template-columns: 20rem 1fr; gap: var(--space-10); align-items: start; }
  .faq-wrap .sec-title { grid-column: 1; }
  .faq-list { grid-column: 2; grid-row: 1; margin-top: 0; }
  .foot-inner { display: grid; grid-template-columns: 1fr auto; align-items: start; row-gap: var(--space-6); }
  .foot-links { margin-top: 0; justify-content: flex-end; }
  .foot-fine { grid-column: 1 / -1; margin-top: 0; }
}
