:root {
  color-scheme: light;
  --ink: #171615;
  --muted: #69625b;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --line: #ded8cf;
  --accent: #c62f29;
  --accent-dark: #9f211d;
  --gold: #f1b445;
  --mint: #1f9d83;
  --shadow: 0 18px 45px rgba(30, 25, 20, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(251, 250, 247, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand small {
  color: var(--muted);
  font-size: 0.79rem;
}

nav {
  display: flex;
  gap: 8px;
}

nav a,
.primary-link,
.ghost-button,
.add-button,
.submit-button,
.admin-product-row {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

nav a {
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  color: var(--ink);
}

nav a:hover {
  background: #eee8df;
}

.hero {
  display: grid;
  min-height: calc(100vh - 76px);
  grid-template-columns: minmax(0, 0.78fr) minmax(300px, 1fr);
  align-items: center;
  gap: clamp(22px, 5vw, 72px);
  padding: clamp(44px, 8vw, 92px) clamp(18px, 4vw, 56px) 34px;
  background:
    linear-gradient(110deg, rgba(251, 250, 247, 0.96) 0%, rgba(251, 250, 247, 0.86) 48%, rgba(248, 224, 174, 0.62) 100%),
    url("assets/workbench-texture.svg");
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  max-width: 650px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 10ch;
  margin-bottom: 16px;
  font-size: clamp(3.8rem, 11vw, 9rem);
  line-height: 0.88;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.hero p:not(.eyebrow) {
  max-width: 54ch;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.6;
}

.primary-link,
.submit-button {
  display: inline-grid;
  place-items: center;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.primary-link:hover,
.submit-button:hover {
  background: var(--accent-dark);
}

.hero-media {
  min-width: 0;
}

.hero-video {
  display: block;
  width: min(430px, 100%);
  aspect-ratio: 9 / 16;
  margin-inline: auto;
  border: 1px solid rgba(23, 22, 21, 0.15);
  border-radius: 8px;
  background: #d9e7f7;
  box-shadow: 0 32px 50px rgba(44, 28, 12, 0.22);
  object-fit: cover;
}

.section-heading {
  padding: 64px clamp(18px, 4vw, 56px) 18px;
}

.section-heading.compact {
  padding: 0 0 24px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 0 clamp(18px, 4vw, 56px) 70px;
}

.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.product-photo-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #e8e3da;
}

.product-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stock-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(23, 22, 21, 0.86);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.product-content {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.product-description,
.available,
.color-stock {
  color: var(--muted);
  line-height: 1.45;
}

.color-stock {
  margin: -8px 0 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.product-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.price {
  font-size: 1.2rem;
}

.colors {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.colors legend,
.quantity-row span,
.order-form span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.color-option input {
  position: absolute;
  opacity: 0;
}

.color-option:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.color-option.sold-out {
  opacity: 0.48;
  cursor: not-allowed;
}

.swatch {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

.quantity-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
}

.quantity-row label,
.order-form label {
  display: grid;
}

.quantity-input,
.order-form input,
.order-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.quantity-input,
.order-form input {
  min-height: 44px;
  padding: 0 12px;
}

.order-form textarea {
  resize: vertical;
  padding: 12px;
}

.admin-page {
  background: #eee8df;
}

.admin-shell {
  padding: 52px clamp(18px, 4vw, 56px);
}

.admin-hero {
  margin-bottom: 24px;
}

.admin-hero h1 {
  margin-bottom: 0;
  font-size: clamp(2.8rem, 8vw, 5.8rem);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.admin-login {
  grid-column: 1 / -1;
  max-width: 520px;
}

.admin-card h2 {
  margin-bottom: 16px;
  font-size: 1.35rem;
  line-height: 1.1;
}

.admin-login,
.admin-form {
  display: grid;
  gap: 16px;
}

.admin-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-fields .wide {
  grid-column: 1 / -1;
}

.admin-form label,
.admin-login label {
  display: grid;
}

.admin-form span,
.admin-login span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-form input,
.admin-form textarea,
.admin-login input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.admin-form input,
.admin-login input {
  min-height: 44px;
  padding: 0 12px;
}

.admin-form input[readonly] {
  background: #f4f1ec;
  color: var(--muted);
}

.admin-form textarea {
  resize: vertical;
  padding: 12px;
}

.color-editor > .panel-title-row {
  margin-bottom: 10px;
}

.color-editor > .panel-title-row > span {
  margin: 0;
}

.admin-color-list {
  display: grid;
  gap: 10px;
}

.admin-color-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 92px 120px auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f4ef;
}

.admin-color-row input[type="color"] {
  height: 44px;
  padding: 4px;
}

.photo-uploader > span {
  display: block;
}

.photo-upload-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  align-items: center;
}

.photo-upload-grid img {
  width: 180px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8e3da;
  object-fit: cover;
}

.file-picker {
  display: inline-grid;
  min-height: 44px;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f1ec;
  cursor: pointer;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker span {
  margin: 0;
  color: var(--ink);
}

.photo-upload-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ghost-button.danger {
  color: var(--accent);
}

.admin-product-list {
  display: grid;
  gap: 10px;
}

.admin-product-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 8px;
  background: #f7f4ef;
  color: var(--ink);
  text-align: left;
}

.admin-product-row.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.admin-product-row img {
  width: 64px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  background: #e8e3da;
}

.admin-product-row strong,
.admin-product-row small {
  display: block;
}

.admin-product-row small {
  color: var(--muted);
  margin-top: 4px;
}

.add-button {
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.add-button:hover {
  background: #393532;
}

.order-shell {
  padding: 64px clamp(18px, 4vw, 56px);
  background: #eee8df;
  border-top: 1px solid var(--line);
}

.order-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: start;
}

.cart-panel,
.order-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.cart-panel {
  padding: 18px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title-row h3 {
  margin: 0;
}

.ghost-button {
  padding: 0 12px;
  background: #f4f1ec;
  color: var(--ink);
}

.cart-lines {
  display: grid;
  gap: 10px;
  min-height: 80px;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cart-line p {
  margin: 0;
}

.cart-line small {
  color: var(--muted);
}

.remove-line {
  align-self: start;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 900;
}

.empty-cart {
  margin: 0;
  color: var(--muted);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 1.2rem;
}

.order-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.form-status {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.form-status.success {
  color: var(--mint);
}

.form-status.error {
  color: var(--accent);
}

@media (max-width: 900px) {
  .hero,
  .order-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-copy {
    max-width: none;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .quantity-row {
    grid-template-columns: 1fr;
  }

  .admin-fields {
    grid-template-columns: 1fr;
  }

  .admin-color-row {
    grid-template-columns: 1fr;
  }

  .photo-upload-grid {
    grid-template-columns: 1fr;
  }

  .photo-upload-grid img {
    width: 100%;
  }
}
