/* N&H Store – light mode = "Handloom", dark mode = "Midnight" */

/* ---------- Colour and type tokens ---------- */
:root {
  --logo: #D3652C;                 /* exact logo colour – never change */
  --bg: #F2E2CC; --surface: #FBF2E6; --ink: #2F281E; --muted: #6F6350; --line: #D9C3A5;
  --btn: #B4511F; --btn-ink: #FFFFFF; --accent: #5B6838; --accent-ink: #FBF2E6; --img-bg: #EBD5B8;
  --radius: 999px; --card-radius: 18px;
  --head: "Fraunces", Georgia, serif; --body: "Nunito Sans", system-ui, sans-serif;
  --stitch: 1.5px dashed var(--line);
  --hero-glow: none;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1B1411; --surface: #261C18; --ink: #F4E8DC; --muted: #B59E8C; --line: #3A2C25;
  --btn: #D3652C; --btn-ink: #1B1411; --accent: #D3652C; --accent-ink: #1B1411; --img-bg: #31241E;
  --radius: 4px; --card-radius: 6px;
  --head: "Cinzel", Georgia, serif; --body: "Manrope", system-ui, sans-serif;
  --stitch: 1px solid var(--line);
  --hero-glow: radial-gradient(60% 45% at 50% 40%, rgba(211,101,44,.2), transparent 70%);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1B1411; --surface: #261C18; --ink: #F4E8DC; --muted: #B59E8C; --line: #3A2C25;
    --btn: #D3652C; --btn-ink: #1B1411; --accent: #D3652C; --accent-ink: #1B1411; --img-bg: #31241E;
    --radius: 4px; --card-radius: 6px;
    --head: "Cinzel", Georgia, serif; --body: "Manrope", system-ui, sans-serif;
    --stitch: 1px solid var(--line);
    --hero-glow: radial-gradient(60% 45% at 50% 40%, rgba(211,101,44,.2), transparent 70%);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--logo); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--btn); color: var(--btn-ink); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Tagline: handwritten in light mode, spaced capitals in dark mode ---------- */
.tag-light, .tag-dark { margin: 0; color: var(--logo); }
.tag-light { font: 400 clamp(19px, 5vw, 24px)/1.3 "Kalam", cursive; }
.tag-light span { display: block; }
.tag-light span + span { color: #5B6838; }
.tag-dark { display: none; font: 300 clamp(10.5px, 2.8vw, 13px)/1.9 "Montserrat", sans-serif; text-transform: uppercase; letter-spacing: .24em; }
.tag-dark span { display: block; }
.tag-dark span + span { font: italic 400 clamp(18px, 4.6vw, 22px)/1.4 "Cormorant Garamond", serif; text-transform: none; letter-spacing: .02em; color: var(--ink); margin-top: 4px; }
:root[data-theme="dark"] .tag-light { display: none; }
:root[data-theme="dark"] .tag-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tag-light { display: none; }
  :root:not([data-theme="light"]) .tag-dark { display: block; }
}

/* ---------- Buttons ---------- */
.ibtn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.ibtn svg { width: 18px; height: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 12px 20px; font: 700 14px/1.1 var(--body);
  border-radius: var(--radius); border: 1px solid var(--btn); background: var(--btn); color: var(--btn-ink); text-align: center; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn svg { width: 17px; height: 17px; flex: none; }

/* ---------- Page switching ---------- */
.view { display: none; }
.view.on { display: block; }
body.navigated .view.on { animation: fade .3s ease; } /* only when moving between pages, never on first load */
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 1. Landing: hero only ---------- */
#home { position: relative; min-height: 100svh; background: var(--hero-glow), var(--bg); }
#home .corner { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; display: flex; gap: 8px; }
.landing { min-height: 100svh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 80px 20px 40px; }
.landing .frame { width: 100%; max-width: 520px; padding: 44px 24px 34px; border-radius: 28px; }
:root:not([data-theme="dark"]) .landing .frame { background: var(--surface); outline: 2px dashed var(--line); outline-offset: -10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .landing .frame { background: none; outline: 0; } }
.landing .lockup { width: min(78%, 320px); margin: 0 auto; }
.landing h1 { margin: 0; }
.landing .taglines { margin-top: 18px; }
.landing .ctas { display: flex; flex-direction: column; gap: 10px; margin: 30px auto 0; max-width: 300px; }
.landing .ctas .btn { width: 100%; padding: 15px 20px; font-size: 15px; }
.landing .where { margin: 22px 0 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }
.landing .where svg { width: 15px; height: 15px; }

/* ---------- Header for inside pages ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar[hidden] { display: none; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand .mark { height: 36px; width: auto; }
.brand .word { height: 14px; width: auto; }
.topbar .icons { display: flex; gap: 6px; }
.wrap { max-width: 1080px; margin: 0 auto; }

/* ---------- 2. Products ---------- */
.tools { padding: 16px 16px 0; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); }
.search:focus-within { border-color: var(--logo); }
.search svg { width: 16px; height: 16px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: 16px var(--body); padding: 12px 0; outline: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 38px; padding: 8px 15px; font-size: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 20px 16px 12px; }
.heading h1 { font-size: 23px; }
.heading span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 14px; padding: 0 16px; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; } }
.card { background: var(--surface); border-radius: var(--card-radius); overflow: hidden; outline: var(--stitch); outline-offset: -5px; display: flex; flex-direction: column; }
.card .img { display: block; aspect-ratio: 4/5; background: var(--img-bg); }
.card .img img { width: 100%; height: 100%; object-fit: cover; }
.card .info { padding: 11px 12px 13px; display: flex; flex-direction: column; flex: 1; }
.card h2 { font-size: 15.5px; line-height: 1.25; }
.price { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.price b { color: var(--ink); font-weight: 700; }
.card .btn { margin-top: auto; min-height: 38px; padding: 9px 10px; font-size: 13px; }
.card .info .btn { margin-top: 10px; }
.empty, .status { padding: 40px 16px; text-align: center; color: var(--muted); }

/* About / contact */
.about { margin: 36px 16px 0; padding: 28px 18px; text-align: center; border-top: 1px solid var(--line); }
.about img { width: 56px; margin: 0 auto; }
.about h2 { font-size: 22px; margin: 10px 0 6px; }
.about p { margin: 0 auto; color: var(--muted); max-width: 46ch; font-size: 14px; }
.about dl { display: grid; grid-template-columns: auto auto; justify-content: center; gap: 4px 12px; margin: 16px 0 0; font-size: 14px; text-align: left; }
.about dt { color: var(--muted); }
.about dd { margin: 0; font-weight: 600; }
.about .row { display: flex; gap: 8px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
footer { padding: 18px 16px 104px; text-align: center; color: var(--muted); font-size: 12.5px; }
footer small { display: block; max-width: 36ch; margin: 0 auto; font-size: inherit; }
footer .copy { margin-top: 8px; opacity: .8; }

.fab { position: fixed; right: 16px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 20; width: 56px; height: 56px; border-radius: 50%;
  display: none; place-items: center; background: var(--btn); color: var(--btn-ink); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.fab svg { width: 26px; height: 26px; }
body.show-fab .fab { display: grid; }

/* ---------- 3. Product detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; color: var(--muted); padding: 6px 16px 0; }
.back svg { width: 16px; height: 16px; }
.detail { padding: 6px 16px 0; display: grid; gap: 18px; }
.detail > * { min-width: 0; } /* stops the photo strip from widening the page */
@media (min-width: 760px) { .detail { grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; padding-top: 16px; } }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--card-radius); background: var(--img-bg); scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; width: 100%; aspect-ratio: 4/5; object-fit: cover; scroll-snap-align: center; }
.dots { display: flex; gap: 4px; justify-content: center; margin-top: 6px; }
.dots button { width: 28px; height: 28px; border: 0; background: none; padding: 0; display: grid; place-items: center; }
.dots button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots button[aria-current="true"]::before { background: var(--logo); }
.kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.detail h1 { font-size: 27px; line-height: 1.15; margin: 6px 0 8px; }
.detail .price { font-size: 14px; }
.detail p { color: var(--muted); margin: 14px 0 18px; white-space: pre-line; }
.detail .stack { display: grid; gap: 10px; }
.detail .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.related h2 { font-size: 20px; padding: 34px 16px 12px; }
