/* Amories web: tokens and shared components.
   KEEP IN SYNC with the design: this file is `web.css` of the Claude Design project
   "Amories Web: Editor & Order Funnel" (company-brain/design/web/web.css), minus the
   Google Fonts import (fonts are self-hosted, see fonts.css) and the 1440×900 mock frame.
   Token and class names are identical on purpose: change a value in both places.
   Source of truth for values: company-brain/design/DESIGN_SYSTEM.md. */

:root {
  /* color — app chrome */
  --canvas: #ffffff;
  --canvas-subtle: #fafaf9;
  --surface: #f4f4f2;
  --surface-pressed: #eaeae7;
  --surface-disabled: #eeeeeb;
  --ink: #20211f;
  --ink-pressed: #353632;
  --ink-2: #62645f;
  --ink-3: #74766f;
  --ink-dis: #92948d;
  --on-ink: #ffffff;
  --divider: #e5e6e1;
  --control-border: #85877f;
  --accent: #725349;
  --accent-wash: #f3eae4;
  /* the cart's offer band (2026-11-17): a warm paper tone, like the book's pages */
  --oat-wash: #f4efe3;
  --sage-wash: #eaf0e8;
  --success: #376349;
  --warning: #805a1d;
  --warning-wash: #fbf2df;
  --danger: #a63838;
  --danger-wash: #faebe9;
  --scrim: rgba(0, 0, 0, 0.28);

  /* color — inside the book only (template "Magazine") */
  --book-red: #b5121b;
  --marker-red: #e3263a;
  --cream: #f3eee6;
  --book-black: #1a1a1a;

  /* type */
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --font-display: "Londrina Solid", var(--font-ui);
  --font-serif: "Bodoni Moda", Georgia, serif;
  --font-marker: "Caveat Brush", cursive;
  --font-hand: "Caveat", cursive;
  --font-small: "Inter", var(--font-ui);

  /* depth */
  --shadow-photo: 0 4px 10px rgba(0, 0, 0, 0.1);
  --shadow-stack: 0 8px 18px rgba(0, 0, 0, 0.12);
  --shadow-control: 0 2px 6px rgba(0, 0, 0, 0.07);
  --shadow-toolbar: 0 6px 18px rgba(0, 0, 0, 0.08);

  /* motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-move: cubic-bezier(0.77, 0, 0.175, 1);
}

@layer base {
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--canvas); color: var(--ink); }
body { font-family: var(--font-ui); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--ink); text-underline-offset: 3px; }
/* Hover only where there is a pointer that hovers: on touch a tapped control would stay highlighted. */
@media (hover: hover) { a:hover { color: var(--ink-2); } }
button { font: inherit; color: inherit; }
p { text-wrap: pretty; }
.tnum { font-variant-numeric: tabular-nums; }
  input, textarea, select { font: inherit; color: inherit; }
  :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
  ::selection { background: var(--accent-wash); }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  }
}

@layer components {
/* ── type tokens ─────────────────────────────── */
.t-display { font-family: var(--font-display); font-weight: 900; font-size: 36px; line-height: 40px; letter-spacing: 0; margin: 0; }
.t-screen { font-family: var(--font-display); font-weight: 900; font-size: 30px; line-height: 35px; margin: 0; }
.t-title { font-size: 24px; line-height: 29px; font-weight: 600; letter-spacing: -0.3px; margin: 0; }
.t-section { font-size: 20px; line-height: 25px; font-weight: 600; letter-spacing: -0.2px; margin: 0; }
.t-card { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.1px; margin: 0; }
.t-body { font-size: 17px; line-height: 24px; margin: 0; }
.t-small { font-size: 15px; line-height: 21px; margin: 0; }
.t-label { font-size: 15px; line-height: 20px; font-weight: 500; margin: 0; }
.t-caption { font-size: 13px; line-height: 18px; margin: 0; }
.t-micro { font-size: 11px; line-height: 14px; font-weight: 500; letter-spacing: 0.1px; margin: 0; }
.ink2 { color: var(--ink-2); }
.ink3 { color: var(--ink-3); }

/* ── buttons ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; cursor: pointer; white-space: nowrap;
  font-size: 17px; line-height: 22px; font-weight: 600; text-decoration: none;
  transition: transform 120ms var(--ease-out), background-color 160ms ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { min-height: 54px; padding: 0 24px; background: var(--ink); color: var(--on-ink); }
@media (hover: hover) { .btn-primary:hover { background: var(--ink-pressed); color: var(--on-ink); } }
.btn-primary:active { background: var(--ink-pressed); }
.btn-secondary { min-height: 50px; padding: 0 20px; background: var(--surface); color: var(--ink); }
@media (hover: hover) { .btn-secondary:hover { background: var(--surface-pressed); } }
.btn-secondary:active { background: var(--surface-pressed); }
.btn-outline { min-height: 50px; padding: 0 20px; background: var(--canvas); color: var(--ink); box-shadow: inset 0 0 0 1px var(--control-border); }
@media (hover: hover) { .btn-outline:hover { background: var(--surface); } }
.btn-outline:active { background: var(--surface); }
.btn-text { min-height: 44px; padding: 0 8px; background: transparent; color: var(--ink); }
@media (hover: hover) { .btn-text:hover { background: var(--surface); } }
.btn-text:active { background: var(--surface); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; line-height: 20px; }
.btn-disabled, .btn:disabled, .btn[aria-disabled="true"] { background: var(--surface-disabled); color: var(--ink-dis); cursor: not-allowed; }
.btn-disabled:active, .btn:disabled:active, .btn[aria-disabled="true"]:active { transform: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; border: 0; background: transparent; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none;
  transition: transform 120ms var(--ease-out), background-color 160ms ease;
}
@media (hover: hover) { .icon-btn:hover { background: var(--surface); } }
.icon-btn:active { background: var(--surface); transform: scale(0.96); }
.icon-btn.dim { color: var(--ink-dis); }
.icon-btn.float { background: var(--canvas); box-shadow: var(--shadow-control); width: 44px; height: 44px; }

/* ── form ────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-label { font-size: 15px; line-height: 20px; font-weight: 500; }
.input {
  min-height: 52px; padding: 0 16px; border-radius: 14px; background: var(--canvas);
  border: 1px solid var(--control-border); font-size: 17px; line-height: 24px; color: var(--ink);
  display: flex; align-items: center; width: 100%; font-family: inherit;
}
.input.focus, .input:focus-visible { border: 2px solid var(--ink); padding: 0 15px; outline: none; }
.input.error { border: 2px solid var(--danger); padding: 0 15px; }
.input .ph { color: var(--ink-3); }
.help { font-size: 13px; line-height: 18px; color: var(--ink-2); }
.err-msg { font-size: 13px; line-height: 18px; color: var(--danger); display: flex; gap: 6px; align-items: center; }

/* ── chips, badges, status ───────────────────── */
.chip { min-height: 34px; padding: 0 14px; border-radius: 999px; background: var(--surface); display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; border: 0; cursor: pointer; }
.chip.on { background: var(--ink); color: var(--on-ink); }
.badge { min-height: 24px; padding: 0 8px; border-radius: 999px; background: var(--surface); display: inline-flex; align-items: center; gap: 4px; font-size: 13px; line-height: 18px; font-weight: 500; white-space: nowrap; }
.badge.ink { background: var(--ink); color: var(--on-ink); }
.badge.warn { background: var(--warning-wash); color: var(--warning); }
.badge.sage { background: var(--sage-wash); color: var(--success); }
/* A fact about the product (Review's spec chips, 2026-11-18): outlined, no wash, so it never competes with a saving. */
.badge.line { background: var(--canvas); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--divider); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--ink-2); white-space: nowrap; }
.status.ok { color: var(--success); }
.status.bad { color: var(--danger); }

/* ── surfaces ────────────────────────────────── */
.card { background: var(--surface); border-radius: 20px; padding: 16px; }
.hairline { height: 1px; background: var(--divider); border: 0; margin: 0; }
.inline-feedback { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; font-size: 15px; line-height: 21px; }
.inline-feedback.warn { background: var(--warning-wash); }
.inline-feedback.bad { background: var(--danger-wash); }
.inline-feedback.ok { background: var(--sage-wash); }

/* ── wordmark ────────────────────────────────── */
.wordmark { font-family: var(--font-display); font-weight: 900; font-size: 24px; line-height: 1; letter-spacing: 0; color: var(--ink); text-decoration: none; }

/* ── paper photo object ──────────────────────── */
.paper { background: #fff; padding: 5px 5px 22px; border-radius: 4px; box-shadow: var(--shadow-photo); }
.paper.nocap { padding-bottom: 12px; }
.paper img, .paper .ph-img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 2px; }

/* ── progress ────────────────────────────────── */
.track { height: 4px; border-radius: 999px; background: var(--divider); overflow: hidden; }
.track > i { display: block; height: 100%; background: var(--ink); border-radius: 999px; }

/* ── segmented control (design system §5.5) ──── */
/* Up to three options. Editor: Memories or All photos. */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); min-height: 40px; padding: 3px; border-radius: 999px; background: var(--surface); }
.seg > button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 15px; line-height: 20px; font-weight: 500; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background-color 180ms var(--ease), color 180ms var(--ease), box-shadow 180ms var(--ease); }
@media (hover: hover) { .seg > button:hover { color: var(--ink); } }
.seg > button.on { background: var(--canvas); color: var(--ink); box-shadow: var(--shadow-control); }
/* On touch the 34 px segment is touched on 44 px: the hit area grows, the look doesn’t. */
@media (pointer: coarse) { .seg > button { position: relative; } .seg > button::before { content: ""; position: absolute; inset: -5px 0; } }

/* ── stepper (copies) ────────────────────────── */
.stepper { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: var(--surface); }
.stepper > button { width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; transition: transform 120ms var(--ease-out), background-color 160ms ease; }
@media (hover: hover) { .stepper > button:hover { background: var(--canvas); } }
.stepper > button:active { transform: scale(0.98); background: var(--canvas); }
.stepper > button[aria-disabled="true"] { color: var(--ink-dis); background: transparent; cursor: not-allowed; transform: none; }
.stepper > output { min-width: 28px; text-align: center; font-size: 17px; line-height: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* On touch each 40 px button is touched on 44 × 44 px (the stepper’s 2 px padding included). */
@media (pointer: coarse) { .stepper > button { position: relative; } .stepper > button::before { content: ""; position: absolute; inset: -2px; } }

/* ── prices ──────────────────────────────────── */
/* The full price next to a discounted one. ink-2, not ink-3: it also sits on surface and accent-wash. */
.was { color: var(--ink-2); font-weight: 400; text-decoration: line-through; text-decoration-thickness: 1px; font-variant-numeric: tabular-nums; }

/* ── cart button with copies count ───────────── */
.cart-btn { position: relative; text-decoration: none; }
.cart-btn .count { position: absolute; right: -2px; top: -2px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 12px; line-height: 20px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--canvas); pointer-events: none; }

/* ── free shipping bar (Review, Cart) ────────── */
/* Fills with transform only (280 ms); the end node turns into a check when reached. Words say it too. */
.ship-bar { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; border-radius: 20px; background: var(--canvas); box-shadow: inset 0 0 0 1px var(--divider); transition: background-color 280ms var(--ease); }
.ship-bar strong { font-weight: 600; }
.ship-bar.reached { background: var(--sage-wash); box-shadow: none; color: var(--success); }
.ship-track { position: relative; height: 6px; margin-right: 12px; border-radius: 999px; background: var(--surface-pressed); }
.ship-fill { position: absolute; inset: 0; border-radius: 999px; background: var(--ink); transform-origin: left center; transition: transform 280ms var(--ease-out); }
.ship-bar.reached .ship-fill { background: var(--success); }
.ship-end { position: absolute; right: -12px; top: 50%; width: 24px; height: 24px; margin-top: -12px; border-radius: 999px; background: var(--canvas); box-shadow: inset 0 0 0 2px var(--control-border); color: var(--ink-2); display: flex; align-items: center; justify-content: center; transition: background-color 180ms var(--ease), color 180ms var(--ease); }
.ship-bar.reached .ship-end { background: var(--success); box-shadow: none; color: var(--on-ink); }

/* ── copies cards (Review) ───────────────────── */
/* Native radios in labels: one tab stop, arrow keys move between the cards. */
.qty-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 8px; margin: 0; padding: 12px 0 0; border: 0; min-width: 0; }
.qty-card { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 44px; padding: 12px 14px; border-radius: 16px; background: var(--canvas); box-shadow: inset 0 0 0 1px var(--control-border); cursor: pointer; transition: box-shadow 160ms ease, background-color 160ms ease, transform 160ms var(--ease-out); }
.qty-card:active { transform: scale(0.97); }
.qty-card input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
@media (hover: hover) { .qty-card:hover { background: var(--canvas-subtle); } }
.qty-card:has(input:checked) { box-shadow: inset 0 0 0 2px var(--ink); background: var(--canvas); }
.qty-card:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
/* One copy has nothing to save, so it is the shorter card; all three start on one line at the top (2026-11-17). */
.qty-card.plain { align-self: start; }
/* "Most popular" (2026-11-17): the card is lifted off the page, its flag is a full-size ink pill with a heart,
   centred on the top edge and out of the flow, so the card keeps its layout. The canvas ring separates it from the border. */
.qty-card.popular { box-shadow: inset 0 0 0 1px var(--control-border), 0 10px 24px -12px rgba(32, 33, 31, 0.28); }
.qty-card.popular:has(input:checked) { box-shadow: inset 0 0 0 2px var(--ink), 0 10px 24px -12px rgba(32, 33, 31, 0.28); }
.qty-card .qty-card-flag { position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); margin: 0; min-height: 26px; padding: 0 12px 0 10px; gap: 5px; font-size: 13px; line-height: 18px; font-weight: 600; box-shadow: 0 0 0 3px var(--canvas); pointer-events: none; z-index: 1; }
/* The savings band (2026-11-17): the card's foot, edge to edge like the cart's offer band, "2nd copy 40% off". It stops at the
   card's border (1 px, 2 px when chosen: --qty-bw) so the border stays whole, its corners following the card's. */
.qty-card { --qty-bw: 1px; }
.qty-card:has(input:checked) { --qty-bw: 2px; }
.qty-save { margin: auto calc(var(--qty-bw) - 14px) calc(var(--qty-bw) - 12px); padding: 8px calc(14px - var(--qty-bw)); border-radius: 0 0 calc(16px - var(--qty-bw)) calc(16px - var(--qty-bw)); background: var(--sage-wash); color: var(--success); font-size: 14px; line-height: 20px; font-weight: 600; text-wrap: balance; }
.qty-card .qty-price { margin-bottom: 10px; }
.qty-card.plain .qty-price { margin-bottom: 0; }

/* ── satisfaction guarantee (Review, Cart, Checkout) ── */
.guarantee { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.guarantee-line { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font-size: 15px; line-height: 20px; font-weight: 500; cursor: pointer; transition: background-color 160ms ease; }
@media (hover: hover) { .guarantee-line:hover { background: var(--surface); } }
.guarantee-line > svg:last-child { color: var(--ink-2); transition: transform 180ms var(--ease); }
.guarantee.open .guarantee-line > svg:last-child { transform: rotate(180deg); }
.guarantee-body { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 12px 16px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--divider); text-align: left; }
.guarantee-body[hidden] { display: none; }
.guarantee-body p { margin: 0; }

/* ── delivery estimate (Review, 2026-11-18) ─── */
/* A date range under the button, not a speed: "Arrives Mon 30 Nov – Wed 2 Dec". */
/* The icon sits in the text, so a phone's wrapped line stays centred with it. */
.eta { display: block; font-size: 15px; line-height: 20px; color: var(--ink); text-align: center; text-wrap: balance; }
.eta > svg { display: inline-block; vertical-align: -3px; margin-right: 8px; color: var(--ink-2); }
.eta strong { font-weight: 600; white-space: nowrap; }

/* ── disclosures (Review's details, 2026-11-18) ── */
/* Stacked sections with hairlines, never tabs. Each header is a real button in a heading; several can be open.
   No height animation: the body is simply there when opened. Only the chevron turns, 180 ms. */
.disclosures { display: flex; flex-direction: column; margin: 0; border-bottom: 1px solid var(--divider); }
.disclosure { border-top: 1px solid var(--divider); scroll-margin-top: 16px; }
.disclosure > h3 { margin: 0; }
.disclosure-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 0 4px; border: 0; background: transparent; color: var(--ink); font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.1px; text-align: left; cursor: pointer; border-radius: 8px; }
.disclosure-btn > svg { flex: none; color: var(--ink-2); transition: transform 180ms var(--ease); }
.disclosure.open .disclosure-btn > svg { transform: rotate(180deg); }
.disclosure-body { display: flex; flex-direction: column; gap: 10px; padding: 0 4px 20px; font-size: 15px; line-height: 21px; color: var(--ink-2); }
.disclosure-body[hidden] { display: none; }
.disclosure-body p { margin: 0; }
.disclosure-body strong { color: var(--ink); font-weight: 600; }
/* label | value rows, for specs */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 0; }
.facts dt { color: var(--ink); font-weight: 500; }
.facts dd { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .ship-bar, .ship-fill, .ship-end, .guarantee-line > svg:last-child, .disclosure-btn > svg { transition: none; }
}

/* ── focus ───────────────────────────────────── */
.focus-ring { outline: 2px solid var(--ink); outline-offset: 2px; }
}
