/* KEITH storefront — built to Ruby's mockups (design/, AIOS-859). Tokens first; everything else uses them. */
:root {
    --ink: #000000;
    --paper: #ffffff;
    --mist: #f4f5f6;
    --line: #e5e7ea;
    --muted: #6b7075;
    --accent: #00a3e0;
    --accent-ink: #0086b8;
    --danger: #c62828;
    --radius: 12px;
    --wrap: 1240px;
    --head: "Montserrat", system-ui, sans-serif;
    --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.6 var(--body); }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 4.5vw, 48px); font-weight: 800; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }
.muted { color: var(--muted); }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.section { padding: 56px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head a { color: var(--accent-ink); font-weight: 600; font-size: 14px; white-space: nowrap; }
[hidden] { display: none !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px;
       border-radius: 8px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font-weight: 700;
       letter-spacing: .06em; text-transform: uppercase; font-size: 13px; cursor: pointer; transition: opacity .15s; }
.btn:hover { opacity: .88; }
.btn:disabled, .btn[aria-disabled="true"] { background: #c9ccd0; border-color: #c9ccd0; color: #fff; cursor: not-allowed; opacity: 1; }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-block { width: 100%; }
.link { color: var(--accent-ink); font-weight: 600; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 50; background: var(--ink); color: #fff; }
.site-head .wrap { display: flex; align-items: center; height: 64px; gap: 24px; }
.logo img { height: 30px; width: auto; }
.nav { display: none; gap: 28px; margin-left: 12px; }
.nav a { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; opacity: .85; padding: 22px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.on { opacity: 1; border-color: var(--accent); }
.head-tools { 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: 8px; color: #fff; background: none; border: 0; cursor: pointer; }
.icon-btn svg { width: 22px; height: 22px; }
.badge-count { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.menu-btn { margin-left: -8px; }
@media (min-width: 960px) { .nav { display: flex; } .menu-btn { display: none; } }
.drawer { position: fixed; inset: 64px 0 0 0; background: var(--ink); color: #fff; padding: 16px; z-index: 49; }
.drawer a { display: block; padding: 14px 4px; border-bottom: 1px solid #222; font-family: var(--head); font-weight: 700; font-size: 18px; }

/* Messages */
.flash { padding: 12px 16px; border-radius: 8px; margin: 16px 0 0; font-size: 14px; }
.flash.error { background: #fdecea; color: #8a1c1c; }
.flash.success { background: #e7f6ee; color: #1d5e3a; }
.flash.info, .flash.warning { background: #eef7fc; color: #0b4f6c; }

/* Hero */
.hero { background: var(--ink); color: #fff; overflow: hidden; }
.hero .wrap { display: grid; align-items: center; gap: 8px; padding-top: 40px; padding-bottom: 32px; }
.hero h1 { font-size: clamp(40px, 7vw, 76px); line-height: 1; margin-bottom: 20px; }
.hero p { color: #b9bdc2; max-width: 420px; margin: 0 0 28px; }
.hero-art { position: relative; }
.hero-art::before { content: ""; position: absolute; inset: 10% 5%; background: radial-gradient(closest-side, rgba(0,163,224,.35), transparent); }
.hero-art img { position: relative; width: auto; max-width: 100%; max-height: min(52vh, 440px); margin: 0 auto; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1fr 1fr; padding-top: 56px; padding-bottom: 56px; } }

/* Series */
.series-list { display: grid; gap: 12px; }
.series-tile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: #000; }
.series-tile img { width: 100%; height: auto; aspect-ratio: 1600/452; object-fit: cover; transition: transform .4s; }
.series-tile:hover img { transform: scale(1.02); }
@media (min-width: 900px) { .series-list { grid-template-columns: 1fr 1fr; } }
.series-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 18px; font-size: 13px; font-weight: 600; }
.chip:hover { border-color: var(--ink); }

/* Trust strip (SIRIM: 48px desktop, 40px mobile, one line — Master 2026-10-22) */
.trust { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--mist); }
.trust .wrap { display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 16px; padding-bottom: 16px; }
.trust img { width: 40px; height: auto; }
.trust span { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
@media (min-width: 768px) { .trust img { width: 48px; } }

/* Product grid and cards */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 768px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.card-img { display: block; aspect-ratio: 1; background: #fff; }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-body .eyebrow { font-size: 11px; }
.card-title { font-family: var(--head); font-weight: 700; font-size: 15px; line-height: 1.3; }
.price { font-weight: 700; }
.price small { font-weight: 400; color: var(--muted); }
.sold { color: var(--danger); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.more { font-size: 12px; color: var(--muted); align-self: center; }
.card-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.tag { position: absolute; top: 10px; left: 10px; z-index: 2; padding: 3px 10px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.tag.sold-tag { background: var(--ink); left: auto; right: 10px; }
.compare-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; background: none; border: 0; padding: 0; color: var(--muted); }
.compare-toggle .box { width: 16px; height: 16px; border: 1.5px solid #9aa0a6; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; }
.compare-toggle.on { color: var(--ink); }
.compare-toggle.on .box { background: var(--ink); border-color: var(--ink); }
.compare-toggle.on .box::after { content: ""; width: 8px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

/* Listing filters */
.page-head { padding: 32px 0 8px; }
.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 24px; }
@media (min-width: 900px) { .filters { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.filters label { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.select, .input, textarea.input { width: 100%; min-height: 46px; border: 1px solid #c9cdd2; border-radius: 8px; padding: 10px 12px; background: #fff; }
.select:focus, .input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Product detail */
.crumbs { font-size: 13px; color: var(--muted); padding: 18px 0; }
.crumbs a:hover { color: var(--ink); }
.pdp { display: grid; gap: 24px; padding-bottom: 48px; }
@media (min-width: 960px) { .pdp { grid-template-columns: 1.1fr 1fr; gap: 48px; } }
.gallery-main { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; scrollbar-width: thin; }
.thumbs button { flex: 0 0 72px; height: 72px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 2px; cursor: pointer; }
.thumbs button.on { border: 2px solid var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: contain; }
.pdp h1 { font-size: clamp(26px, 3.4vw, 38px); margin: 6px 0 8px; }
.pdp-price { font-family: var(--head); font-size: 28px; font-weight: 800; }
.sirim-inline { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.sirim-inline img { width: 24px; height: auto; }
.opt { padding: 18px 0; border-top: 1px solid var(--line); }
.opt-label { font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.opt-label span { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); margin-left: 8px; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); cursor: pointer; padding: 0; outline-offset: 3px; }
.swatch.on { outline: 2px solid var(--accent); }
.swatch .ltd { position: absolute; top: -6px; right: -8px; background: var(--danger); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 6px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 44px; padding: 0 18px; border: 1px solid #c9cdd2; border-radius: 8px; background: #fff; cursor: pointer; font-weight: 600; }
.pill.on { border: 2px solid var(--accent); background: #eef9fd; }
.pill:disabled { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.buy { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.qty { display: inline-flex; border: 1px solid #c9cdd2; border-radius: 8px; height: 48px; }
.qty button { width: 44px; border: 0; background: none; font-size: 18px; cursor: pointer; }
.qty input { width: 44px; border: 0; text-align: center; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.buy .btn-ghost { grid-column: 1 / -1; }
.stock-note { grid-column: 1 / -1; font-size: 13px; }
.highlights { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.highlights li { display: flex; gap: 10px; font-size: 14px; }
.highlights li::before { content: ""; flex: 0 0 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/12px no-repeat; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table th, .spec-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table th { width: 38%; color: var(--muted); font-weight: 600; }
@media (max-width: 959px) {
    .sticky-buy { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr; }
    body.has-sticky { padding-bottom: 84px; }
}
@media (min-width: 960px) { .sticky-buy { display: none; } }

/* Compare */
.compare-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.compare { width: 100%; min-width: 640px; border-collapse: collapse; }
.compare th, .compare td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
.compare thead td { text-align: center; }
.compare thead img { width: 160px; height: 160px; object-fit: contain; margin: 8px auto; }
.compare tbody th { width: 180px; font-weight: 700; background: #fafbfc; }
.compare tr.differs td { background: #eef9fd; }
.compare .remove { font-size: 13px; color: var(--muted); text-decoration: underline; background: none; border: 0; cursor: pointer; }

/* Cart and checkout */
.checkout { display: grid; gap: 24px; padding: 24px 0 56px; }
@media (min-width: 960px) { .checkout { grid-template-columns: 1fr 380px; align-items: start; } }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: #fff; }
.panel + .panel { margin-top: 16px; }
.line-item { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: 0; }
.line-item img { width: 84px; height: 84px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; }
.line-err { color: var(--danger); font-size: 13px; font-weight: 600; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; }
.sum-total { font-family: var(--head); font-weight: 800; font-size: 22px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .wide { grid-column: 1 / -1; } }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .req { color: var(--danger); }
.field .error { display: block; color: #b42318; font-size: 13px; margin-top: 4px; }
.field .note { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.field input.invalid, .field select.invalid, .field textarea.invalid { border-color: #b42318; }
.select2-container { width: 100% !important; }
.select2-container .select2-selection--single { height: 46px; border: 1px solid #c9cdd2; border-radius: 8px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 44px; padding-left: 12px; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 44px; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 4px; width: 18px; height: 18px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Order status */
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 20px 0; }
.timeline div { font-size: 12px; text-align: center; padding-top: 12px; border-top: 4px solid var(--line); color: var(--muted); font-weight: 600; }
.timeline div.done { border-color: var(--accent); color: var(--ink); }

/* Content pages */
.prose { max-width: 760px; }
.prose p { margin: 0 0 1em; }
.split { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 56px; } }
.split img { border-radius: var(--radius); }
.facts { display: grid; gap: 12px; }
@media (min-width: 768px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.fact { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
details.faq { border-bottom: 1px solid var(--line); padding: 16px 0; }
details.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--muted); }
details.faq[open] summary::after { content: "–"; }
details.faq div { padding-top: 10px; color: #33373b; }
.posts { display: grid; gap: 20px; }
@media (min-width: 768px) { .posts { grid-template-columns: repeat(3, 1fr); } }
.post img { aspect-ratio: 16/10; object-fit: cover; width: 100%; border-radius: var(--radius); background: var(--mist); }
.post h3 { margin-top: 12px; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.contact-list strong { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Films */
.films { display: grid; grid-auto-flow: column; grid-auto-columns: 70%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.films video { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: var(--radius); background: #000; scroll-snap-align: start; }
@media (min-width: 768px) { .films { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); } }

/* Footer */
.site-foot { background: var(--ink); color: #c7cacd; margin-top: 40px; font-size: 14px; }
.site-foot .wrap { padding-top: 44px; padding-bottom: 28px; }
.foot-cols { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .foot-cols { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.foot-cols h4 { color: #fff; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px; }
.foot-cols a { display: block; padding: 4px 0; }
.foot-cols a:hover { color: #fff; }
.foot-brand img { height: 26px; width: auto; margin-bottom: 14px; }
.badges { display: flex; align-items: center; gap: 18px; margin: 32px 0 0; }
.badges img { display: block; width: auto; height: 56px; }
.badges .badge-award { height: 42px; }
.badge-band { background: var(--ink); }
.badge-band .badges { justify-content: center; margin: 0; padding: 28px 0; }
.badge-band .badges img { height: 72px; }
.badge-band .badges { gap: 24px; }
.badge-band .badges .badge-award { height: 54px; }
.prose-lead p::first-line { font-weight: 700; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; border-top: 1px solid #222; margin-top: 32px; padding-top: 18px; font-size: 12px; color: #8a8f94; }
.foot-base a { margin-left: 14px; }

/* Grid children must be allowed to shrink, or scrolling strips (thumbnails) widen the page on phones. */
.pdp > *, .checkout > *, .split > *, .hero .wrap > * { min-width: 0; }

.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 28px 0 8px; }
@media (min-width: 768px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
.photo-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: var(--mist); }

/* Full-screen hero (Ruby, design/home-hero v1, AIOS-871). Text sits in the image's clear area:
   left ~42% on desktop, top ~39% on phones; gradients keep it legible. */
.hero-full { position: relative; height: calc(100svh - 64px); min-height: 520px; background: #000; color: #fff; overflow: hidden; }
.hero-full picture, .hero-full img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-full img { object-fit: cover; object-position: 30% 50%; }
.hero-full::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(90deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,.55) 30%, rgba(0,0,0,0) 55%); }
.hero-copy { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: center;
    padding: 0 9vw; max-width: calc(42% + 9vw); }
.hero-copy h1 { font-size: clamp(44px, 5vw, 84px); line-height: .98; margin: 0 0 20px; }
.hero-copy p { color: #d3d6da; font-size: 17px; max-width: 400px; margin: 0 0 30px; }
.hero-copy .btn { align-self: flex-start; }
@media (max-width: 767px) {
    .hero-full img { object-position: 50% 100%; }
    .hero-full::after { background: linear-gradient(180deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.6) 30%, rgba(0,0,0,0) 52%); }
    .hero-copy { justify-content: flex-start; max-width: none; padding: 36px 20px 0; }
    .hero-copy h1 { font-size: clamp(40px, 12vw, 56px); margin-bottom: 14px; }
    .hero-copy p { font-size: 15px; margin-bottom: 22px; }
}
@media (prefers-reduced-motion: no-preference) {
    .hero-full img, .hero-copy { animation: hero-in .9s ease-out both; }
    .hero-copy { animation-delay: .15s; }
    @keyframes hero-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
    .hero-full img { animation-name: hero-img-in; }
    @keyframes hero-img-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: scale(1); } }
}
