/* Mirrorloom — a simple shop for kaleidoscope prints. White page, one
   typeface (DM Sans), and the products carry all the colour. */
:root {
  --white: #ffffff;
  --soft: #f5f3ef;          /* product photo backdrop */
  --soft-2: #eeebe6;
  --ink: #111111;
  --ink-2: #4d4d4d;
  --ink-3: #8a8a8a;
  --line: #e8e8e8;
  --accent: #b4235a;        /* sale and "new" badges */
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gut: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --r: 10px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font: 400 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 1em; height: 1em; flex: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
p { margin: 0; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent; font-weight: 500; font-size: 15px; text-decoration: none; white-space: nowrap; transition: background .2s, border-color .2s; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #333; }
.btn-light { background: #fff; border-color: #cfcfcf; }
.btn-light:hover { border-color: var(--ink); }
.btn-block { width: 100%; }
.icon-btn { position: relative; width: 40px; height: 40px; border: 0; padding: 0; border-radius: 50%; background: none; display: grid; place-items: center; font-size: 22px; transition: background .2s; }
.icon-btn:hover { background: var(--soft); }
.link { border: 0; background: none; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- header */
.announce { background: var(--ink); color: #fff; text-align: center; font-size: 13px; padding: 8px var(--gut); }
.header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { max-width: var(--max); margin: 0 auto; height: 64px; padding: 0 var(--gut); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 19px; letter-spacing: -0.03em; text-decoration: none; }
.brand .mark { width: 24px; height: 24px; }
.nav { display: flex; gap: 28px; }
.nav a { text-decoration: none; font-size: 14.5px; color: var(--ink-2); }
.nav a:hover { color: var(--ink); }
.header-end { display: flex; justify-content: flex-end; gap: 4px; }
.cart-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }

/* ---------------------------------------------------------------- hero */
.hero { max-width: var(--max); margin: 0 auto; padding: clamp(16px, 2vw, 24px) var(--gut) 0; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2vw, 24px); }
.hero-copy { background: var(--soft); border-radius: var(--r); padding: clamp(32px, 5vw, 72px); display: flex; flex-direction: column; justify-content: center; }
.kicker { font-size: 13px; font-weight: 500; color: var(--accent); margin-bottom: 14px; }
.hero h1 { font-size: clamp(36px, 4.4vw, 58px); line-height: 1.08; letter-spacing: -0.028em; text-wrap: balance; }
.lede { color: var(--ink-2); font-size: 17px; max-width: 440px; margin: 20px 0 32px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-media { border-radius: var(--r); overflow: hidden; background: var(--soft); aspect-ratio: 4 / 4.2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- sections */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 6vw, 80px) var(--gut) 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; }
.section-head h2, .about h2, .letter h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.15; }

/* categories */
.cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cat { position: relative; display: block; border-radius: var(--r); overflow: hidden; background: var(--soft); text-decoration: none; aspect-ratio: 4 / 5; }
.cat img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.cat:hover img { transform: scale(1.03); }
.cat span { position: absolute; left: 12px; bottom: 12px; background: #fff; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }

/* toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 14px; transition: border-color .2s, background .2s, color .2s; }
.chip:hover { border-color: #bbb; }
.chip[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.toolbar-end { display: flex; gap: 8px; }
.search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-3); }
.search:focus-within { border-color: var(--ink); color: var(--ink); }
.search input { border: 0; outline: 0; background: none; width: 150px; font-size: 14px; color: var(--ink); }
.sort select { height: 36px; padding: 0 34px 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%23111' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; -webkit-appearance: none; appearance: none; font-size: 14px; }
.count { font-size: 13px; color: var(--ink-3); margin: 14px 0 20px; }
.empty { padding: 48px 0; text-align: center; color: var(--ink-2); }

/* product cards */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 16px; }
.card { position: relative; display: flex; flex-direction: column; }
.card-media { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r); overflow: hidden; background: var(--soft); margin-bottom: 12px; }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .35s ease; }
.card-media .alt { opacity: 0; }
.card:hover .card-media .alt { opacity: 1; }
.badge { position: absolute; left: 10px; top: 10px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: #fff; font-size: 12px; font-weight: 500; }
.badge.new { background: var(--accent); color: #fff; }
.card h3 { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.card .type { font-size: 13.5px; color: var(--ink-3); }
.card .price { font-size: 15px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.card .add { position: relative; z-index: 2; margin-top: 12px; height: 40px; border-radius: 999px; border: 1px solid #cfcfcf; background: #fff; font-size: 14px; font-weight: 500; transition: background .2s, color .2s, border-color .2s; }
.card .add:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.card-open { position: absolute; inset: 0; z-index: 1; border-radius: var(--r); }

/* about */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: center; }
.about-media { border-radius: var(--r); overflow: hidden; aspect-ratio: 1; }
.about-media img { width: 100%; height: 100%; object-fit: cover; }
.about-copy { max-width: 480px; }
.about-copy h2 { margin-bottom: 18px; }
.about-copy p:not(.kicker) { color: var(--ink-2); font-size: 16px; margin-top: 12px; }

/* perks */
.perks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.perks > div { padding: 24px; border-radius: var(--r); background: var(--soft); }
.perks svg { font-size: 24px; margin-bottom: 14px; }
.perks h3 { font-size: 16px; margin-bottom: 4px; }
.perks p { color: var(--ink-2); font-size: 14px; }

/* newsletter */
.letter { text-align: center; padding-bottom: clamp(56px, 7vw, 96px); }
.letter > p { color: var(--ink-2); margin-top: 8px; }
.letter-form { display: flex; gap: 8px; max-width: 460px; margin: 24px auto 0; }
.letter-form input { flex: 1; min-width: 0; height: 48px; padding: 0 20px; border: 1px solid #cfcfcf; border-radius: 999px; font-size: 15px; }
.letter-form input:focus { outline: none; border-color: var(--ink); }
.letter-done { margin-top: 24px; font-weight: 500; }

/* footer */
.footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 48px var(--gut) 32px; display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand p { color: var(--ink-3); font-size: 14px; margin-top: 10px; max-width: 280px; }
.footer-cols { display: flex; gap: 64px; }
.footer-cols div { display: flex; flex-direction: column; gap: 10px; }
.footer-cols h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.footer-cols a { font-size: 14px; color: var(--ink-2); text-decoration: none; }
.footer-cols a:hover { color: var(--ink); text-decoration: underline; }
.footer-note { max-width: var(--max); margin: 0 auto; padding: 20px var(--gut) 32px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }

/* ---------------------------------------------------------------- product modal */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .4); }
.modal { position: fixed; z-index: 70; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(1000px, calc(100% - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: #fff; border-radius: 14px; display: grid; grid-template-columns: 1.05fr 1fr; box-shadow: 0 24px 80px rgba(0, 0, 0, .25); }
.close { position: absolute; top: 12px; right: 12px; z-index: 3; background: #fff; }
.p-media { padding: 16px; }
.p-media > img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r); background: var(--soft); }
.p-thumbs { display: flex; gap: 8px; margin-top: 8px; }
.p-thumbs button { width: 64px; height: 80px; padding: 0; border: 1px solid transparent; border-radius: 8px; overflow: hidden; background: var(--soft); }
.p-thumbs button[aria-pressed="true"] { border-color: var(--ink); }
.p-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.p-info { padding: 40px 32px 32px 16px; display: flex; flex-direction: column; gap: 12px; }
.p-cat { font-size: 13px; color: var(--ink-3); }
.p-info h2 { font-size: 30px; line-height: 1.15; letter-spacing: -0.03em; }
.p-price { font-size: 20px; font-variant-numeric: tabular-nums; }
.p-note { color: var(--ink-2); }
.p-field { margin-top: 8px; }
.p-label { font-size: 13.5px; font-weight: 500; margin-bottom: 8px; }
.sizes { display: flex; gap: 8px; flex-wrap: wrap; }
.sizes button { height: 42px; padding: 0 16px; border-radius: 8px; border: 1px solid #cfcfcf; background: #fff; font-size: 14px; }
.sizes button:hover { border-color: var(--ink); }
.sizes button[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 500; }
.p-buy { display: flex; gap: 10px; margin-top: 8px; }
.p-buy .btn { flex: 1; }
.qty { display: inline-flex; align-items: center; height: 48px; border: 1px solid #cfcfcf; border-radius: 999px; }
.qty button { width: 40px; height: 100%; border: 0; background: none; display: grid; place-items: center; font-size: 16px; border-radius: 999px; }
.qty span { min-width: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.p-facts { list-style: none; padding: 0; margin: 8px 0 4px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.p-facts li { display: flex; align-items: center; gap: 8px; }
.p-facts svg { font-size: 18px; }
.acc { border-top: 1px solid var(--line); padding-top: 12px; }
.acc:last-child { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.acc summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; font-weight: 500; font-size: 14.5px; }
.acc summary::after { content: '+'; font-size: 18px; line-height: 1; }
.acc[open] summary::after { content: '−'; }
.acc summary::-webkit-details-marker { display: none; }
.acc p, .acc dl { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.acc dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.acc dt { color: var(--ink-3); }
.acc dd { margin: 0; }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }

/* ---------------------------------------------------------------- cart */
.cart { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: #fff; display: flex; flex-direction: column; box-shadow: -12px 0 48px rgba(0, 0, 0, .15); }
.cart-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.cart-head h2 { font-size: 20px; }
.ship-bar { padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.bar { height: 4px; border-radius: 2px; background: var(--soft-2); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .3s; }
.cart-items { flex: 1; overflow-y: auto; padding: 0 20px; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 72px; height: 90px; object-fit: cover; border-radius: 8px; background: var(--soft); }
.cart-item h3 { font-size: 14.5px; }
.cart-item p { font-size: 13px; color: var(--ink-3); }
.cart-item .qty { height: 34px; margin-top: 8px; }
.cart-item .qty button { width: 32px; font-size: 14px; }
.cart-item .line { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.cart-item .remove { display: block; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.cart-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--ink-2); }
.cart-foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.cart-total { display: flex; justify-content: space-between; font-size: 16px; }
.cart-total b { font-weight: 600; }
.cart-tax { font-size: 12.5px; color: var(--ink-3); }
.cart-concept { font-size: 13px; background: var(--soft); padding: 10px 12px; border-radius: 8px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; transition: opacity .25s, transform .25s; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .perks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-media { aspect-ratio: 4 / 3; order: -1; }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about { grid-template-columns: 1fr; }
  .modal { grid-template-columns: 1fr; top: auto; bottom: 0; left: 0; transform: none; width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .p-info { padding: 8px 20px 28px; }
  .p-media > img { aspect-ratio: 1; }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
  .card h3 { font-size: 14px; }
  .card .type { font-size: 12.5px; }
  .card .price { font-size: 14px; }
  .card .add { height: 36px; font-size: 13px; }
  .toolbar-end { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .chip { flex: none; }
  .perks { grid-template-columns: 1fr; gap: 12px; }
  .letter-form { flex-direction: column; }
  .footer-cols { gap: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
