/* =============================================================================
   Grounded Carts — shared foundation for the Apps pages
   -----------------------------------------------------------------------------
   Tokens and primitives copied verbatim from index.html so /apps and
   /apps/order-edits are the same design system, not a second one. The homepage
   keeps its own proven inline CSS untouched; tools/verify-website.js asserts the
   token values here still match index.html so the two cannot drift apart.
   ============================================================================= */

:root {
  --bg: #FAFAF7;          /* near-white with the barest warmth — editorial */
  --bg-soft: #F0F0EA;     /* soft stone — section alternates */
  --sand: #E2E2DC;
  --line: #D8D8D2;
  --ink: #1B1F23;         /* cool charcoal, not warm brown */
  --ink-soft: #4A5159;
  --muted: #6B7280;
  --muted-strong: #5D6570;
  --accent: #4A6B4A;      /* sage / olive — grounded, professional */
  --accent-deep: #2D4A2D; /* deep forest hover */
  --warm: #B89060;        /* soft brass for accents */
  --gold: #B89060;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --maxw: 1180px;
  --radius: 0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

.visually-hidden { position: absolute; 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: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; font-size: 13px; font-weight: 500; border: 0; transition: top 0.15s ease; }
.skip-link:focus { top: 12px; }

body {
  background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 17px; line-height: 1.6;
  counter-reset: sec;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; }
ul { list-style: none; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; line-height: 1.1; color: var(--ink); }
h1 { font-size: clamp(40px, 6vw, 72px); font-weight: 500; letter-spacing: -0.02em; }
h2 { font-size: clamp(30px, 4.2vw, 46px); }
h3 { font-size: clamp(22px, 2.4vw, 28px); }
p { color: var(--ink-soft); }
.eyebrow { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-soft); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.final-cta :focus-visible { outline-color: var(--gold); }

/* Topbar — printed running head */
.topbar { background: var(--bg); color: var(--muted); border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 8px 0; text-align: center; }
.topbar strong { color: var(--ink); font-weight: 600; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--ink); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-family: var(--serif); font-size: 24px; font-weight: 500; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 32px; font-size: 13px; color: var(--ink-soft); }
.nav-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-cta { display: inline-flex; align-items: center; background: none; border: 0; border-radius: 0; padding: 4px 0; border-bottom: 1px solid var(--ink); color: var(--ink); font-size: 13px; font-weight: 500; transition: color 0.15s ease, border-color 0.15s ease; }
.nav-cta:hover { color: var(--accent-deep); border-color: var(--accent-deep); }
.nav-actions { display: flex; gap: 12px; align-items: center; }
.mobile-nav { display: none; position: relative; }
.mobile-nav summary { list-style: none; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink); padding: 4px 0; border-bottom: 1px solid var(--ink); }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav[open] summary { color: var(--accent-deep); border-color: var(--accent-deep); }
.mobile-nav-panel { position: absolute; top: calc(100% + 10px); right: 0; background: var(--bg); border: 1px solid var(--ink); min-width: 200px; z-index: 60; display: flex; flex-direction: column; }
.mobile-nav-panel a { padding: 13px 16px; font-size: 14px; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.mobile-nav-panel a:last-child { border-bottom: 0; }
.mobile-nav-panel a:hover { background: var(--bg-soft); color: var(--ink); }
.mobile-nav-panel a[aria-current="page"] { color: var(--ink); font-weight: 600; }
@media (max-width: 760px) {
  .nav-links { display: none; }
  .mobile-nav { display: block; }
}
@media (max-width: 400px) { .brand { font-size: 20px; } .nav-inner { height: 60px; } }

/* Buttons — two print-flavoured styles only */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0; padding: 15px 28px; border-radius: 0; font-family: var(--sans); font-size: 15px; font-weight: 500; border: 1px solid transparent; cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease; }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-ghost { display: inline-flex; align-items: center; background: none; border: 0; border-radius: 0; padding: 4px 0; border-bottom: 1px solid var(--ink); color: var(--ink); }
.btn-ghost:hover { color: var(--accent-deep); border-color: var(--accent-deep); }

/* Sections — numbered magazine folios */
section { padding: 96px 0; }
.section-head { display: grid; grid-template-columns: 220px 1fr; gap: 48px; align-items: start; border-top: 1px solid var(--ink); padding-top: 28px; margin-bottom: 64px; }
.section-head .eyebrow { grid-column: 1; grid-row: 1 / span 2; }
.section-head .eyebrow::before { counter-increment: sec; content: counter(sec, decimal-leading-zero); color: var(--ink); font-weight: 700; margin-right: 12px; }
.section-head h2 { grid-column: 2; margin-top: 0; }
.section-head p { grid-column: 2; margin-top: 16px; max-width: 60ch; }
@media (max-width: 760px) {
  .section-head { grid-template-columns: 1fr; gap: 12px; }
  .section-head .eyebrow { grid-column: 1; grid-row: auto; }
  .section-head h2, .section-head p { grid-column: 1; }
}

/* Final CTA — the page's one ink moment, full-bleed */
.final-cta { background: var(--ink); color: var(--bg); border-radius: 0; padding: 104px 0; text-align: left; margin: 96px 0 0; }
.final-cta h2 { color: var(--bg); font-size: clamp(34px, 4.6vw, 56px); max-width: 24ch; margin-bottom: 24px; }
.final-cta p { color: rgba(250,247,242,0.8); max-width: 54ch; margin: 0 0 40px; }
.final-cta .btn-primary { background: var(--bg); color: var(--ink); border-color: var(--bg); border-radius: 0; }
.final-cta .btn-primary:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.final-cta .btn-ghost { color: var(--bg); border-bottom-color: var(--bg); margin-left: 28px; }
.final-cta .btn-ghost:hover { color: var(--gold); border-color: var(--gold); }

/* Footer — colophon */
footer { border-top: 0; margin-top: 0; padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-inner p, .footer-links { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--ink); }

/* =============================================================================
   Apps-page primitives — same rules, thin borders and spacing as the homepage,
   just slightly more product-oriented.
   ============================================================================= */

/* Breadcrumbs */
.crumbs { padding: 20px 0 0; font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--sand); }
.crumbs a { border-bottom: 1px solid transparent; }
.crumbs a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.crumbs [aria-current="page"] { color: var(--ink-soft); }

/* App hero */
.app-hero { padding: 48px 0 72px; }
.app-hero h1 { margin-top: 16px; font-size: clamp(40px, 6.4vw, 82px); line-height: 1.0; letter-spacing: -0.02em; max-width: 20ch; }
.app-hero h1 em { font-style: italic; color: var(--accent-deep); font-weight: 500; }
.app-hero .lede { max-width: 60ch; margin-top: 28px; }
.app-hero-ctas { display: flex; gap: 28px; margin-top: 36px; align-items: center; flex-wrap: wrap; }
.commercial-line { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--ink); font-size: 14.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; max-width: 60ch; }

/* Pending / status note — the honest App Store state */
.pending-state { display: inline-flex; align-items: center; padding: 15px 0; font-size: 15px; font-weight: 500; color: var(--muted-strong); border-bottom: 1px dashed var(--line); }

/* App card — the portfolio entry */
.app-card { border-top: 2px solid var(--ink); padding-top: 32px; display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 64px; align-items: start; }
@media (max-width: 880px) { .app-card { grid-template-columns: 1fr; gap: 36px; } }
.app-card-name { font-family: var(--serif); font-size: clamp(28px, 3.4vw, 40px); font-weight: 500; margin: 0; }
.app-card-endorse { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-deep); margin-bottom: 10px; }
.app-card p { margin-top: 14px; max-width: 56ch; font-size: 16.5px; }
.app-card-ctas { margin-top: 28px; display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.app-terms { border: 1px solid var(--ink); padding: 28px 28px 24px; }
.app-terms .k { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-strong); }
.app-terms .plan-figure { font-family: var(--serif); font-size: 56px; line-height: 1; margin: 14px 0 2px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.app-terms .plan-figure span { font-size: 15px; font-family: var(--sans); color: var(--muted-strong); letter-spacing: 0; }
.app-terms .plan-alt { font-size: 14px; color: var(--muted-strong); margin-bottom: 18px; font-variant-numeric: tabular-nums; }
.app-terms ul { border-top: 1px solid var(--line); }
.app-terms li { font-size: 14px; color: var(--ink-soft); padding: 9px 0; border-bottom: 1px solid var(--sand); display: flex; gap: 10px; }
.app-terms li:last-child { border-bottom: 0; }
.app-terms li::before { content: "—"; color: var(--muted); flex-shrink: 0; }

/* Feature rows — ruled entries, no cards */
.feature-list { border-bottom: 1px solid var(--line); }
.feature { display: grid; grid-template-columns: 220px 1fr; gap: 48px; border-top: 1px solid var(--line); padding: 32px 0; align-items: start; }
.feature h3 { font-size: clamp(20px, 2.1vw, 25px); margin: 0; }
.feature-num { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); font-weight: 700; }
.feature-cat { display: block; font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--accent-deep); margin-top: 8px; }
.feature p { margin-top: 10px; font-size: 15.5px; max-width: 64ch; }
@media (max-width: 760px) { .feature { grid-template-columns: 1fr; gap: 12px; } }

/* Three-step explainer */
.steps { border-bottom: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 90px 280px 1fr; gap: 32px; align-items: baseline; border-top: 1px solid var(--line); padding: 28px 0; }
.step-num { font-family: var(--serif); font-size: 34px; color: var(--ink); }
.step h3 { margin: 0; font-size: 24px; }
.step p { font-size: 15px; color: var(--ink-soft); max-width: 56ch; margin: 0; }
@media (max-width: 760px) {
  .step { grid-template-columns: 56px 1fr; gap: 8px 24px; }
  .step h3, .step p { grid-column: 2; }
}

/* Two-column ruled control list */
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; border-top: 1px solid var(--ink); }
@media (max-width: 760px) { .control-grid { grid-template-columns: 1fr; gap: 0; } }
.control { border-bottom: 1px solid var(--line); padding: 22px 0; }
.control h3 { font-size: 18px; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
.control p { margin-top: 6px; font-size: 14.5px; max-width: 46ch; }

/* Problem list — run-in set lines */
.problem-list { margin-top: 40px; border-top: 1px solid var(--ink); }
.problem-list li { border-bottom: 1px solid var(--line); padding: 18px 0; font-family: var(--serif); font-size: clamp(20px, 2.2vw, 27px); color: var(--ink); }
.problem-list li span { display: block; font-family: var(--sans); font-size: 14.5px; color: var(--ink-soft); margin-top: 6px; max-width: 60ch; }

/* Pricing block */
.plan { max-width: 1020px; border-top: 2px solid var(--ink); display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .plan { grid-template-columns: 1fr; } }
.plan-col { padding: 36px 48px 36px 0; }
.plan-col + .plan-col { border-left: 1px solid var(--line); padding-left: 48px; padding-right: 0; }
@media (max-width: 760px) {
  .plan-col { padding: 28px 0; }
  .plan-col + .plan-col { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
}
.plan-name { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.plan-price { font-family: var(--serif); font-size: 64px; margin: 14px 0 2px; line-height: 1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.plan-price .cur { font-size: 15px; font-family: var(--sans); color: var(--muted-strong); margin-left: 6px; letter-spacing: 0.04em; }
.plan-sub { font-size: 14px; color: var(--muted-strong); }
.plan-list { margin-top: 22px; border-top: 1px solid var(--line); }
.plan-list li { font-size: 15px; color: var(--ink-soft); padding: 10px 0; border-bottom: 1px solid var(--sand); display: flex; gap: 10px; }
.plan-list li:last-child { border-bottom: 0; }
.plan-list li::before { content: "—"; color: var(--muted); flex-shrink: 0; }
.plan-note { margin-top: 26px; font-size: 13.5px; color: var(--muted-strong); max-width: 62ch; }

/* Pull-quote / positioning statement */
.statement { max-width: 58ch; margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(21px, 2.4vw, 27px); line-height: 1.5; color: var(--ink); }
.statement::before { content: ""; display: block; width: 48px; height: 0; border-top: 1px solid var(--ink); margin-bottom: 20px; }

/* Trust / built-by block */
.builtby { border-top: 1px solid var(--ink); padding-top: 28px; max-width: 66ch; }
.builtby p { font-size: 16.5px; }
.builtby a { color: var(--accent); border-bottom: 1px solid currentColor; }

/* FAQ — native <details>, keyboard-accessible with no JavaScript */
.faq-grid { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 48px; align-items: start; }
@media (max-width: 880px) { .faq-grid { grid-template-columns: 1fr; } }
.faq-list { border-top: 1px solid var(--ink); counter-reset: faq; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item > summary { list-style: none; cursor: pointer; padding: 22px 0; font-family: var(--serif); font-size: 21px; font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 16px; min-height: 44px; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::before { counter-increment: faq; content: counter(faq, decimal-leading-zero); font-family: var(--sans); font-size: 11px; letter-spacing: 0.1em; font-weight: 600; color: var(--muted); margin-right: 22px; flex-shrink: 0; }
.faq-item > summary::after { content: "+"; margin-left: auto; font-size: 24px; color: var(--ink); font-weight: 300; transition: transform 0.2s ease; }
.faq-item[open] > summary::after { transform: rotate(45deg); }
.faq-item .faq-a { font-size: 15.5px; color: var(--ink-soft); max-width: 62ch; padding: 0 0 24px 44px; }
.faq-item .faq-a p + p { margin-top: 12px; }
@media (max-width: 520px) { .faq-item .faq-a { padding-left: 0; } }

/* Cross-link back to the studio */
.cross { border-top: 1px solid var(--ink); padding-top: 28px; display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; align-items: baseline; }
.cross p { max-width: 56ch; font-size: 15.5px; }

/* -----------------------------------------------------------------------------
   Touch targets
   The homepage's rule-underline controls (.nav-cta, .btn-ghost, the mobile Menu
   disclosure, breadcrumbs) are visually thin by design. Rather than change the
   type or the underline position — which would fork the look from the homepage —
   these expand the *hit area* with an overlay so nothing moves by a pixel.
   -------------------------------------------------------------------------- */
.nav-cta, .mobile-nav summary, .btn-ghost, .crumbs a { position: relative; }
.nav-cta::after, .mobile-nav summary::after, .btn-ghost::after {
  content: ""; position: absolute; left: -6px; right: -6px; top: -9px; bottom: -9px;
}
.crumbs a::after { content: ""; position: absolute; left: 0; right: 0; top: -14px; bottom: -14px; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
