/* ===========================================================================
   ChemEase website — redesign token layer and shared chrome.

   Deliberately a SEPARATE stylesheet from css/style.css rather than an
   addition to it. The handoff says to extend style.css, but that file carries
   a different design system entirely — neumorphic shadows, #FF8A3D orange,
   Bricolage Grotesque, and unscoped `*` and `body` resets. Merging the two
   would break privacy.html, terms.html and delete-account.html, which still
   use it. Pages on the new design load this file alone; the legacy pages keep
   style.css until they are ported.

   Every value below is from the handoff's Design Tokens section, which was
   verified against the shipped app: --ce-brand-500 #B85C27 is the app's real
   --md-sys-color-primary ("ChemEase Terracotta").
   ======================================================================== */

:root {
    /* --- Colour ------------------------------------------------------- */
    --ce-ink: #1C1A17;
    --ce-ink-strong: #26221C;
    --ce-body: #5C564A;
    --ce-muted: #7C7565;
    --ce-faint: #9E9786;
    --ce-line: #E5E0D5;
    --ce-line-soft: #D4CDBC;
    --ce-sand: #F2EFE8;
    --ce-cream: #FDF3EC;
    --ce-cream-deep: #F6E5D5;
    --ce-peach: #EECBAB;
    --ce-tan: #E4AC7E;

    --ce-brand-400: #D98756;
    --ce-brand-500: #B85C27;
    --ce-brand-600: #9C4B1D;
    --ce-brand-700: #8F4517;

    --ce-green: #10B981;
    --ce-green-dark: #0D9668;
    --ce-green-bright: #58F0A5;
    --ce-blue: #3B82F6;
    --ce-purple: #A855F7;

    /* Alpha compositions, written as the handoff specifies them. */
    --ce-line-70: #e5e0d5b3;
    --ce-line-60: #e5e0d599;
    --ce-line-50: #e5e0d580;
    --ce-header-bg: #faf9f6f2;
    --ce-glass: #ffffffcc;
    --ce-glass-soft: #ffffff8c;
    --ce-glass-mid: #ffffff8f;
    --ce-hover: #0000000f;
    --ce-tint: #0000000a;
    --ce-selection: #e98c4b4d;
    --ce-footer-rule: #3d372e99;

    /* --- Typography --------------------------------------------------- */
    --ce-font: "Space Grotesk", Inter, system-ui, -apple-system, sans-serif;
    --ce-mono: "JetBrains Mono", ui-monospace, monospace;

    /* --- Spacing / radius --------------------------------------------- */
    --ce-maxw: 1280px;
    --ce-maxw-narrow: 1180px;
    --ce-pad-x: 28px;

    --ce-r-xs: 6px;
    --ce-r-sm: 8px;
    --ce-r-md: 10px;
    --ce-r: 12px;
    --ce-r-lg: 14px;
    --ce-r-xl: 16px;
    --ce-r-shot: 18px;
    --ce-r-glass: 24px;
    --ce-r-pill: 999px;

    /* --- Shadow -------------------------------------------------------- */
    --ce-sh-hairline: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --ce-sh-subtle: 0 1px 3px rgba(0,0,0,.05);
    --ce-sh-lift: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --ce-sh-float: 0 24px 60px -34px rgba(28,26,23,.45), 0 1px 3px rgba(0,0,0,.08);
    --ce-focus-ring: 0 0 0 3px #e98c4b26;

    --ce-ease: cubic-bezier(.4, 0, .2, 1);
}

/* --- Global resets ----------------------------------------------------
   Scoped by virtue of this file never loading alongside style.css, so these
   cannot reach the legacy pages.
   -------------------------------------------------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: #fff;
    color: var(--ce-ink);
    font-family: var(--ce-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--ce-brand-500); text-decoration: none; }
a:hover { color: var(--ce-brand-700); }
img { max-width: 100%; display: block; }
input { font-family: inherit; }
input::placeholder { color: var(--ce-faint); }
::selection { background: var(--ce-selection); color: var(--ce-ink); }

h1, h2, h3, h4, p { margin: 0; }

.ce-wrap {
    width: 100%;
    max-width: var(--ce-maxw);
    margin: 0 auto;
    padding-left: var(--ce-pad-x);
    padding-right: var(--ce-pad-x);
}
.ce-wrap--narrow { max-width: var(--ce-maxw-narrow); }

.ce-mono { font-family: var(--ce-mono); }

.ce-eyebrow {
    font-family: var(--ce-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ce-brand-500);
}

/* Visually hidden, still read aloud. */
.ce-sr {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Ambient background washes ---------------------------------------
   Three slow-drifting radial gradients. Durations are deliberately longer
   than perceptible motion: the page should feel alive without anything
   reading as an animation.
   -------------------------------------------------------------------- */
.ce-washes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ce-wash { position: absolute; border-radius: 50%; pointer-events: none; }

@keyframes ce-drift-a {
    0%, 100% { transform: translate3d(0,0,0) scale(1); }
    50%      { transform: translate3d(5%,-7%,0) scale(1.14); }
}
@keyframes ce-drift-b {
    0%, 100% { transform: translate3d(0,0,0) scale(1.08); }
    50%      { transform: translate3d(-6%,6%,0) scale(1); }
}
@keyframes ce-drift-c {
    0%, 100% { transform: translate3d(0,0,0) scale(1); }
    50%      { transform: translate3d(4%,5%,0) scale(1.2); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}

/* --- Buttons ---------------------------------------------------------- */
.ce-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--ce-r);
    font-family: inherit;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .2s var(--ce-ease), border-color .2s var(--ce-ease),
                color .2s var(--ce-ease), box-shadow .2s var(--ce-ease);
}
.ce-btn:focus-visible {
    outline: none;
    border-color: var(--ce-brand-400);
    box-shadow: var(--ce-focus-ring);
}

.ce-btn--primary { background: var(--ce-brand-500); color: #fff; }
.ce-btn--primary:hover { background: var(--ce-brand-600); color: #fff; }

.ce-btn--secondary { background: #fff; border-color: var(--ce-line-70); color: var(--ce-ink); }
.ce-btn--secondary:hover { border-color: var(--ce-line-soft); color: var(--ce-ink); }

.ce-btn--dark { background: var(--ce-ink-strong); color: #fff; }
.ce-btn--dark:hover { background: var(--ce-brand-500); color: #fff; }

.ce-btn--ghost { background: transparent; color: #413C33; font-weight: 500; }
.ce-btn--ghost:hover { background: var(--ce-hover); color: var(--ce-ink); }

.ce-btn--lg { padding: 14px 26px; font-size: 15.5px; }
.ce-btn--md { padding: 13px 24px; font-size: 15px; }
.ce-btn--sm { padding: 9px 18px; font-size: 13.5px; border-radius: var(--ce-r-md); }
.ce-btn--xs { padding: 8px 14px; font-size: 13.5px; border-radius: var(--ce-r-sm); }

/* --- Header ----------------------------------------------------------- */
.ce-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--ce-header-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--ce-line-60);
}
.ce-header__inner {
    max-width: var(--ce-maxw);
    margin: 0 auto;
    padding: 12px var(--ce-pad-x);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 26px;
}
.ce-logo { display: flex; align-items: center; gap: 10px; color: inherit; }
.ce-logo img { width: 30px; height: 30px; border-radius: var(--ce-r-sm); box-shadow: var(--ce-sh-hairline); }
.ce-logo span { font-size: 17px; font-weight: 600; letter-spacing: -.02em; color: var(--ce-ink-strong); }

.ce-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.ce-nav a {
    padding: 7px 12px;
    border-radius: var(--ce-r-xs);
    color: var(--ce-body);
    font-weight: 500;
    font-size: 13.5px;
    transition: background-color .2s var(--ce-ease), color .2s var(--ce-ease);
}
.ce-nav a:hover { background: var(--ce-hover); color: var(--ce-ink); }
.ce-nav a[aria-current="page"] { background: var(--ce-hover); color: var(--ce-ink); font-weight: 600; }

.ce-header__right { margin-left: auto; display: flex; align-items: center; gap: 9px; }

/* --- Footer ----------------------------------------------------------- */
.ce-footer { background: var(--ce-ink-strong); color: var(--ce-sand); }
.ce-footer__top {
    max-width: var(--ce-maxw);
    margin: 0 auto;
    padding: 52px var(--ce-pad-x) 26px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 36px;
}
.ce-footer .ce-logo img { box-shadow: none; }
.ce-footer .ce-logo span { color: var(--ce-sand); }
.ce-footer__blurb {
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ce-faint);
    max-width: 290px;
}
.ce-footer h2 {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ce-faint);
    margin: 0 0 13px;
}
.ce-footer__links { display: flex; flex-direction: column; gap: 9px; }
/* 5.44:1 on #26221C — passes AA. Do not darken. */
.ce-footer__links a { font-size: 14px; color: var(--ce-line-soft); overflow-wrap: anywhere; }
.ce-footer__links a:hover { color: var(--ce-tan); }

.ce-footer__bar {
    max-width: var(--ce-maxw);
    margin: 0 auto;
    border-top: 1px solid var(--ce-footer-rule);
    padding: 18px var(--ce-pad-x) 40px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12.5px;
    color: var(--ce-faint);
}

/* --- Google Play badge ------------------------------------------------
   The official asset, placed unmodified. Google's terms forbid altering its
   colour, proportions or spacing, and forbid rebuilding it -- which is what
   the prototype's three custom lockups did.

   The asset has no internal padding: its rounded rect fills the whole
   viewBox. The required clear space, a quarter of the badge height, is
   therefore applied here as margin. Heights are set inline per placement.
   -------------------------------------------------------------------- */
.ce-badge {
    display: inline-block;
    flex: none;
    line-height: 0;
    border-radius: 9px;
    /* Clear space: >= 1/4 of badge height on every side. */
    margin: 15px 15px 15px 0;
    transition: opacity .2s var(--ce-ease);
}
.ce-badge:hover { opacity: .85; }
.ce-badge:focus-visible { outline: none; box-shadow: var(--ce-focus-ring); }
.ce-badge img { display: block; height: auto; }

/* The badge is black with a #a6a6a6 border, so it reads against both the
   light hero and the dark band without any treatment of its own. */

/* --- Tool tiles and category rows -------------------------------------
   Category tints are derived from --cat, never hard-coded, so adding a
   category needs one colour rather than three.
   -------------------------------------------------------------------- */
.ce-cats { display: flex; flex-direction: column; gap: 34px; }

.ce-cat__head { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.ce-cat__dot { width: 9px; height: 9px; border-radius: var(--ce-r-pill); flex: none; background: var(--cat); }
.ce-cat__name { font-size: 16.5px; font-weight: 600; letter-spacing: -.015em; }
.ce-cat__count {
    font-family: var(--ce-mono);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: var(--ce-r-pill);
    background: color-mix(in srgb, var(--cat) 8%, transparent);
    color: var(--cat);
}
.ce-cat__rule { flex: 1; height: 1px; background: var(--ce-line); }

.ce-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 10px; }

.ce-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 13px 15px;
    border-radius: var(--ce-r-lg);
    background: color-mix(in srgb, var(--cat) 4%, transparent);
    border: 1px solid color-mix(in srgb, var(--cat) 18%, transparent);
    color: inherit;
    transition: transform .2s var(--ce-ease), box-shadow .2s var(--ce-ease);
}
.ce-tile:hover { transform: translateY(-2px); box-shadow: var(--ce-sh-lift); color: inherit; }
.ce-tile:focus-visible { outline: none; box-shadow: var(--ce-focus-ring); }
.ce-tile b { font-size: 13.5px; font-weight: 600; line-height: 1.3; letter-spacing: -.015em; }
.ce-tile span { font-size: 12px; line-height: 1.42; color: var(--ce-body); }

/* --- Glass surface ---------------------------------------------------- */
.ce-glass {
    background: var(--ce-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--ce-line-70);
    border-radius: var(--ce-r-glass);
}
