:root {
  --ink: #24130d;
  --muted: #76695f;
  --line: #ded2c5;
  --paper: #f4efe7;
  --panel: #ffffff;
  --accent: #8c5a2f;
  --accent-strong: #5b351f;
  --rose: #7a3f35;
  --gold: #d9a94e;
  --sky: #6e7168;
  --charcoal: #32302b;
  --shadow: 0 20px 60px rgba(36, 19, 13, .14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 54px);
  background: rgba(244, 239, 231, .94);
  border-bottom: 1px solid rgba(36, 19, 13, .1);
  backdrop-filter: blur(18px);
}

.brand,
.cart-button,
.nav {
  display: flex;
  align-items: center;
}

.brand {
  width: 138px;
  height: 50px;
}

.brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav {
  gap: clamp(12px, 3vw, 34px);
  color: var(--muted);
  font-weight: 600;
}

.nav a:hover,
.nav a.is-active {
  color: var(--ink);
}

.nav a.is-active {
  border-bottom: 2px solid var(--accent);
}

.page:not(.is-active) {
  display: none !important;
}

.page.is-active {
  display: block;
}

.hero.page.is-active {
  display: grid;
}

.cart-button,
.primary-button,
.primary-link,
.secondary-button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.cart-button {
  gap: 10px;
  padding: 10px 12px;
  color: #fff;
  background: var(--accent-strong);
  border-radius: 999px;
}

.cart-button strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  color: var(--ink);
  background: #fff;
  border-radius: 50%;
}

.hero {
  position: relative;
  min-height: calc(100vh - 72px);
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: clamp(44px, 8vw, 94px) clamp(18px, 4vw, 54px);
  background: #211711;
}

.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(24, 18, 14, .9), rgba(43, 28, 20, .62) 46%, rgba(43, 28, 20, .18));
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 76% 28%, rgba(217, 169, 78, .34), transparent 26%),
    linear-gradient(135deg, #4c3a31, #1f1b18 50%, #6d382f);
}

.hero-carousel {
  position: absolute;
  inset: 0 0 0 42%;
  overflow: hidden;
}

.hero-carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transform: scale(1.05);
  animation: heroSlide 35s infinite;
}

.hero-carousel img:nth-child(2) {
  animation-delay: 5s;
}

.hero-carousel img:nth-child(3) {
  animation-delay: 10s;
}

.hero-carousel img:nth-child(4) {
  animation-delay: 15s;
}

.hero-carousel img:nth-child(5) {
  animation-delay: 20s;
}

.hero-carousel img:nth-child(6) {
  animation-delay: 25s;
}

.hero-carousel img:nth-child(7) {
  animation-delay: 30s;
}

@keyframes heroSlide {
  0% {
    opacity: 0;
    transform: scale(1.05);
  }
  8%,
  24% {
    opacity: 1;
  }
  32%,
  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}

.object-preview {
  filter: drop-shadow(0 34px 38px rgba(0, 0, 0, .2));
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 660px;
  color: #fff;
}

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

.hero .eyebrow {
  color: #f1cf83;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  color: #fff8ee;
  font-size: clamp(3.2rem, 8vw, 7.5rem);
  line-height: .9;
  letter-spacing: 0;
  text-shadow: 0 18px 34px rgba(0, 0, 0, .34);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 560px;
  color: rgba(255, 255, 255, .84);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.hero-about {
  max-width: 650px;
  margin-top: clamp(46px, 9vh, 96px);
  margin-left: auto;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 248, 238, .22);
  text-align: right;
}

.hero-about h2 {
  margin-bottom: 10px;
  color: #f1cf83;
  font-size: 1.1rem;
  line-height: 1.2;
}

.hero-about p {
  margin-left: auto;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, .78);
  font-size: .98rem;
  line-height: 1.65;
}

.primary-link,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
  font-weight: 800;
}

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

.secondary-button {
  justify-self: start;
  min-height: 44px;
  padding: 0 16px;
  color: var(--accent-strong);
  background: #fff7ec;
  border: 1px solid #d9c3aa;
  border-radius: 6px;
  font-weight: 800;
}

.secondary-button:hover {
  background: #f3e4d2;
}

.section {
  padding: clamp(52px, 8vw, 96px) clamp(18px, 4vw, 54px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto 28px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  max-width: 760px;
  margin: auto;
}

.product-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-visual {
  display: grid;
  place-items: center;
  min-height: 180px;
  border-radius: 6px;
  background: #f7f2ea;
  overflow: hidden;
}

.product-photo {
  width: 100%;
  height: 300px;
  object-fit: contain;
  object-position: center;
  padding: 14px;
}

.fallback-line-art {
  position: relative;
  width: 190px;
  height: 230px;
}

.fallback-line-art::before,
.fallback-line-art::after,
.line-art-flower::before,
.line-art-flower::after {
  position: absolute;
  content: "";
  border: 3px solid var(--accent-strong);
  border-radius: 50%;
}

.fallback-line-art::before {
  left: 90px;
  top: 18px;
  width: 30px;
  height: 48px;
  transform: rotate(34deg);
}

.fallback-line-art::after {
  left: 50px;
  top: 46px;
  width: 28px;
  height: 44px;
  transform: rotate(-28deg);
}

.line-art-flower {
  position: absolute;
  left: 82px;
  top: 62px;
  width: 3px;
  height: 108px;
  background: var(--accent-strong);
  transform: rotate(-7deg);
}

.line-art-flower::before {
  left: 12px;
  top: -26px;
  width: 34px;
  height: 34px;
}

.line-art-flower::after {
  left: -48px;
  top: 18px;
  width: 34px;
  height: 34px;
}

.line-art-vase {
  position: absolute;
  left: 46px;
  bottom: 18px;
  width: 98px;
  height: 84px;
  border: 4px solid var(--accent-strong);
  border-top: 0;
  border-radius: 0 0 36px 36px;
}

.line-art-vase::before {
  position: absolute;
  left: 16px;
  top: -16px;
  width: 66px;
  height: 18px;
  content: "";
  border: 4px solid var(--accent-strong);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
}

.product-card h3 {
  margin-bottom: 6px;
}

.product-card p {
  color: var(--muted);
  line-height: 1.5;
}

.product-card button {
  justify-self: start;
}

.configurator-section {
  background: #e9dfd1;
}

.configurator,
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(320px, 1.05fr);
  gap: clamp(20px, 4vw, 44px);
  max-width: 1180px;
  margin: auto;
}

.preview-panel,
.custom-form,
.checkout-form,
.order-list,
.cart-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.preview-panel {
  display: grid;
  align-content: center;
  gap: 24px;
  min-height: 560px;
  padding: clamp(20px, 5vw, 44px);
}

.object-preview {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 1 / 1.15;
  margin: auto;
}

.preview-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  border-radius: 8px;
  background: #f8f3ec;
}

.selection-summary,
.total-line,
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.grand-total {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 1.15rem;
}

.selection-summary {
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
}

.custom-form,
.checkout-form {
  display: grid;
  gap: 22px;
  padding: clamp(18px, 4vw, 34px);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
.field span {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
}

.manual-fields {
  padding: 18px;
  background: #fff7ec;
  border: 1px solid #d9c3aa;
  border-radius: 8px;
}

.manual-fields legend {
  padding: 0 8px;
  color: var(--accent-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.1;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.segment {
  min-height: 46px;
  padding: 8px;
  color: var(--ink);
  background: #f8f3ec;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.segment.is-active {
  color: #fff;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.part-controls {
  display: grid;
  gap: 16px;
}

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

.part-row {
  display: grid;
  grid-template-columns: minmax(150px, .42fr) 1fr;
  gap: 14px;
  align-items: start;
}

.part-row strong {
  line-height: 1.25;
  padding-top: 6px;
  word-break: normal;
}

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

.swatch {
  width: 34px;
  height: 34px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}

.swatch.is-active {
  box-shadow: 0 0 0 3px var(--ink);
}

.field input,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  color: var(--ink);
  background: #fffaf3;
  border: 1px solid var(--line);
  border-radius: 6px;
  resize: vertical;
}

.checkout-layout {
  align-items: start;
}

.payment-box {
  padding: 16px;
  background: #fff7ec;
  border: 1px solid #d9c3aa;
  border-radius: 8px;
}

.payment-box h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.payment-box p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.45;
}

.payment-box strong {
  color: var(--ink);
}

.about-section {
  background: #fffaf3;
}

.about-content {
  max-width: 900px;
  margin: auto;
}

.about-content h2 {
  max-width: 820px;
  margin-bottom: 22px;
}

.about-content p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.8;
}

.order-list {
  min-height: 250px;
  padding: 10px;
}

.empty {
  margin: 0;
  padding: 20px;
  color: var(--muted);
}

.cart-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.cart-item:last-child {
  border-bottom: 0;
}

.cart-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.cart-meta {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}

.cart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.cart-actions button {
  min-width: 34px;
  min-height: 34px;
  color: var(--accent-strong);
  background: #fff7ec;
  border: 1px solid #d9c3aa;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.cart-actions button:last-child {
  padding: 0 12px;
}

.cart-actions span {
  min-width: 26px;
  text-align: center;
  font-weight: 800;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.cart-drawer.is-open {
  display: block;
}

.cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .35);
}

.cart-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(420px, calc(100vw - 24px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
  overflow: auto;
}

.cart-header h2 {
  font-size: 1.6rem;
}

.icon-button {
  width: 38px;
  height: 38px;
  color: var(--ink);
  background: #f4eadc;
  border-radius: 50%;
  font-weight: 800;
}

.full {
  width: 100%;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  transform: translateX(-50%) translateY(120px);
  max-width: min(92vw, 440px);
  padding: 14px 18px;
  color: #fff;
  background: var(--accent-strong);
  border-radius: 6px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: .25s ease;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.footer {
  padding: 28px clamp(18px, 4vw, 54px);
  color: #fff8ee;
  background: var(--accent-strong);
  text-align: center;
  font-weight: 800;
}

.footer a {
  color: #f1cf83;
}

@media (max-width: 860px) {
  .topbar {
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    min-height: 720px;
    align-items: end;
  }

  .hero::after {
    background: linear-gradient(180deg, rgba(24, 18, 14, .2), rgba(24, 18, 14, .92));
  }

  .hero-media {
    inset: 0;
  }

  .hero-carousel {
    inset: 0;
  }

  .section-heading,
  .configurator,
  .checkout-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .preview-panel {
    min-height: 430px;
  }

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

@media (max-width: 520px) {
  .cart-button span {
    display: none;
  }

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

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