@font-face {
  font-family: 'Caprasimo';
  src: url('/fonts/caprasimo-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Figtree';
  src: url('/fonts/figtree-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fff8ec;
  --paper-deep: #f6ebd8;
  --ink: #21170f;
  --muted: #5e4f40;
  --line: #e3d3bb;
  --ribbon: #c7361f;
  --ribbon-deep: #a32a17;
  --display: 'Caprasimo', Georgia, serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
}

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

html { -webkit-text-size-adjust: 100%; }
html.revealing { overflow: hidden; }
html.revealing .site-header, html.revealing main, html.revealing footer { visibility: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
  overflow-wrap: break-word;
}

body.has-vote-bar { padding-bottom: 96px; }

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
[hidden] { display: none !important; }

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h2 { font-size: clamp(1.9rem, 5vw, 3rem); }
h1:focus, h2:focus { outline: none; }

:focus-visible { outline: 3px solid var(--ribbon); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.container { width: min(1120px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { width: min(760px, 100%); margin-inline: auto; padding-inline: var(--gutter); }

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 700 1rem/1.2 var(--body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.button:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.button:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.button.primary { background: var(--ribbon); color: #fff; }
.button.large { min-height: 60px; padding: 14px 34px; font-size: 1.2rem; }

/* Header and footer */

.preview-banner {
  padding: 8px var(--gutter);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.875rem;
  text-align: center;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px max(var(--gutter), calc((100% - 1120px) / 2 + var(--gutter)));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 400 1.5rem/1 var(--display);
  text-decoration: none;
}

.brand svg { width: 26px; height: 26px; }

.header-link { font-weight: 700; white-space: nowrap; }

.site-footer {
  margin-top: 72px;
  padding: 36px var(--gutter) 44px;
  border-top: 2px solid var(--ink);
  background: var(--paper-deep);
  font-size: 0.9375rem;
}

.site-footer .disclosure { font-weight: 700; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; }
.site-footer small { display: block; margin-top: 14px; color: var(--muted); }
.amazon-note { margin-top: 12px; color: var(--muted); font-size: 0.8125rem; }

/* Gift tags */

.tag-shadow { filter: drop-shadow(0 12px 14px rgb(33 23 15 / 0.25)); }

.tag {
  --hole: 12px;
  position: relative;
  padding: 64px 28px 30px;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
  clip-path: polygon(18% 0, 82% 0, 100% 44px, 100% 100%, 0 100%, 0 44px);
  -webkit-mask: radial-gradient(circle var(--hole) at 50% 30px, transparent 97%, #000);
  mask: radial-gradient(circle var(--hole) at 50% 30px, transparent 97%, #000);
}

.tag-to {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.tag-name { font: 400 clamp(1.5rem, 3vw, 2.1rem)/1.05 var(--display); margin-top: 8px; }
.tag-line { margin-top: 10px; color: var(--muted); font-size: 0.9375rem; line-height: 1.35; }

/* Home */

#home { overflow-x: clip; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  padding-block: clamp(24px, 6vw, 72px);
}

.hero h1 { font-size: clamp(2.75rem, 7vw, 5.4rem); }
.lede { margin-top: 20px; max-width: 34em; font-size: clamp(1.1rem, 2vw, 1.3rem); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 30px; }
.note { color: var(--muted); font-size: 0.9375rem; }

.hero-tags { position: relative; height: 470px; }
.hero-tags .tag-shadow { position: absolute; width: 270px; }
.hero-tags .tag-shadow:nth-child(1) { left: 2%; top: 44px; transform: rotate(-11deg); }
.hero-tags .tag-shadow:nth-child(2) { right: 0; top: 96px; transform: rotate(9deg); }
.hero-tags .tag-shadow:nth-child(3) { left: 22%; top: 6px; transform: rotate(-1deg); }

.swatch-tag .tag { padding-top: 124px; }
.swatch-tag .tag::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 98px;
  background: var(--pattern) var(--c);
}

.paper-band { display: grid; grid-template-columns: repeat(13, 1fr); height: 54px; border-block: 2px solid var(--ink); }
.paper-band span { background: var(--pattern) var(--c); }

.section { padding-block: clamp(44px, 7vw, 76px) 0; }
.section-intro { margin-top: 12px; color: var(--muted); max-width: 38em; }

.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 28px; }

.type-tile {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  background: var(--paper);
  text-decoration: none;
  transition: transform 0.15s ease;
}

.type-tile:hover { transform: translateY(-3px) rotate(-0.6deg); }
.type-tile-paper { height: 84px; border-bottom: 2px solid var(--ink); background: var(--pattern) var(--c); }
.type-tile-text { padding: 14px 16px 18px; }
.type-tile-name { display: block; font: 400 1.3rem/1.1 var(--display); }
.type-tile-line { display: block; margin-top: 6px; color: var(--muted); font-size: 0.9375rem; line-height: 1.35; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 28px; counter-reset: step; }
.steps li { counter-increment: step; padding-top: 16px; border-top: 2px solid var(--ink); }
.steps li::before { content: counter(step); display: block; font: 400 2.4rem/1 var(--display); color: var(--ribbon); }
.steps h3 { margin-top: 10px; font-size: 1.15rem; }
.steps p { margin-top: 6px; color: var(--muted); }

/* Quiz */

.quiz { min-height: calc(100svh - 74px); padding-block: 12px 56px; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }

.quiz-back {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--ink);
  font: 700 1rem var(--body);
  text-decoration: underline;
  cursor: pointer;
}

.quiz-step { margin-left: auto; color: var(--muted); font-size: 0.9375rem; }
.quiz-progress { height: 10px; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; background: var(--paper-deep); }
.quiz-bar { display: block; height: 100%; background: var(--ribbon); transition: width 0.25s ease; }
.quiz h1 { margin-top: clamp(28px, 7vw, 64px); font-size: clamp(2.1rem, 6vw, 3.6rem); }
.quiz-about { margin-top: clamp(28px, 7vw, 64px); color: var(--muted); font-weight: 700; }
.quiz-about:not([hidden]) + h1 { margin-top: 6px; }
.quiz-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 30px; }

.answer {
  min-height: 88px;
  padding: 16px 20px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: 600 1.125rem/1.3 var(--body);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  animation: rise 0.22s ease both;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.answer:nth-child(2) { animation-delay: 0.04s; }
.answer:nth-child(3) { animation-delay: 0.08s; }
.answer:nth-child(4) { animation-delay: 0.12s; }
@media (hover: hover) {
  .answer:hover { background: #ffe9c9; transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
}
.answer:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.quiz-answers.many .answer { min-height: 64px; }
.answer.skip { grid-column: 1 / -1; min-height: 52px; border-style: dashed; background: transparent; box-shadow: none; text-align: center; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
}

/* Result */

.wrapped {
  position: relative;
  display: flex;
  justify-content: center;
  padding: clamp(36px, 7vw, 76px) var(--gutter);
  border-block: 2px solid var(--ink);
  background: var(--pattern) var(--c);
  overflow: hidden;
}

.wrapped::before, .wrapped::after { content: ''; position: absolute; background: var(--ribbon); }
.wrapped::before { top: 0; bottom: 0; left: 50%; width: 48px; transform: translateX(-50%); }
.wrapped::after { left: 0; right: 0; top: 50%; height: 48px; transform: translateY(-50%); }
.wrapped .tag-shadow { position: relative; z-index: 1; width: min(560px, 100%); }
.wrapped .tag { padding: 72px clamp(22px, 5vw, 56px) 40px; }
.wrapped h1 { margin-top: 10px; font-size: clamp(2.4rem, 7vw, 4.2rem); }
.wrapped .tag-line { margin-top: 14px; font-size: clamp(1.1rem, 2.4vw, 1.35rem); color: var(--ink); }

.result-copy { padding-top: 34px; }
.result-description { font-size: clamp(1.15rem, 2.2vw, 1.35rem); }
.avoid { margin-top: 18px; padding-left: 14px; border-left: 4px solid var(--ribbon); }
.avoid strong { color: var(--ribbon-deep); }
.also { margin-top: 14px; color: var(--muted); }

.gifts { padding-top: 44px; }
.gift-disclosure { margin-top: 10px; color: var(--muted); font-size: 0.9375rem; }

.controls { display: flex; flex-wrap: wrap; align-items: end; gap: 16px 28px; margin-top: 22px; }
.control-label { display: block; margin-bottom: 6px; font-size: 0.875rem; font-weight: 700; }

.select {
  min-height: 46px;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: 600 1rem var(--body);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  min-height: 46px;
  padding: 8px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 600 1rem var(--body);
  cursor: pointer;
}

.chip[aria-pressed='true'] { background: var(--ink); color: var(--paper); }

html:not(.js) .controls, html:not(.js) .vote, html:not(.js) .share { display: none; }
html.js .budget-heading { display: none; }
html.js .gift-list:not(.active) { display: none; }
.budget-heading { margin-top: 32px; font: 400 1.5rem/1.1 var(--display); }

.gift-list { display: grid; gap: 14px; margin-top: 22px; }

.gift {
  position: relative;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
}

.gift.leading { box-shadow: 0 0 0 3px var(--ribbon); border-color: var(--ribbon); }

.gift-swatch {
  position: relative;
  width: 92px;
  height: 92px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  background: var(--pattern) var(--c);
}

.gift-swatch::before, .gift-swatch::after { content: ''; position: absolute; background: var(--ribbon); }
.gift-swatch::before { top: 0; bottom: 0; left: 50%; width: 14px; transform: translateX(-50%); }
.gift-swatch::after { left: 0; right: 0; top: 50%; height: 14px; transform: translateY(-50%); }

.gift h3 { font-size: 1.2rem; line-height: 1.25; }
.gift-why { margin-top: 4px; color: var(--muted); }
.gift-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.gift-link { min-height: 44px; padding: 8px 18px; font-size: 0.9375rem; box-shadow: 0 2px 0 var(--ink); }

.vote {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: 600 0.9375rem var(--body);
  cursor: pointer;
}

.vote:hover { background: var(--paper-deep); }
.vote [data-heart] { color: var(--ribbon); font-size: 1.25rem; line-height: 1; }

.gift-live { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.gift-live img { display: block; width: 72px; height: 72px; object-fit: contain; }
.live-title { font-size: 0.875rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.live-price { margin-top: 4px; font-size: 0.9375rem; }
.live-deal { margin-top: 2px; color: var(--ribbon-deep); font-size: 0.875rem; font-weight: 700; }
.price-note { margin-top: 14px; color: var(--muted); font-size: 0.8125rem; }
.deals-note { margin-top: 32px; }
.deals-note p { margin-bottom: 12px; }

.share {
  margin-top: 48px;
  padding: clamp(24px, 5vw, 40px);
  border-radius: 18px;
  background: var(--ink);
  color: var(--paper);
}

.share h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
.share p { margin-top: 10px; color: #e9dcc7; max-width: 38em; }
.share-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.share .button { border-color: var(--paper); box-shadow: none; }
.share .button.primary { border-color: var(--ribbon); }

.retake { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 30px; }

.vote-bar {
  position: fixed;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px var(--gutter);
  border-top: 2px solid var(--ink);
  background: #ffe9c9;
  font-weight: 600;
  text-align: center;
}

.vote-bar .button { min-height: 44px; padding: 8px 18px; }

/* Unwrap screen */

.reveal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; overflow: hidden; visibility: visible; }

.reveal-half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.5%;
  background: var(--paper-deep);
  background-image:
    repeating-linear-gradient(45deg, rgb(199 54 31 / 0.12) 0 14px, transparent 14px 28px);
  transition: transform 0.85s cubic-bezier(0.7, 0, 0.2, 1);
}

.reveal-half.left { left: 0; border-right: 24px solid var(--ribbon); }
.reveal-half.right { right: 0; border-left: 24px solid var(--ribbon); }
.reveal.open .reveal-half.left { transform: translateX(-102%); }
.reveal.open .reveal-half.right { transform: translateX(102%); }

.reveal-center {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 32px 24px;
  max-width: min(420px, calc(100vw - 32px));
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.reveal.open .reveal-center { opacity: 0; transform: scale(0.9); pointer-events: none; }
.reveal-center p { font: 400 clamp(1.6rem, 6vw, 2.2rem)/1.1 var(--display); }

/* Text pages */

.prose { padding-top: 24px; }
.prose h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); }
.prose h2 { margin-top: 36px; font-size: 1.7rem; }
.prose p { margin-top: 14px; }

@media (max-width: 800px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-tags { height: 330px; }
  .hero-tags .tag-shadow { width: 214px; }
  .hero-tags .tag-shadow:nth-child(1) { left: -2%; top: 34px; }
  .hero-tags .tag-shadow:nth-child(2) { right: -2%; top: 60px; }
  .hero-tags .tag-shadow:nth-child(3) { left: calc(50% - 107px); top: 0; }
  .hero-tags .tag { padding-inline: 18px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .quiz-answers { grid-template-columns: minmax(0, 1fr); }
  .answer { min-height: 72px; }
  .answer.skip { min-height: 52px; }
  .quiz-answers.many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .gift { grid-template-columns: 56px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .gift-swatch { width: 56px; height: 56px; }
  .gift-swatch::before { width: 10px; }
  .gift-swatch::after { height: 10px; }
  .gift-actions { margin-left: -70px; }
  .gift-link { flex: 1 1 auto; }
  .button.large { width: 100%; }
  .hero-actions .note { width: 100%; text-align: center; }
}

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