:root {
  color-scheme: dark;
  --night: #101b18;
  --night-soft: #17241f;
  --forest: #20352c;
  --paper: #eee7d8;
  --paper-dim: #bcb7a9;
  --gold: #d2b875;
  --line: rgba(238, 231, 216, .17);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --page-pad: clamp(1.25rem, 6.5vw, 7rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.17'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
img { display: block; max-width: 100%; }
::selection { color: var(--night); background: var(--gold); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 50;
  top: 1rem;
  left: 1rem;
  padding: .75rem 1rem;
  transform: translateY(-200%);
  background: var(--paper);
  color: var(--night);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 5.7rem;
  padding: .8rem var(--page-pad);
  border-bottom: 1px solid var(--line);
}
.wordmark-name, .footer-brand { font: 1.85rem/.9 var(--serif); letter-spacing: -.06em; }
.eyebrow, .site-footer > span {
  color: var(--paper-dim);
  font-size: .62rem;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.main-nav { display: flex; gap: clamp(1.5rem, 4vw, 3.5rem); color: var(--paper-dim); font-size: .78rem; }
.main-nav a:hover, .site-footer a:hover { color: var(--gold); }
.cart-trigger {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem 0 .6rem .7rem;
  border: 0;
  background: transparent;
  font-size: .78rem;
}
.cart-count {
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: .67rem;
}

.eyebrow { display: flex; align-items: center; gap: .7rem; margin: 0 0 1.55rem; color: var(--gold); }
.eyebrow > span { width: 1.8rem; height: 1px; background: var(--gold); }
h1, h2, p { margin-top: 0; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: 3.15rem;
  padding: .75rem 1.15rem;
  border: 1px solid transparent;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
  font-size: .76rem;
  font-weight: 600;
}
.button-gold { background: var(--gold); color: var(--night); }
.button-gold:hover:not(:disabled) { background: var(--paper); }
.button:disabled { cursor: not-allowed; opacity: .45; }

.catalog-section { padding: clamp(2.5rem, 5vw, 4rem) var(--page-pad) clamp(4rem, 7vw, 6rem); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.section-heading .eyebrow { margin-bottom: .7rem; }
.section-heading h1, .modal h2 { margin-bottom: 0; font: clamp(2.5rem, 5vw, 4.15rem)/1.05 var(--serif); font-weight: 400; letter-spacing: -.045em; }
.catalog-notice { display: flex; align-items: flex-start; gap: .8rem; margin: 0 0 2.5rem; padding: 1rem 1.1rem; border: 1px solid rgba(210, 184, 117, .34); background: rgba(210, 184, 117, .055); }
.catalog-notice[hidden], .cart-items[hidden] { display: none; }
.notice-mark { display: grid; flex: 0 0 1.2rem; height: 1.2rem; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font: .75rem var(--serif); }
.catalog-notice p { margin: 0; color: var(--paper-dim); font-size: .75rem; line-height: 1.65; }
.catalog-notice strong { color: var(--paper); font-weight: 500; }
.catalog-controls { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; }
.filter-list { display: flex; flex-wrap: wrap; gap: .45rem; }
.filter-button { padding: .65rem .85rem; border: 1px solid var(--line); background: transparent; color: var(--paper-dim); font-size: .7rem; transition: .2s ease; }
.filter-button:hover, .filter-button.is-active { border-color: var(--gold); color: var(--gold); }
.search-field { display: flex; align-items: center; gap: .55rem; min-width: 12rem; border-bottom: 1px solid var(--line); color: var(--gold); }
.search-field input { width: 100%; padding: .65rem 0; border: 0; background: transparent; color: var(--paper); font-size: .74rem; }
.search-field input:focus { outline: none; }
.search-field:focus-within { border-color: var(--gold); }
.search-field input::placeholder { color: var(--paper-dim); }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.2vw, 2rem); }
.product-card { min-width: 0; }
.product-art { position: relative; display: block; width: 100%; aspect-ratio: .87; overflow: hidden; background: var(--night-soft); }
.product-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 36%; filter: saturate(.77); transition: transform .65s cubic-bezier(.2,.65,.2,1); }
.product-card:hover .product-art img { transform: scale(1.045); }
.product-type { position: absolute; top: .85rem; left: .85rem; padding: .45rem .6rem; background: rgba(16, 27, 24, .85); color: var(--gold); font-size: .57rem; letter-spacing: .11em; text-transform: uppercase; }
.product-details { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: .8rem; padding: 1.05rem 0 .9rem; }
.product-category { display: block; margin-bottom: .45rem; color: var(--paper-dim); font-size: .56rem; letter-spacing: .12em; text-transform: uppercase; }
.product-name { margin: 0; font: 1.45rem/1.1 var(--serif); font-weight: 400; }
.product-description { margin: .65rem 0 0; color: var(--paper-dim); font-size: .7rem; line-height: 1.65; }
.product-price { padding-top: .1rem; color: var(--gold); font: 1.05rem var(--serif); white-space: nowrap; }
.add-button { width: 100%; padding: .75rem .85rem; border: 1px solid var(--line); background: transparent; text-align: left; font-size: .72rem; transition: .2s ease; }
.add-button span { float: right; color: var(--gold); }
.add-button:hover { border-color: var(--gold); background: rgba(210, 184, 117, .06); }
.empty-state { padding: 3rem 0; color: var(--paper-dim); text-align: center; }

.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 2rem var(--page-pad); }
.footer-brand { color: var(--paper); }
.site-footer p, .site-footer a:not(.footer-brand) { margin: 0; color: var(--paper-dim); font-size: .68rem; }
.site-footer > span { font-size: .52rem; }

.modal {
  width: min(100% - 1rem, 36rem);
  max-height: min(88svh, 55rem);
  padding: clamp(1.3rem, 4vw, 2.2rem);
  border: 1px solid rgba(210, 184, 117, .38);
  background: var(--night-soft);
  color: var(--paper);
  box-shadow: 0 2rem 7rem rgba(0, 0, 0, .55);
}
.modal::backdrop { background: rgba(4, 9, 7, .78); backdrop-filter: blur(5px); }
.modal-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding-bottom: 1.35rem; border-bottom: 1px solid var(--line); }
.modal-heading .eyebrow { margin-bottom: .65rem; }
.modal h2 { font-size: 2.5rem; }
.icon-button { display: grid; width: 2.3rem; height: 2.3rem; place-items: center; border: 1px solid var(--line); background: transparent; color: var(--paper); font-size: 1.35rem; }
.icon-button:hover { border-color: var(--gold); color: var(--gold); }
.cart-items { display: grid; gap: 1rem; padding-top: 1.35rem; }
.cart-row { display: grid; grid-template-columns: 4rem 1fr auto; align-items: center; gap: .9rem; }
.cart-row img { width: 4rem; aspect-ratio: .9; object-fit: cover; }
.cart-row h3 { margin: 0 0 .3rem; font: 1.1rem var(--serif); font-weight: 400; }
.cart-row p { margin: 0; color: var(--paper-dim); font-size: .7rem; }
.quantity-controls { display: flex; align-items: center; gap: .6rem; margin-top: .65rem; }
.quantity-controls button { width: 1.65rem; height: 1.65rem; border: 1px solid var(--line); background: transparent; }
.quantity-controls button:hover { border-color: var(--gold); color: var(--gold); }
.quantity-controls span { min-width: 1.2rem; text-align: center; font-size: .72rem; }
.remove-button { padding: .25rem; border: 0; background: transparent; color: var(--paper-dim); font-size: .67rem; }
.remove-button:hover { color: var(--gold); }
.cart-empty { padding: 2rem 0 1rem; color: var(--paper-dim); font-size: .85rem; line-height: 1.7; }
.cart-summary { display: flex; justify-content: space-between; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .82rem; }
.cart-summary strong { color: var(--gold); font-weight: 500; }
.shipping-region-field { margin-top: 1.2rem; }
.form-field select { width: 100%; padding: .75rem; border: 1px solid var(--line); border-radius: 0; background: var(--night); color: var(--paper); }
.order-total-summary { font-weight: 700; }
.cart-disclaimer, .checkout-note { margin: .65rem 0 1.35rem; color: var(--paper-dim); font-size: .7rem; line-height: 1.7; }
.checkout-trigger, .checkout-submit { width: 100%; margin-top: .8rem; }
.checkout-note { margin-top: 1.25rem; }
.checkout-modal form { display: grid; gap: 1rem; }
.form-field { display: grid; gap: .45rem; color: var(--paper-dim); font-size: .72rem; }
.form-field input, .form-field textarea { width: 100%; padding: .75rem; border: 1px solid var(--line); border-radius: 0; background: var(--night); color: var(--paper); resize: vertical; }
.form-field input:focus, .form-field textarea:focus { border-color: var(--gold); outline: none; }
.form-feedback { min-height: 0; margin: 0; color: var(--gold); font-size: .74rem; line-height: 1.6; }
.form-feedback:not(:empty) { padding: .8rem; border: 1px solid rgba(210, 184, 117, .38); }
.form-feedback.is-error { border-color: rgba(232, 125, 112, .55); color: #f0aaa0; }
.consent-field { display: flex; align-items: flex-start; gap: .65rem; color: var(--paper-dim); font-size: .7rem; line-height: 1.6; }
.consent-field input { flex: 0 0 auto; margin: .18rem 0 0; accent-color: var(--gold); }

.admin-page { min-height: 100vh; }
.admin-main { width: min(100% - 2 * var(--page-pad), 90rem); margin: 0 auto; padding: clamp(3rem, 7vw, 6rem) 0; }
.admin-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; }
.admin-header .eyebrow { margin-bottom: .8rem; }
.admin-header h1 { margin: 0; font: clamp(2.5rem, 5vw, 4.2rem)/1.05 var(--serif); font-weight: 400; letter-spacing: -.045em; }
.admin-description { max-width: 40rem; margin: .8rem 0 0; color: var(--paper-dim); font-size: .8rem; line-height: 1.7; }
.admin-panel { padding: clamp(1rem, 3vw, 2rem); border: 1px solid var(--line); background: var(--night-soft); }
.admin-login { width: min(100%, 28rem); margin: 2rem auto; }
.admin-login h2 { margin: 0 0 1.2rem; font: 1.8rem var(--serif); font-weight: 400; }
.admin-login form { display: grid; gap: 1rem; }
.admin-status { min-height: 1.4rem; margin: 0; color: var(--paper-dim); font-size: .76rem; line-height: 1.6; }
.admin-status.is-error { color: #f0aaa0; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.5rem 0; }
.admin-toolbar > div { display: flex; align-items: center; gap: .75rem; }
.admin-search { min-width: min(20rem, 52vw); padding: .7rem; border: 1px solid var(--line); background: var(--night); }
.admin-toolbar > .form-field { min-width: 11rem; }
.admin-toolbar select.admin-search { color: var(--paper); }
.order-action { white-space: nowrap; }
.admin-search:focus { border-color: var(--gold); outline: none; }
.admin-button { min-height: 2.6rem; padding: .55rem .85rem; border: 1px solid var(--line); background: transparent; color: var(--paper); font-size: .72rem; }
.admin-button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.admin-button:disabled { cursor: not-allowed; opacity: .45; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .73rem; }
.admin-table th, .admin-table td { max-width: 19rem; padding: .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th { color: var(--gold); font-weight: 500; white-space: nowrap; }
.admin-table td { color: var(--paper-dim); overflow-wrap: anywhere; line-height: 1.55; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; color: var(--paper-dim); font-size: .72rem; }
.admin-pagination { display: flex; gap: .5rem; }
.admin-empty { padding: 2rem 1rem; color: var(--paper-dim); text-align: center; }
@media (max-width: 650px) {
  .admin-header, .admin-toolbar { align-items: stretch; flex-direction: column; }
  .admin-toolbar > div { justify-content: space-between; }
  .admin-search { min-width: 0; width: 100%; }
  .admin-footer { align-items: flex-start; flex-direction: column; }
}
@media (min-width: 1500px) {
  :root { --page-pad: max(7rem, calc((100vw - 1300px) / 2)); }
}
@media (max-width: 800px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  :root { --page-pad: 1.2rem; }
  .site-header { min-height: 4.7rem; }
  .wordmark-name { font-size: 1.55rem; }
  .catalog-controls { align-items: stretch; flex-direction: column-reverse; gap: 1rem; }
  .filter-list { gap: .35rem; }
  .filter-button { padding: .57rem .65rem; font-size: .63rem; }
  .search-field { width: 100%; }
  .product-grid { grid-template-columns: 1fr; gap: 2rem; }
  .product-art { aspect-ratio: 1.03; }
  .product-name { font-size: 1.55rem; }
  .site-footer { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .site-footer > span { justify-self: end; align-self: center; }
  .cart-row { grid-template-columns: 3.4rem 1fr auto; gap: .65rem; }
  .cart-row img { width: 3.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
