/* Ivora — one stylesheet, driven by the tokens in :root.
   Change a token and it changes everywhere: colours, type sizes, spacing,
   radii, shadows, widths and motion all live in the first block. Components
   below use tokens only; a raw number there is a one-off (an icon's size, a
   hairline) and says why. */

/* Inter, self-hosted (SIL Open Font License): one variable file for weights
   400 to 700, Latin subset. It is the fallback for devices without San
   Francisco, so it is not preloaded. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ========================================================================
   Tokens
   ======================================================================== */
:root {
  color-scheme: light;

  /* Colour */
  --color-bg: #ffffff;
  --color-bg-soft: #f5f5f7;          /* bands, tiles on white */
  --color-bg-hover: #e8e8ed;
  --color-bg-header: rgb(251 251 253 / 0.8);
  --color-bg-sheet: rgb(255 255 255 / 0.9); /* cookie banner */
  --color-text: #1d1d1f;
  --color-text-muted: #6e6e73;
  --color-text-footer: #424245;
  --color-nav: rgb(0 0 0 / 0.8);
  --color-nav-strong: #000000;          /* menu item hovered or current */
  --color-border: #d2d2d7;
  --color-hairline: #e3e3e8;
  --color-hairline-soft: #ececf0;
  --color-hairline-header: rgb(0 0 0 / 0.08);
  --color-dot: #e0e0e5;
  --color-accent: #0066cc;           /* links, outlines */
  --color-accent-soft: #e8f1fb;
  --color-button: #0071e3;
  --color-button-hover: #0077ed;
  --color-on-accent: #ffffff;
  --color-label: #bf4800;            /* quiet labels such as "On the Shopify App Store" */
  --color-success: #1a7f37;
  --color-danger: #d70015;
  --color-warning-bg: #fff4e5;
  --color-warning-text: #8a4b00;
  /* Tool groups: tile background and icon colour */
  --tone-ads-bg: #eef0ff;    --tone-ads-fg: #4338ca;
  --tone-market-bg: #e3f5f1; --tone-market-fg: #0f766e;
  --tone-sales-bg: #fdf1e3;  --tone-sales-fg: #b45309;
  --tone-app-bg: #eaf3fd;    --tone-app-fg: #1d4ed8;
  /* JSON in example blocks */
  --code-key: #4338ca; --code-string: #0f766e; --code-number: #b45309; --code-literal: #a21caf;

  /* Type */
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, system-ui, "Segoe UI", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-base: 17px;                 /* body copy */
  --text-xs: 0.8125rem;              /* 13px: the smallest text anywhere */
  --text-sm: 0.94rem;
  --text-md: 1.05rem;
  --text-lg: 1.15rem;
  --text-xl: 1.3rem;
  --text-2xl: 1.6rem;
  --text-h1: clamp(2.1rem, 6vw, 4rem);
  --text-h2: clamp(1.75rem, 4vw, 2.5rem);
  --text-h2-banner: clamp(1.9rem, 4vw, 2.75rem);
  --text-title: clamp(2.1rem, 5vw, 3.5rem); /* product and tool titles */
  --text-subhead: clamp(1.15rem, 2vw, 1.4rem);
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --leading-body: 1.47;
  --leading-tight: 1.06;
  --leading-heading: 1.1;
  --leading-snug: 1.2;
  --leading-lead: 1.4;
  --tracking-body: -0.022em;
  --tracking-heading: -0.012em;
  --tracking-tight: -0.02em;

  /* Space: one scale for every gap, padding and margin */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-12: 48px;
  --space-14: 56px;
  --space-16: 64px;
  --space-18: 72px;
  --space-20: 80px;
  --space-22: 88px;
  --space-24: 96px;
  /* Named roles, so a change of rhythm is one line */
  --section-y: var(--space-20);          /* top and bottom of a section */
  --section-y-phone: var(--space-14);
  --heading-to-text: var(--space-5);     /* section heading to its text */
  --heading-to-block: var(--space-9);    /* section heading to cards, tiles, steps */
  --grid-gap: var(--space-6);            /* between cards and tiles */
  --grid-gap-phone: var(--space-4);
  --card-pad: var(--space-7);            /* inside every card */
  --card-pad-phone: var(--space-5);
  --page-top: var(--space-12);           /* header to the page title */
  --page-top-phone: var(--space-8);
  --hero-top: var(--space-16);           /* header to the home headline */
  --hero-top-phone: var(--space-10);

  /* Layout */
  --page-width: 1024px;                  /* the grid; the logo, every heading and block start on its left edge */
  --gutter: 22px;
  --measure: none;                       /* line length of running text: none fills the grid; 75ch would hold lines to about 75 characters */
  --measure-lead: none;                  /* the same for intros under page titles */
  --measure-hero: 880px;                 /* the centred home hero: as wide as its headline */
  --header-height: 52px;

  /* Shape */
  --radius-sm: 12px;
  --radius-md: 14px;
  --radius: 18px;
  --radius-lg: 22px;
  --radius-xl: 24px;
  --radius-pill: 980px;
  --shadow-lift: 0 4px 24px rgb(0 0 0 / 0.08);
  --shadow-float: 0 4px 32px rgb(0 0 0 / 0.1);
  --shadow-sheet: 0 8px 40px rgb(0 0 0 / 0.16);
  --shadow-soft: 0 2px 16px rgb(0 0 0 / 0.08);
  --blur-glass: saturate(180%) blur(20px);

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --duration-reveal: 0.7s;
  --duration-reveal-text: 0.55s;
  --rise: 28px;
  --rise-text: 14px;
  --duration-menu: 0.4s;
}

/* Dark theme, chosen by the device (no switch on the page). Only colour and
   shadow tokens change; every component follows. Text and labels keep at
   least 4.5:1 contrast. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --color-bg: #000000;
    --color-bg-soft: #1c1c1e;
    --color-bg-hover: #2c2c2e;
    --color-bg-header: rgb(22 22 23 / 0.8);
    --color-bg-sheet: rgb(28 28 30 / 0.92);
    --color-text: #f5f5f7;
    --color-text-muted: #a1a1a6;
    --color-text-footer: #d2d2d7;
    --color-nav: rgb(255 255 255 / 0.8);
    --color-nav-strong: #ffffff;
    --color-border: #424245;
    --color-hairline: #38383a;
    --color-hairline-soft: #2c2c2e;
    --color-hairline-header: rgb(255 255 255 / 0.1);
    --color-dot: #48484a;
    --color-accent: #2997ff;
    --color-accent-soft: #0f2a44;
    --color-label: #ff9f0a;
    --color-warning-bg: #33260f;
    --color-warning-text: #ffc266;
    --tone-ads-bg: #23264a;    --tone-ads-fg: #a5b4fc;
    --tone-market-bg: #0f302a; --tone-market-fg: #5eead4;
    --tone-sales-bg: #3a2814;  --tone-sales-fg: #fdba74;
    --tone-app-bg: #142b47;    --tone-app-fg: #93c5fd;
    --code-key: #a5b4fc; --code-string: #5eead4; --code-number: #fdba74; --code-literal: #f0abfc;
    --shadow-lift: 0 4px 24px rgb(0 0 0 / 0.6);
    --shadow-float: 0 4px 32px rgb(0 0 0 / 0.7);
    --shadow-sheet: 0 8px 40px rgb(0 0 0 / 0.8);
    --shadow-soft: 0 2px 16px rgb(0 0 0 / 0.6);
  }
  /* In the dark, tiles and visuals on a black page get a hairline edge instead of relying on shadow. */
  .viz, .feed { box-shadow: 0 0 0 1px var(--color-hairline-soft), var(--shadow-float); }
}

/* ========================================================================
   Base
   ======================================================================== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font: var(--text-base) / var(--leading-body) var(--font-text);
  letter-spacing: var(--tracking-body);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
[id] { scroll-margin-top: calc(var(--header-height) + var(--space-4)); }
img { max-width: 100%; }
a { color: var(--color-accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--color-accent); text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--page-width); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--space-4); top: -60px; z-index: 100; background: var(--color-button); color: var(--color-on-accent); padding: 10px var(--space-4); border-radius: 8px; font-weight: var(--weight-semibold); }
.skip-link:focus { top: var(--space-3); color: var(--color-on-accent); }

/* ========================================================================
   Type
   ======================================================================== */
h1, h2, h3 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
h1 { font-size: var(--text-h1); line-height: var(--leading-tight); letter-spacing: -0.015em; }
h2 { font-size: var(--text-h2); line-height: var(--leading-heading); letter-spacing: var(--tracking-heading); margin-top: 1.6em; }
h3 { font-size: var(--text-xl); letter-spacing: -0.01em; }
main h2 { margin-bottom: var(--heading-to-text); }
main h2 + :is(.grid, .principles, .step-cards, .shots, .faq, .check-list, .price-tiles, .app-card, details.example, .toc) { margin-top: var(--heading-to-block); }
.section > .wrap > h2:first-child { margin-top: 0; }
p, ul { margin: 0 0 1em; }
p, li { text-wrap: pretty; }
/* Running text keeps one line length on every page. */
.prose p, .prose li, .legal p, .legal li, .section > .wrap > p, .section > .wrap > :is(ul, ol):not([class]) { max-width: var(--measure); }

.lead { font-size: var(--text-xl); line-height: var(--leading-lead); color: var(--color-text-muted); letter-spacing: var(--tracking-heading); max-width: var(--measure-lead); }
.page-head .lead { max-width: var(--measure-lead); }
.subhead { font-weight: var(--weight-semibold); color: var(--color-text); margin: 0 0 var(--space-3); max-width: var(--measure-lead); font-size: clamp(1.3rem, 2.4vw, 1.75rem); line-height: 1.25; letter-spacing: var(--tracking-heading); text-wrap: balance; }
.eyebrow { margin-bottom: var(--space-3); font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--color-text-muted); letter-spacing: -0.01em; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow .icon-tile { width: 26px; height: 26px; border-radius: 7px; margin-right: var(--space-2); vertical-align: middle; }
.muted { color: var(--color-text-muted); }
.badge { display: inline-block; margin-bottom: var(--space-3); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-label); }

/* ========================================================================
   Buttons
   ======================================================================== */
.button { display: inline-block; padding: var(--space-3) var(--space-6); border-radius: var(--radius-pill); background: var(--color-button); color: var(--color-on-accent); font-size: var(--text-md); font-weight: var(--weight-regular); letter-spacing: var(--tracking-tight); text-decoration: none; }
.button:hover { background: var(--color-button-hover); color: var(--color-on-accent); text-decoration: none; }
.button.secondary { background: transparent; color: var(--color-accent); border: 1px solid var(--color-accent); }
.button.secondary:hover { background: var(--color-accent); color: var(--color-on-accent); }
.button.small { padding: var(--space-2) var(--space-4); font-size: var(--text-sm); }
.button:focus-visible { outline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: var(--space-6); }

/* ========================================================================
   Header and footer
   ======================================================================== */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--color-bg-header); backdrop-filter: var(--blur-glass); -webkit-backdrop-filter: var(--blur-glass); border-bottom: 1px solid var(--color-hairline-header); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: var(--header-height); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.1rem; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); color: var(--color-text); text-decoration: none; }
.brand:hover { color: var(--color-text); text-decoration: none; }
.brand .brand-mark { width: 24px; height: 24px; flex-shrink: 0; } /* the mark, drawn in the text colour */
.site-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.site-header nav a { padding: 13px 10px; font-size: 0.82rem; font-weight: var(--weight-regular); color: var(--color-nav); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--color-nav-strong); text-decoration: none; }
.site-header nav a.header-cta { margin-left: 10px; padding: 6px 14px; border-radius: var(--radius-pill); font-size: var(--text-xs); color: var(--color-on-accent); background: var(--color-button); }
.site-header nav a.header-cta:hover { background: var(--color-button-hover); color: var(--color-on-accent); }

.site-footer { background: var(--color-bg-soft); border-top: 1px solid var(--color-hairline); font-size: var(--text-xs); color: var(--color-text-muted); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 0.8fr 1.6fr 0.8fr; gap: var(--space-8); padding-top: var(--space-16); padding-bottom: var(--space-8); }
.footer-brand .brand { font-size: var(--text-md); margin-bottom: 10px; }
.footer-brand p { margin: 0 0 var(--space-2); }
.footer-heading { margin: 0 0 10px; font-weight: var(--weight-semibold); font-size: var(--text-xs); color: var(--color-text); }
.site-footer a { color: var(--color-text-footer); text-decoration: none; }
.site-footer a:hover { color: var(--color-text); text-decoration: underline; }
.site-footer ul.plain li { margin-bottom: var(--space-2); }
.footer-bottom { padding-bottom: var(--space-10); }
.footer-bottom p { margin: 0; padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { margin-bottom: 6px; }

/* ========================================================================
   Sections
   ======================================================================== */
.hero { padding: var(--hero-top) 0 var(--space-18); background: var(--color-bg); }
.page-head { padding: var(--page-top) 0 var(--space-6); background: var(--color-bg); }
.section { padding: var(--section-y) 0; }
.section.band { background: var(--color-bg-soft); }
.page-head + .section { padding-top: var(--space-6); }
main > .section:last-child { padding-bottom: var(--space-24); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: var(--space-12); align-items: center; }

/* Home hero: centred headline over the example feed */
.hero-center .hero-grid { grid-template-columns: 1fr; justify-items: center; gap: var(--space-14); text-align: center; }
.hero-center h1 { max-width: var(--measure-hero); margin-left: auto; margin-right: auto; }
.hero-center .subhead { max-width: var(--measure-hero); margin: var(--space-2) auto var(--space-3); font-size: var(--text-subhead); font-weight: var(--weight-regular); line-height: var(--leading-lead); color: var(--color-text-muted); }
.hero-center .actions { justify-content: center; }
.hero-center .feed { width: 100%; max-width: 620px; text-align: left; }
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-5); margin: var(--space-7) 0 0; padding: 0; list-style: none; font-size: var(--text-sm); color: var(--color-text-muted); }
.trust li { display: inline-flex; align-items: center; gap: var(--space-2); }
.trust li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--color-success); }
.trust a { color: var(--color-text-muted); }
.trust a:hover { color: var(--color-text); }

/* Example feed in the home hero */
.feed { margin: 0; background: var(--color-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-float); overflow: hidden; }
.feed-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--color-hairline-soft); font-size: 0.92rem; font-weight: var(--weight-semibold); }
.feed-head > span:first-child { display: inline-flex; align-items: center; gap: var(--space-2); }
.feed ul { list-style: none; margin: 0; padding: 6px 0; }
.feed li { display: flex; align-items: flex-start; gap: var(--space-3); padding: 11px 18px; }
.feed li + li { border-top: 1px solid var(--color-hairline-soft); }
.feed li .icon-tile { width: 34px; height: 34px; }
.feed li strong { display: block; font-size: 0.9rem; }
.feed li div span { display: block; font-size: 0.88rem; line-height: 1.45; color: var(--color-text-muted); }
.chip { padding: 2px 10px; border: 1px solid var(--color-border); border-radius: 999px; font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text-muted); }

/* Centred intro above the home banners */
.section.intro { padding-bottom: var(--space-10); text-align: center; }
.section.intro .lead { max-width: var(--measure-lead); margin: 0 auto; }

/* Home banners: one per tool group, text beside its visual */
.banner-section { padding: var(--space-22) 0; }
.banner-section.band { background: var(--color-bg-soft); }
.banner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--space-14); align-items: center; }
.banner > * { min-width: 0; }
.banner-section.flip .banner-text { order: 2; }
.banner h2 { margin-top: 0; font-size: var(--text-h2-banner); }
.banner-text > p:not(.eyebrow) { font-size: var(--text-lg); color: var(--color-text-muted); }
.banner .eyebrow { display: flex; align-items: center; gap: 10px; }
.banner .eyebrow .icon-tile { margin: 0; }
.banner-links { list-style: none; padding: 0; margin: var(--space-5) 0 0; display: grid; gap: var(--space-2); overflow-wrap: anywhere; }
.banner-links a::after, .tool-links a::after, .card-list a::after { content: "\00a0›"; }
.banner-app .actions { margin-top: var(--space-5); }
.banner-section.band .viz { box-shadow: var(--shadow-lift); }

/* Closing call to action */
.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-5) var(--space-8); padding: var(--space-12); border-radius: var(--radius-xl); background: var(--color-bg-soft); }
.cta-band h2 { margin-top: 0; }
.cta-band p { margin: 0; color: var(--color-text-muted); }
.cta-band .actions { margin-top: 0; }

/* ========================================================================
   Grids, cards and tiles
   ======================================================================== */
.grid { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.two, .grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card { display: flex; flex-direction: column; padding: var(--card-pad); border-radius: var(--radius); background: var(--color-bg-soft); }
.section.band .card { background: var(--color-bg); }
.card:hover { box-shadow: var(--shadow-lift); transform: scale(1.01); }
.card h3 { margin: 14px 0 var(--space-1); }
.card h3 a, .card h4 a { color: var(--color-text); text-decoration: none; }
.card h3 a:hover, .card h4 a:hover { color: var(--color-accent); }
.card p { font-size: 1rem; }
.card > p:last-of-type { margin-bottom: 18px; }
.card .meta { margin-bottom: var(--space-3); font-size: 0.88rem; color: var(--color-text-muted); }
.card > .button.small, .card > a.button, .card > a:last-child { margin-top: auto; align-self: flex-start; }
.card > .icon-tile { margin-bottom: 0; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: 14px; }
.card-top .badge { margin: 0; }
.card-title { margin: 14px 0 6px; font-size: var(--text-xl); letter-spacing: -0.01em; }
.card-list { list-style: none; padding: 0; margin: var(--space-1) 0 0; display: grid; gap: var(--space-2); }
.card-list li { color: var(--color-text-muted); }
.card-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-1); }
.card-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; font-size: 0.9rem; }
.card-links a { color: var(--color-text-muted); }

/* A tool card is one link: the title's link covers the whole card. */
.tool-card { position: relative; }
.tool-card > .icon-tile { align-self: flex-start; }
.tool-card h3, .tool-card h4 { margin: 14px 0 6px; font-size: var(--text-md); }
.tool-card h3 a::after, .tool-card h4 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tool-card p { color: var(--color-text-muted); }
.tool-card .button { position: relative; z-index: 1; }

/* The app card on Products: text beside the app's visual */
.app-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--space-7); align-items: center; margin-top: var(--space-4); padding: var(--card-pad); }
.app-card > * { min-width: 0; }
.app-card-body { display: flex; flex-direction: column; }
.app-card h3 { margin: 14px 0 2px; font-size: var(--text-xl); }
.app-card h3 a { color: var(--color-text); text-decoration: none; }
.card.app-card > .app-card-shot { margin: 0; align-self: center; }
.app-card-shot .viz { box-shadow: var(--shadow-soft); }

/* Steps: numbered tiles (tool pages) or tiles with an icon (home, app page) */
.step-cards { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: var(--grid-gap); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step-cards li { counter-increment: step; padding: var(--card-pad); border-radius: var(--radius); background: var(--color-bg-soft); }
.section.band .step-cards li { background: var(--color-bg); }
.step-cards li > .icon { display: block; margin-bottom: 10px; color: var(--color-accent); }
.step-cards h3 { margin-bottom: 6px; font-size: var(--text-md); }
.step-cards p { margin: 0; color: var(--color-text-muted); }
.step-cards.numbered li { padding: var(--space-6); }
.step-cards.numbered li::before { content: counter(step); display: inline-grid; place-items: center; width: 32px; height: 32px; margin-bottom: 14px; border-radius: 50%; background: var(--color-accent-soft); color: var(--color-accent); font-weight: var(--weight-semibold); }
.step-cards.numbered p { color: var(--color-text); max-width: none; }

/* Principles: titled columns of short text */
.principles { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.principles h3 { font-size: 1.02rem; }
.principles p { margin: 0; color: var(--color-text-muted); }

/* Prices: one tile per charge, the amount up front */
.price-tiles { list-style: none; padding: 0; margin: var(--space-2) 0 var(--space-6); display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.price-tiles li { display: grid; gap: 2px; max-width: none; padding: 18px var(--space-5); border-radius: var(--radius); background: var(--color-bg); }
.section:not(.band) .price-tiles li { background: var(--color-bg-soft); }
.price-tiles strong { font-size: var(--text-2xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); line-height: var(--leading-snug); }
.price-tiles small { font-size: var(--text-xs); color: var(--color-text-muted); }

/* Who it's for (home) */
.audience h3 { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-md); }
.audience h3 .icon-tile { width: 32px; height: 32px; border-radius: 9px; }
.audience p { color: var(--color-text-muted); }
.tool-links { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-sm); font-weight: var(--weight-medium); }

/* Facts row (About) and checklist (Contact) */
.facts { list-style: none; padding: 0; margin: var(--space-7) 0 0; display: flex; flex-wrap: wrap; gap: var(--space-3); }
.facts li { display: inline-flex; align-items: center; gap: 10px; padding: 10px var(--space-4); border-radius: var(--radius-pill); background: var(--color-bg-soft); font-size: var(--text-sm); color: var(--color-text); }
.facts .icon { color: var(--color-accent); }
.check-list { list-style: none; padding: 0; margin: 0 0 var(--space-5); display: grid; gap: 10px; }
.check-list li { position: relative; padding-left: 30px; }
.check-list li::before { content: ""; position: absolute; left: 0; top: 0.2em; width: 18px; height: 18px; border-radius: 50%; background: var(--color-accent-soft); }
.check-list li::after { content: ""; position: absolute; left: 6px; top: calc(0.2em + 4px); width: 5px; height: 9px; border: solid var(--color-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Icons and their coloured tiles */
.icon { flex-shrink: 0; vertical-align: middle; }
.icon-tile { display: inline-grid !important; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; line-height: 0; }
.tone-ads-intelligence { background: var(--tone-ads-bg); color: var(--tone-ads-fg); }
.tone-market-and-demand { background: var(--tone-market-bg); color: var(--tone-market-fg); }
.tone-sales-signals { background: var(--tone-sales-bg); color: var(--tone-sales-fg); }
.tone-app { background: var(--tone-app-bg); color: var(--tone-app-fg); }

/* ========================================================================
   Products page
   ======================================================================== */
.pill-nav { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.pill-nav a { display: inline-flex; align-items: center; gap: var(--space-2); padding: 9px var(--space-4); border: 1px solid transparent; border-radius: var(--radius-pill); background: var(--color-bg-soft); color: var(--color-text); font-size: 0.92rem; text-decoration: none; }
.pill-nav a:hover { background: var(--color-bg-hover); color: var(--color-text); text-decoration: none; }
.pill-nav .count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--color-bg); color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.group-title { display: flex; align-items: center; gap: var(--space-3); margin-top: 1.8em; }
.group-title .icon-tile { width: 32px; height: 32px; border-radius: 9px; }
.group-title a { display: inline-block; padding: var(--space-1) 0; color: var(--color-text); text-decoration: none; }
.group-title a:hover { color: var(--color-accent); }
.group-intro { margin-bottom: var(--space-6); }

/* ========================================================================
   Product and tool pages
   ======================================================================== */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-5); font-size: 0.88rem; color: var(--color-text-muted); }
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs [aria-current] { color: var(--color-text); }
.product-title { max-width: var(--measure-lead); margin-bottom: var(--space-5); font-size: var(--text-title); }
.tool-hero { align-items: start; }
.tool h2 { margin-top: 1.8em; }
.tool ul, .tool ol { padding-left: 1.2em; }
.tool li { margin-bottom: 6px; }
.showcase { padding: var(--space-2) 0 var(--space-14); }
.showcase .viz { max-width: 760px; margin: 0 auto; }

/* At a glance */
.glance { padding: var(--space-5) 22px; border-radius: var(--radius); background: var(--color-bg-soft); }
.glance-title { margin: 0 0 10px; font-weight: 700; }
.glance dl { margin: 0; }
.glance dl > div { display: grid; grid-template-columns: 110px 1fr; gap: var(--space-3); padding: 9px 0; border-top: 1px solid var(--color-hairline); font-size: 0.92rem; }
.glance dt { color: var(--color-text-muted); }
.glance dd { margin: 0; }

/* Product sub-navigation: Overview · Support · Privacy · Terms */
.subnav { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-6); border-bottom: 1px solid var(--color-hairline); }
.subnav a { margin-bottom: -1px; padding: var(--space-2) var(--space-3); border-bottom: 2px solid transparent; color: var(--color-text-muted); text-decoration: none; }
.subnav a:hover { color: var(--color-text); }
.subnav a[aria-current="page"] { color: var(--color-text); border-bottom-color: var(--color-text); }
.page-head .badge { margin-bottom: 0; }

/* Example output */
.code { margin: 0 0 1em; padding: var(--space-4) 18px; border-radius: var(--radius-md); background: var(--color-bg-soft); overflow-x: auto; font: var(--text-xs) / 1.55 var(--font-mono); }
.band .code { background: var(--color-bg); }
.code code { white-space: pre; font-size: inherit; }
.code .j-key { color: var(--code-key); }
.code .j-str { color: var(--code-string); }
.code .j-num { color: var(--code-number); }
.code .j-lit { color: var(--code-literal); }
details.example summary { display: inline-flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); padding: 10px var(--space-4); border-radius: var(--radius-pill); background: var(--color-bg-soft); font-weight: var(--weight-medium); list-style: none; cursor: pointer; }
.band details.example summary { background: var(--color-bg); }
details.example summary::-webkit-details-marker { display: none; }
details.example summary::before { content: "▸"; color: var(--color-accent); transition: transform 0.15s ease; }
details.example[open] summary::before { transform: rotate(90deg); }

/* FAQ */
.faq h3 { margin: 1.2em 0 0.3em; font-size: 1.02rem; }
.faq p { margin: 0; color: var(--color-text-muted); }

/* Screenshots and demo video (app page) */
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--grid-gap); }
.shots figure { margin: 0; }
.shots img { display: block; width: 100%; height: auto; border-radius: var(--radius-md); background: var(--color-bg); box-shadow: var(--shadow-lift); }
.shots figcaption { margin-top: 10px; font-size: var(--text-sm); color: var(--color-text-muted); }
video.demo { display: block; width: 100%; height: auto; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #0f3b44; }

/* ========================================================================
   Legal pages
   ======================================================================== */
.legal h2 { margin-bottom: var(--space-4); font-size: 1.25rem; scroll-margin-top: 80px; }
.legal li { margin-bottom: 6px; }
.toc { max-width: var(--measure); margin-bottom: var(--space-7); padding: var(--space-4) var(--space-5); border-radius: var(--radius); background: var(--color-bg-soft); }
.toc-title { margin: 0 0 var(--space-2); font-weight: 700; }
.toc ol { margin: 0; padding-left: 1.3em; columns: 2; column-gap: var(--space-8); }
.toc li { margin-bottom: 6px; break-inside: avoid; }

/* ========================================================================
   Product visuals (what each tool reports, drawn in HTML)
   ======================================================================== */
.viz { margin: 0; overflow: hidden; border-radius: var(--radius-lg); background: var(--color-bg); box-shadow: var(--shadow-float); font-size: var(--text-sm); text-align: left; }
.viz-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-hairline-soft); font-size: var(--text-xs); }
.viz-title { flex: 1; min-width: 0; color: var(--color-text-muted); } /* wraps rather than being cut */
.viz-dots { display: inline-flex; flex-shrink: 0; gap: 6px; }
.viz-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--color-dot); }
.viz-body { display: grid; gap: var(--space-3); padding: 18px var(--space-5) var(--space-5); }
.viz-note { margin: -4px 0 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.viz-sub { margin: var(--space-1) 0 -4px; font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: 0.03em; text-transform: uppercase; color: var(--color-text-muted); }
.viz-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.viz-stat { padding: 10px var(--space-3); border-radius: var(--radius-sm); background: var(--color-bg-soft); }
.viz-stat strong { display: block; font-size: 1.35rem; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); line-height: var(--leading-snug); }
.viz-stat span { font-size: var(--text-xs); color: var(--color-text-muted); }
.viz-bar { display: grid; grid-template-columns: minmax(90px, 0.9fr) 1.6fr auto; align-items: center; gap: var(--space-3); }
.viz-bar-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.viz-bar-value { min-width: 52px; text-align: right; font-size: 0.86rem; font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.viz progress { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 99px; background: var(--color-hairline-soft); transform-origin: left center; }
.viz progress::-webkit-progress-bar { border-radius: 99px; background: var(--color-hairline-soft); }
.viz progress::-webkit-progress-value { border-radius: 99px; background: var(--color-button); }
.viz progress::-moz-progress-bar { border-radius: 99px; background: var(--color-button); }
.viz-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 10px var(--space-3); border-radius: var(--radius-sm); background: var(--color-bg-soft); }
.viz-row > span:first-child { min-width: 0; }
.viz-app strong, .viz-app .viz-muted { display: block; }
.viz-muted { font-size: 0.86rem; color: var(--color-text-muted); }
.viz-rating { font-weight: var(--weight-semibold); white-space: nowrap; }
.viz-ad { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 14px; }
.viz-ad strong, .viz-ad .viz-muted, .viz-change strong, .viz-change > .viz-muted { display: block; }
.viz-thumb { display: grid; place-items: center; align-content: center; gap: var(--space-1); aspect-ratio: 16 / 10; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--color-accent-soft), var(--color-bg-soft)); color: var(--color-accent); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.viz-new { display: inline-block; margin-bottom: var(--space-1); padding: 2px 9px; border-radius: 99px; background: var(--color-success); color: var(--color-on-accent); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.viz-new.down { background: var(--color-danger); }
.viz-change { padding: var(--space-3) 14px; border-radius: var(--radius-sm); background: var(--color-bg-soft); }
.viz-price s { color: var(--color-text-muted); }
.viz-alert { display: flex; align-items: center; gap: 10px; padding: 10px var(--space-3); border-radius: var(--radius-sm); background: var(--color-warning-bg); color: var(--color-warning-text); font-size: 0.88rem; }

/* ========================================================================
   Phone menu: a full-screen sheet under the header, opened by the two-line
   button, which turns into a cross. Links slide in one after another.
   ======================================================================== */
.menu-button { display: none; }
@media (max-width: 640px) {
  .header-inner { flex-wrap: nowrap; }
  .menu-button { display: grid; place-content: center; gap: 6px; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; background: none; color: var(--color-text); cursor: pointer; }
  .menu-button span { display: block; width: 18px; height: 1.5px; border-radius: 1px; background: currentColor; transition: transform var(--duration-menu) var(--ease-out); }
  .menu-open .menu-button span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .menu-open .menu-button span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .menu-open .site-header { background: var(--color-bg); }
  /* On phones the header is fixed, not sticky: iOS Safari lets a sticky header
     scroll away while the page is locked, taking the menu sheet with it. */
  .site-header { position: fixed; top: 0; left: 0; right: 0; }
  body { padding-top: calc(var(--header-height) + 1px); }

  /* The header's backdrop-filter makes it the containing block of fixed children, so the sheet is placed from the header's bottom edge with an explicit height. */
  #site-nav { position: fixed; top: 100%; left: 0; right: 0; height: calc(100dvh - var(--header-height)); z-index: 39; display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; padding: var(--space-4) var(--gutter) var(--space-10); overflow-y: auto; background: var(--color-bg); visibility: hidden; opacity: 0; transition: opacity var(--duration-menu) var(--ease-out), visibility 0s linear var(--duration-menu); }
  .menu-open #site-nav { visibility: visible; opacity: 1; transition: opacity var(--duration-menu) var(--ease-out); }
  .site-header #site-nav a:not(.header-cta) { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-hairline); font-family: var(--font-display); font-size: 1.75rem; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); color: var(--color-text); }
  .site-header #site-nav a.header-cta { display: block; margin: var(--space-8) 0 0; padding: var(--space-3) var(--space-6); text-align: center; font-size: var(--text-md); }
  #site-nav > a { opacity: 0; transform: translateY(-8px); transition: opacity 0.3s ease, transform var(--duration-menu) var(--ease-out); }
  .menu-open #site-nav > a { opacity: 1; transform: none; }
  .menu-open #site-nav > a:nth-child(1) { transition-delay: 0.04s; }
  .menu-open #site-nav > a:nth-child(2) { transition-delay: 0.08s; }
  .menu-open #site-nav > a:nth-child(3) { transition-delay: 0.12s; }
  .menu-open #site-nav > a:nth-child(4) { transition-delay: 0.16s; }
  .menu-open #site-nav > a:nth-child(5) { transition-delay: 0.2s; }
}
@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  .menu-button span, #site-nav, #site-nav > a { transition: none; }
}

/* ========================================================================
   Cookie banner
   ======================================================================== */
.cookie-banner { position: fixed; left: var(--space-4); right: var(--space-4); bottom: var(--space-4); z-index: 50; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); max-width: 720px; margin: 0 auto; padding: var(--space-4) 18px; border-radius: var(--radius); background: var(--color-bg-sheet); backdrop-filter: var(--blur-glass); -webkit-backdrop-filter: var(--blur-glass); box-shadow: var(--shadow-sheet); font-size: 0.92rem; }
.cookie-banner[hidden] { display: none; }
.cookie-banner p { flex: 1 1 320px; margin: 0; color: var(--color-text-muted); }
.cookie-actions { display: flex; gap: var(--space-2); }
.cookie-actions .button { padding: 9px var(--space-4); border: 1px solid transparent; font: inherit; font-weight: var(--weight-semibold); cursor: pointer; }
.cookie-actions .button.secondary { border-color: var(--color-border); }

/* ========================================================================
   Motion
   Blocks below the first screen rise in as they scroll into view (site.js
   marks only blocks that start off screen); bars grow from the left; the
   hero feed lists its rows one after another. Off with reduced motion.
   ======================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(var(--rise)); transition: opacity var(--duration-reveal) ease, transform var(--duration-reveal) var(--ease-out); }
  .reveal.in { opacity: 1; transform: none; }
  .section > .wrap > .reveal:not(.card):not(.cta-band) { transform: translateY(var(--rise-text)); transition-duration: var(--duration-reveal-text); }
  .section > .wrap > .reveal.in { transform: none; }
  .reveal progress { transform: scaleX(0); transition: transform 1s var(--ease-out) 0.25s; }
  .reveal.in progress { transform: scaleX(1); }
  .hero .feed li { animation: feed-in 0.6s var(--ease-out) both; }
  .hero .feed li:nth-child(2) { animation-delay: 0.12s; }
  .hero .feed li:nth-child(3) { animation-delay: 0.24s; }
  .hero .feed li:nth-child(4) { animation-delay: 0.36s; }
  .hero .feed li:nth-child(5) { animation-delay: 0.48s; }
  .card, .button { transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.2s ease, color 0.2s ease; }
  .button:active { transform: scale(0.97); }
}
@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
  details.example summary::before { transition: none; }
}
@keyframes feed-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ========================================================================
   Narrower screens
   ======================================================================== */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .banner { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
  .banner-section.flip .banner-text { order: 0; }
  .banner-section { padding: var(--space-14) 0; }
}
@media (max-width: 760px) {
  .app-card { grid-template-columns: minmax(0, 1fr); }
  .card-links a { display: inline-block; padding: var(--space-2) 0; }
}
@media (max-width: 720px) {
  .grid.two { grid-template-columns: minmax(0, 1fr); }
  .shots { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .grid, .grid.two, .grid.cols-2, .principles, .step-cards { gap: var(--grid-gap-phone); }
  .card, .app-card { padding: var(--card-pad-phone); }
  .card > p:last-of-type { margin-bottom: 0; }
  .section { padding: var(--section-y-phone) 0; }
  .hero { padding: var(--hero-top-phone) 0 var(--space-12); }
  .page-head { padding: var(--page-top-phone) 0 var(--space-4); }
  .cta-band { padding: var(--space-7); }
  .footer-grid { padding-top: var(--space-12); }
  .trust a { display: inline-block; padding: 6px 0; }
  .toc ol { columns: 1; }
  /* Example JSON wraps on a phone instead of scrolling sideways. */
  .code code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .toc a { display: inline-block; padding: 6px 0; }
  /* Tool cards: icon, name and a two-line summary; the whole card is the link. */
  .tool-card h3, .tool-card h4 { margin: 14px 0 var(--space-1); font-size: 1.02rem; }
  .tool-card p { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tool-card .button { display: none; }
  /* Bigger tap targets */
  .site-footer ul.plain li { margin: 0; }
  .site-footer ul.plain a, .footer-brand a:not(.brand) { display: inline-block; padding: 10px 0; }
  .glance a { display: inline-block; padding: 6px 0; }
  .breadcrumbs a { display: inline-block; padding: var(--space-2) 0; }
  .cookie-banner { left: var(--space-3); right: var(--space-3); bottom: var(--space-3); font-size: 1rem; }
  .cookie-banner p a { display: inline-block; padding: var(--space-1) 0; }
  .cookie-actions { width: 100%; }
  .cookie-actions .button { flex: 1; min-height: 46px; }
}
@media (max-width: 520px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) {
  /* The window dots are decoration: on a phone the title gets their room and wraps instead of being cut. */
  .viz-dots { display: none; }
  .viz-bar { grid-template-columns: 1fr auto; }
  .viz-bar progress { grid-column: 1 / -1; grid-row: 2; }
  .viz-ad { grid-template-columns: 72px 1fr; }
}
@media (max-width: 420px) { .glance dl > div { grid-template-columns: 1fr; gap: 2px; } }
