/* ==================================================================
   KIHT GIFT SHOP — base
   tokens, reset, typography, primitives
   ================================================================== */

/* ---------- 1. tokens ---------- */
:root {
  /* paper & ink */
  --paper: #f6f2ea;
  --paper-raised: #fffdf9;
  --paper-sunk: #efe9dd;
  --ink: #17140f;
--ink-head: #c41515;
  --ink-soft: #4d463c;
  --ink-mute: #857c6f;
  --line: #ded5c5;
  --line-strong: #c9bda7;

  /* accents — deliberately not purple */
  --clay: #b3532e;
  --clay-deep: #8f3f21;
  --moss: #4e5f44;
  --brass: #a8802f;
  --plum: #5c3f4e;
  --sky: #8ea3a0;

  /* feedback */
  --ok: #3f6b46;
  --warn: #96631d;
  --bad: #a63c2c;

  /* type */
  --f-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --f-text: "Karla", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --step--1: clamp(0.82rem, 0.8rem + 0.1vw, 0.88rem);
  --step-0: clamp(0.97rem, 0.94rem + 0.15vw, 1.05rem);
  --step-1: clamp(1.13rem, 1.05rem + 0.4vw, 1.3rem);
  --step-2: clamp(1.4rem, 1.2rem + 0.9vw, 1.85rem);
  --step-3: clamp(1.8rem, 1.4rem + 1.8vw, 2.7rem);
  --step-4: clamp(2.3rem, 1.6rem + 3.2vw, 4rem);
  --step-5: clamp(2.8rem, 1.5rem + 5.6vw, 6rem);

  /* space & shape */
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --shell: 82rem;
  --shell-wide: 92rem;
  --measure: 62ch;

  --r-sm: 2px;
  --r-md: 4px;
  --r-lg: 8px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(23, 20, 15, 0.06);
  --shadow-md: 0 8px 24px -12px rgba(23, 20, 15, 0.28);
  --shadow-lg: 0 28px 60px -30px rgba(23, 20, 15, 0.45);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.4s;

  /* per-product art palette, overridable per card */
  --art-bg: #e7ded0;
  --art-1: #b3532e;
  --art-2: #8f3f21;
  --art-3: #ded5c5;
  --art-ink: #17140f;
  --art-shadow: rgba(23, 20, 15, 0.1);
}

/* ---------- 2. reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 7rem;
}

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: var(--step-0);
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img,
svg,
video { display: block; max-width: 100%; }

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button { background: none; border: 0; cursor: pointer; }

ul,
ol { list-style: none; padding: 0; }

a { color: inherit; text-decoration: none; }

table { border-collapse: collapse; width: 100%; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

:where(h1, h2, h3, h4) {
  color: var(--ink-head);
  font-family: var(--f-display);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.015em;
  font-variation-settings: "SOFT" 8, "WONK" 1, "opsz" 90;
  text-wrap: balance;
}

/* headings sit on light paper, but the newsletter band is near-black: keep its text light */
.band :is(h1, h2, h3, h4) { color: inherit; }

p { text-wrap: pretty; }

/* ---------- 3. a11y ---------- */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 0.65rem 1.1rem;
  border-radius: var(--r-md);
  font-size: var(--step--1);
  letter-spacing: 0.02em;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- 4. layout ---------- */
.shell {
  width: min(100% - (var(--gutter) * 2), var(--shell));
  margin-inline: auto;
}
.shell--wide { width: min(100% - (var(--gutter) * 2), var(--shell-wide)); }
.shell--narrow { width: min(100% - (var(--gutter) * 2), 52rem); }

.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--sunk { background: var(--paper-sunk); }
.section--raised { background: var(--paper-raised); }

.rule { border-top: 1px solid var(--line); }

/* section eyebrow: "01 — New this week" */
.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: var(--step--1);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.eyebrow b {
  font-family: var(--f-mono);
  font-weight: 400;
  color: var(--clay);
  letter-spacing: 0.08em;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  transform: translateY(-0.3em);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
}
.section-head h2 { font-size: var(--step-3); }
.section-head p {
  max-width: 34ch;
  color: var(--ink-soft);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: var(--measure);
}

/* ---------- 5. buttons ---------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  --btn-bd: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.82rem 1.6rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-pill);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), transform 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: var(--line-strong);
}
.btn--ghost:hover { --btn-bg: var(--ink); --btn-fg: var(--paper); --btn-bd: var(--ink); }

.btn--quiet {
  --btn-bg: transparent;
  --btn-fg: var(--ink-soft);
  --btn-bd: transparent;
  padding-inline: 0.4rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.btn--quiet:hover { --btn-fg: var(--clay); transform: none; }

.btn--clay { --btn-bg: var(--clay); --btn-bd: var(--clay); --btn-fg: #fff8f2; }
.btn--clay:hover { --btn-bg: var(--clay-deep); --btn-bd: var(--clay-deep); }

.btn--block { width: 100%; }
.btn--sm { padding: 0.55rem 1.05rem; font-size: 0.72rem; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line-strong);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: gap 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s;
}
.link-arrow:hover { gap: 0.9rem; border-color: var(--ink); }
.link-arrow svg { width: 1em; height: 1em; }

/* ---------- 6. forms ---------- */
.field { display: grid; gap: 0.4rem; }

.field > label,
.label {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.78rem 0.9rem;
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font-size: var(--step-0);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input::placeholder,
.textarea::placeholder { color: #a89e8d; }
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(23, 20, 15, 0.08);
}
.textarea { min-height: 8rem; resize: vertical; }

.select {
  appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2317140f' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 0.7rem;
}

.field__error {
  font-size: var(--step--1);
  color: var(--bad);
  min-height: 0;
}
.field[data-invalid] .input,
.field[data-invalid] .select,
.field[data-invalid] .textarea { border-color: var(--bad); }

.hint { font-size: var(--step--1); color: var(--ink-mute); }

.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  cursor: pointer;
  font-size: var(--step-0);
  line-height: 1.45;
}
.check input {
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--paper-raised);
  display: grid;
  place-content: center;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.check input::after {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  background: var(--paper);
  clip-path: polygon(14% 46%, 0 60%, 38% 100%, 100% 22%, 86% 8%, 36% 70%);
  transform: scale(0);
  transition: transform 0.18s var(--ease);
}
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input:checked::after { transform: scale(1); }

/* optional VAT tick inside the checkout/cart summary */
.check--vat {
  margin-top: 0.9rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-sunk);
}
.check--vat input:checked ~ span > b { color: var(--ink); }

/* radio chips — colourways, delivery speed */
.swatches { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.swatches input { position: absolute; opacity: 0; pointer-events: none; }
.swatches label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font-size: var(--step--1);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.swatches label::before {
  content: "";
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--dot, var(--line-strong));
  box-shadow: inset 0 0 0 1px rgba(23, 20, 15, 0.15);
}
.swatches input:checked + label { border-color: var(--ink); background: var(--paper-raised); }
.swatches input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- 7. bits ---------- */
.badge {
  display: inline-block;
  padding: 0.24rem 0.6rem;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.badge--clay { background: var(--clay); color: #fff8f2; }
.badge--moss { background: var(--moss); color: #f2f6ee; }
.badge--low { background: var(--warn); color: #fff8ec; }
.badge--out { background: var(--ink-mute); }

.price {
  font-family: var(--f-display);
  font-size: var(--step-1);
  font-variant-numeric: tabular-nums;
}
.price s { color: var(--ink-mute); font-size: 0.7em; margin-right: 0.4rem; }

.stars {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--brass);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}
.stars small { color: var(--ink-mute); margin-left: 0.35rem; font-size: var(--step--1); }

.note {
  display: flex;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  background: var(--paper-sunk);
  border-left: 2px solid var(--clay);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.note--ok { border-color: var(--ok); }
.note--bad { border-color: var(--bad); color: var(--bad); }

.meta {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  text-transform: uppercase;
}

/* quantity stepper */
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--paper-raised);
  overflow: hidden;
}
.qty button {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-content: center;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ink-soft);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.qty button:hover:not([disabled]) { background: var(--ink); color: var(--paper); }
.qty button[disabled] { opacity: 0.3; cursor: not-allowed; }
.qty input {
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  background: none;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: var(--step-0);
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* accordion */
.acc { border-top: 1px solid var(--line); }
.acc__item { border-bottom: 1px solid var(--line); }
.acc__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  text-align: left;
  font-weight: 600;
  font-size: var(--step-0);
}
.acc__btn i {
  flex: none;
  width: 1rem;
  height: 1rem;
  position: relative;
  transition: transform 0.3s var(--ease);
}
.acc__btn i::before,
.acc__btn i::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 1.5px;
  background: var(--ink);
  transform: translateY(-50%);
}
.acc__btn i::after { transform: translateY(-50%) rotate(90deg); }
.acc__btn[aria-expanded="true"] i { transform: rotate(135deg); }
.acc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease);
}
.acc__panel > div { overflow: hidden; }
.acc__item.is-open .acc__panel { grid-template-rows: 1fr; }
.acc__body {
  padding-bottom: 1.2rem;
  color: var(--ink-soft);
  font-size: var(--step-0);
}
.acc__body ul { display: grid; gap: 0.4rem; }
.acc__body li { padding-left: 1.1rem; position: relative; }
.acc__body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.4rem;
  height: 1px;
  background: var(--line-strong);
}

/* breadcrumbs */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--step--1);
  color: var(--ink-mute);
}
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.crumbs span[aria-hidden] { color: var(--line-strong); }
.crumbs [aria-current] { color: var(--ink); }

/* reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .no-print { display: none !important; }
}