/* NYXITE storefront
   Palette comes from the brand files: the black of the logo plates and the bone of the moon.
   Earthshine (the faint blue light on the moon's dark side) is the only accent, kept for focus and links. */

:root {
  --void: #050605;
  --regolith: #101112;
  --crater: #1c1e20;
  --rille: #2c2f33;
  --bone: #e5e4df;
  --dust: #9a9ca0;
  --earthshine: #a9c1e8;
  --flare: #f3a892;

  --display: 'Syne', 'Arial Black', sans-serif;
  --body: 'Hanken Grotesk', system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --step-4: clamp(2.5rem, 1rem + 5.6vw, 5.75rem);

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --measure: 34rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; scroll-padding-top: 6.5rem; }
body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font: 400 var(--step-0)/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--earthshine); outline-offset: 3px; }
::selection { background: var(--bone); color: var(--void); }

h1, h2, .display {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 0.98;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font: 600 var(--step-1)/1.25 var(--body); }
.quiet { color: var(--dust); }
.small { font-size: var(--step--1); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.wrap { padding-inline: var(--gutter); max-width: 88rem; margin-inline: auto; width: 100%; }

/* ---------- buttons, links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 3.25rem; padding: 0.75rem 1.6rem;
  border: 1.5px solid var(--bone); border-radius: 999px;
  background: var(--bone); color: var(--void);
  font-weight: 600; text-decoration: none; text-align: center;
  transition: background-color 0.15s, color 0.15s;
}
.btn:hover { background: transparent; color: var(--bone); }
.btn[disabled], .btn[aria-disabled='true'] { background: var(--crater); border-color: var(--crater); color: var(--dust); cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--bone); border-color: var(--rille); }
.btn-ghost:hover { border-color: var(--bone); }
.btn-wide { width: 100%; }
.link { color: var(--bone); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-color: var(--dust); background: none; border: 0; padding: 0; }
.link:hover { text-decoration-color: var(--earthshine); color: var(--earthshine); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--void) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--crater);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; margin-right: auto; }
.brand img:first-child { height: 1.9rem; width: auto; }
.brand img:last-child { height: 0.95rem; width: auto; }
.site-nav { display: flex; align-items: center; gap: clamp(0.9rem, 2.5vw, 2rem); }
.site-nav a, .site-nav button { background: none; border: 0; padding: 0.5rem 0; text-decoration: none; font-weight: 500; }
.site-nav a:hover, .site-nav button:hover { color: var(--earthshine); }
.cart-count {
  display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding-inline: 0.35rem;
  margin-left: 0.35rem; border-radius: 999px; background: var(--bone); color: var(--void);
  font-size: 0.8rem; font-weight: 700;
}
.cart-count[data-empty='true'] { background: transparent; color: var(--dust); box-shadow: inset 0 0 0 1.5px var(--rille); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--crater); }
.hero .wrap {
  position: relative; display: grid; align-content: end;
  min-height: min(42rem, calc(100svh - 4.25rem));
  padding-block: clamp(3rem, 8vw, 6rem);
}
.hero-moon {
  position: absolute; z-index: 0; pointer-events: none;
  width: clamp(22rem, 46vw, 44rem);
  right: clamp(-6rem, 2vw, 5rem); top: clamp(-5rem, -3vw, -1.5rem);
  transform-origin: 60% 55%;
  animation: moonrise 1.8s cubic-bezier(0.2, 0.7, 0.1, 1) both;
}
@keyframes moonrise {
  from { opacity: 0; transform: translateY(14%) rotate(-16deg); }
  to { opacity: 1; transform: none; }
}
.hero-copy { position: relative; z-index: 1; mix-blend-mode: difference; }
.hero-copy h1 { max-width: 11.5em; color: #fff; }
.hero-sub { position: relative; z-index: 1; mix-blend-mode: difference; margin-top: 1.75rem; max-width: 27rem; font-size: var(--step-1); line-height: 1.4; color: #fff; }
.hero-actions { position: relative; z-index: 1; margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }

/* ---------- catalogue ---------- */
.shelf { padding-block: clamp(3rem, 7vw, 5.5rem) 0; }
.shelf:last-of-type { padding-bottom: clamp(3rem, 7vw, 5.5rem); }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(0.75rem, 1.6vw, 1.5rem); }
.tile { display: block; text-decoration: none; }
.tile-art {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 6px;
  background: var(--regolith); display: grid; place-items: center;
}
.tile-art img { width: 74%; height: 74%; object-fit: contain; transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.1, 1); }
.tile-art[data-kind='photo'] { background: #fff; }
.tile-art[data-kind='photo'] img { width: 100%; height: 100%; object-fit: cover; }
.tile:hover .tile-art img, .tile:focus-visible .tile-art img { transform: scale(1.04); }
.tile-flag {
  position: absolute; left: 0.75rem; top: 0.75rem; padding: 0.2rem 0.65rem; border-radius: 999px;
  background: var(--void); color: var(--bone); font-size: var(--step--1); font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--rille);
}
.tile-meta { display: flex; justify-content: space-between; gap: 1rem; padding-top: 0.8rem; }
.tile-meta h3 { font-size: var(--step-0); }
.tile-meta p { color: var(--dust); font-size: var(--step--1); }
.tile-price { font-weight: 600; white-space: nowrap; }

.facts { border-block: 1px solid var(--crater); margin-top: clamp(3rem, 7vw, 5.5rem); }
.facts ul { display: grid; grid-template-columns: repeat(3, 1fr); }
.facts li { padding: 1.5rem var(--gutter); }
.facts li + li { border-left: 1px solid var(--crater); }
.facts strong { display: block; font-weight: 600; }
.facts span { color: var(--dust); font-size: var(--step--1); }

/* ---------- drop list ---------- */
.droplist { position: relative; overflow: hidden; }
.droplist::before {
  content: ''; position: absolute; inset: 0; opacity: 0.16;
  background: url('/img/repeat.webp') 0 0 / 22rem;
  mask-image: linear-gradient(90deg, transparent 20%, #000 75%);
}
.droplist .wrap { position: relative; padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.droplist h2 { max-width: 14ch; }
.droplist p { margin-top: 1rem; max-width: var(--measure); color: var(--dust); }
.inline-form { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 0.75rem; max-width: 34rem; }
.inline-form .field { flex: 1 1 16rem; }
.form-note { margin-top: 0.75rem; min-height: 1.5em; font-size: var(--step--1); }
.form-note[data-tone='ok'] { color: var(--earthshine); }
.form-note[data-tone='bad'] { color: var(--flare); }

/* ---------- forms ---------- */
.field { display: grid; gap: 0.4rem; }
.field label, .field .label { font-size: var(--step--1); font-weight: 500; }
.field .optional { color: var(--dust); font-weight: 400; }
.input {
  width: 100%; min-height: 3.25rem; padding: 0.7rem 1rem;
  background: var(--regolith); border: 1.5px solid var(--rille); border-radius: 10px;
}
.input::placeholder { color: #6d7074; }
.input:hover { border-color: var(--dust); }
.input:focus-visible { outline-offset: 1px; border-color: var(--earthshine); }
.input[aria-invalid='true'] { border-color: var(--flare); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dust) 50%), linear-gradient(135deg, var(--dust) 50%, transparent 50%); background-position: calc(100% - 1.35rem) 55%, calc(100% - 1rem) 55%; background-size: 0.35rem 0.35rem; background-repeat: no-repeat; padding-right: 2.5rem; }
.field-error { color: var(--flare); font-size: var(--step--1); }
.field-error:empty { display: none; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--crater); color: var(--dust); font-size: var(--step--1); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; padding-block: 1.75rem; }
.site-footer nav { display: flex; gap: 1.5rem; }

/* ---------- product page ---------- */
.product { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 5rem); padding-block: clamp(1.5rem, 4vw, 3.5rem) clamp(3rem, 7vw, 6rem); align-items: start; }
.product-art { position: sticky; top: 5.5rem; aspect-ratio: 1; border-radius: 8px; background: var(--regolith); display: grid; place-items: center; overflow: hidden; }
.product-art img { width: 78%; height: 78%; object-fit: contain; }
.product-art[data-kind='photo'] { background: #fff; }
.product-art[data-kind='photo'] img { width: 100%; height: 100%; object-fit: cover; }
.crumb { font-size: var(--step--1); color: var(--dust); margin-bottom: 1.25rem; }
.product-info h1 { font-size: var(--step-3); }
.product-price { margin-top: 0.9rem; font-size: var(--step-2); font-weight: 600; }
.product-blurb { margin-top: 0.4rem; color: var(--dust); }
.sizes { margin-top: 2rem; }
.sizes-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.75rem; }
.sizes legend { font-weight: 600; padding: 0; float: left; }
.size-row { clear: both; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; }
.size { position: relative; }
.size input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.size input:disabled { cursor: not-allowed; }
.size-face {
  display: grid; justify-items: center; gap: 0.45rem; padding: 0.85rem 0.25rem 0.7rem;
  border: 1.5px solid var(--rille); border-radius: 12px; background: var(--regolith);
  transition: border-color 0.15s, background-color 0.15s;
}
.size-face svg { width: 1.75rem; height: 1.75rem; }
.size-name { font-weight: 600; line-height: 1; }
.size-note { font-size: 0.75rem; color: var(--dust); line-height: 1; min-height: 0.75rem; white-space: nowrap; }
.size input:hover:not(:disabled) + .size-face { border-color: var(--dust); }
.size input:checked + .size-face { border-color: var(--bone); background: var(--crater); }
.size input:focus-visible + .size-face { outline: 2px solid var(--earthshine); outline-offset: 3px; }
.size input:disabled + .size-face { opacity: 0.45; }
.size input:disabled + .size-face .size-name { text-decoration: line-through; }
.moon-key { margin-top: 0.75rem; font-size: var(--step--1); color: var(--dust); }
.buy { margin-top: 1.5rem; display: grid; gap: 0.75rem; }
.product-copy { margin-top: 2.25rem; padding-top: 1.75rem; border-top: 1px solid var(--crater); max-width: var(--measure); display: grid; gap: 1rem; }

/* ---------- cart drawer + dialogs ---------- */
dialog { color: var(--bone); border: 0; padding: 0; }
dialog::backdrop { background: rgba(0, 0, 0, 0.66); }
.drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; height: 100dvh; max-height: none;
  width: min(27rem, 100vw); max-width: none; background: var(--regolith);
  border-left: 1px solid var(--rille);
}
.drawer[open] { display: flex; flex-direction: column; animation: slide-in 0.28s cubic-bezier(0.2, 0.7, 0.1, 1); }
@keyframes slide-in { from { transform: translateX(100%); } }
.drawer-head, .drawer-foot { padding: 1.25rem 1.5rem; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--rille); }
.drawer-head h2 { font-size: var(--step-2); }
.drawer-body { flex: 1; overflow-y: auto; padding: 0.5rem 1.5rem; }
.drawer-foot { border-top: 1px solid var(--rille); display: grid; gap: 0.9rem; }
.icon-btn { background: none; border: 0; padding: 0.5rem; margin: -0.5rem; border-radius: 8px; color: var(--dust); }
.icon-btn:hover { color: var(--bone); }
.cart-empty { padding-block: 3rem; display: grid; gap: 1rem; justify-items: start; }
.cart-empty img { width: 4rem; opacity: 0.35; }

.line { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 1rem; padding-block: 1.1rem; border-bottom: 1px solid var(--crater); align-items: start; }
.line:last-child { border-bottom: 0; }
.line-art { aspect-ratio: 1; border-radius: 6px; background: var(--void); display: grid; place-items: center; overflow: hidden; }
.line-art img { width: 76%; height: 76%; object-fit: contain; }
.line-art[data-kind='photo'] { background: #fff; }
.line-art[data-kind='photo'] img { width: 100%; height: 100%; object-fit: cover; }
.line h3 { font-size: var(--step-0); }
.line-sub { color: var(--dust); font-size: var(--step--1); }
.line-warn { color: var(--flare); font-size: var(--step--1); margin-top: 0.25rem; }
.line-price { font-weight: 600; text-align: right; }
.qty { margin-top: 0.6rem; display: inline-flex; align-items: center; border: 1.5px solid var(--rille); border-radius: 999px; }
.qty button { width: 2.25rem; height: 2.25rem; background: none; border: 0; border-radius: 999px; font-size: 1.1rem; line-height: 1; }
.qty button:hover:not(:disabled) { background: var(--crater); }
.qty button:disabled { color: var(--rille); cursor: not-allowed; }
.qty output { min-width: 1.5rem; text-align: center; font-weight: 600; font-size: var(--step--1); }
.line-remove { margin-left: 0.75rem; font-size: var(--step--1); }

.totals { display: grid; gap: 0.4rem; }
.totals div { display: flex; justify-content: space-between; gap: 1rem; }
.totals dt { color: var(--dust); }
.totals .grand { padding-top: 0.6rem; margin-top: 0.3rem; border-top: 1px solid var(--rille); font-size: var(--step-1); font-weight: 600; }
.totals .grand dt { color: var(--bone); }

.sheet { margin: auto; width: min(38rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); background: var(--regolith); border: 1px solid var(--rille); border-radius: 14px; }
.sheet-inner { padding: 1.5rem clamp(1.25rem, 4vw, 2rem) 2rem; display: grid; gap: 1.25rem; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { font-size: var(--step-2); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 600; padding-bottom: 0.5rem; }
th, td { text-align: left; padding: 0.55rem 0.75rem 0.55rem 0; border-bottom: 1px solid var(--crater); }
thead th { color: var(--dust); font-weight: 500; font-size: var(--step--1); }

/* ---------- checkout ---------- */
.checkout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); padding-block: clamp(2rem, 5vw, 4rem) clamp(3rem, 7vw, 6rem); align-items: start; }
.checkout h1 { font-size: var(--step-3); margin-bottom: 2rem; }
.form-group { display: grid; gap: 1rem; padding-bottom: 2rem; }
.form-group legend { font: 600 var(--step-1)/1.25 var(--body); padding: 0 0 1rem; }
.row { display: grid; grid-template-columns: 2fr 1.1fr 1fr; gap: 0.75rem; }
.summary { position: sticky; top: 5.5rem; background: var(--regolith); border: 1px solid var(--crater); border-radius: 14px; padding: 1.5rem; }
.summary h2 { font: 600 var(--step-1)/1.25 var(--body); letter-spacing: 0; margin-bottom: 0.5rem; }
.summary .totals { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--rille); }
.notice { padding: 1rem 1.15rem; border-radius: 10px; background: var(--crater); border-left: 3px solid var(--earthshine); font-size: var(--step--1); }
.notice[data-tone='bad'] { border-left-color: var(--flare); }
.notice[hidden] { display: none; }
.notice + .notice, .notice + form { margin-top: 1.25rem; }

/* ---------- order status ---------- */
.order { max-width: 46rem; padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem); }
.order h1 { font-size: var(--step-3); }
.order-lede { margin-top: 1rem; font-size: var(--step-1); line-height: 1.4; color: var(--dust); max-width: var(--measure); }
.phases { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(3, 1fr); }
.phases li { display: grid; gap: 0.6rem; justify-items: start; padding-top: 1rem; border-top: 2px solid var(--rille); color: var(--dust); }
.phases li[data-done='true'] { border-top-color: var(--bone); color: var(--bone); }
.phases svg { width: 2.25rem; height: 2.25rem; }
.phases strong { font-weight: 600; }
.order-block { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--crater); display: grid; gap: 0.75rem; }
.order-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

/* ---------- admin ---------- */
.admin { padding-block: 2.5rem 5rem; }
.admin h1 { font-size: var(--step-3); }
.admin-gate { max-width: 26rem; display: grid; gap: 1rem; margin-top: 1.5rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-block: 1.75rem; }
.tab { padding: 0.5rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--rille); background: none; font-weight: 500; }
.tab[aria-selected='true'] { background: var(--bone); color: var(--void); border-color: var(--bone); }
.table-scroll { overflow-x: auto; }
.admin td { vertical-align: top; font-size: var(--step--1); }
.admin .input { min-height: 2.5rem; padding: 0.4rem 0.7rem; }
.admin .num { width: 5.5rem; }
.pill { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-weight: 600; font-size: 0.8rem; box-shadow: inset 0 0 0 1.5px var(--rille); white-space: nowrap; }
.pill[data-s='paid'] { background: var(--earthshine); color: var(--void); box-shadow: none; }
.pill[data-s='shipped'] { background: var(--bone); color: var(--void); box-shadow: none; }
.pill[data-s='cancelled'] { color: var(--dust); text-decoration: line-through; }
.pill[data-s='awaiting_payment'] { color: var(--flare); box-shadow: inset 0 0 0 1.5px var(--flare); }
.btn-sm { min-height: 2.25rem; padding: 0.3rem 0.9rem; font-size: var(--step--1); }
.stack { display: grid; gap: 0.5rem; justify-items: start; }
.stock-grid { display: grid; grid-template-columns: repeat(5, minmax(4rem, 1fr)); gap: 0.5rem; }
.stock-grid label { display: grid; gap: 0.2rem; font-size: 0.8rem; color: var(--dust); }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 50; padding: 0.7rem 1.2rem; border-radius: 999px; background: var(--bone); color: var(--void); font-weight: 600; font-size: var(--step--1); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.toast[data-tone='bad'] { background: var(--flare); }

.state { padding-block: 5rem; display: grid; gap: 1rem; justify-items: start; max-width: var(--measure); }
.state h1 { font-size: var(--step-3); }

/* ---------- responsive ---------- */
@media (max-width: 60rem) {
  .product, .checkout { grid-template-columns: 1fr; }
  .product-art, .summary { position: static; }
  .checkout .summary { order: -1; }
}
@media (max-width: 44rem) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .tile-meta { flex-direction: column; gap: 0.1rem; }
  .facts ul { grid-template-columns: 1fr; }
  .facts li + li { border-left: 0; border-top: 1px solid var(--crater); }
  .facts li { padding-block: 1rem; }
  .hero-moon { width: 19rem; right: -7.5rem; top: -1.5rem; }
  .hero .wrap { min-height: 31rem; }
  .brand img:last-child { display: none; }
  .row { grid-template-columns: 1fr 1fr; }
  .row .field:first-child { grid-column: 1 / -1; }
  .order-cols { grid-template-columns: 1fr; }
  .size-note { font-size: 0.68rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
