:root {
  --cream: #fbf6ee;
  --paper: #fffdf9;
  --pine: #1f3d2b;
  --pine-2: #2d5640;
  --berry: #a4262c;
  --berry-2: #c2353b;
  --wood: #c89b6d;
  --bark: #5b3a1f;
  --ink: #2a2220;
  --muted: #6e625a;
  --line: #e8dccb;
  --gold: #c9a24a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(60, 40, 20, 0.12);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Nunito', system-ui, -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--pine-2); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--pine); }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }

/* Ribbon + header */
.ribbon {
  background: var(--berry);
  color: #fff;
  text-align: center;
  font-size: .9rem;
  padding: .45rem 1rem;
  font-weight: 700;
}
.ribbon a { color: #fff; }
header.site {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251, 246, 238, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--pine); font: 700 1.5rem var(--serif); }
.brand img { width: 36px; height: 36px; }
nav.main { display: flex; gap: 6px; align-items: center; }
nav.main a { text-decoration: none; color: var(--ink); font-weight: 700; padding: .45rem .8rem; border-radius: 999px; }
nav.main a:hover { background: #f1e6d6; }
.cart-link { position: relative; }
.cart-count {
  position: absolute; top: -2px; right: -4px;
  background: var(--berry); color: #fff; font-size: .72rem; min-width: 20px; height: 20px;
  border-radius: 10px; display: grid; place-items: center; padding: 0 5px;
}
.cart-count:empty { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: .85rem 1.5rem;
  font: 800 1rem var(--sans); cursor: pointer; text-decoration: none;
  background: var(--berry); color: #fff; transition: transform .1s, background .2s, box-shadow .2s;
  box-shadow: 0 6px 16px rgba(164, 38, 44, .25);
}
.btn:hover { background: var(--berry-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn.green { background: var(--pine); box-shadow: 0 6px 16px rgba(31, 61, 43, .25); }
.btn.green:hover { background: var(--pine-2); }
.btn.ghost { background: transparent; color: var(--pine); box-shadow: inset 0 0 0 2px var(--pine); }
.btn.ghost:hover { background: #efe5d6; }
.btn.small { padding: .5rem 1rem; font-size: .9rem; }
.btn.block { width: 100%; }

/* Hero */
.hero { padding: 48px 0 32px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 32ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.hero-img { border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 3 / 2; background: #efe3d1; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.kicker { display: inline-block; font-weight: 800; color: var(--berry); letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; margin-bottom: .6rem; }
.guarantee {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 22px;
  background: var(--paper); border: 1px dashed var(--gold); border-radius: 12px; padding: .6rem .9rem; font-size: .95rem;
}
.guarantee b { color: var(--pine); }

section { padding: 56px 0; }
section.alt { background: var(--paper); border-block: 1px solid var(--line); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step .num { width: 36px; height: 36px; border-radius: 50%; background: var(--pine); color: #fff; display: grid; place-items: center; font-weight: 800; margin-bottom: 10px; }

.styles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.style-card {
  background: var(--paper); border: 2px solid var(--line); border-radius: 14px; overflow: hidden;
  text-align: left; padding: 0; cursor: pointer; font: inherit; color: inherit; transition: border-color .2s, transform .15s;
}
.style-card:hover { transform: translateY(-2px); border-color: var(--wood); }
.style-card.active { border-color: var(--berry); box-shadow: 0 0 0 3px rgba(164, 38, 44, .15); }
.style-card img { aspect-ratio: 4 / 3; object-fit: contain; background: #fff; width: 100%; border-bottom: 1px solid var(--line); }
.style-card .meta { padding: 10px 12px; }
.style-card .meta b { display: block; font-size: .95rem; }
.style-card .meta span { font-size: .82rem; color: var(--muted); }

.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 220px; gap: 14px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; background: #efe3d1; }
.gallery img:first-child { grid-row: span 2; }

.product { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.price { font: 700 2rem var(--serif); color: var(--berry); }
ul.ticks { list-style: none; padding: 0; margin: 0 0 1.2em; }
ul.ticks li { padding-left: 28px; position: relative; margin-bottom: .4em; }
ul.ticks li::before { content: '✓'; position: absolute; left: 0; color: var(--pine-2); font-weight: 900; }

details.faq { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; font-weight: 800; }
details.faq p { margin: .6em 0 0; color: var(--muted); }

footer.site { background: var(--pine); color: #e9efe9; padding: 36px 0; margin-top: 40px; font-size: .92rem; }
footer.site a { color: #fff; }
footer.site .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* Snow */
.snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.snow i { position: absolute; top: -10px; width: 6px; height: 6px; background: #fff; border-radius: 50%; opacity: .8; animation: fall linear infinite; box-shadow: 0 0 3px rgba(0,0,0,.08); }
@keyframes fall { to { transform: translateY(105vh) translateX(30px); } }
@media (prefers-reduced-motion: reduce) { .snow { display: none; } }
main, header.site, footer.site { position: relative; z-index: 1; }

/* Cards / forms */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 2px 0 rgba(0,0,0,.02); }
label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; font: inherit; padding: .7rem .85rem; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
}
/* Native dropdowns, in brand colours with our own chevron */
select {
  appearance: none; -webkit-appearance: none; cursor: pointer; font-weight: 700; color: var(--pine);
  padding-right: 2.4rem; background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5l5 5 5-5' fill='none' stroke='%231f3d2b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .85rem center;
  transition: border-color .2s, background-color .2s;
}
select:hover { border-color: var(--wood); background-color: #fffaf2; }
select option { color: var(--ink); font-weight: 600; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pine-2); box-shadow: 0 0 0 3px rgba(45, 86, 64, .15); }
textarea { resize: vertical; min-height: 80px; }
.field { margin-bottom: 14px; }
.field .err { color: var(--berry); font-size: .82rem; margin-top: 3px; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.row3 { display: grid; gap: 12px; grid-template-columns: 2fr 1fr 1fr; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: .75rem 1.2rem; border-radius: 12px;
  opacity: 0; transition: .25s; z-index: 100; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Page header */
.page-head { padding: 36px 0 12px; }

/* Studio */
.studio { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: start; padding-bottom: 40px; }
.preview-wrap { position: sticky; top: 84px; }
.preview-stage {
  background: radial-gradient(ellipse at 50% 30%, #fff8ec, #efe2cd);
  border-radius: 20px; border: 1px solid var(--line); padding: 28px; box-shadow: var(--shadow);
  perspective: 1200px; min-height: 360px; display: grid; place-items: center; position: relative; overflow: hidden;
}
.box3d { width: 100%; max-width: 520px; transition: transform .6s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
.box3d.angle { transform: rotateX(45deg) rotateZ(-12deg) scale(.8); }
/* The lid drawn true to size: 150 x 100 mm (3:2), almost square corners, no rim added around it,
   so what you see is exactly the area that gets engraved. */
.lid {
  position: relative; border-radius: 2px; overflow: hidden; aspect-ratio: 3 / 2;
  box-shadow: 0 0 0 1px #8f6438, 0 24px 40px rgba(60,35,10,.35);
}
.box3d.angle .lid { box-shadow: 0 0 0 1px #8f6438, 0 60px 60px rgba(60,35,10,.35); }
.lid-size { text-align: center; font: 700 .78rem var(--sans); color: var(--muted, #8a7560); margin-top: 10px; letter-spacing: .02em; }
.lid canvas { width: 100%; height: 100%; display: block; }
/* Couples pair: two lids side by side, edges touching (2px line = the join). */
.box3d.pair { display: flex; gap: 2px; max-width: 640px; }
.box3d.pair .lid { flex: 1 1 0; }
.box-kind { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.box-kind .chip.active { background: var(--berry); border-color: var(--berry); color: #fff; }
#pair-note { margin: -4px 0 10px; }
.preview-tabs { display: flex; gap: 6px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; padding: .4rem .9rem;
  font: 700 .88rem var(--sans); cursor: pointer; color: var(--ink);
}
.chip.active { background: var(--pine); color: #fff; border-color: var(--pine); }
.generating {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(251, 246, 238, .82);
  font-weight: 800; color: var(--pine); text-align: center; z-index: 3; border-radius: 20px;
}
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid #e6d7c2; border-top-color: var(--berry); animation: spin 1s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.versions { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 4px; }
.versions button { flex: 0 0 auto; width: 84px; aspect-ratio: 3/2; border-radius: 3px; border: 2px solid var(--line); background: #fff; padding: 0; cursor: pointer; overflow: hidden; }
.versions button.active { border-color: var(--berry); }
.versions img { width: 100%; height: 100%; object-fit: contain; }
.versions button { position: relative; }
.versions .in-cart { position: absolute; right: 3px; bottom: 3px; background: var(--pine); color: #fff; font: 800 .68rem var(--sans); border-radius: 999px; padding: 1px 6px; }

.panel { margin-bottom: 16px; }
.panel h3 { display: flex; align-items: center; gap: 10px; }
.panel h3 .n { width: 28px; height: 28px; border-radius: 50%; background: var(--berry); color: #fff; font: 800 .9rem var(--sans); display: grid; place-items: center; }
.studio .styles-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.studio .style-card .meta { padding: 7px 9px; }
.studio .style-card .meta span { display: none; }

.dropzone {
  border: 2px dashed var(--wood); border-radius: 14px; padding: 18px; text-align: center; cursor: pointer; background: #fffaf2;
}
.dropzone.drag { background: #f6ead8; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.photo-grid .photo { position: relative; aspect-ratio: 1; }
.photo-grid .photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
.photo-grid .photo .num { position: absolute; left: 5px; bottom: 5px; background: rgba(255,250,242,.92); color: var(--ink, #3a2a1a); font: 700 .72rem var(--sans); padding: 1px 6px; border-radius: 8px; }
.photo-grid .photo .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(58,42,26,.75); color: #fff; font: 700 .9rem/24px var(--sans); cursor: pointer; padding: 0; }
.photo-grid .photo .x:hover { background: var(--berry); }
.photo-grid .add { aspect-ratio: 1; border: 2px dashed var(--wood); border-radius: 10px; background: #fffaf2; display: grid; place-items: center; cursor: pointer; font: 700 .8rem var(--sans); color: inherit; text-align: center; }
.photo-grid .add.drag, .photo-grid .add:hover { background: #f6ead8; }
.photo-grid .photo .as-photo { position: absolute; right: 4px; bottom: 4px; border: 0; border-radius: 8px; background: rgba(58,42,26,.82); color: #fff; font: 700 .68rem/1.2 var(--sans); padding: 3px 6px; cursor: pointer; }
.photo-grid .photo .as-photo:hover { background: var(--berry); }
.photo-offer { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #fffaf2; border: 1px solid #ecdcc4; }
.photo-grid .photo.loading { display: grid; place-items: center; border-radius: 10px; background: #f6ead8; font: 600 .75rem var(--sans); }

.chat { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; padding: 4px; margin-bottom: 10px; }
.msg { padding: .6rem .9rem; border-radius: 14px; max-width: 85%; white-space: pre-wrap; }
.msg.assistant { background: #eef3ee; align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: var(--pine); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.event { align-self: center; background: none; color: var(--muted); font-size: .8rem; font-weight: 700; padding: .1rem .6rem; }
.msg.typing { color: var(--muted); font-style: italic; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { flex: 1; min-height: 0; resize: none; overflow-y: hidden; line-height: 1.4; max-height: 9.5em; }
.chat-input .btn { flex: none; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.suggest button { font-size: .8rem; }

.save-state { font-size: .82rem; color: var(--muted); }
.design-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.design-bar input { max-width: 240px; font-weight: 700; }

/* "My designs" menu */
.dmenu { position: relative; }
.dmenu-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px 0 6px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--pine);
  font: 800 .95rem var(--sans); cursor: pointer; transition: border-color .2s, background .2s;
}
.dmenu-btn:hover, .dmenu-btn[aria-expanded="true"] { border-color: var(--wood); background: #fffaf2; }
.dmenu-btn:not(:has(img:not([hidden]))) { padding-left: 14px; }
.dmenu-btn img { width: 44px; height: 33px; object-fit: contain; background: #fff; border-radius: 999px 8px 8px 999px; border: 1px solid var(--line); }
.dmenu-btn b { color: var(--muted); font-weight: 700; }
.dmenu-btn svg { transition: transform .2s; }
.dmenu-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.dmenu-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; width: min(560px, calc(100vw - 32px));
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px;
}
.dmenu-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-family: var(--serif); color: var(--pine); font-size: 1.1rem; }
.dmenu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: min(420px, 60vh); overflow-y: auto; padding: 2px; }
.dcard { position: relative; border: 2px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; transition: border-color .2s, transform .15s; }
.dcard:hover { border-color: var(--wood); transform: translateY(-2px); }
.dcard.current { border-color: var(--berry); box-shadow: 0 0 0 3px rgba(164, 38, 44, .12); }
.dcard-open { display: block; width: 100%; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.dcard-img { display: grid; place-items: center; aspect-ratio: 3 / 2; background: linear-gradient(#fbf3e6, #f3e6d2); border-bottom: 1px solid var(--line); }
.dcard-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.dcard-empty { font-size: .78rem; color: var(--muted); font-weight: 700; }
.dcard-meta { display: block; padding: 7px 9px; }
.dcard-meta b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 22px; }
.dcard-meta span { font-size: .75rem; color: var(--muted); }
.dcard-del {
  position: absolute; right: 6px; bottom: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer;
}
.dcard-del:hover, .dcard-del:focus-visible { background: #f8e3e3; color: var(--berry); }
.dcard-confirm { display: none; position: absolute; inset: 0; background: rgba(255, 253, 249, .96); padding: 10px; text-align: center; flex-direction: column; justify-content: center; gap: 6px; }
.dcard.confirming .dcard-confirm { display: flex; }
.dcard-confirm .btn.small { padding: .35rem .8rem; font-size: .82rem; }
@media (max-width: 560px) { .dmenu-panel { position: fixed; left: 16px; right: 16px; top: 120px; width: auto; } }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.note { font-size: .85rem; color: var(--muted); }
.warn { background: #fff3dc; border: 1px solid #f0d49a; padding: .6rem .8rem; border-radius: 10px; font-size: .88rem; }

/* Cart */
.cart-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }
.cart-item { display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 120px; aspect-ratio: 3/2; object-fit: contain; background: #fff; border-radius: 2px; border: 1px solid var(--line); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { border: 0; background: transparent; width: 34px; height: 34px; cursor: pointer; font-size: 1.1rem; }
.qty span { min-width: 26px; text-align: center; font-weight: 800; }
.sum-row { display: flex; justify-content: space-between; margin: 8px 0; }
.sum-row.total { font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--line); padding-top: 10px; }
.empty { text-align: center; padding: 50px 0; }
.linklike { background: none; border: 0; color: var(--berry); cursor: pointer; font: inherit; font-size: .88rem; padding: 0; text-decoration: underline; }

table.orders { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.orders th, table.orders td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }

@media (max-width: 880px) {
  .hero .wrap, .product, .studio, .cart-layout { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 160px; }
  .gallery img:first-child { grid-column: span 2; grid-row: span 1; }
  .preview-wrap { position: static; }
  nav.main a.hide-sm { display: none; }
  .row, .row3 { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 90px 1fr; }
  .cart-item img { width: 90px; }
  .cart-item .right { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
}
.btn.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(164, 38, 44, .18); } }

/* Homepage: the three tones of a real-photo engraving */
.tones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-self: center; }
.tone { aspect-ratio: 3 / 4; border-radius: 14px; display: flex; align-items: flex-end; padding: 10px; background: #e2c49a; box-shadow: inset 0 0 0 1px rgba(90,60,30,.15); }
.tone span { background: rgba(255,250,242,.92); border-radius: 8px; padding: 2px 8px; font: 700 .8rem var(--sans); }
.t-black { background: #3b2416; }
.t-dots { background-color: #e2c49a; background-image: radial-gradient(circle, #3b2416 32%, transparent 34%); background-size: 9px 9px; }
