/* ==========================================================================
   SMALL HOURS — children's clothing, made slowly
   The premium formula, interpreted for kids: one enormous photograph, warm
   gallery-white space, tiny quiet type, and a range small enough to know by
   name. Young Serif carries the warmth; Figtree stays out of the way.
   ========================================================================== */

:root {
  --cream: #FAF7F1;
  --cream-deep: #F1EBDF;
  --ink: #26221C;
  --ink-soft: #7A7264;
  --clay: #A96A47;
  --line: #E5DECF;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Figtree', 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Young Serif', serif; font-weight: 400; line-height: 1.15; }

img { display: block; max-width: 100%; height: auto; }
a { color: var(--ink); }
button { font: inherit; cursor: pointer; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--cream); padding: 10px 18px; z-index: 99; }
.skip:focus { left: 12px; top: 12px; }

.quiet-link {
  color: var(--clay); text-decoration: none; font-weight: 600; font-size: .92rem;
  border-bottom: 1px solid currentColor; padding-bottom: 1px;
}
.quiet-link:hover { color: var(--ink); }
.as-btn { background: none; border-top: none; border-left: none; border-right: none; }

/* ---------- Header ---------- */

.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 28px;
  padding: 16px clamp(18px, 4vw, 48px);
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.mark {
  font-family: 'Young Serif', serif; font-size: 1.1rem; letter-spacing: .22em;
  text-decoration: none; color: var(--ink); white-space: nowrap;
}

.top-nav { display: flex; gap: 22px; margin-left: auto; }
.top-nav a { text-decoration: none; color: var(--ink-soft); font-weight: 500; font-size: .9rem; }
.top-nav a:hover { color: var(--ink); }

.bag-btn {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: none; border: none; color: var(--ink);
  font-weight: 600; font-size: .9rem; padding: 4px 2px;
  border-bottom: 1px solid var(--ink);
}
.bag-btn span { font-variant-numeric: tabular-nums; }
.bag-btn.bump { animation: bump .25s ease; }
@keyframes bump { 50% { transform: scale(1.1); } }

/* ---------- Hero ---------- */

.hero { position: relative; }
.hero-photo { width: 100%; height: min(88vh, 900px); object-fit: cover; }

.hero-foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 26px clamp(18px, 4vw, 48px) 8px;
}
.hero-kicker { font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--clay); font-weight: 600; margin-bottom: 10px; }
.hero-foot h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
.hero-link {
  color: var(--ink); text-decoration: none; font-weight: 600;
  border-bottom: 1.5px solid var(--clay); padding-bottom: 2px; white-space: nowrap;
}
.hero-link:hover { color: var(--clay); }

/* ---------- Blocks ---------- */

.block { max-width: 1280px; margin: 0 auto; padding: clamp(48px, 7vw, 90px) clamp(18px, 4vw, 48px) 0; }

.block-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin-bottom: 26px;
}
.block-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }

/* ---------- Product cards ---------- */

.product-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 26px); }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 26px) clamp(14px, 2vw, 26px); }

.card {
  text-decoration: none; color: var(--ink); display: grid; gap: 8px; align-content: start;
  position: relative;
}
.card-photo { overflow: hidden; border-radius: 4px; background: var(--cream-deep); position: relative; }
.card-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform .7s cubic-bezier(.2, .6, .2, 1); }
.card:hover .card-photo img { transform: scale(1.035); }

.card-new {
  position: absolute; top: 10px; left: 10px;
  background: var(--cream); color: var(--clay);
  font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 2px;
}

.card-name { font-weight: 600; font-size: .95rem; }
.card-meta { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; color: var(--ink-soft); }
.card-meta .price { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.card.is-hidden { display: none; }

/* ---------- Collections ---------- */

.collection-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 26px); }

.coll {
  position: relative; display: grid; text-decoration: none; color: var(--ink);
  border-radius: 4px; overflow: hidden;
}
.coll img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform .7s cubic-bezier(.2, .6, .2, 1); }
.coll:hover img { transform: scale(1.035); }
.coll-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 16px;
  background: linear-gradient(transparent, rgba(38, 34, 28, .45));
  color: var(--cream);
}
.coll-bar h3 { font-size: 1.15rem; margin-bottom: 2px; }
.coll-bar p { font-size: .82rem; opacity: .9; }

/* ---------- Filters ---------- */

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter {
  border: 1px solid var(--line); background: var(--cream); color: var(--ink-soft);
  border-radius: 999px; padding: 6px 15px; font-weight: 500; font-size: .85rem;
  transition: border-color .15s ease, color .15s ease;
}
.filter:hover { border-color: var(--clay); color: var(--ink); }
.filter.is-on { border-color: var(--ink); color: var(--ink); background: var(--cream-deep); }

/* ---------- Campaign ---------- */

.campaign {
  max-width: 1280px; margin: 0 auto;
  padding: clamp(48px, 7vw, 90px) clamp(18px, 4vw, 48px) 0;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 56px); align-items: center;
}
.campaign img { border-radius: 4px; width: 100%; }
.campaign-copy h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-bottom: 14px; }
.campaign-copy p:not(.hero-kicker) { color: var(--ink-soft); max-width: 46ch; margin-bottom: 18px; }

/* ---------- Notes ---------- */

.notes {
  max-width: 1280px; margin: 0 auto;
  padding: clamp(48px, 7vw, 90px) clamp(18px, 4vw, 48px) 0;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(24px, 4vw, 56px); align-items: center;
}
.notes img { border-radius: 4px; width: 100%; }
.notes-list { list-style: none; display: grid; gap: 22px; }
.notes-list h3 { font-size: 1.2rem; margin-bottom: 4px; }
.notes-list p { color: var(--ink-soft); max-width: 46ch; }

/* ---------- Product page ---------- */

.piece-page { max-width: 1160px; margin: 0 auto; padding: 18px clamp(18px, 4vw, 48px) 0; }
.crumb { padding: 6px 0 18px; }

.piece { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(26px, 5vw, 64px); align-items: start; }

.piece-photo { border-radius: 4px; overflow: hidden; background: var(--cream-deep); }
.piece-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

.piece-body { display: grid; gap: 14px; padding-top: 10px; }
.piece-kicker { font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--clay); font-weight: 600; }
.piece-body h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.piece-colour { color: var(--ink-soft); }
.piece-price { font-family: 'Young Serif', serif; font-size: 1.5rem; }
.piece-desc { color: var(--ink-soft); max-width: 50ch; }
.piece-fabric { font-size: .92rem; }
.piece-fabric strong { font-weight: 600; }

.size-label { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; margin-top: 6px; }
.size-row { display: flex; flex-wrap: wrap; gap: 8px; }
.size-btn {
  border: 1px solid var(--line); background: var(--cream); color: var(--ink);
  min-width: 52px; padding: 9px 12px; border-radius: 3px; font-weight: 500;
  transition: border-color .15s ease, background .15s ease;
}
.size-btn:hover { border-color: var(--ink); }
.size-btn.is-on { border: 1.5px solid var(--ink); background: var(--cream-deep); font-weight: 600; }

.add-btn {
  margin-top: 8px;
  background: var(--ink); color: var(--cream); border: none; border-radius: 3px;
  padding: 15px 26px; font-weight: 600; font-size: 1rem;
  transition: background .15s ease;
}
.add-btn:hover { background: #3A342B; }
.add-btn.added { background: #4C6B45; }

.piece-care { font-size: .88rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 14px; }

.not-found { text-align: center; padding: 70px 0; display: grid; gap: 12px; justify-items: center; }

.also { padding-top: clamp(48px, 7vw, 80px); }
.also h2 { font-size: 1.5rem; margin-bottom: 22px; }

/* ---------- Bag drawer ---------- */

.veil { position: fixed; inset: 0; z-index: 60; background: rgba(38, 34, 28, .35); }
.veil[hidden], .bag[hidden] { display: none; }

.bag {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(420px, 94vw);
  background: var(--cream); border-left: 1px solid var(--line);
  box-shadow: -16px 0 40px rgba(38, 34, 28, .18);
  display: flex; flex-direction: column; overflow-y: auto;
}

.bag-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 20px 22px 14px; border-bottom: 1px solid var(--line);
}
.bag-head h2 { font-size: 1.3rem; }
.bag-close { border: none; background: none; color: var(--clay); font-weight: 600; font-size: .9rem; }

.bag-lines { list-style: none; padding: 4px 22px; }
.bag-line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 4px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.bag-line img { width: 64px; height: 80px; object-fit: cover; border-radius: 3px; grid-row: 1 / 3; }
.bl-name { font-weight: 600; font-size: .95rem; }
.bl-detail { grid-column: 2; color: var(--ink-soft); font-size: .85rem; }
.bl-price { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.bl-ctl { grid-column: 2 / 4; display: flex; gap: 14px; }
.bl-btn { border: none; background: none; color: var(--clay); font-size: .82rem; font-weight: 600; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

.bag-empty { padding: 22px; color: var(--ink-soft); }

.bag-tail { padding: 12px 22px 28px; display: grid; gap: 14px; }
.bag-ship { font-size: .85rem; color: var(--clay); font-weight: 600; }
.bag-total { display: flex; justify-content: space-between; font-family: 'Young Serif', serif; font-size: 1.2rem; border-top: 1px solid var(--ink); padding-top: 12px; }

#payForm { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; }
.field label { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.field input {
  border: 1px solid var(--line); border-radius: 3px; background: #FFFEFB;
  padding: 11px 13px; font: inherit; color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--ink); }
.field input.bad { border-color: #A03325; }
.err { color: #A03325; font-size: .85rem; }

.pay-btn {
  background: var(--ink); color: var(--cream); border: none; border-radius: 3px;
  padding: 14px; font-weight: 600; font-size: .98rem;
}
.pay-btn:hover { background: #3A342B; }
.bag-fine { font-size: .82rem; color: var(--ink-soft); }

.bag-done { display: grid; gap: 10px; padding-top: 8px; justify-items: start; }
.bag-done h3 { font-size: 1.3rem; }
.bag-done p { color: var(--ink-soft); }

/* ---------- Footer ---------- */

.foot {
  margin-top: clamp(56px, 8vw, 100px);
  border-top: 1px solid var(--line);
  padding: 44px clamp(18px, 4vw, 48px) 52px;
  text-align: center; display: grid; gap: 8px;
}
.foot-mark { font-family: 'Young Serif', serif; letter-spacing: .22em; font-size: 1rem; }
.foot-line { color: var(--ink-soft); font-size: .9rem; }
.foot-fine { font-size: .82rem; color: var(--ink-soft); max-width: 74ch; margin: 8px auto 0; }
.foot-fine a { color: var(--clay); }

/* ---------- Reveals ---------- */

.reveal { opacity: 0; translate: 0 14px; }
.reveal.is-in { opacity: 1; translate: 0 0; transition: opacity .55s ease, translate .55s ease; }

/* ---------- Responsive ---------- */

@media (max-width: 1020px) {
  .product-strip, .product-grid, .collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .product-strip, .product-grid, .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .campaign, .notes { grid-template-columns: minmax(0, 1fr); }
  .piece { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .top { gap: 14px; }
  .top-nav { display: none; }
  .bag-btn { margin-left: auto; }
  .hero-photo { height: 62vh; }
  .hero-foot { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.is-in { opacity: 1; translate: none; transition: none; }
  .card-photo img, .coll img { transition: none; }
  .bag-btn.bump { animation: none; }
}
