/* DeeDeux storefront
   Black and white. Structure from type and space, one symbol, one accent.
   Duality: the hero splits black/white and the mark inverts across the split. */
:root {
  --ink: #000000;
  --paper: #ffffff;
  --stone: #ececea;      /* photo wells */
  --graphite: #595959;   /* secondary text, 7:1 on white */
  --rule: #d4d4d4;
  --oxblood: #6b1d24;    /* the single accent: sold out, errors, alerts */
  --ok: #1f5130;
  --sans: "Helvetica Neue", Helvetica, "Inter", "Segoe UI", Arial, sans-serif;
  --wrap: 1320px;
  --gutter: clamp(16px, 4vw, 48px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: var(--graphite); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- mark + wordmark ---------- */
.mark { width: 26px; height: 26px; fill: currentColor; flex: none; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--ink); }
.site-header .inner { max-width: var(--wrap); margin: 0 auto; padding: 14px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav { display: flex; gap: clamp(16px, 3vw, 32px); font-size: 15px; }
.nav a { text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; }
.nav a:hover { border-bottom-color: var(--ink); }
.cart-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 2px; background: var(--ink); color: var(--paper); font-size: 12px; line-height: 20px; text-align: center; border-radius: 10px; }

main { max-width: var(--wrap); margin: 0 auto; padding: 40px var(--gutter) 96px; }
main.home { max-width: none; padding: 0; }
h1, h2 { font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
h1.page-title { font-size: clamp(32px, 5vw, 48px); margin: 0 0 32px; }
h2 { font-size: 26px; margin: 0 0 16px; }

/* ---------- hero: the duality split ---------- */
.hero { position: relative; display: grid; grid-template-columns: 1fr 1fr; min-height: min(86svh, 820px); overflow: hidden; border-bottom: 1px solid var(--ink); }
.hero-half { padding: clamp(28px, 5vw, 72px); display: flex; flex-direction: column; justify-content: flex-end; }
.hero-dark { background: var(--ink); color: var(--paper); }
.hero-light { background: var(--paper); color: var(--ink); align-items: flex-end; }
.hero-kicker { margin: 0 0 12px; font-size: 15px; color: #bdbdbd; position: relative; z-index: 2; }
.hero h1 { font-size: clamp(56px, 9.5vw, 148px); margin: 0 0 20px; letter-spacing: -0.045em; line-height: 0.9; position: relative; z-index: 2; }
.hero-line { max-width: 30ch; margin: 0 0 32px; font-size: clamp(17px, 1.6vw, 20px); color: #e6e6e6; position: relative; z-index: 2; }
.hero-note { margin: 0; font-size: 15px; position: relative; z-index: 2; }
.hero-mark { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); pointer-events: none; mix-blend-mode: difference; z-index: 1; }
.hero-mark .mark { width: clamp(220px, 34vw, 500px); height: auto; aspect-ratio: 1; fill: var(--paper); display: block; }
@media (prefers-reduced-motion: no-preference) {
  .hero-mark .mark { animation: mark-in 1.1s cubic-bezier(.2, .7, .1, 1) both; }
  @keyframes mark-in { from { opacity: 0; transform: rotate(-90deg) scale(.85); } to { opacity: 1; transform: none; } }
}
.hero .btn-invert:focus-visible { outline-color: var(--paper); }

/* ---------- shop ---------- */
.shop { max-width: var(--wrap); margin: 0 auto; padding: 64px var(--gutter) 96px; }
.shop-bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.shop-bar h2 { font-size: clamp(32px, 4vw, 44px); margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; border: 1px solid var(--ink); background: transparent; color: var(--ink); padding: 6px 14px; font-size: 14px; text-decoration: none; cursor: pointer; font-family: inherit; }
.chip:hover, .chip.active { background: var(--ink); color: var(--paper); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 40px 20px; }
.card { text-decoration: none; display: block; }
.card .img { aspect-ratio: 4 / 5; background: var(--stone); overflow: hidden; display: grid; place-items: center; }
.card .img img { width: 100%; height: 100%; object-fit: cover; }
.img-mark { width: 30%; aspect-ratio: 1; background: url("/assets/mark.svg") center / contain no-repeat; opacity: .12; }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; font-size: 15px; }
.card-row + .card-row { margin-top: 2px; font-size: 14px; }
.card .name { font-weight: 600; }
.card:hover .name { text-decoration: underline; text-underline-offset: 3px; }
.card-swatches { display: inline-flex; gap: 4px; }
.swatch-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); }
.empty { color: var(--graphite); padding: 72px 0; font-size: 18px; }

/* ---------- product page ---------- */
.product { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.gallery .main { aspect-ratio: 4 / 5; background: var(--stone); }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.thumbs button { padding: 0; border: 1px solid transparent; background: var(--stone); width: 68px; height: 85px; cursor: pointer; }
.thumbs button.active { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product > div:last-child { position: sticky; top: 88px; }
.product h1 { font-size: clamp(30px, 3.6vw, 44px); margin: 0 0 6px; }
.p-collection { margin: 0 0 18px; color: var(--graphite); }
.product .price { font-size: 22px; margin-bottom: 28px; }
.product .desc { color: var(--graphite); white-space: pre-line; margin: 28px 0 0; padding-top: 24px; border-top: 1px solid var(--rule); max-width: 60ch; }
.field-label { margin: 20px 0 8px; font-size: 14px; font-weight: 600; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border: 1px solid var(--rule); background: var(--paper); cursor: pointer; }
.swatch .swatch-dot { width: 26px; height: 26px; }
.swatch[aria-pressed="true"] { border: 2px solid var(--ink); }
.sizes { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; }
.sizes button { min-width: 54px; padding: 11px 12px; border: 1px solid var(--rule); background: var(--paper); cursor: pointer; font: inherit; }
.sizes button:hover { border-color: var(--ink); }
.sizes button.active { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.badge { font-size: 14px; color: var(--oxblood); min-height: 1em; }

/* ---------- forms & buttons ---------- */
label { display: block; font-size: 14px; font-weight: 600; margin: 16px 0 6px; }
input, select, textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--rule); background: var(--paper); border-radius: 0; font: inherit; color: inherit; }
input:hover, select:hover, textarea:hover { border-color: var(--graphite); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
textarea { min-height: 96px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.btn { display: inline-block; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); padding: 15px 28px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { background: var(--paper); color: var(--ink); }
.btn-invert { background: var(--paper); color: var(--ink); border-color: var(--paper); align-self: flex-start; position: relative; z-index: 2; }
.btn-invert:hover { background: transparent; color: var(--paper); }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.secondary:hover { background: var(--ink); color: var(--paper); }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn.danger { background: var(--oxblood); border-color: var(--oxblood); color: var(--paper); }
.btn.danger:hover { background: var(--paper); color: var(--oxblood); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { display: block; width: 100%; margin-top: 20px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--rule); }
.qty button { width: 40px; height: 42px; border: 0; background: none; cursor: pointer; font-size: 18px; color: inherit; }
.qty span { min-width: 32px; text-align: center; }

.msg { padding: 12px 14px; margin: 12px 0; font-size: 14px; border-left: 3px solid; }
.msg.error { background: #f6eeee; color: var(--oxblood); }
.msg.ok { background: #eef3ef; color: var(--ok); }

/* ---------- bag & checkout ---------- */
.layout-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--ink); padding: 28px; }
.panel h2 { font-size: 22px; }
.line-item { display: grid; grid-template-columns: 84px 1fr auto; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.line-item:first-child { border-top: 1px solid var(--rule); }
.line-item img, .line-item > div:first-child:empty { width: 84px; height: 105px; object-fit: cover; background: var(--stone); }
.line-item a { font-weight: 600; text-decoration: none; }
.line-item .meta, .meta { font-size: 14px; color: var(--graphite); }
.link-btn { background: none; border: 0; padding: 0; color: var(--graphite); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }
.summary-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0; }
.summary-row.total { font-size: 18px; font-weight: 700; border-top: 1px solid var(--ink); padding-top: 14px; margin-top: 14px; }
.tabs { display: flex; margin-bottom: 8px; border-bottom: 1px solid var(--rule); }
.tabs button { flex: 1; background: none; border: 0; padding: 12px; cursor: pointer; font: inherit; font-size: 15px; color: var(--graphite); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }

.status { display: inline-block; padding: 2px 10px; font-size: 13px; text-transform: capitalize; border: 1px solid currentColor; }
.status.paid, .status.delivered { color: var(--ok); }
.status.shipped { color: var(--ink); }
.status.review, .status.cancelled { color: var(--oxblood); }
.status.pending { color: var(--graphite); }
.order-card { margin-bottom: 12px; }
.narrow { max-width: 440px; margin: 48px auto; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--paper); }
.site-footer .inner { max-width: var(--wrap); margin: 0 auto; padding: 48px var(--gutter); display: grid; gap: 8px; }
.site-footer p { margin: 0; color: #cfcfcf; max-width: 52ch; }
.site-footer .fine { font-size: 13px; color: #9a9a9a; margin-top: 16px; }
.site-footer :focus-visible { outline-color: var(--paper); }

/* ---------- admin ---------- */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; border-top: 1px solid var(--ink); }
.admin-table th { text-align: left; font-weight: 600; padding: 10px; border-bottom: 1px solid var(--ink); }
.admin-table td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.admin-table img { width: 48px; height: 60px; object-fit: cover; background: var(--stone); }
.upload-previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.upload-previews figure { margin: 0; position: relative; }
.upload-previews img { width: 72px; height: 90px; object-fit: cover; border: 1px solid var(--rule); }
.upload-previews button { position: absolute; top: 2px; right: 2px; background: var(--ink); color: var(--paper); border: 0; width: 22px; height: 22px; cursor: pointer; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.checkbox input { width: auto; }
.color-add { display: grid; grid-template-columns: 1fr 56px auto; gap: 8px; align-items: stretch; }
.color-add input[type="color"] { padding: 4px; height: auto; cursor: pointer; }
.color-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip-color { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--rule); padding: 6px 10px; font-size: 14px; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; min-height: 92svh; }
  .hero-mark { top: 50%; }
  .hero-mark .mark { width: clamp(180px, 56vw, 300px); }
  .hero-dark { justify-content: flex-start; }
  .hero-light { justify-content: flex-end; }
  .product, .layout-2 { grid-template-columns: 1fr; gap: 28px; }
  .product > div:last-child { position: static; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .logo span { font-size: 18px; }
  .admin-table { font-size: 12px; display: block; overflow-x: auto; }
}
