/* Leamy Looms — site styles. Dark, earthy brown palette with moss and wheat accents; no build step. */
:root {
  --bg: #1b1613;        /* espresso */
  --bg-2: #221b17;
  --surface: #2a221d;
  --line: #3b3029;
  --text: #ece3d4;      /* oat */
  --muted: #b6a997;
  --accent: #93a06a;    /* moss (buttons, links) */
  --accent-hi: #b4c08c;
  --highlight: #d2b06a; /* wheat (italic emphasis) */
  --cedar: #b89b7c;     /* warm tan (small labels) */
  --moss: #6f7a4f;
  --walnut: #7a5a44;
  --plum: #7a5266;
  --indigo: #56627f;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Work Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-hi); text-underline-offset: 3px; }
a:hover { color: var(--highlight); }
:focus-visible { outline: 2px solid var(--highlight); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.04; margin: 0 0 0.45em; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.9rem, 6.6vw, 5.4rem); }
h2 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); }
h3 { font-size: 1.45rem; font-weight: 600; }
h1 em, h2 em { font-style: italic; color: var(--highlight); }
p { margin: 0 0 1em; }
.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.eyebrow {
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--cedar); margin: 0 0 0.9rem; font-weight: 600;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.section__head h2 { margin: 0; }

/* Selvedge: the striped band at the very top, like the edge of a cloth */
.selvedge {
  height: 8px;
  background: repeating-linear-gradient(90deg,
    var(--accent) 0 28px, var(--highlight) 28px 40px, var(--walnut) 40px 76px,
    var(--plum) 76px 92px, var(--indigo) 92px 124px, var(--bg) 124px 130px);
}

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding: 1.1rem 0; }
.wordmark { font-family: var(--serif); font-weight: 600; font-size: 2rem; color: var(--text); text-decoration: none; letter-spacing: 0; line-height: 1; }
.wordmark em { font-style: italic; font-weight: 500; color: var(--highlight); }
.wordmark:hover { color: var(--text); }
.nav { display: flex; align-items: center; gap: 0.4rem 1.6rem; flex-wrap: wrap; }
.nav a { color: var(--text); text-decoration: none; font-size: 1rem; padding: 0.25rem 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--text); }
.nav__cart span { display: inline-block; min-width: 1.5em; padding: 0 0.4em; margin-left: 0.2em; text-align: center; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 0.85rem; }

/* Buttons */
.btn {
  display: inline-block; cursor: pointer; border: 1px solid var(--accent); border-radius: 3px;
  background: var(--accent); color: #1b1613; font: 600 0.98rem/1 var(--sans);
  letter-spacing: 0.03em; padding: 0.95rem 1.5rem; text-decoration: none; transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--accent-hi); border-color: var(--accent-hi); color: #1b1613; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--muted); }
.btn--ghost:hover { background: var(--surface); color: var(--text); border-color: var(--text); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* Hero */
.hero { position: relative; min-height: min(76vh, 700px); display: grid; align-items: end; overflow: hidden; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(27,22,19,0.2) 0%, rgba(27,22,19,0.55) 45%, rgba(27,22,19,0.96) 100%); }
.hero__text { position: relative; z-index: 1; padding: 5rem 0 3.5rem; }
.hero__text .lede { color: var(--text); opacity: 0.9; }
.hero__text .eyebrow { color: var(--highlight); }

/* Tag strip */
.tags { list-style: none; margin: 0; padding: 1.1rem 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 2rem; color: var(--muted); font-size: 0.9rem; letter-spacing: 0.14em; text-transform: uppercase; }
.tags li::before { content: "\25C6"; color: var(--accent); font-size: 0.6em; margin-right: 0.9em; vertical-align: 0.2em; }
.tagbar { border-bottom: 1px solid var(--line); background: var(--bg-2); }

/* Category tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.tile { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 3px; text-decoration: none; background: var(--surface); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(27,22,19,0) 45%, rgba(27,22,19,0.88) 100%); }
.tile span { position: absolute; z-index: 1; left: 1rem; right: 1rem; bottom: 0.9rem; font-family: var(--serif); font-weight: 600; font-size: 1.7rem; color: var(--text); line-height: 1.1; }
.tile:hover img { transform: scale(1.04); }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem 1.5rem; }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.card { display: block; color: var(--text); text-decoration: none; }
.card__img { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--surface); border-radius: 3px; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card__img img { transform: scale(1.04); }
.card:hover { color: var(--text); }
.card__body { padding: 0.85rem 0.1rem 0; }
.card__body h3 { margin: 0 0 0.15rem; font-size: 1.45rem; }
.price { color: var(--muted); margin: 0; }
.badge { position: absolute; top: 0.7rem; left: 0.7rem; background: var(--bg); color: var(--text); border: 1px solid var(--line); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; padding: 0.3rem 0.6rem; border-radius: 2px; }

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 2rem; }
.chip { cursor: pointer; background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 1rem; font: 500 0.95rem var(--sans); }
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Split (image + text) */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4.5rem); align-items: center; }
.split__img { aspect-ratio: 4 / 5; overflow: hidden; border-radius: 3px; background: var(--surface); }
.split__img img { width: 100%; height: 100%; object-fit: cover; }

/* Extra-heavy emphasis (used on "little weight to it.") */
h1 em.heavy, h2 em.heavy { font-weight: 700; }

/* Photo gallery (commission examples) */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin-top: 2.2rem; }
.gallery-grid__item { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 3px; background: var(--surface); }
.gallery-grid__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-grid__item:hover img { transform: scale(1.04); }
.gallery-grid--full { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.gallery-grid--full .gallery-grid__item { aspect-ratio: 4 / 5; }
@media (max-width: 900px) { .gallery-grid, .gallery-grid--full { grid-template-columns: repeat(2, 1fr); } }

/* Page header */
.page-head { padding: clamp(2.2rem, 5vw, 3.8rem) 0 1.4rem; }
.page-head h1 { font-size: clamp(2.7rem, 5.6vw, 4.2rem); margin-bottom: 0.3em; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin: 0 0 1.2rem; }
.crumbs a { color: var(--muted); }

/* Product page */
.product { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: start; padding-bottom: 4rem; }
.gallery__main { aspect-ratio: 4 / 5; overflow: hidden; border-radius: 3px; background: var(--surface); }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: flex; gap: 0.6rem; margin-top: 0.6rem; flex-wrap: wrap; }
.thumb { width: 84px; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--surface); cursor: pointer; opacity: 0.7; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-current="true"], .thumb:hover { opacity: 1; border-color: var(--highlight); }
.product__info h1 { font-size: clamp(2.4rem, 4vw, 3.4rem); }
.product__price { font-size: 1.4rem; color: var(--text); margin: 0 0 1.4rem; }
.details { list-style: none; padding: 1rem 0 0; margin: 1.4rem 0 0; border-top: 1px solid var(--line); color: var(--muted); }
.details li { padding: 0.25rem 0; }
.buy { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; margin-top: 1.6rem; }
select.qty { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 3px; padding: 0.8rem 0.9rem; font: inherit; }
.note { color: var(--muted); font-size: 0.95rem; margin-top: 1rem; }
.msg { margin-top: 1rem; padding: 0.8rem 1rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 3px; }
.msg--warn { border-left-color: var(--cedar); }

/* Cart */
.cart { display: grid; grid-template-columns: 1fr 340px; gap: 2.5rem; align-items: start; padding-bottom: 4rem; }
.cart__row { display: grid; grid-template-columns: 84px 1fr auto; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.cart__row img { width: 84px; height: 84px; object-fit: cover; border-radius: 3px; }
.cart__row h3 { margin: 0 0 0.2rem; }
.cart__row h3 a { color: var(--text); text-decoration: none; }
.cart__controls { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.4rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 0.9rem; text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--text); }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 1.4rem; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1rem; margin: 0 0 1.2rem; }
.summary dd { margin: 0; text-align: right; }
.summary .btn { width: 100%; text-align: center; }
.empty { padding: 2rem 0 5rem; }

/* Prose pages */
.prose { max-width: 62ch; }
.prose h2 { margin-top: 1.6em; font-size: clamp(2rem, 3.4vw, 2.7rem); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font-size: 0.95rem; }
.site-footer__in { display: flex; justify-content: space-between; gap: 1.5rem 3rem; flex-wrap: wrap; padding: 2.4rem 0 1.2rem; }
.site-footer nav { display: flex; gap: 0.4rem 1.4rem; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer small { display: block; padding: 0 0 1.6rem; }

/* Draft ribbon (shown while data/products.json has "draft": true) */
.draft-ribbon { position: fixed; left: 1rem; bottom: 1rem; z-index: 20; background: var(--highlight); color: #1b1613; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; padding: 0.45rem 0.8rem; border-radius: 999px; box-shadow: 0 4px 18px rgba(0,0,0,0.4); }

/* Phones and tablets (iPhone / Android): dark form controls, notch-safe edges, finger-sized targets */
:root { color-scheme: dark; }
body { -webkit-tap-highlight-color: rgba(147, 160, 106, 0.25); overflow-wrap: break-word; }
.wrap { width: min(100% - 2rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px), var(--wrap)); }
.hero { min-height: min(76svh, 700px); }
select.qty { min-height: 48px; font-size: max(1rem, 16px); }
.site-footer small { padding-bottom: calc(1.6rem + env(safe-area-inset-bottom, 0px)); }
.draft-ribbon { left: calc(1rem + env(safe-area-inset-left, 0px)); bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
@media (pointer: coarse) {
  .nav a { padding: 0.65rem 0.15rem; }
  .chip { padding: 0.7rem 1.1rem; }
  .link-btn { padding: 0.65rem 0; }
  .site-footer nav a { display: inline-block; padding: 0.45rem 0; }
  .thumb { width: 72px; }
}

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .grid, .grid--4 { grid-template-columns: repeat(2, 1fr); gap: 1.6rem 1rem; }
  .split, .product, .cart { grid-template-columns: 1fr; }
  .split__img { aspect-ratio: 4 / 3; }
}
@media (max-width: 480px) {
  body { font-size: 1rem; }
  .wordmark { font-size: 1.7rem; }
  .card__body h3 { font-size: 1.25rem; }
  .cart__row { grid-template-columns: 64px 1fr; }
  .cart__row img { width: 64px; height: 64px; }
  .cart__row > .price { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
