:root {
  --bg: #efede8;
  --card: #f8f7f3;
  --ink: #111111;
  --ink-soft: #464646;
  --line: #d5d3cd;
  --warm: #f0ba7d;
  --cool: #f6f9ff;
  --shadow: 0 14px 36px rgba(15, 15, 15, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  background: radial-gradient(circle at top left, #f7f6f2 0%, var(--bg) 46%, #e9e7e1 100%);
  color: var(--ink);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 247, 243, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 1rem clamp(1rem, 3vw, 2rem);
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.brand-block {
  display: grid;
  gap: 0.2rem;
}

.brand {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 600;
}

.tag {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.9rem;
  transition: color 180ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
}

.page-grid {
  width: min(1160px, calc(100% - 2rem));
  margin: 1.8rem auto 4rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 2.6vw, 1.8rem);
}

.intro-card {
  grid-column: span 12;
  background: linear-gradient(160deg, #f9f8f4 0%, #f1efe9 100%);
}

h1,
h2 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  max-width: 18ch;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

p {
  margin: 0;
  line-height: 1.45;
  color: var(--ink-soft);
}

strong {
  color: var(--ink);
}

.section-head {
  display: grid;
  gap: 0.45rem;
}

.demo-card {
  grid-column: span 7;
  display: grid;
  gap: 1rem;
}

.scene-shell {
  position: relative;
  height: min(58vw, 510px);
  min-height: 320px;
  background: linear-gradient(180deg, #88857e 0%, #7f7b74 100%);
  border: 1px solid #767269;
  border-radius: 14px;
  overflow: hidden;
}

#lock-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.scene-status {
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.8rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  background: rgba(248, 247, 243, 0.92);
  font-size: 0.82rem;
  color: var(--ink);
}

.demo-controls {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
#payment-button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #f8f7f3;
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

button:hover,
button:focus-visible,
#payment-button:hover,
#payment-button:focus-visible {
  background: #2a2a2a;
}

.ghost-button {
  background: transparent;
  color: var(--ink);
}

.ghost-button:hover,
.ghost-button:focus-visible {
  background: #eceae3;
}

.light-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
}

.light-toggle::after {
  content: "";
  position: absolute;
  inset: -20%;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: pulse 2.8s ease-in-out infinite;
  pointer-events: none;
}

.toggle-core {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: var(--cool);
  border: 1px solid rgba(17, 17, 17, 0.2);
  box-shadow: 0 0 0.45rem rgba(246, 249, 255, 0.95);
}

.light-toggle[data-mode="warm"] .toggle-core {
  background: var(--warm);
  box-shadow: 0 0 0.75rem rgba(240, 186, 125, 0.82);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.15;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.35;
    transform: scale(1.02);
  }
}

.catalog-card {
  grid-column: span 5;
  display: grid;
  gap: 0.75rem;
}

.search-label {
  font-size: 0.84rem;
  color: var(--ink-soft);
}

input,
select,
textarea {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 0.62rem 0.65rem;
}

.scroll-panel {
  max-height: 470px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-y: auto;
  background: #fbfaf7;
}

.theme-list {
  list-style: none;
  margin: 0;
  padding: 0.55rem;
  display: grid;
  gap: 0.45rem;
}

.theme-item {
  border: 1px solid #d8d6cf;
  background: #fff;
  border-radius: 10px;
  padding: 0.65rem;
  display: grid;
  gap: 0.45rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.theme-item.selected {
  border-color: #111111;
  box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.1);
}

.theme-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.theme-title {
  margin: 0;
  color: var(--ink);
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 1.14rem;
}

.theme-description {
  margin: 0;
  font-size: 0.88rem;
}

.theme-preview-hint {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4d4a43;
}

.theme-price {
  color: var(--ink);
  font-size: 0.9rem;
  white-space: nowrap;
}

.designer-card,
.checkout-card {
  grid-column: span 6;
  display: grid;
  gap: 0.95rem;
}

.designer-toolbar {
  display: grid;
  grid-template-columns: auto minmax(120px, 220px) auto auto;
  align-items: center;
  gap: 0.5rem;
}

.designer-shell {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.5rem;
}

#faceplate-designer {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  border: 1px dashed #c9c6bf;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

#saved-svg-output {
  min-height: 160px;
  resize: vertical;
}

#designer-status {
  min-height: 1.2rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

#checkout-form {
  display: grid;
  gap: 0.95rem;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 0.55rem 0.8rem;
  align-items: end;
  border: 1px solid var(--line);
  padding: 0.75rem;
  border-radius: 10px;
}

.price-line {
  margin: 0;
  color: var(--ink);
  font-size: 0.94rem;
}

.total-line {
  font-weight: 700;
}

.customer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.8rem;
}

#checkout-status {
  min-height: 1.2rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.site-footer {
  padding: 1.5rem 1rem 3rem;
  text-align: center;
  color: #666;
  font-size: 0.88rem;
}

@media (max-width: 980px) {
  .demo-card,
  .catalog-card,
  .designer-card,
  .checkout-card {
    grid-column: span 12;
  }

  .scene-shell {
    height: min(76vw, 480px);
  }

  .designer-toolbar {
    grid-template-columns: auto 1fr;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: start;
    flex-direction: column;
  }

  .customer-grid,
  .checkout-grid {
    grid-template-columns: 1fr;
  }
}
