/* Photobook Studio mock: styles. System fonts only, no external files. */

:root {
  --paper: #F7F3EC;
  --surface: #FFFDF9;
  --stage: #EFE9DF;
  --ink: #1E2226;
  --ink-2: #464C54;
  --muted: #6E737A;
  --line: #E3DCD0;
  --accent: #0F766E;
  --accent-strong: #0B5F58;
  --accent-soft: #DDEFEC;
  --badge: #1E2226;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", Times, serif;
  --bar-h: 84px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  padding-bottom: var(--bar-h);
}

a { color: inherit; }
button { font: inherit; }

/* ---------- top bar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar__inner {
  max-width: 1320px; margin: 0 auto; padding: 16px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.wordmark__mark { width: 36px; height: 29px; color: var(--accent); flex: none; }
.wordmark__text { font-size: 22px; letter-spacing: -0.01em; color: var(--ink-2); white-space: nowrap; }
.wordmark__text strong { color: var(--ink); font-weight: 750; }
.topbar__links { display: flex; align-items: center; gap: 24px; }
.topbar__link { text-decoration: none; color: var(--ink-2); font-size: 16px; }
.topbar__link:hover { color: var(--ink); text-decoration: underline; }
.topbar__bag {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-strong);
}
.topbar__bag svg { width: 22px; height: 22px; }

/* ---------- stepper ---------- */
.stepper { border-top: 1px solid var(--line); }
.stepper__list {
  list-style: none; margin: 0 auto; padding: 12px 40px; max-width: 1320px;
  display: flex; justify-content: center; gap: 12px;
}
.stepper__step { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 16px; }
.stepper__step + .stepper__step::before {
  content: ""; width: 48px; height: 2px; background: var(--line); border-radius: 2px; margin-right: 2px;
}
.stepper__dot {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line); font-size: 14px; font-weight: 700; color: var(--muted); background: var(--surface);
}
.stepper__dot svg { width: 14px; height: 14px; }
.stepper__step.is-done { color: var(--ink-2); }
.stepper__step.is-done .stepper__dot { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-strong); }
.stepper__step.is-active { color: var(--ink); font-weight: 650; }
.stepper__step.is-active .stepper__dot { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- intro ---------- */
.page { max-width: 1320px; margin: 0 auto; padding: 0 40px; }
.intro { padding: 36px 0 20px; }
.intro__eyebrow { margin: 0 0 6px; font-size: 14px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-strong); }
.intro__title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 46px; line-height: 1.1; letter-spacing: -0.01em; }
.intro__sub { margin: 12px 0 0; font-size: 19px; color: var(--ink-2); max-width: 46em; }

/* ---------- catalog bar + chips ---------- */
.catalog { padding: 8px 0 40px; }
.catalog__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 22px; flex-wrap: wrap; }
.catalog__count { margin: 0; font-size: 17px; color: var(--ink-2); }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; min-height: 46px; border-radius: 999px;
  border: 1.5px solid #CFC6B8; background: var(--surface); color: var(--ink);
  font-size: 17px; font-weight: 550; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #FFFDF8; }
.chip:focus-visible, .more-button:focus-visible, .continue-bar__button:focus-visible, .design-card:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px;
}
.chip__icon { width: 20px; height: 20px; flex: none; }

/* ---------- grid + cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px 24px;
  transition: opacity .15s ease;
}
.grid[aria-busy="true"] { opacity: .45; }

.design-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.design-card:hover { border-color: #CBBFAE; box-shadow: 0 10px 28px -14px rgba(40, 32, 20, .35); }
.design-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 12px 30px -14px rgba(15, 118, 110, .45); }

.design-card__media {
  position: relative;
  display: grid; place-items: center;
  aspect-ratio: 1 / 1.04;
  margin: 10px 10px 0;
  border-radius: calc(var(--radius) - 6px);
  background: radial-gradient(120% 90% at 50% 35%, #F8F4ED 0%, var(--stage) 70%);
}
.design-card[data-format="landscape"] .design-card__media { aspect-ratio: 4 / 3.25; }
.design-card[data-format="square"] .design-card__media { aspect-ratio: 1 / 1; }

.design-card__cover {
  height: 84%; aspect-ratio: 3 / 4;
  border-radius: 2px 4px 4px 2px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .14), 0 14px 26px -12px rgba(40, 30, 20, .55);
  transition: transform .2s ease;
}
.design-card[data-format="landscape"] .design-card__cover { height: auto; width: 84%; aspect-ratio: 4 / 3; }
.design-card[data-format="square"] .design-card__cover { height: 78%; aspect-ratio: 1 / 1; }
.design-card:hover .design-card__cover { transform: translateY(-3px); }
.design-card__art { display: block; width: 100%; height: 100%; }

.design-card__badge {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  padding: 4px 11px 5px; border-radius: 999px;
  background: var(--badge); color: #FFFDF8;
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.design-card__badge::before { content: "\2605"; margin-right: 5px; color: #F2C14E; }

.design-card__body {
  flex: 1;
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 20px 18px;
}
.design-card__name { margin: 0; font-size: 21px; line-height: 1.25; font-weight: 650; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.design-card__meta { margin: auto 0 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.design-card__price { font-size: 16px; color: var(--ink-2); white-space: nowrap; }
.design-card__cta { font-size: 16px; font-weight: 650; color: var(--accent); }
.design-card.is-selected .design-card__cta::before { content: "\2713  "; }

.catalog__more { display: flex; justify-content: center; margin-top: 34px; }
.more-button {
  padding: 13px 28px; min-height: 50px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font-size: 17px; font-weight: 650; cursor: pointer;
}
.more-button:hover { background: var(--ink); color: #FFFDF8; }
.more-button[disabled] { opacity: .6; cursor: progress; }
.more-button[hidden] { display: none; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer__inner { max-width: 1320px; margin: 0 auto; padding: 28px 40px 36px; display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: baseline; }
.footer__brand { margin: 0; font-size: 18px; color: var(--ink-2); }
.footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer__links a { color: var(--ink-2); text-decoration: none; font-size: 15px; }
.footer__note { margin: 0; flex-basis: 100%; font-size: 14px; color: var(--muted); }

/* ---------- continue bar ---------- */
.continue-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255, 253, 249, .96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -16px rgba(40, 32, 20, .4);
  backdrop-filter: blur(6px);
}
.continue-bar__inner {
  max-width: 1320px; margin: 0 auto; padding: 14px 40px; min-height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.continue-bar__status { margin: 0; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.continue-bar__kicker { font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.continue-bar__name { font-size: 18px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-bar__button {
  flex: none; max-width: 60%;
  padding: 13px 28px; min-height: 52px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.continue-bar__button:hover { background: var(--accent-strong); }
.continue-bar__button[disabled] { background: #D8D2C7; color: #6E737A; cursor: not-allowed; }

/* ---------- responsive ---------- */
@media (max-width: 1199px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 819px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
}

@media (max-width: 640px) {
  :root { --radius: 12px; --bar-h: 76px; }
  body { font-size: 16px; }
  .topbar__inner { padding: 12px 16px; }
  .wordmark__mark { width: 30px; height: 24px; }
  .wordmark__text { font-size: 19px; }
  .topbar__links { gap: 14px; }
  .topbar__link { display: none; }
  .topbar__bag { width: 38px; height: 38px; }
  .stepper__list { padding: 10px 16px; gap: 6px; justify-content: space-between; }
  .stepper__step { gap: 6px; font-size: 13px; }
  .stepper__step + .stepper__step::before { width: 10px; }
  .stepper__dot { width: 22px; height: 22px; font-size: 12px; }
  .stepper__dot svg { width: 11px; height: 11px; }
  .page { padding: 0 16px; }
  .intro { padding: 24px 0 14px; }
  .intro__eyebrow { font-size: 12px; }
  .intro__title { font-size: 34px; }
  .intro__sub { font-size: 16px; }
  .catalog__bar { margin-bottom: 16px; gap: 12px; }
  .catalog__count { font-size: 15px; order: 2; }
  .chips { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .chip { justify-content: center; padding: 8px 6px; min-height: 44px; font-size: 15px; gap: 5px; }
  .chip__icon { width: 17px; height: 17px; }
  .design-card__media { margin: 6px 6px 0; }
  .design-card__badge { top: 8px; left: 8px; font-size: 11.5px; padding: 3px 8px 4px; }
  .design-card__badge::before { margin-right: 3px; }
  .design-card__body { padding: 10px 12px 14px; gap: 6px; }
  .design-card__name { font-size: 16px; line-height: 1.28; }
  .design-card__price { font-size: 14px; }
  .design-card__cta { display: none; }
  .catalog__more { margin-top: 24px; }
  .more-button { width: 100%; }
  .footer__inner { padding: 22px 16px 28px; }
  .continue-bar__inner { padding: 10px 16px; gap: 12px; }
  .continue-bar__kicker { font-size: 11px; }
  .continue-bar__name { font-size: 15px; }
  .continue-bar__button { max-width: 64%; padding: 12px 18px; min-height: 48px; font-size: 15px; }
}

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

/* ---------- funnel: steps 1, 3, 4 (funnel.js) ---------- */
.funnel-view[hidden], main.page[hidden] { display: none !important; }
a.stepper__label { color: inherit; text-decoration: none; }
a.stepper__label:hover { text-decoration: underline; }
body[data-view]:not([data-view="design"]) { padding-bottom: 0; }
body[data-view]:not([data-view="design"]) .continue-bar { display: none; }

.funnel { padding-bottom: 48px; }
.funnel__actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; }
.funnel__primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 28px; min-height: 52px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font: inherit; font-size: 17px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.funnel__primary:hover { background: var(--accent-strong); }
.funnel__primary[disabled] { background: #D8D2C7; color: #6E737A; cursor: not-allowed; }
.funnel__back { color: var(--ink-2); font-size: 16px; text-decoration: none; }
.funnel__back:hover { color: var(--ink); text-decoration: underline; }
.funnel__note { margin: 14px 0 0; text-align: right; color: var(--muted); font-size: 14px; }

/* step 1 */
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 12px; }
.product-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px 20px 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.product-card:hover { border-color: #CBBFAE; }
.product-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.product-card__art { align-self: stretch; display: grid; place-items: center; background: var(--stage); border-radius: calc(var(--radius) - 6px); padding: 18px; margin-bottom: 8px; }
.product-card__art svg { width: 60%; height: auto; display: block; }
.product-card__name { font-size: 19px; font-weight: 650; }
.product-card__note { font-size: 15px; color: var(--ink-2); }
.product-card__price { font-size: 15px; color: var(--accent-strong); font-weight: 650; }

/* step 3: editor */
.editor__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 28px 0 18px; }
.editor__title { font-size: 38px; }
.editor__meta { margin: 8px 0 0; color: var(--ink-2); font-size: 17px; }
.arm-switch { display: inline-flex; align-items: center; gap: 6px; padding: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); flex-wrap: wrap; }
.arm-switch__label { padding: 0 8px 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.arm-switch button { border: 0; border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 15px; background: transparent; color: var(--ink-2); cursor: pointer; }
.arm-switch button[aria-pressed="true"] { background: var(--ink); color: #FFFDF8; }

.editor__body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.tray { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.tray__title { margin: 0; font-weight: 700; font-size: 16px; }
.tray__status { margin: 4px 0 12px; font-size: 14px; color: var(--ink-2); }
.editor[data-inner="empty"] .tray__status { color: #A4452C; font-weight: 650; }
.tray__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tray__photo { display: block; border-radius: 6px; overflow: hidden; aspect-ratio: 4 / 3; }
.tray__photo svg { display: block; width: 100%; height: 100%; }
.tray__upload { margin-top: 12px; width: 100%; min-height: 44px; border-radius: 999px; border: 1.5px solid #CFC6B8; background: var(--surface); font: inherit; font-size: 15px; cursor: pointer; }

.workspace { background: var(--stage); border-radius: var(--radius); padding: 14px 20px 18px; min-width: 0; }
.workspace__bar { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 12px; }
.workspace__label { font-weight: 650; font-size: 16px; min-width: 11em; text-align: center; }
.workspace__of { font-weight: 400; color: var(--muted); }
.workspace__nav { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 22px; line-height: 1; cursor: pointer; }
.spread { display: flex; justify-content: center; max-width: 820px; margin: 0 auto; filter: drop-shadow(0 14px 22px rgba(40, 30, 20, .28)); }
.spread .book-page { display: block; width: 50%; height: auto; }
.spread .book-page svg { display: block; width: 100%; height: auto; }
.spread[data-format="landscape"] { max-width: 980px; }
.spread > .book-page:first-child { border-right: 1px solid rgba(0, 0, 0, .12); }
.workspace__hint { margin: 14px 0 0; text-align: center; font-size: 15px; color: var(--ink-2); }
.workspace__hint.is-empty { color: #A4452C; font-weight: 650; }

.strip { display: flex; gap: 12px; overflow-x: auto; padding: 14px 2px 8px; margin-top: 14px; }
.strip__item { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px; border: 2px solid transparent; border-radius: 10px; background: none; font: inherit; cursor: pointer; }
.strip__item.is-active { border-color: var(--accent); background: var(--accent-soft); }
.strip__spread { display: flex; width: 120px; box-shadow: 0 2px 6px rgba(40, 30, 20, .25); }
.strip__spread .book-page { display: block; width: 50%; height: auto; }
.strip__spread .book-page svg { display: block; width: 100%; height: auto; }
.strip__label { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }

/* step 4 */
.order-card { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 12px; }
.order-card__cover { align-self: start; box-shadow: 0 12px 24px -12px rgba(40, 30, 20, .5); }
.order-card__cover svg { display: block; width: 100%; height: auto; }
.order-card__list { margin: 0; display: grid; gap: 0; }
.order-card__list div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
.order-card__list dt { color: var(--ink-2); }
.order-card__list dd { margin: 0; font-weight: 650; text-align: right; }
.order-card__total { border-bottom: 0 !important; font-size: 20px !important; }

@media (max-width: 900px) {
  .editor__head { flex-direction: column; align-items: flex-start; }
  .editor__body { grid-template-columns: minmax(0, 1fr); }
  .tray { order: 2; }
  .tray__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .product-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 640px) {
  .editor__title { font-size: 30px; }
  .arm-switch button { padding: 8px 12px; font-size: 14px; }
  .workspace { padding: 10px 10px 14px; }
  .workspace__label { min-width: 0; font-size: 15px; }
  .order-card { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .order-card__cover { max-width: 180px; }
  .funnel__actions { flex-wrap: wrap; }
}
/* keep the spread inside the screen on laptops and projectors */
.spread[data-format="portrait"] { max-width: min(820px, 80vh); }
.spread[data-format="landscape"] { max-width: min(980px, 140vh); }
.spread[data-format="square"] { max-width: min(820px, 108vh); }
@media (max-width: 640px) {
  .arm-switch { width: 100%; border-radius: 14px; }
  .arm-switch__label { width: 100%; padding: 4px 8px 0; }
  .arm-switch button { flex: 1 1 0; }
}
