/* Hacking Home — site styles. Colours come from the logo: terracotta wrench, olive house, blush leaves, warm cream. */
:root {
  --cream: #f7f2ec;
  --cream-2: #efe7dd;
  --paper: #fffdfa;
  --ink: #26241f;
  --ink-2: #5a564d;
  --ink-3: #6e695d;
  --line: #e3dbcf;
  --terracotta: #b25a2a;
  --terracotta-2: #944a21;
  --olive: #2f5a3c;
  --olive-2: #24472f;
  --blush: #e9c7bf;
  --sage: #cfd6c7;
  --gold: #c99a4b;
  --ok: #2f7a4e;
  --warn: #b0611f;
  --radius: 14px;
  --radius-s: 8px;
  --shadow: 0 10px 30px rgba(38, 36, 31, .08);
  --font-head: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1180px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.tiny { font-size: .8rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.section { padding: 48px 0; }
.section-tight { padding: 28px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 13px 22px; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 .95rem var(--font-body); cursor: pointer; text-decoration: none; transition: .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--terracotta); color: #fff; }
.btn-primary:hover { background: var(--terracotta-2); }
.btn-dark { background: var(--olive); color: #fff; }
.btn-dark:hover { background: var(--olive-2); }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-2); padding-left: 8px; padding-right: 8px; }
.btn-ghost:hover { color: var(--ink); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }

/* Header */
.topbar { background: var(--olive); color: #fff; font-size: .82rem; text-align: center; padding: 7px 12px; letter-spacing: .01em; }
.topbar b { color: var(--blush); }
.header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header .wrap { display: flex; align-items: center; gap: 18px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo img { height: 40px; width: auto; }
.logo span { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; white-space: nowrap; }
@media (max-width: 420px) { .logo { gap: 6px; } .logo img { height: 32px; } .logo span { font-size: .95rem; letter-spacing: 0; } }
@media (max-width: 340px) { .logo span { display: none; } }
.nav { display: none; gap: 18px; margin-left: 8px; }
.nav a { text-decoration: none; font-weight: 600; font-size: .86rem; color: var(--ink-2); white-space: nowrap; }
.nav a:hover, .nav a[aria-current] { color: var(--terracotta); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; color: var(--ink); text-decoration: none; }
.icon-btn:hover { background: var(--cream-2); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.signed::after { content: ""; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); border: 2px solid var(--paper); }
.cart-count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--terracotta); color: #fff; font-size: .7rem; font-weight: 700; display: none; align-items: center; justify-content: center; }
.cart-count.on { display: inline-flex; }
.menu-btn { display: inline-flex; }
.mobile-nav { display: none; background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px 16px 16px; }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 10px 0; text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); }
@media (min-width: 1100px) { .nav { display: flex; } .menu-btn { display: none; } .mobile-nav { display: none !important; } }

/* Hero */
.hero { background: var(--paper); border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; gap: 28px; padding-top: 40px; padding-bottom: 40px; align-items: center; }
.hero-kicker { color: var(--terracotta-2); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; margin-bottom: 12px; }
.hero p.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 46ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero-media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 1; background: var(--cream-2); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 820px) { .hero .wrap { grid-template-columns: 1.1fr 1fr; padding-top: 64px; padding-bottom: 64px; } }

/* Perks strip */
.perks { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin: 0; padding: 0; list-style: none; }
.perks li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px; font-size: .9rem; display: flex; gap: 10px; align-items: flex-start; }
.perks svg { width: 20px; height: 20px; flex: none; color: var(--terracotta); margin-top: 2px; }
.perks b { display: block; }
@media (min-width: 820px) { .perks { grid-template-columns: repeat(4, 1fr); } }

/* Category tiles */
.cat-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
.cat-tile { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; background: var(--cream-2); text-decoration: none; display: block; }
.cat-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.cat-tile:hover img { transform: scale(1.04); }
.cat-tile span { position: absolute; left: 12px; bottom: 12px; background: rgba(255,253,250,.92); padding: 7px 12px; border-radius: 999px; font-weight: 700; font-size: .9rem; }
@media (min-width: 720px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }

/* Product grid */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head a { font-weight: 600; font-size: .92rem; }
.grid { display: grid; gap: 18px 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 26px 20px; } }
.card { text-decoration: none; display: block; }
.card-media { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; background: var(--cream-2); margin-bottom: 10px; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-media img { transform: scale(1.03); }
.badge { position: absolute; top: 10px; left: 10px; background: var(--paper); border-radius: 999px; padding: 4px 10px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--terracotta-2); }
.badge-dark { background: var(--olive); color: #fff; }
.card h3 { font-family: var(--font-body); font-size: .98rem; font-weight: 600; margin: 0 0 3px; }
.card .price { font-weight: 700; }
.card .price s { color: var(--ink-3); font-weight: 500; margin-left: 6px; font-size: .9em; }
.card .swatches { display: flex; gap: 4px; margin-top: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }

/* Filters */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); text-decoration: none; font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.chip[aria-current], .chip:hover { background: var(--olive); color: #fff; border-color: var(--olive); }

/* Product page */
.product { display: grid; gap: 28px; }
@media (min-width: 900px) { .product { grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: start; } }
.gallery-main { border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; background: var(--cream-2); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 10px; }
.gallery-thumbs button { padding: 0; border: 2px solid transparent; border-radius: var(--radius-s); overflow: hidden; background: var(--cream-2); aspect-ratio: 1; cursor: pointer; }
.gallery-thumbs button[aria-current] { border-color: var(--terracotta); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.crumbs { font-size: .85rem; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { text-decoration: none; }
.price-row { display: flex; align-items: baseline; gap: 12px; margin: 10px 0 4px; }
.price-row .now { font-size: 1.7rem; font-weight: 700; }
.price-row .was { color: var(--ink-3); text-decoration: line-through; }
.price-row .save { color: var(--ok); font-weight: 700; font-size: .9rem; }
.compare-note { font-size: .85rem; color: var(--ink-2); margin-bottom: 14px; }
.offers { display: grid; gap: 8px; margin: 16px 0; }
.offer { display: flex; gap: 10px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; font-size: .9rem; }
.offer svg { width: 18px; height: 18px; color: var(--terracotta); flex: none; margin-top: 2px; }
.field { margin: 14px 0; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.colour-options { display: flex; flex-wrap: wrap; gap: 8px; }
.colour-options input { position: absolute; opacity: 0; }
.colour-options label { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 7px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); cursor: pointer; font-size: .88rem; font-weight: 600; }
.colour-options input:checked + label { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.colour-options input:focus-visible + label { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.colour-options .swatch { width: 20px; height: 20px; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); }
.qty button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; }
.qty input { width: 44px; text-align: center; border: 0; background: transparent; font: inherit; font-weight: 700; }
.buy-row { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.buy-row .btn-primary { flex: 1; min-width: 200px; }
.stock-note { font-size: .85rem; color: var(--ink-2); margin-top: 10px; }
details.acc { border-top: 1px solid var(--line); }
details.acc:last-child { border-bottom: 1px solid var(--line); }
details.acc summary { padding: 14px 0; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
details.acc summary::after { content: "+"; color: var(--ink-3); }
details.acc[open] summary::after { content: "–"; }
details.acc .acc-body { padding: 0 0 16px; font-size: .95rem; white-space: pre-line; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--olive); background: var(--sage); padding: 3px 9px; border-radius: 999px; }

/* Cart */
.cart-layout { display: grid; gap: 28px; }
@media (min-width: 900px) { .cart-layout { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.line { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: center; }
.line img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-s); background: var(--cream-2); }
.line .title { font-weight: 700; }
.line .meta { font-size: .85rem; color: var(--ink-2); }
.line .remove { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: .82rem; padding: 0; text-decoration: underline; }
.line .amount { font-weight: 700; text-align: right; }
.line .amount .free { color: var(--ok); font-size: .8rem; display: block; width: max-content; max-width: 9.5rem; margin-left: auto; font-weight: 600; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h3 { margin-bottom: 12px; }
.totals { display: grid; gap: 8px; font-size: .95rem; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.totals .disc { color: var(--ok); }
.progress { height: 8px; background: var(--cream-2); border-radius: 4px; overflow: hidden; margin: 8px 0 6px; }
.progress i { display: block; height: 100%; background: var(--olive); }
.input, select.input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-s); background: #fff; font: inherit; }
.input:focus { outline: 2px solid var(--terracotta); outline-offset: 1px; border-color: transparent; }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; }
.rates { display: grid; gap: 8px; margin-top: 12px; }
.rate { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-s); cursor: pointer; background: #fff; }
.rate input { margin: 0; }
.rate.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.rate .r-name { font-weight: 700; font-size: .92rem; }
.rate .r-eta { font-size: .82rem; color: var(--ink-2); }
.rate .r-price { margin-left: auto; font-weight: 700; }
.rate .r-price.free { color: var(--ok); }
.carrier-logo { font-size: .7rem; font-weight: 800; letter-spacing: .05em; padding: 3px 6px; border-radius: 4px; background: var(--cream-2); color: var(--ink-2); }
.note { font-size: .85rem; color: var(--ink-2); }
.alert { padding: 12px 14px; border-radius: var(--radius-s); font-size: .9rem; margin: 10px 0; }
.alert-ok { background: #e6f2ea; color: #1d5a37; }
.alert-warn { background: #fbeedd; color: #7a4512; }
.alert-err { background: #f9e3df; color: #8a2b1d; }
.empty { text-align: center; padding: 48px 0; }

/* Account */
.account-grid { display: grid; gap: 20px; }
@media (min-width: 820px) { .account-grid { grid-template-columns: 1fr 1fr; } }
.code-box { font-family: var(--font-head); font-size: 1.6rem; letter-spacing: .08em; background: var(--cream-2); padding: 12px 16px; border-radius: var(--radius-s); text-align: center; }
.orders li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }

/* Reviews / trust */
.reviews { display: grid; gap: 14px; }
@media (min-width: 720px) { .reviews { grid-template-columns: repeat(3, 1fr); } }
.review { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; font-size: .95rem; }
.stars { color: var(--gold); letter-spacing: .1em; margin-bottom: 6px; }
.review cite { display: block; font-style: normal; color: var(--ink-3); font-size: .82rem; margin-top: 8px; }
.review p { margin: 6px 0 0; }
.review cite a { color: inherit; }
.review-reply { margin-top: 10px; padding: 10px 12px; background: var(--cream-2); border-radius: var(--radius-s); font-size: .88rem; }
.stars-off { color: var(--line); }
.verified { color: var(--ok); font-weight: 700; }
.card-rating { font-size: .8rem; margin-top: 2px; }
.card-rating .stars { margin: 0; }
.card-rating span { color: var(--ink-3); }
.rating-line { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; font-size: .9rem; color: var(--ink-2); margin-bottom: 4px; }
.rating-line .stars { margin: 0; }
.shop-stats { margin: -6px 0 16px; color: var(--ink-2); }
.shop-stats .stars { margin: 0 4px 0 0; }
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { font-size: 2rem; color: var(--line); cursor: pointer; line-height: 1; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--gold); }
.star-input input:focus-visible + label { outline: 2px solid var(--terracotta); outline-offset: 2px; }
textarea.input { min-height: 130px; resize: vertical; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table .inline-form { flex-wrap: wrap; }
.admin-table select.input, .admin-table .input { padding: 7px 9px; width: auto; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--cream-2); }
.pill.shipped { background: #e3ecf7; color: #234b7a; } .pill.delivered { background: #e6f2ea; color: #1d5a37; }

/* Banner CTA */
.cta { background: var(--olive); color: #fff; border-radius: var(--radius); padding: 36px 24px; display: grid; gap: 16px; text-align: center; }
.cta h2 { color: #fff; }
.cta p { color: #dfe3d8; max-width: 52ch; margin: 0 auto; }
.cta .inline-form { max-width: 460px; margin: 0 auto; width: 100%; }

/* Text pages */
.prose { font-size: 1rem; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--cream-2); }

/* Footer */
.footer { background: var(--paper); border-top: 1px solid var(--line); margin-top: 48px; padding: 40px 0 24px; font-size: .9rem; }
.footer .cols { display: grid; gap: 24px; }
@media (min-width: 720px) { .footer .cols { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer h4 { font-family: var(--font-body); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin: 6px 0; }
.footer a { text-decoration: none; color: var(--ink-2); }
.footer a:hover { color: var(--terracotta); }
.footer .fine { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .8rem; display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: .9rem; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; white-space: nowrap; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast a { color: var(--blush); font-weight: 700; margin-left: 8px; }

/* Modal (register gate) */
.modal-bg { position: fixed; inset: 0; background: rgba(38,36,31,.55); display: none; align-items: center; justify-content: center; z-index: 90; padding: 16px; }
.modal-bg.on { display: flex; }
.modal { background: var(--paper); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.modal h3 { margin-bottom: 4px; }
.modal .x { float: right; border: 0; background: none; font-size: 1.3rem; cursor: pointer; color: var(--ink-3); }

[hidden] { display: none !important; }
