/* Gift Reveal 2.0 — Warm editorial stationery design system.
   All colors come exclusively from /tokens.css (zero raw hex literals here). */

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
  scrollbar-color: var(--line-strong) var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection-bg);
  color: var(--ink);
}

input,
textarea,
select,
button {
  font: inherit;
  caret-color: var(--blue);
}

button,
a,
input,
textarea,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex='-1']:focus {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  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;
  inset-block-start: -100px;
  inset-inline-start: 16px;
  background: var(--ink);
  color: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  inset-block-start: 12px;
}

/* Top announcement bar */
.trust-strip {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 10px 16px;
  font-size: 13px;
  letter-spacing: 0.01em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
}

.trust-strip strong {
  font-weight: 600;
  color: var(--white);
}

.trust-sep {
  opacity: 0.45;
}

/* Header & navigation */
.header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 25px;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
}

.brand > span:not(.brand-dot) {
  font-weight: 400;
}

.brand-dot {
  color: var(--coral);
}

.brand-mark {
  width: 22px;
  height: 22px;
  stroke: var(--coral);
  stroke-width: 2.3;
  stroke-linecap: round;
  fill: none;
  flex-shrink: 0;
  margin-inline-end: 8px;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.text-link {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 8px 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s ease;
}

.text-link:hover {
  color: var(--blue);
}

.text-link[aria-current='page'] {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Main container */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 40px;
  align-items: end;
  padding: 24px 0 36px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5.2vw, 4.35rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
  text-wrap: balance;
}

.hero h1 em {
  font-style: italic;
  color: var(--blue);
}

.hero-lede {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  max-width: 56ch;
  margin: 0 0 20px;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  font-size: 14px;
  color: var(--ink-soft);
}

.hero-price {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.hero-price small {
  font-weight: 500;
  font-size: 12px;
  color: var(--blue);
}

.hero-note {
  color: var(--blue);
  transform: rotate(5deg);
  padding-bottom: 10px;
  text-align: center;
}

.hero-note svg {
  width: 96px;
  stroke: var(--blue);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  margin: 0 auto 4px;
}

.hero-note p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  line-height: 1.2;
  margin: 0;
}

/* Status banner */
.cancel-notice {
  margin: 0 0 20px;
  padding: 14px 18px;
  background: var(--coral-soft);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-md);
  color: var(--error-ink);
  font-size: 14px;
}

.cancel-notice a {
  font-weight: 700;
}

/* Studio card */
.studio {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 18px 48px var(--surface-shadow);
  align-items: stretch;
}

/* Left: tactile stationery & envelope scene */
.gift-scene {
  background: var(--scene-bg);
  background-image: radial-gradient(ellipse at 45% 36%, var(--scene-glow) 0%, var(--scene-bg) 72%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px 28px;
  position: relative;
  overflow: hidden;
  min-height: 660px;
}

.scene-top,
.scene-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-soft);
}

.scene-pack-pill {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--ink);
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
}

.live-indicator::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
}

.gift-object {
  position: relative;
  width: 344px;
  height: 452px;
  margin: 18px auto 12px;
}

.shadow-card {
  position: absolute;
  width: 286px;
  height: 348px;
  background: var(--shadow-card);
  top: 26px;
  inset-inline-start: 40px;
  transform: rotate(7deg);
  border-radius: 4px;
}

.paper-card {
  position: absolute;
  inset-inline-start: 22px;
  top: 0;
  transform: rotate(-5.5deg);
  width: 286px;
  height: 378px;
  background: var(--card-surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px var(--card-shadow);
  padding: 22px 24px;
  z-index: 2;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 3px;
}

.studio:hover .paper-card {
  transform: rotate(-4deg) translateY(-4px);
}

.paper-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  gap: 10px;
}

.paper-top strong {
  color: var(--blue);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.paper-motif {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-inline-end: 8px;
}

.paper-motif svg {
  width: 60px;
  height: 60px;
  fill: none;
  stroke: var(--coral);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.paper-card[data-accent='coral'] .paper-motif svg {
  stroke: var(--coral-deep);
}

.paper-card[data-accent='teal'] .paper-motif svg {
  stroke: var(--teal);
}

.paper-card h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 36px;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 2px 0 10px;
  color: var(--blue);
  white-space: pre-line;
}

.paper-card h2 em {
  font-style: italic;
}

.paper-card p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}

.paper-bottom {
  position: absolute;
  bottom: 20px;
  inset-inline-start: 24px;
  inset-inline-end: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.paper-bottom span:first-child {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.02em;
  color: var(--blue);
}

.envelope {
  position: absolute;
  inset-inline-start: 2px;
  bottom: 24px;
  width: 338px;
  height: 212px;
  background: var(--envelope-body);
  border-radius: 5px;
  box-shadow: 0 18px 30px var(--envelope-shadow);
  transform: rotate(3.5deg);
  z-index: 3;
  overflow: hidden;
}

.envelope-flap {
  position: absolute;
  inset: 0;
  background: var(--envelope-flap);
  clip-path: polygon(0 0, 50% 64%, 100% 0);
}

.envelope-fold-left {
  position: absolute;
  inset: 0;
  background: var(--envelope-left);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.envelope-fold-right {
  position: absolute;
  inset: 0;
  background: var(--envelope-right);
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

.seal {
  position: absolute;
  z-index: 1;
  top: 100px;
  inset-inline-start: 147px;
  height: 44px;
  width: 44px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 3px 6px var(--seal-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--seal-ink);
}

.pack-tag {
  position: absolute;
  z-index: 4;
  inset-inline-end: 2px;
  bottom: 6px;
  transform: rotate(-5deg);
  background: var(--tag-bg);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  box-shadow: 0 4px 10px var(--tag-shadow);
}

/* 5-page preview rail inside scene */
.page-rail {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.page-thumb {
  background: var(--paper-elevated);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 6px;
  text-align: center;
  font-size: 11px;
  line-height: 1.25;
  color: var(--ink-soft);
}

.page-thumb strong {
  display: block;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--blue);
  margin-bottom: 2px;
}

.page-thumb.secret-page {
  background: var(--coral-soft);
  border-color: var(--error-border);
  color: var(--coral-deep);
}

.page-thumb.secret-page strong {
  color: var(--coral-deep);
}

/* Right: 3-step studio builder */
.builder {
  padding: 32px 38px 34px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.steps {
  display: flex;
  gap: 18px;
  list-style: none;
  padding: 0 0 20px;
  margin: 0 0 24px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.steps li > span {
  height: 24px;
  width: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.steps .active {
  color: var(--blue);
  font-weight: 700;
}

.steps .active > span {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.builder h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
}

.panel-lede {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 22px;
  line-height: 1.55;
}

/* Pack picker inside Studio */
.pack-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 20px;
}

.pack-option {
  border: 1px solid var(--line);
  background: var(--paper-elevated);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  text-align: start;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 44px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.pack-option:hover {
  border-color: var(--blue);
}

.pack-option[aria-pressed='true'] {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 1px var(--blue);
}

.pack-option-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.25;
}

.pack-option-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

.pack-option-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  margin-top: 2px;
}

/* Form controls */
label {
  font-size: 14px;
  font-weight: 600;
  display: block;
  margin: 0 0 7px;
  color: var(--ink);
}

label small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-inline-start: 6px;
}

input,
textarea,
select {
  width: 100%;
  display: block;
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--ink-soft);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
}

input[aria-invalid='true'],
textarea[aria-invalid='true'],
select[aria-invalid='true'] {
  border-color: var(--coral-deep);
  background: var(--error-bg);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.78;
}

textarea {
  resize: vertical;
  min-height: 92px;
  max-height: 220px;
}

.field-help {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin: 6px 0 18px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.label-row span {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Occasion idea chips */
.examples {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: -4px 0 20px;
}

.examples > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-inline-end: 2px;
}

.examples button {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 7px 12px;
  min-height: 36px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.examples button:hover {
  background: var(--blue-soft);
  border-color: var(--blue-border);
  color: var(--blue-dark);
}

/* Buttons */
.primary {
  width: 100%;
  background: var(--blue);
  color: var(--white);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 15px 20px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.12s ease;
}

.primary:hover:not(:disabled) {
  background: var(--blue-dark);
}

.primary:active:not(:disabled) {
  transform: translateY(1px);
}

.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.secondary-button {
  width: 100%;
  background: var(--paper-elevated);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  text-decoration: none;
  margin-top: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.button-note {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 0;
}

.back-button {
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 0;
  min-height: 44px;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.back-button:hover {
  color: var(--blue-dark);
  text-decoration: underline;
}

/* Alert boxes (full border, never one-sided bar) */
#error,
#checkout-error,
.alert-box {
  font-size: 14px;
  background: var(--error-bg);
  color: var(--error-ink);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}

.status-box {
  font-size: 14px;
  background: var(--success-bg);
  color: var(--success-ink);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 16px;
}

/* Puzzle peek preview */
.puzzle-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: var(--paper-warm);
  border-radius: var(--radius-sm);
  margin: 0 0 16px;
}

.puzzle-tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
  transition: background 0.15s ease, color 0.15s ease;
}

.puzzle-tabs button[aria-pressed='true'] {
  background: var(--white);
  color: var(--blue);
  box-shadow: 0 1px 4px var(--surface-shadow);
}

.puzzle-preview {
  border: 1px solid var(--line);
  background: var(--card-surface);
  padding: 22px 22px 20px;
  min-height: 230px;
  border-radius: var(--radius-md);
}

.puzzle-step-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--blue);
  text-transform: uppercase;
}

.puzzle-preview h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
  margin: 6px 0 8px;
}

.puzzle-preview > p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

#puzzle-items {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.75;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  overflow-wrap: anywhere;
  margin: 16px 0;
}

.answer-line {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.answer-line span {
  height: 1px;
  background: var(--line-strong);
  flex: 1;
}

.included {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 14px;
  font-size: 13px;
  margin: 16px 0 18px;
  color: var(--ink-soft);
}

/* Offer choice in Step 2 */
.offer-summary {
  background: var(--paper-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 0 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.offer-summary strong {
  display: block;
  font-size: 15px;
  color: var(--ink);
}

.offer-summary small {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.offer-price-tag {
  font-size: 20px;
  font-weight: 700;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.billing-country-group {
  margin: 0 0 16px;
}

.billing-country-group .field-help {
  margin: 6px 0 0;
}

.country-notice {
  background: var(--coral-soft);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-sm);
  color: var(--coral-deep);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  margin: 10px 0 0;
}

/* Step 3 handoff & recovery */
.success-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--coral-soft);
  color: var(--coral);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 16px;
}

.success-mark svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  fill: none;
}

#recovery-code,
.code-block {
  display: block;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  background: var(--soft);
  padding: 14px 16px;
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin: 12px 0 16px;
  color: var(--ink);
}

.recovery-backup {
  border-top: 1px solid var(--line);
  margin: 18px 0 20px;
}

.recovery-backup summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  min-height: 44px;
  list-style: none;
  color: var(--ink-soft);
}

.recovery-backup summary::-webkit-details-marker {
  display: none;
}

/* How it works section */
.how {
  padding: 72px 0 60px;
}

.section-heading {
  max-width: 60ch;
  margin: 0 auto 36px;
  text-align: center;
}

.section-heading h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 3.6vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 10px;
  text-wrap: balance;
}

.section-heading p {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
}

.how-grid article {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.how-step-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  color: var(--blue);
  display: block;
  margin-bottom: 8px;
}

.how-grid h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  margin: 0 0 10px;
}

.how-grid p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin: 0;
}

/* Occasion showcase strip */
.occasions {
  padding: 12px 0 64px;
}

.occasion-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.occasion-item {
  background: var(--paper-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}

.occasion-item h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  margin: 0 0 6px;
  color: var(--ink);
}

.occasion-item p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

/* Warm-up sample section */
.sample {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  gap: 32px;
  align-items: center;
}

.sample h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.sample p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.sample-game > p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 16px;
}

.sample-game > p span {
  color: var(--coral);
  margin: 0 8px;
}

.sample-game summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line-strong);
  padding: 13px 0;
  min-height: 44px;
  list-style: none;
  color: var(--blue);
}

.sample-game summary::-webkit-details-marker {
  display: none;
}

.sample-game details p {
  font-size: 15px;
  color: var(--ink);
  margin: 4px 0 0;
}

/* Footer */
.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  padding: 32px 0 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 24px;
}

.site-footer .brand {
  font-size: 20px;
}

.footer-tagline {
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  font-size: 14px;
  color: var(--muted);
}

.footer-links a {
  text-decoration: none;
  padding: 6px 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-links a:hover {
  color: var(--blue);
  text-decoration: underline;
}

/* Release dialog */
.version-button {
  border: 0;
  background: none;
  color: var(--muted);
  min-height: 44px;
  font-size: 13px;
  text-decoration: underline;
  padding: 8px 4px;
}

.version-button:hover {
  color: var(--blue);
}

.release-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-elevated);
  color: var(--ink);
  max-width: 480px;
  width: calc(100% - 32px);
  padding: 28px;
  box-shadow: 0 24px 60px var(--surface-shadow-lg);
}

.release-dialog::backdrop {
  background: var(--backdrop);
}

.release-dialog h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  margin: 0 0 12px;
}

.release-dialog p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.release-dialog button {
  min-height: 44px;
  justify-content: center;
}

/* Success, Recovery & Info Pages */
.narrow-page,
.success {
  max-width: 720px;
  margin: 40px auto 64px;
  padding: 36px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 40px var(--surface-shadow);
}

.success > .brand,
.narrow-page > .brand {
  margin-bottom: 24px;
}

.success h1,
.narrow-page h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 5vw, 3.3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 8px 0 18px;
}

.success h2,
.narrow-page h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  margin: 24px 0 10px;
}

.success form,
.narrow-page form {
  margin: 24px 0;
}

.success form .primary,
.narrow-page form .primary {
  margin-top: 14px;
  justify-content: center;
}

.success .primary {
  justify-content: center;
}

.success #retry {
  margin-top: 16px;
}

.success [role='alert'] {
  color: var(--error-ink);
  overflow-wrap: anywhere;
}

.success [role='status'] {
  color: var(--ink-soft);
}

.purchase-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-elevated);
  padding: 20px 22px;
  margin: 16px 0;
}

.purchase-card h2 {
  margin: 0 0 4px;
}

.purchase-pack-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.purchase-pack-group h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  margin: 0 0 10px;
}

.download-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.success .download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--blue);
  color: var(--white);
  padding: 14px 16px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  min-height: 48px;
  text-align: center;
  transition: background 0.15s ease;
}

.success .download:hover {
  background: var(--blue-dark);
}

.success .download.alt {
  background: var(--ink);
}

.success .download.alt:hover {
  background: var(--ink-soft);
}

.note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.recover {
  color: var(--blue);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.recover:hover {
  text-decoration: underline;
}

/* Catalog / Library page */
.catalog-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 28px 72px;
}

.catalog-hero {
  max-width: 64ch;
  margin-bottom: 28px;
}

.catalog-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}

.catalog-hero p {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
}

.catalog-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  background: var(--paper-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.catalog-filters label {
  margin-bottom: 6px;
  font-size: 13px;
}

.catalog-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 18px;
}

.catalog-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0 0 32px;
}

.catalog-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 6px 22px var(--surface-shadow);
}

.catalog-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.catalog-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--blue-soft);
  color: var(--blue-dark);
  white-space: nowrap;
}

.catalog-badge.preview-only {
  background: var(--paper-warm);
  color: var(--ink-soft);
}

.catalog-card h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
  margin: 0;
}

.catalog-card-desc {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}

.catalog-meta {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
}

.catalog-puzzles {
  list-style: none;
  padding: 12px 0;
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
}

.catalog-puzzles li {
  display: flex;
  gap: 8px;
}

.catalog-puzzles span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue);
  font-weight: 700;
}

.catalog-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.catalog-local-tools {
  border-top: 1px dashed var(--line-strong);
  margin-top: 8px;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.catalog-local-tools a {
  color: var(--blue);
  text-decoration: none;
  padding: 4px 0;
}

.catalog-local-tools a:hover {
  text-decoration: underline;
}

.demo-items {
  font-family: var(--font-mono);
  background: var(--blue-soft);
  color: var(--blue-dark);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
  line-height: 1.8;
}

/* Error pages (404 / 500) */
.error-page {
  max-width: 600px;
  margin: 64px auto;
  padding: 40px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px var(--surface-shadow);
}

.error-code {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--coral-deep);
  margin: 24px 0 8px;
}

.error-page h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  margin: 0 0 14px;
}

.error-copy {
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 26px;
}

.error-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.error-cta {
  justify-content: center;
}

/* Responsive layout */
@media (max-width: 1024px) {
  .studio {
    grid-template-columns: minmax(0, 1fr);
  }

  .gift-scene {
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    padding: 22px 24px;
  }

  .catalog-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .header {
    padding: 18px 20px;
    flex-wrap: wrap;
  }

  main,
  .catalog-page {
    padding: 0 18px 48px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 18px 0 26px;
  }

  .hero-note {
    display: none;
  }

  .gift-scene {
    padding: 18px 16px;
    overflow: hidden;
  }

  .gift-object {
    transform: scale(0.76);
    transform-origin: top center;
    margin: 6px auto -88px;
    margin-inline-start: calc((100% - 344px) / 2);
  }

  .builder {
    padding: 24px 20px 26px;
  }

  .pack-picker {
    grid-template-columns: 1fr;
  }

  .how {
    padding: 48px 0 40px;
  }

  .how-grid,
  .occasion-grid,
  .sample,
  .catalog-filters,
  .catalog-list,
  .download-row {
    grid-template-columns: 1fr;
  }

  .sample {
    padding: 26px 22px;
  }

  .narrow-page,
  .success,
  .error-page {
    margin: 20px 14px 40px;
    padding: 24px 20px;
  }

  .page-rail {
    gap: 6px;
  }

  .page-thumb {
    font-size: 10px;
    padding: 6px 4px;
  }
}

@media (max-width: 380px) {
  .header {
    padding: 16px 14px;
  }

  main,
  .catalog-page {
    padding: 0 14px 40px;
  }

  .gift-object {
    transform: scale(0.64);
    margin: 4px auto -142px;
    margin-inline-start: calc((100% - 344px) / 2);
  }

  .steps {
    gap: 10px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
