:root {
  /* Refined palette from reference */
  --color-bg: #F5EEE4; /* parchment */
  --color-bg-alt: #EBDCCB;
  --color-paper: #FCF8F3;
  --color-ink: #7A4F3A; /* deep title brown */
  --color-ink-soft: #8C5E46; /* body brown */
  --color-accent: #B98362; /* clay/gold accent */
  --color-accent-soft: #D6B894; /* light frame accent */
  --color-muted: #A68770;
  --color-divider: #E2D2BF;
  --color-frame-line: #D6B894;
  --color-frame-bg: #F6ECDE;
  --vignette: radial-gradient(circle at 50% 15%, rgba(0,0,0,0) 55%, rgba(0,0,0,.07) 100%);
  --radius-s: 4px;
  --radius-m: 10px;
  --shadow-soft: 0 2px 6px rgba(60,40,20,0.12);
  --shadow-hover: 0 4px 14px rgba(60,40,20,0.18);
  --max-width: 1080px;
  font-family: 'Libre Baskerville', serif;
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    linear-gradient(180deg,var(--color-bg) 0%, var(--color-bg) 40%, var(--color-bg-alt) 100%);
  color: var(--color-ink-soft);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}
body::before { /* subtle paper-esque fiber/texture replacement for missing PNG */
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(45deg, rgba(0,0,0,0.015) 0 12px, rgba(0,0,0,0) 12px 24px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,0.012) 0 10px, rgba(0,0,0,0) 10px 20px);
  mix-blend-mode: multiply; opacity: .55; z-index: 0;
}
body::after { /* subtle vignette */
  content: ""; position: fixed; inset: 0; pointer-events: none; background: var(--vignette); mix-blend-mode: multiply; opacity: .55; z-index: 1;
}

.serif { font-family: 'Playfair Display', 'Libre Baskerville', serif; }
.script { font-family: 'Dancing Script', cursive; font-size: 2.2rem; color: var(--color-accent); }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(248,244,241,0.9); backdrop-filter: blur(6px);
  border-bottom: 1px solid #e5d9cf;
}
.primary-nav { display: flex; align-items: center; justify-content: space-between; max-width: var(--max-width); margin: 0 auto; padding: .5rem 1rem; }
.primary-nav .brand { font-family: 'Playfair Display', serif; font-size: 1.2rem; text-decoration: none; color: var(--color-brown); font-weight: 600; }
.primary-nav ul { list-style: none; display: flex; gap: 1.2rem; margin: 0; padding: 0; }
.primary-nav a { text-decoration: none; color: var(--color-text); font-weight: 500; }
.primary-nav a:hover { color: var(--color-accent); }
.menu-toggle { display: none; }

@media (max-width: 760px) {
  .primary-nav ul { position: absolute; top: 100%; right: 0; background: var(--color-paper); flex-direction: column; padding: 1rem 1.2rem; box-shadow: var(--shadow-soft); display: none; }
  .primary-nav ul.open { display: flex; }
  .menu-toggle { display: block; background: none; border: 1px solid var(--color-accent-soft); padding: .4rem .6rem; border-radius: var(--radius-s); }
}

.section { padding: 3.2rem 1.2rem 2.6rem; }
.content { max-width: var(--max-width); margin: 0 auto; }
.content.narrow { max-width: 760px; }

.hero { position: relative; text-align: center; padding: 5.8rem 1rem 3.8rem; background: linear-gradient(180deg,rgba(255,255,255,0.65),rgba(255,255,255,0)); overflow: hidden; }
.hero-inner { position: relative; z-index: 2; }
.hero h1 { font-size: clamp(2.9rem, 7vw, 4.1rem); margin: 0 0 1.2rem; color: var(--color-ink); font-weight: 600; letter-spacing: .5px; }
.tagline { font-size: 1.15rem; max-width: 640px; margin: 0 auto 2.2rem; color: var(--color-ink-soft); }
.hero-illustration { position: absolute; inset: 0; background: url('assets/hearth-etching.svg') center/400px auto no-repeat; opacity: .09; filter: sepia(.55) saturate(.6); z-index: 0; pointer-events: none; }

.cta, .secondary { font-family: 'Libre Baskerville', serif; cursor: pointer; position: relative; }
.cta, .secondary {
  background: linear-gradient(180deg,var(--color-paper),#F8F1E8);
  color: var(--color-ink-soft);
  border: 1.5px solid var(--color-accent);
  padding: .85rem 1.55rem .9rem;
  font-size: .95rem;
  letter-spacing: .5px;
  border-radius: 40px;
  box-shadow: 0 0 0 1px var(--color-accent-soft), 0 2px 4px rgba(122,79,58,0.12);
  transition: background .3s, transform .25s, box-shadow .25s;
}
.cta:hover, .secondary:hover { background: linear-gradient(180deg,#FFF,#F6EBDD); transform: translateY(-2px); }
.cta:active, .secondary:active { transform: translateY(0); box-shadow: 0 0 0 1px var(--color-accent-soft), 0 1px 2px rgba(122,79,58,0.25) inset; }
.secondary { opacity: .9; }

.about-layout { display: grid; gap: 2.2rem; grid-template-columns: minmax(0,300px) 1fr; align-items: start; }
@media (max-width: 820px) { .about-layout { grid-template-columns: 1fr; } }
.portrait-frame { margin: 0; background: var(--color-frame-bg); padding: .55rem; border: 1px solid var(--color-frame-line); border-radius: 4px; box-shadow: 0 0 0 1px #ECDCC9, 0 0 0 4px #F5E8D7, 0 0 0 5px rgba(214,184,148,.55); text-align: center; }
.portrait-frame img { width: 100%; border-radius: 2px; display: block; }
.portrait-frame img:not(.portrait-photo) { filter: sepia(.35) contrast(1.02) saturate(.85); }
.portrait-photo { object-fit: cover; }
.portrait-frame figcaption { font-size: .85rem; margin-top: .4rem; color: var(--color-muted); }

.gallery-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.gallery-item { position: relative; flex: 0 0 210px; max-width: 210px; background: var(--color-frame-bg); padding: .55rem .55rem .95rem; border: 1px solid var(--color-frame-line); border-radius: 4px; box-shadow: 0 0 0 1px #ECDCC9, 0 0 0 4px #F5E8D7, 0 0 0 5px rgba(214,184,148,.55); cursor: zoom-in; transition: transform .25s, box-shadow .25s; }
@media (max-width: 980px) { .gallery-item { flex: 0 0 180px; max-width: 180px; } }
@media (max-width: 640px) { .gallery-item { flex: 0 0 47%; max-width: 47%; } }
@media (max-width: 430px) { .gallery-item { flex: 0 0 100%; max-width: 340px; } }
.gallery-item:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px #ECDCC9, 0 0 0 4px #F5E8D7, 0 0 0 5px rgba(214,184,148,.65), 0 4px 10px rgba(122,79,58,.15); }
.gallery-item figure { margin: 0; }
.gallery-item img { width: 100%; display: block; border-radius: 2px; filter: sepia(.35) contrast(1.02) saturate(.85); }
.gallery-item figcaption { margin-top: .5rem; font-size: .7rem; font-style: italic; font-family: 'Libre Baskerville', serif; letter-spacing: .3px; color: var(--color-ink); }

.lightbox { position: fixed; inset: 0; background: rgba(30,20,10,.72); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 80vw; max-height: 65vh; width: auto; height: auto; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.lightbox p { color: #fff; font-size: .95rem; margin-top: 1rem; }
.lightbox-close { position: absolute; top: 1.2rem; right: 1.2rem; font-size: 2rem; line-height: 1; background: none; border: none; color: #fff; cursor: pointer; }

.preorder { background: linear-gradient(180deg,#F5EFE6,#F2E6D7); text-align: center; }
.basket-illustration { height: 160px; background: url('assets/basket-etching.svg') center/contain no-repeat; opacity: .15; margin-top: 1rem; }

.how .steps { list-style: none; margin: 2.2rem 0 0; padding: 0; display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); }
.how li { background: var(--color-paper); border: 1px solid #e6dbd1; padding: 1.2rem 1.1rem 1.4rem; border-radius: 14px; position: relative; box-shadow: var(--shadow-soft); }
.step-icon { font-size: 2.2rem; font-family: 'Playfair Display', serif; color: var(--color-accent); margin-bottom: .4rem; }

.contact form { display: grid; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.field input, .field select, .field textarea { font: inherit; padding: .65rem .7rem; border: 1px solid #d9cfc6; border-radius: 8px; background: #fff; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--color-accent-soft); }
#contact-status { min-height: 1.2rem; font-size: .85rem; }

.qr-block { margin-top: 2.4rem; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
#qr-canvas { background: #fff; padding: .8rem; border: 1px solid #e0d6cc; border-radius: 10px; }

.site-footer { text-align: center; padding: 3rem 1rem 4rem; background: #EFE4D7; margin-top: 4rem; border-top: 1px solid var(--color-accent-soft); }
.logo-mark { font-size: 1.4rem; margin: 0 0 .4rem; }
.socials a { color: var(--color-accent); }
.socials a:hover { text-decoration: underline; }

/* Dialog */
#preorder-modal { border: none; padding: 0; border-radius: 18px; max-width: 480px; width: 100%; }
#preorder-modal::backdrop { background: rgba(40,25,15,.55); backdrop-filter: blur(4px); }
#preorder-form { padding: 2rem 1.8rem 1.8rem; display: grid; gap: 1rem; background: var(--color-paper); border: 1px solid #e5d9cf; border-radius: 18px; }
#preorder-form h2 { margin: 0 0 .4rem; }
#preorder-status { min-height: 1.2rem; font-size: .8rem; }

menu { display: flex; justify-content: flex-end; gap: .6rem; margin: .4rem 0 0; padding: 0; }
menu button { font: inherit; }

/* Accessibility helpers */
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Simplified headings (no flourishes) */
h2 { font-family: 'Playfair Display', serif; font-weight: 600; color: var(--color-ink); margin: 0 0 1.2rem; text-align: center; font-size: clamp(1.9rem,4.2vw,2.4rem); }

/* Slightly tighter spacing after lists and paragraphs inside sections */
.section p { margin-top: 0; }
.section p + p { margin-top: .9rem; }

/* Utility subtle divider */
.divider { height: 1px; background: linear-gradient(90deg,transparent, var(--color-divider), transparent); margin: 2.5rem auto; max-width: 680px; }

/* Optional soft texture overlay class */
.texture-overlay { position: relative; }
.texture-overlay::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: url('assets/subtle-paper.png'); mix-blend-mode: multiply; opacity: .18; }

/* Print QR */
@media print {
  body * { visibility: hidden; }
  #qr-canvas, #qr-canvas * { visibility: visible; }
  #qr-canvas { position: absolute; inset: 0; margin: auto; transform: scale(1.6); }
}
