/* ===== Cakes by Richa ===== */
:root {
  --cream: #fbf5ec;
  --paper: #fffaf3;
  --cocoa: #3b2420;
  --cocoa-soft: #6e5550;
  --rose: #c75b6e;
  --rose-deep: #a8435a;
  --blush: #f4d9d6;
  --saffron: #e3a03a;
  --pistachio: #a9b98a;
  --line: #ead9c8;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(59,36,32,.06), 0 12px 32px -12px rgba(59,36,32,.18);
  --display: "Fraunces", Georgia, serif;
  --body: "DM Sans", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--cream); color: var(--cocoa);
  font-family: var(--body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--rose-deep); }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.35rem; }
em.flourish { font-style: italic; color: var(--rose); }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .74rem; font-weight: 600; color: var(--rose-deep); margin: 0 0 .6rem; }
.muted { color: var(--cocoa-soft); margin: 0; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.section { padding: clamp(56px, 9vw, 104px) 0; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--paper); padding: 8px 12px; z-index: 99; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 3px; border-radius: 6px; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cocoa); font-family: var(--display); font-size: 1.35rem; }
.logo-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--rose); color: var(--paper); font-size: 1.1rem; }
.logo em { color: var(--rose); }
.site-nav { display: flex; gap: 6px; align-items: center; }
.site-nav a { text-decoration: none; color: var(--cocoa); padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: .95rem; }
.site-nav a:hover { background: var(--blush); }
.site-nav a[aria-current="page"] { background: var(--cocoa); color: var(--paper); }
.site-nav .btn { margin-left: 6px; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--saffron); color: var(--cocoa); font-size: .72rem; font-weight: 700; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font: inherit; color: var(--cocoa); }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 12px 16px 20px; background: var(--cream); border-bottom: 1px solid var(--line); }
  .nav-open .site-nav { display: flex; }
  .site-nav .btn { margin: 6px 0 0; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1.5px solid var(--cocoa);
  background: var(--cocoa); color: var(--paper); font: 600 .95rem var(--body);
  text-decoration: none; cursor: pointer; transition: transform .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); background: var(--rose-deep); border-color: var(--rose-deep); }
.btn.ghost { background: transparent; color: var(--cocoa); }
.btn.ghost:hover { background: var(--blush); }
.btn.small { padding: 7px 14px; font-size: .85rem; }
.btn.saffron { background: var(--saffron); border-color: var(--saffron); color: var(--cocoa); }
.btn[disabled] { opacity: .55; cursor: wait; transform: none; }
.site-nav a.btn { color: var(--paper); }
.site-nav a.btn:hover { background: var(--rose-deep); }

/* ---- Hero ---- */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.hero p.lede { font-size: 1.18rem; color: var(--cocoa-soft); max-width: 34ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-art { position: relative; aspect-ratio: 1; }
.hero-art .plate { position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(circle at 50% 40%, var(--blush), #ecc4c0 70%); }
.hero-art img { position: absolute; inset: 14%; width: 72%; height: 72%; object-fit: cover; border-radius: 50%; box-shadow: var(--shadow); }
.hero-art .sticker { position: absolute; right: 0; bottom: 8%; background: var(--saffron); color: var(--cocoa); font-family: var(--display); font-style: italic; padding: 14px 18px; border-radius: 50%; width: 120px; height: 120px; display: grid; place-items: center; text-align: center; line-height: 1.15; transform: rotate(-10deg); box-shadow: var(--shadow); }
@media (max-width: 800px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { max-width: 380px; margin: 0 auto; } }

/* ---- Cards / grids ---- */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; }
.how li { list-style: none; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.how .num { font-family: var(--display); font-size: 2.4rem; color: var(--rose); font-style: italic; line-height: 1; }
.how ol, ol.how { padding: 0; margin-top: 36px; }
@media (max-width: 760px) { .how { grid-template-columns: 1fr; } }

.flavors { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.flavors span { padding: 8px 16px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: .95rem; }
.band { background: var(--cocoa); color: var(--cream); }
.band h2 { color: var(--paper); }
.band .eyebrow { color: var(--saffron); }
.band .muted { color: #d9c7c0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.peek { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.peek img { border-radius: 14px; aspect-ratio: 1; object-fit: cover; }

/* ---- Reference gallery ---- */
.page-head { padding: 48px 0 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 24px 0 28px; }
.chip-filter { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font: 500 .9rem var(--body); color: var(--cocoa); cursor: pointer; }
.chip-filter[aria-pressed="true"] { background: var(--cocoa); color: var(--paper); border-color: var(--cocoa); }
.search { margin-left: auto; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font: inherit; min-width: 220px; }
@media (max-width: 600px) { .search { margin-left: 0; width: 100%; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; padding-bottom: 120px; }
.ref-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, border-color .2s; }
.ref-card:hover { box-shadow: var(--shadow); }
.ref-card.clipped { border-color: var(--rose); box-shadow: 0 0 0 2px var(--rose); }
.ref-card figure { margin: 0; position: relative; aspect-ratio: 4/5; background: var(--blush); }
.ref-card figure img { width: 100%; height: 100%; object-fit: cover; }
.ref-code { position: absolute; top: 12px; left: 12px; background: var(--paper); color: var(--cocoa); font: 700 .78rem/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; padding: 7px 10px; border-radius: 8px; }
.ref-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.ref-body h3 { font-size: 1.12rem; margin: 0; }
.ref-body .muted { font-size: .9rem; }
.ref-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; }
.clip-btn { flex: 1; }
.clip-btn[aria-pressed="true"] { background: var(--rose); border-color: var(--rose); color: var(--paper); }

.tray {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%);
  display: flex; align-items: center; gap: 14px; background: var(--cocoa); color: var(--cream);
  padding: 10px 10px 10px 20px; border-radius: 999px; box-shadow: 0 18px 40px -12px rgba(0,0,0,.4);
  transition: transform .3s ease; z-index: 50; max-width: calc(100% - 32px);
}
.tray.show { transform: translate(-50%, 0); }
.tray .codes { font: 600 .82rem ui-monospace, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; color: var(--saffron); }
.tray button.link { background: none; border: 0; color: #d9c7c0; font: inherit; cursor: pointer; text-decoration: underline; font-size: .85rem; }

/* ---- Order form ---- */
.order-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; padding-bottom: 80px; }
@media (max-width: 900px) { .order-layout { grid-template-columns: 1fr; } }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 36px); }
fieldset { border: 0; padding: 0; margin: 0 0 32px; }
legend { font-family: var(--display); font-size: 1.45rem; padding: 0; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-weight: 600; font-size: .9rem; }
.field .hint { font-size: .82rem; color: var(--cocoa-soft); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; font: inherit; color: var(--cocoa);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px var(--blush); }
textarea { min-height: 110px; resize: vertical; }
.req { color: var(--rose); }
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-group label { cursor: pointer; }
.pill-group input { position: absolute; opacity: 0; pointer-events: none; }
.pill-group span { display: inline-block; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-size: .92rem; }
.pill-group input:checked + span { background: var(--cocoa); color: var(--paper); border-color: var(--cocoa); }
.pill-group input:focus-visible + span { outline: 3px solid var(--saffron); outline-offset: 2px; }

.code-entry { display: flex; gap: 8px; }
.code-entry input { font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; }
.ref-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.ref-chip { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 6px 8px 6px 6px; }
.ref-chip img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--blush); }
.ref-chip .c { font: 700 .78rem ui-monospace, Menlo, monospace; }
.ref-chip .t { font-size: .76rem; color: var(--cocoa-soft); line-height: 1.2; }
.ref-chip button { margin-left: auto; border: 0; background: none; font-size: 1.1rem; color: var(--cocoa-soft); cursor: pointer; padding: 2px 6px; }
.ref-chip.unknown { border-style: dashed; }
.empty-note { font-size: .9rem; color: var(--cocoa-soft); margin: 10px 0 0; }

.ai-box { border: 1.5px dashed var(--saffron); background: #fff8ec; border-radius: var(--radius); padding: 22px; }
.ai-box h3 { display: flex; align-items: center; gap: 8px; }
.ai-result { margin-top: 16px; display: grid; gap: 12px; }
.ai-result img { border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.ai-status { font-size: .9rem; color: var(--cocoa-soft); min-height: 1.4em; margin: 10px 0 0; }
.ai-status.err { color: #b3261e; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.attached-flag { font-size: .85rem; color: #3f6b2f; font-weight: 600; }

.summary { position: sticky; top: 90px; }
.summary h3 { margin-bottom: 12px; }
.summary dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; }
.summary dt { color: var(--cocoa-soft); }
.summary dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.submit-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---- Footer ---- */
footer { background: var(--cocoa); color: var(--cream); margin-top: 0; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1.5fr 1fr; gap: 32px; padding: 48px 0 28px; width: min(1120px, 100% - 32px); margin: 0 auto; }
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-name { font-family: var(--display); font-size: 1.3rem; margin: 0; }
footer .muted { color: #d9c7c0; }
footer .eyebrow { color: var(--saffron); }
footer a { color: var(--cream); }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.footer-nav { display: flex; flex-direction: column; gap: 6px; }
.footer-nav a { text-decoration: none; opacity: .85; }
.footer-nav a:hover { opacity: 1; text-decoration: underline; }
.footer-fine { width: min(1120px, 100% - 32px); margin: 0 auto; padding: 18px 0 28px; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; color: #bfa9a2; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } }

/* fixes */
.band .flavors span { background: transparent; color: var(--cream); border-color: rgba(255,250,243,.28); }
.code-entry { align-items: stretch; }
.code-entry .btn { border-radius: 12px; padding-inline: 18px; }
input[type=file] { font: inherit; font-size: .9rem; }

[hidden] { display: none !important; }
