@layer reset, tokens, base, components, utilities;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

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

  body,
  h1,
  h2,
  h3,
  p,
  ul,
  ol {
    margin: 0;
  }

  ul,
  ol {
    padding: 0;
    list-style: none;
  }

  img,
  svg {
    display: block;
    max-width: 100%;
  }

  button,
  input,
  select,
  textarea {
    font: inherit;
  }
}

@layer tokens {
  :root {
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --color-ink: #1e1b4b;
    --color-ink-soft: #3a3570;
    --color-body: #4a4760;
    --color-muted: #6b6878;
    --color-surface: #faf8f5;
    --color-surface-raised: #ffffff;
    --color-surface-subtle: #f1ece4;
    --color-border: #ece8e1;
    --color-accent: #f08a1c;
    --color-accent-dark: #d9740c;
    --color-accent-soft: #f5a04a;
    --color-success: #2f7d4e;
    --color-success-soft: #e6f2ea;

    --container: 1200px;
    --gutter: clamp(16px, 5vw, 48px);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 999px;

    --shadow-card: 0 18px 40px rgb(30 27 75 / 12%);
    --shadow-device: 0 40px 80px rgb(30 27 75 / 18%), 0 8px 24px rgb(30 27 75 / 10%);
  }
}

@layer base {
  html {
    scroll-behavior: smooth;
  }

  body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    background: var(--color-surface);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
  }

  main {
    flex: 1;
  }

  a {
    color: inherit;
  }

  a:hover {
    color: var(--color-accent-dark);
  }

  :focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
  }
}

@layer components {
  .container {
    width: min(100% - (var(--gutter) * 2), var(--container));
    margin-inline: auto;
  }

  .skip-link {
    position: absolute;
    z-index: 20;
    top: 12px;
    left: 12px;
    translate: 0 -200%;
    border-radius: var(--radius-pill);
    background: var(--color-ink);
    padding: 10px 18px;
    color: var(--color-surface-raised);
    font-weight: 700;
    text-decoration: none;
  }

  .skip-link:focus {
    translate: 0;
  }

  .site-header {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
  }

  .site-header__inner {
    display: flex;
    flex-wrap: wrap;
    min-height: 76px;
    align-items: center;
    gap: 12px 24px;
  }

  .site-header__brand {
    display: inline-flex;
    align-items: center;
    flex: none;
    text-decoration: none;
  }

  .site-header__brand img {
    width: auto;
    height: 34px;
  }

  .site-nav {
    display: flex;
    align-items: center;
    gap: 34px;
    margin-inline: auto;
    font-size: 15px;
    font-weight: 600;
  }

  .site-nav a {
    padding-block: 6px;
    color: var(--color-body);
    text-decoration: none;
  }

  .site-nav a:hover {
    color: var(--color-ink);
    box-shadow: inset 0 -2px 0 var(--color-accent);
  }

  .site-header__cta {
    flex: none;
  }

  .button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-pill);
    padding: 0 22px;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition:
      background-color 160ms ease,
      color 160ms ease,
      border-color 160ms ease;
  }

  .button--primary {
    background: var(--color-ink);
    color: var(--color-surface-raised);
  }

  .button--primary:hover {
    background: var(--color-ink-soft);
    color: var(--color-surface-raised);
  }

  .button--ghost {
    border: 1px solid var(--color-border);
    background: var(--color-surface-raised);
    color: var(--color-ink);
  }

  .button--ghost:hover {
    border-color: var(--color-ink);
    color: var(--color-ink);
  }

  .button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }

  .site-footer {
    background: var(--color-ink);
    color: var(--color-surface-raised);
    padding-block: 64px 32px;
  }

  .site-footer a {
    color: #e4e2f2;
    text-decoration: none;
  }

  .site-footer a:hover {
    color: var(--color-accent-soft);
  }

  .site-footer__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
  }

  .site-footer__brand {
    display: flex;
    max-width: 360px;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: #c9c6e0;
  }

  .site-footer__tagline {
    color: var(--color-surface-raised);
    font-size: 15px;
    font-weight: 700;
  }

  .site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 32px 64px;
    font-size: 15px;
  }

  .site-footer__nav > div {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .site-footer__label {
    color: var(--color-accent-soft);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 24px;
    margin-top: 44px;
    border-top: 1px solid var(--color-ink-soft);
    padding-top: 28px;
    color: #c9c6e0;
    font-size: 13px;
  }
}

@layer utilities {
  .eyebrow {
    color: var(--color-accent-dark);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .lede {
    max-width: 44em;
    color: var(--color-body);
    font-size: clamp(17px, 1.8vw, 20px);
    line-height: 1.6;
    text-wrap: pretty;
  }

  .page-shell {
    max-width: 820px;
    padding-block: clamp(64px, 10vw, 120px);
  }

  .page-shell h1 {
    max-width: 16ch;
    margin-top: 14px;
    font-family: var(--font-display);
    font-size: clamp(42px, 6vw, 72px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.02;
    text-wrap: balance;
  }

  .page-shell .lede {
    margin-top: 22px;
  }

  .page-shell p + p {
    margin-top: 18px;
  }

  .page-shell .button-row {
    margin-top: 30px;
  }

  .service-hero {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-raised);
  }

  .service-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: clamp(32px, 6vw, 72px);
    align-items: center;
    padding-block: clamp(48px, 7vw, 96px);
  }

  .service-hero h1 {
    max-width: 13ch;
    margin-top: 14px;
    font-family: var(--font-display);
    font-size: clamp(40px, 6vw, 68px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.02;
    text-wrap: balance;
  }

  .service-hero .lede {
    margin-top: 20px;
  }

  .service-hero .button-row {
    margin-top: 28px;
  }

  .service-hero__icon {
    display: grid;
    width: min(100%, 340px);
    aspect-ratio: 1;
    justify-self: end;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-surface-subtle);
    padding: clamp(24px, 4vw, 48px);
  }

  .service-hero__icon img {
    width: 72%;
    height: auto;
  }

  .service-details {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
    gap: clamp(32px, 6vw, 64px);
    align-items: start;
    padding-block: clamp(48px, 7vw, 88px);
  }

  .service-details h2,
  .service-card h2 {
    font-family: var(--font-display);
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
  }

  .service-details p {
    margin-top: 16px;
    color: var(--color-body);
    font-size: 17px;
  }

  .service-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface-raised);
    padding: 28px;
    box-shadow: var(--shadow-card);
  }

  .service-card p {
    margin-top: 12px;
    color: var(--color-body);
    font-size: 15px;
  }

  .service-card .button {
    margin-top: 22px;
    width: 100%;
  }

  @media (max-width: 1100px) {
    .site-nav {
      gap: 22px;
    }
  }

  @media (max-width: 860px) {
    .site-header__inner {
      padding-block: 14px;
    }

    .site-nav {
      order: 3;
      width: 100%;
      margin-inline: 0;
      gap: 22px;
      overflow-x: auto;
      padding-block: 2px;
      white-space: nowrap;
    }

    .site-header__cta {
      margin-left: auto;
    }

    .service-hero__inner,
    .service-details {
      grid-template-columns: 1fr;
    }

    .service-hero__icon {
      justify-self: start;
      width: min(100%, 280px);
    }
  }
}

/* Editorial, campaign and support pages share the site design tokens. */
@layer components {
  .converted-page { overflow-wrap: anywhere; }
  .converted-page .page-shell { max-width: 900px; }
  .converted-page > .container { padding-block: clamp(28px, 4.5vw, 60px); }
  .converted-page h1 { font-family: var(--font-display); font-size: clamp(36px, 5vw, 64px); line-height: 1.08; letter-spacing: -.03em; max-width: 22ch; }
  .converted-page h2 { font-family: var(--font-display); font-size: clamp(26px, 3vw, 36px); line-height: 1.2; margin-block: 36px 16px; }
  .converted-page h3 { font-size: 20px; line-height: 1.35; margin-block: 24px 12px; }
  .converted-page p { margin-block: 14px; color: var(--color-body); }
  .converted-page ul, .converted-page ol { padding-left: 24px; margin-block: 20px; }
  .converted-page ul { list-style: disc; }
  .converted-page ol { list-style: decimal; }
  .converted-page li + li { margin-top: 10px; }
  .converted-page figure { margin: 28px 0; }
  .converted-page figcaption, .sources, .author-card, .breadcrumb, .breadcrumbs { font-size: 14px; color: var(--color-muted); }
  .converted-page img { height: auto; border-radius: var(--radius-md); }
  .converted-page video { width: 100%; height: auto; border-radius: var(--radius-md); }
  .converted-page iframe { width: 100%; border: 1px solid var(--color-border); border-radius: var(--radius-md); min-height: 440px; }
  .converted-page table { display: block; overflow-x: auto; border-collapse: collapse; margin-block: 24px; max-width: 100%; }
  .converted-page th, .converted-page td { padding: 12px; text-align: left; border: 1px solid var(--color-border); }
  .converted-page blockquote { border-left: 3px solid var(--color-accent); margin-inline: 0; padding-left: 24px; }
  .converted-page .button-row { margin-block: 24px; }
  .download-grid, .content-container, .metrics-grid, .statstrip, .related-grid, .blog-grid, .ph-steps, .ph-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 24px; margin-block: 32px; }
  .download-grid .qr { width: 240px; max-width: 100%; margin: 24px auto; }
  .download-grid h2, .service-card h2 { margin-top: 0; }
  .converted-page .step img { max-height: 560px; object-fit: contain; margin-top: 20px; }
  .gift-details { margin-block: 32px; }
  #gift-code { font-family: monospace; font-size: 20px; user-select: all; }
  .converted-page button:disabled { cursor: default; opacity: .6; }
  .post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 48px; }
  .article-wrap { min-width: 0; }
  .article-wrap h1 { margin-block: 20px; }
  .article-hero, .article-banner { width: 100%; margin-block: 28px; }
  .author-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-block: 22px; }
  .author-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--color-ink); color: white; font-weight: 800; }
  .author-meta { display: flex; flex-direction: column; }
  .article-tag, .rtag, .blog-card__tag, .blog-hero__eyebrow, .ph-eyebrow { color: var(--color-accent-dark); font-size: 13px; font-weight: 800; }
  .toc-inner { position: sticky; top: 24px; border-left: 1px solid var(--color-border); padding-left: 20px; }
  .toc-nav { display: grid; gap: 14px; font-size: 14px; }
  .toc-title { font-weight: 800; }
  .stat, .metric-card, .ph-step, .ph-chip, .highlight-box, .callout { background: var(--color-surface-raised); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 24px; }
  .num, .metric-value { font-family: var(--font-display); font-size: 34px; color: var(--color-ink); }
  .lbl, .metric-description { font-size: 14px; }
  .stat .src { font-size: 12px; margin-top: 12px; }
  .faq-q { font-weight: 800; padding-top: 14px; }
  .article-cta, .service-cta, .ph-proof { margin-block: 36px; padding: 28px; background: var(--color-surface-subtle); border-radius: var(--radius-lg); }
  .article-cta h2 { margin-top: 0; }
  .download-app-btn, .service-cta-button, .ph-btn, .download-btn { display: inline-flex; align-items: center; justify-content: center; padding: 14px 22px; border-radius: var(--radius-pill); background: var(--color-ink); color: white; font-weight: 800; text-decoration: none; }
  .download-app-btn:hover, .ph-btn:hover, .download-btn:hover { color: white; background: var(--color-ink-soft); }
  .prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-block: 36px; }
  .pn span, .pn strong { display: block; }
  .blog-card, .rcard, .promo { display: block; border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; background: white; text-decoration: none; }
  .blog-card__body, .rcard-b, .promo { padding: 24px; }
  .blog-card img, .rcard img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: contain; border-radius: 0; }
  .blog-card h3, .rcard h3 { margin-top: 12px; }
  .blog-card__meta { color: var(--color-muted); font-size: 12px; }
  .blog-card__topline, .blog-section__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
  .promo__icon svg { width: 40px; height: 40px; }
  .feat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--color-surface-subtle); border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; margin-block: 36px; }
  .feat__media { display: grid; align-items: center; }
  .feat__media img { display: block; width: 100%; height: auto; }
  .feat__body { padding: clamp(24px, 4vw, 48px); }
  .feat__badge { display: block; font-weight: 800; }
  .chip-row { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 28px; }
  .chip { border: 1px solid var(--color-border); border-radius: var(--radius-pill); padding: 10px 18px; text-decoration: none; background: white; }
  .ph-hero { border-bottom: 1px solid var(--color-border); }
  .ph-hero__in { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .5fr); gap: 48px; align-items: center; padding-block: 64px; }
  .ph-hero__visual img { max-height: 480px; margin-inline: auto; }
  .ph-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 24px; }
  .ph-h1 { margin-top: 20px; }
  .ph-sec { padding-block: 32px; }
  .ph-sec--tint { background: var(--color-surface-subtle); }
  .ph-form { max-width: 720px; margin-block: 24px; }
  .ph-step__n { color: var(--color-accent-dark); font-weight: 800; font-size: 28px; }
  .header-row { display: flex; align-items: center; gap: 16px; }
  .download-icon { font-size: 28px; }
  .pitch-preview { margin-bottom: 24px; }
  @media (max-width: 900px) {
    .post-layout { grid-template-columns: minmax(0, 1fr); }
    .toc { display: none; }
  }
  @media (max-width: 600px) {
    .feat, .ph-hero__in, .prevnext { grid-template-columns: minmax(0, 1fr); }
    .ph-hero__visual img { max-height: 320px; }
    .converted-page .content-container { grid-template-columns: minmax(0, 1fr); }
  }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
}
