/* =====================================================================
   The Kruffessional — birthday gift registry
   Palette: warm cream + deep cocoa ink + rose primary + gold accent
   Fonts:   Fraunces (display) · Nunito Sans (body)
   ===================================================================== */

:root {
  --bg: #FCF6F1;
  --bg-deep: #F8EDE6;
  --surface: #FFFFFF;
  --ink: #3B2428;
  --muted: #6E5054;
  --rose: #BE185D;          /* primary (contrast-safe on white/cream) */
  --rose-deep: #9D174D;
  --rose-tint: #FBE8F0;
  --gold: #CA8A04;
  --gold-ink: #7C5A03;
  --gold-tint: #FDF3D7;
  --line: #EFE1D8;
  --line-strong: #96745F; /* WCAG non-text boundary: ≥3:1 on cream */
  --ok-bg: #DCFCE7;
  --ok-ink: #14532D;
  --ok-dot: #16A34A;
  --avail-bg: #F1F7EC;
  --avail-ink: #3F6212;
  --avail-dot: #65A30D;
  --radius: 18px;
  --shadow-rest: 0 1px 2px rgba(59, 36, 40, .05);
  --shadow-hover: 0 14px 34px -16px rgba(59, 36, 40, .22);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

::selection { background: var(--rose-tint); color: var(--rose-deep); }

img, svg { display: block; }

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

.container {
  width: min(1080px, 100% - 2.5rem);
  margin-inline: auto;
}

.container-narrow { width: min(760px, 100% - 2.5rem); }

/* ---------------------------------------------------------------------
   Header
   --------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(252, 246, 241, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.16rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .01em;
}

.brand-icon { width: 24px; height: 24px; color: var(--rose); flex: none; }

.header-nav {
  display: flex;
  gap: 1.3rem;
  margin-left: auto;
}

.header-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: .93rem;
  padding: .35rem 0;
  transition: color .2s ease;
}

.header-nav a:hover { color: var(--rose-deep); }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 44px;
  padding: 0 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--rose); color: #fff; }
.btn-primary:hover { background: var(--rose-deep); color: #fff; }

.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--bg-deep); border-color: #8A6A5B; }

.btn-small { padding: 0 .9rem; font-size: .88rem; }

.btn:disabled { opacity: .55; cursor: wait; }

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */

.hero { padding: 4.2rem 0 3.2rem; }

.hero-inner {
  position: relative;
  text-align: center;
}

.confetti {
  position: absolute;
  top: -3.4rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(820px, 100%);
  height: auto;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 .7rem;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.7rem, 7vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -.01em;
}

.hero-sub {
  margin: 1.1rem auto 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 1.06rem;
}

.hero-ctas {
  margin-top: 1.7rem;
  display: flex;
  justify-content: center;
  gap: .8rem;
  flex-wrap: wrap;
}

.hero-meta {
  margin-top: 1.6rem;
  display: flex;
  justify-content: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .42rem .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .88rem;
  font-weight: 700;
  color: var(--muted);
}

.meta-chip svg { width: 15px; height: 15px; color: var(--gold); }

.meta-chip-theme { background: var(--avail-bg); border-color: var(--ok-dot); color: var(--avail-ink); }
.meta-chip-theme svg { color: var(--avail-dot); }

/* ---------------------------------------------------------------------
   How it works
   --------------------------------------------------------------------- */

.how { padding: .6rem 0 2.4rem; }

.how-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}

.how-step {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.how-num {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-tint);
  color: var(--rose-deep);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.how-step h3 { margin: .15rem 0 .2rem; font-size: 1rem; font-weight: 800; }
.how-step p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------------------------------------------------------------------
   Sections + grids + cards
   --------------------------------------------------------------------- */

.section { padding: 3rem 0 3.4rem; scroll-margin-top: 76px; }

.section-alt {
  background: var(--bg-deep);
  border-block: 1px solid var(--line);
}

.section-head { margin-bottom: 1.6rem; }

.section-head h2 {
  margin: 0 0 .35rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.9rem;
  letter-spacing: -.01em;
}

.section-note {
  margin: 0;
  color: var(--muted);
  font-size: .96rem;
  max-width: 62ch;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 1.3rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-rest);
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease;
}

.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, .8) 0%, rgba(255, 255, 255, 0) 46%),
    linear-gradient(140deg, #FBEFE7 0%, #F7E3E3 100%);
}

.card-gc .card-media {
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, .8) 0%, rgba(255, 255, 255, 0) 46%),
    linear-gradient(140deg, #FCF3E1 0%, #F9E7DC 100%);
}

/* items with a real product photo */
.card-media-photo { background: #FFFFFF; }
.card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-icon { color: var(--rose-deep); }
.card-gc .card-icon { color: #8A5A04; }
.card-icon svg { width: 52px; height: 52px; stroke-width: 1.6; }

.chip {
  position: absolute;
  top: .7rem;
  left: .7rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .28rem .65rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.chip .dot { width: 7px; height: 7px; border-radius: 50%; }

.chip-available { background: var(--avail-bg); color: var(--avail-ink); }
.chip-available .dot { background: var(--avail-dot); }
.chip-reserved { background: var(--gold-tint); color: var(--gold-ink); }
.chip-reserved .dot { background: var(--gold); }
.chip-count { background: var(--rose-tint); color: var(--rose-deep); }
.chip-count .dot { background: var(--rose); }

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.05rem 1.15rem 1.2rem;
}

.card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
}

.card-title-row h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.16rem;
  line-height: 1.25;
}

.price { color: var(--rose-deep); font-weight: 800; font-size: 1rem; flex: none; }

.card-note {
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .92rem;
}

.card-actions {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}

.card-actions .btn-primary { flex: 1 1 auto; }

.mark-btn { flex: none; }

.track-done-note {
  display: inline-flex;
  align-items: center;
  padding: 0 .95rem;
  min-height: 44px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 800;
  color: var(--muted);
}

.track-off { display: none; }

.load-error {
  grid-column: 1 / -1;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.cursor-hint { cursor: pointer; }

/* ---------------------------------------------------------------------
   Shipping address
   --------------------------------------------------------------------- */

.address-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-rest);
  padding: 1.1rem 1.3rem 1.3rem;
}

.address-lines {
  list-style: none;
  margin: 0;
  padding: 0;
}

.addr-line {
  display: grid;
  grid-template-columns: 9.2rem 1fr 44px;
  gap: .7rem;
  align-items: center;
  padding: .55rem .35rem;
  border-bottom: 1px dashed var(--line);
  transition: background-color .2s ease;
}

.addr-line:last-child { border-bottom: none; }
.addr-line:hover { background: #FBF4EF; border-radius: 10px; }

.addr-label {
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

.addr-value { font-weight: 600; font-size: 1rem; overflow-wrap: anywhere; }

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg);
  color: var(--rose-deep);
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}

.icon-btn:hover { background: var(--rose-tint); border-color: var(--rose); }
.icon-btn svg { width: 19px; height: 19px; }

.address-actions {
  margin-top: 1.05rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  flex-wrap: wrap;
}

.address-hint { color: var(--muted); font-size: .88rem; }

/* ---------------------------------------------------------------------
   Footer / toast / noscript
   --------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 1.9rem 0 2.2rem;
}

.footer-inner { text-align: center; }

.footer-brand {
  margin: 0 0 .3rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.footer-note { margin: 0; color: var(--muted); font-size: .87rem; }

.footer-theme {
  margin: .55rem 0 0;
  color: var(--gold-ink);
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.toast {
  position: fixed;
  bottom: 1.3rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--ink);
  color: var(--bg);
  padding: .72rem 1.15rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .92rem;
  box-shadow: 0 10px 30px -10px rgba(59, 36, 40, .4);
}

.noscript-note {
  margin: 2rem auto;
  max-width: 40ch;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */

@media (max-width: 860px) {
  .how-inner { grid-template-columns: 1fr; gap: .9rem; }
}

@media (max-width: 760px) {
  .header-nav { gap: .9rem; }
  .addr-line { grid-template-columns: 1fr 44px; grid-template-rows: auto auto; }
  .addr-label { grid-column: 1; grid-row: 1; }
  .addr-value { grid-column: 1; grid-row: 2; }
  .icon-btn { grid-column: 2; grid-row: 1 / 3; justify-self: end; }
}

@media (max-width: 620px) {
  .header-nav { display: none; }
  .header-cta { margin-left: auto; }
  .hero { padding: 3.1rem 0 2.6rem; }
  .hero-sub br { display: none; }
}

@media (max-width: 480px) {
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .section { padding: 2.4rem 0 2.8rem; }
}

/* ---------------------------------------------------------------------
   Reduced motion
   --------------------------------------------------------------------- */

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