/* ==========================================================================
   inkpod — design system (tokens + core components)
   Direction: "tattoo studio meets editorial print". Warm bone paper, true-black
   ink, one traditional flash red used sparingly. Big serif display, quiet sans
   body, mono labels like a studio price board. Hairlines, not shadows.
   Page/feature CSS lives in pages.css, commerce.css, customizer.css, chat.css,
   admin.css — they must only use these tokens.
   ========================================================================== */

:root {
  /* color */
  --bone: #f3eee6;          /* page background */
  --paper: #fbf8f3;         /* raised surfaces */
  --sand: #e8dfd2;          /* subtle fills, image placeholders */
  --ink: #151311;           /* text, primary buttons */
  --ink-2: #3a3530;
  --muted: #6b635a;         /* secondary text (AA on bone) */
  --line: rgba(21, 19, 17, .14);
  --line-strong: rgba(21, 19, 17, .32);
  --red: #c8381f;           /* flash red — accents, sale, focus */
  --red-soft: #f1d6cc;
  --mustard: #d9a52b;       /* traditional flash yellow — tiny highlights only */
  --olive: #4b5a36;         /* success */
  --olive-soft: #dfe5d2;
  --danger: #a3261a;
  --danger-soft: #f6dcd6;
  /* skin swatches used in previews */
  --skin-1: #f6dccb; --skin-2: #e9c1a0; --skin-3: #d19a72;
  --skin-4: #a96f4a; --skin-5: #7a4a2e; --skin-6: #4b2c1c;

  /* type */
  --f-display: "Instrument Serif", "Times New Roman", serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --t-hero: clamp(3rem, 7.4vw, 6.6rem);
  --t-h1: clamp(2.5rem, 5vw, 4.2rem);
  --t-h2: clamp(2rem, 3.6vw, 3.1rem);
  --t-h3: clamp(1.45rem, 2vw, 1.8rem);
  --t-body: 1rem;
  --t-small: .875rem;
  --t-label: .72rem;

  /* space & shape */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4.5rem; --s-9: 7rem;
  --r-sm: 8px; --r-md: 14px; --r-lg: 22px; --r-pill: 999px;
  --wrap: 1280px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow-pop: 0 18px 50px -20px rgba(21, 19, 17, .35);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bone); color: var(--ink);
  font: 400 var(--t-body)/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column;
}
/* paper grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1000; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main { flex: 1; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 var(--s-4); font-weight: 400; }
p { margin: 0 0 var(--s-4); }
::selection { background: var(--ink); color: var(--bone); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bone); padding: .6rem 1rem; z-index: 2000; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- type ---------- */
.display, .h1, .h2, .h3 { font-family: var(--f-display); font-weight: 400; letter-spacing: -.012em; }
.display { font-size: var(--t-hero); line-height: .92; }
.h1 { font-size: var(--t-h1); line-height: .98; }
.h2 { font-size: var(--t-h2); line-height: 1.02; }
.h3 { font-size: var(--t-h3); line-height: 1.1; }
.display em, .h1 em, .h2 em, .h3 em { font-style: italic; color: var(--red); }
.lede { font-size: clamp(1.05rem, 1.4vw, 1.25rem); line-height: 1.55; color: var(--ink-2); max-width: 40ch; }
.label {
  font: 400 var(--t-label)/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
}
.label--ink { color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: var(--t-small); }
.price { font-family: var(--f-mono); font-size: .95rem; letter-spacing: .02em; }
.price s { color: var(--muted); margin-left: .4em; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: 760px; }
.wrap--mid { max-width: 1040px; }
.section { padding: var(--s-9) 0; }
.section--tight { padding: var(--s-8) 0; }
.section--ink { background: var(--ink); color: var(--bone); }
.section--ink .label, .section--ink .muted { color: rgba(243, 238, 230, .62); }
.section--paper { background: var(--paper); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s-5); margin-bottom: var(--s-7); flex-wrap: wrap; }
.section-head .h2 { margin: var(--s-2) 0 0; max-width: 18ch; }
.grid { display: grid; gap: var(--s-6) var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5) var(--s-3); } .section { padding: var(--s-8) 0; } }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-6) 0; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--ink); --fg: var(--bone); --bd: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 50px; padding: 0 1.6rem; border-radius: var(--r-pill);
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd);
  font: 500 .95rem/1 var(--f-body); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: transform .25s var(--ease), background .2s, color .2s, box-shadow .25s var(--ease);
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-pop); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn--ghost { --bg: transparent; --fg: var(--ink); --bd: var(--line-strong); }
.btn--ghost:hover { --bd: var(--ink); box-shadow: none; }
.btn--light { --bg: var(--bone); --fg: var(--ink); --bd: var(--bone); }
.btn--red { --bg: var(--red); --fg: #fff; --bd: var(--red); }
.btn--block { width: 100%; }
.btn--sm { min-height: 40px; padding: 0 1.1rem; font-size: .875rem; }
.btn--lg { min-height: 58px; padding: 0 2rem; font-size: 1.02rem; }
.btn[disabled], .btn.is-loading { opacity: .5; pointer-events: none; }
.link-arrow { font-weight: 500; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.link-arrow::after { content: " →"; }

/* ---------- forms ---------- */
.field { display: grid; gap: .4rem; margin-bottom: var(--s-4); }
.field > label, .field .field-label { font-size: .85rem; font-weight: 500; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: .8rem 1rem; background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: var(--r-md); outline: none;
  transition: border-color .2s, box-shadow .2s; font-size: 1rem; /* 16px: no iOS zoom */
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 2.6rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23151311' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21, 19, 17, .08); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.help { font-size: .8rem; color: var(--muted); }
.error-text { font-size: .82rem; color: var(--danger); }
.check { display: flex; gap: .65rem; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--ink); flex: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s-4); }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* option pills (size / pack / finish pickers) */
.opts { display: flex; flex-wrap: wrap; gap: .5rem; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opt span {
  display: inline-flex; flex-direction: column; justify-content: center; min-height: 46px; padding: .55rem 1rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--paper);
  font-size: .9rem; line-height: 1.2; transition: border-color .2s, background .2s, color .2s;
}
.opt span small { font-family: var(--f-mono); font-size: .68rem; color: var(--muted); letter-spacing: .04em; margin-top: 2px; }
.opt input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--bone); }
.opt input:checked + span small { color: rgba(243, 238, 230, .7); }
.opt input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }

/* ---------- small components ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .35em; padding: .3rem .65rem; border-radius: var(--r-pill);
  font: 400 .68rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .1em;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink);
}
.badge--red { background: var(--red); border-color: var(--red); color: #fff; }
.badge--ink { background: var(--ink); border-color: var(--ink); color: var(--bone); }
.badge--olive { background: var(--olive-soft); border-color: transparent; color: var(--olive); }
.stamp { /* circular rubber-stamp badge */
  display: grid; place-items: center; width: 108px; height: 108px; border-radius: 50%;
  border: 1.5px solid currentColor; text-align: center; font: 400 .66rem/1.35 var(--f-mono);
  text-transform: uppercase; letter-spacing: .12em; transform: rotate(-12deg); padding: .8rem;
}
.alert { padding: .9rem 1.1rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--paper); font-size: .92rem; margin-bottom: var(--s-4); }
.alert--error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.alert--ok { background: var(--olive-soft); border-color: transparent; color: var(--olive); }
.alert--test { background: #fff6dc; border: 1px dashed var(--mustard); color: #6b4f0a; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6); }
.media { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--sand); }
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.ratio-1 { aspect-ratio: 1 / 1; } .ratio-45 { aspect-ratio: 4 / 5; } .ratio-34 { aspect-ratio: 3 / 4; } .ratio-169 { aspect-ratio: 16 / 9; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .4rem; font: 400 .72rem/1.4 var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: var(--s-5) 0; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs span[aria-hidden] { opacity: .5; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font: 400 .7rem/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: .7rem .6rem; border-bottom: 1px solid var(--line-strong); }
.table td { padding: .9rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-pill); height: 40px; }
.qty button { width: 38px; height: 38px; border: 0; background: none; cursor: pointer; font-size: 1.1rem; }
.qty input { width: 34px; text-align: center; border: 0; background: none; font-family: var(--f-mono); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* product card (shared by home, shop, related) */
.pcard { display: block; text-decoration: none; color: inherit; }
.pcard .media { aspect-ratio: 4 / 5; }
.pcard .media .img-2 { position: absolute; inset: 0; opacity: 0; transition: opacity .5s var(--ease); }
.pcard:hover .media img { transform: scale(1.035); }
.pcard:hover .media .img-2 { opacity: 1; }
.pcard .badge { position: absolute; top: .8rem; left: .8rem; z-index: 2; }
.pcard__body { display: flex; justify-content: space-between; gap: .8rem; padding-top: .9rem; }
.pcard__name { font-family: var(--f-display); font-size: 1.35rem; line-height: 1.1; }
.pcard__sub { font-size: .85rem; color: var(--muted); margin-top: .2rem; }
.pcard .price { white-space: nowrap; padding-top: .2rem; }

/* marquee band */
.marquee { overflow: hidden; border-block: 1px solid var(--line); background: var(--bone); }
.marquee__track { display: flex; gap: 3rem; width: max-content; padding: .95rem 0; animation: marquee 38s linear infinite; }
.marquee__track > * { font: 400 .78rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .14em; white-space: nowrap; display: inline-flex; gap: 3rem; align-items: center; }
.marquee__track > *::after { content: "✦"; color: var(--red); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; } * { scroll-behavior: auto !important; } }

/* prose (policies, guides, product descriptions) */
.prose { max-width: 68ch; font-size: 1.02rem; line-height: 1.72; }
.prose h2 { font-family: var(--f-display); font-size: 2rem; line-height: 1.1; margin: 2.4rem 0 .8rem; }
.prose h3 { font-weight: 600; font-size: 1.05rem; margin: 1.8rem 0 .5rem; }
.prose ul, .prose ol { padding-left: 1.2rem; margin: 0 0 1rem; }
.prose li { margin: .3rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.6rem; font-size: .92rem; }
.prose th, .prose td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); }
.prose th { font: 400 .7rem/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.prose a { color: var(--ink); }
.prose strong { font-weight: 600; }

/* accordion (FAQ, product details) */
.acc { border-top: 1px solid var(--line); }
.acc details { border-bottom: 1px solid var(--line); }
.acc summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.15rem 0; font-weight: 500; font-size: 1.02rem; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font: 300 1.5rem/1 var(--f-body); transition: transform .3s var(--ease); }
.acc details[open] summary::after { transform: rotate(45deg); }
.acc .acc__body { padding: 0 0 1.3rem; color: var(--ink-2); max-width: 70ch; }

/* ---------- header ---------- */
.announce { background: var(--ink); color: var(--bone); text-align: center; font: 400 .7rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .14em; padding: .7rem var(--gutter); }
.announce a { color: inherit; }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(243, 238, 230, .9); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 72px; }
.logo { font: italic 400 2rem/1 var(--f-display); letter-spacing: -.02em; text-transform: lowercase; text-decoration: none; display: inline-flex; align-items: baseline; gap: .1em; }
.logo i { font-style: normal; color: var(--red); font-size: .7em; }
.nav { display: flex; gap: 1.6rem; }
.nav a { text-decoration: none; font-size: .9rem; position: relative; padding: .4rem 0; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: .4rem; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 0; background: none; cursor: pointer; text-decoration: none; transition: background .2s; }
.icon-btn:hover { background: rgba(21, 19, 17, .06); }
.icon-btn svg { width: 21px; height: 21px; }
.cart-count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font: 700 .62rem/18px var(--f-mono); text-align: center; }
.menu-toggle { display: none; }
@media (max-width: 960px) {
  .site-header__inner { grid-template-columns: auto 1fr auto; height: 62px; }
  .site-header .nav { display: none; }
  .menu-toggle { display: inline-grid; }
  .logo { font-size: 1.75rem; justify-self: center; }
}
@media (min-width: 961px) { .site-header__inner > .logo { justify-self: center; } }

/* mobile drawer */
.drawer { position: fixed; inset: 0; z-index: 200; visibility: hidden; }
.drawer.is-open { visibility: visible; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(21, 19, 17, .4); opacity: 0; transition: opacity .3s; }
.drawer.is-open .drawer__scrim { opacity: 1; }
.drawer__panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(88vw, 380px); background: var(--bone); padding: 1.2rem var(--gutter) 2rem; transform: translateX(-100%); transition: transform .4s var(--ease); display: flex; flex-direction: column; overflow-y: auto; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__nav { display: grid; margin-top: 1.5rem; }
.drawer__nav a { font: 400 2.1rem/1.25 var(--f-display); text-decoration: none; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.drawer__foot { margin-top: auto; padding-top: 2rem; display: grid; gap: .6rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--bone); padding: var(--s-8) 0 var(--s-5); margin-top: auto; }
.site-footer a { text-decoration: none; color: rgba(243, 238, 230, .78); }
.site-footer a:hover { color: var(--bone); }
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--s-6); }
.footer-top h3 { font: 400 .7rem/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .14em; color: rgba(243, 238, 230, .55); margin-bottom: 1rem; }
.footer-top ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; font-size: .92rem; }
.footer-news p { color: rgba(243, 238, 230, .7); max-width: 34ch; }
.footer-news form { display: flex; gap: .5rem; margin-top: 1rem; max-width: 420px; }
.footer-news .input { background: transparent; border-color: rgba(243, 238, 230, .3); color: var(--bone); border-radius: var(--r-pill); }
.footer-news .input::placeholder { color: rgba(243, 238, 230, .5); }
.footer-wordmark { font: italic 400 clamp(5rem, 19vw, 17rem)/.8 var(--f-display); letter-spacing: -.04em; text-transform: lowercase; margin: var(--s-8) 0 var(--s-5); color: var(--bone); opacity: .95; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-top: var(--s-5); border-top: 1px solid rgba(243, 238, 230, .15); font: 400 .7rem/1.4 var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: rgba(243, 238, 230, .55); }
.footer-bottom nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr 1fr; } .footer-news { grid-column: 1 / -1; } }

/* ---------- toast ---------- */
.toast-host { position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); z-index: 3000; display: grid; gap: .5rem; pointer-events: none; }
.toast { background: var(--ink); color: var(--bone); padding: .85rem 1.2rem; border-radius: var(--r-pill); font-size: .9rem; box-shadow: var(--shadow-pop); animation: toast-in .35s var(--ease); pointer-events: auto; }
.toast--error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* reveal on scroll (site.js adds .is-in) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
