:root {
  --bg: #070707;
  --panel: #111111;
  --panel-2: #171717;
  --panel-3: #202020;
  --text: #f5f2e9;
  --muted: #aaa49a;
  --gold: #d2aa55;
  --gold-soft: #ead18e;
  --border: rgba(255,255,255,.09);
  --gold-border: rgba(210,170,85,.32);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 88% 5%, rgba(210,170,85,.09), transparent 25%),
    var(--bg);
  color: var(--text);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 18px 130px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.brand-button {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: .08em;
  border-radius: 16px;
  background: linear-gradient(145deg, #141414, #0a0a0a);
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
}

h1 {
  margin: 0;
  font-size: clamp(18px, 4vw, 30px);
  line-height: 1.08;
}

h2, h3, p { text-wrap: balance; }

.icon-button {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}

.hero {
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 24px;
  overflow: hidden;
}

.hero-copy h2 {
  margin: 12px 0;
  font-size: clamp(34px, 6vw, 56px);
  line-height: .96;
  max-width: 640px;
}

.hero-copy p,
.screen-heading > p:last-child,
.screen-panel p:last-child,
.product-card p,
.material-card span,
.fit-summary p {
  color: var(--muted);
  line-height: 1.6;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--gold-border);
  color: var(--gold-soft);
  background: rgba(210,170,85,.08);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.btn {
  border-radius: 14px;
  padding: 13px 16px;
  border: 1px solid transparent;
  font-weight: 800;
}

.btn.primary {
  background: var(--gold);
  color: #0a0a0a;
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn.danger {
  background: transparent;
  color: #f1c9c9;
  border-color: rgba(255,120,120,.25);
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.product-visual-card {
  min-height: 290px;
  position: relative;
  display: grid;
  place-items: center;
}

.product-orbit {
  position: absolute;
  width: 82%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(210,170,85,.15);
}

.boot-placeholder {
  position: relative;
  width: min(100%, 260px);
  aspect-ratio: 1;
  border-radius: 32px;
  border: 1px solid rgba(210,170,85,.28);
  background:
    radial-gradient(circle at 30% 25%, rgba(210,170,85,.20), transparent 34%),
    linear-gradient(145deg, #191919, #0a0a0a);
  display: grid;
  place-items: center;
  text-align: center;
  transform: rotate(-3deg);
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}

.boot-label {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: .12em;
  color: var(--gold-soft);
}

.boot-placeholder small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  padding: 0 24px 20px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.feature-card {
  text-align: left;
  min-height: 156px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}

.feature-card:hover { border-color: rgba(210,170,85,.4); }

.feature-icon {
  display: block;
  color: var(--gold-soft);
  font-size: 22px;
  margin-bottom: 20px;
}

.feature-card strong,
.feature-card small { display: block; }

.feature-card small {
  color: var(--muted);
  line-height: 1.4;
  margin-top: 8px;
}

.screen-panel,
.fit-card,
.fit-summary {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel-2);
  padding: 24px;
}

.screen-panel h3 {
  margin: 8px 0;
  font-size: 24px;
}

.app-screen {
  padding-top: 8px;
  padding-bottom: 80px;
}

.screen-heading {
  margin-bottom: 22px;
  max-width: 760px;
}

.screen-heading h2 {
  font-size: clamp(34px, 6vw, 58px);
  line-height: .98;
  margin: 10px 0 12px;
}

.back-link {
  padding: 0;
  margin-bottom: 24px;
  border: 0;
  background: transparent;
  color: var(--gold-soft);
  font-weight: 800;
}

.fit-layout {
  display: grid;
  grid-template-columns: .72fr 1.28fr;
  gap: 16px;
}

.fit-summary {
  align-self: start;
  position: sticky;
  top: 18px;
}

.fit-summary h3 {
  font-size: 24px;
  margin: 20px 0 8px;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.07);
  margin-top: 18px;
}

#progress-bar {
  height: 100%;
  width: 20%;
  background: var(--gold);
  transition: width .25s ease;
}

.fit-card {
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.fit-question h3 {
  font-size: 28px;
  margin: 0 0 8px;
}

.fit-question > p {
  margin: 0 0 20px;
  color: var(--muted);
}

.option-grid { display: grid; gap: 10px; }

.option { position: relative; }

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option label {
  display: block;
  border: 1px solid var(--border);
  background: #101010;
  padding: 15px 16px;
  border-radius: 16px;
  transition: .2s ease;
}

.option input:checked + label {
  border-color: var(--gold);
  background: rgba(210,170,85,.10);
  color: var(--gold-soft);
}

.option label:hover { border-color: rgba(210,170,85,.45); }

.fit-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.result-card { display: grid; gap: 14px; padding-bottom: 28px; }

.result-score {
  font-size: 54px;
  font-weight: 900;
  line-height: 1;
  color: var(--gold-soft);
}

.result-list {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
}

.result-list div {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #101010;
}

.saved-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}

.saved-profile-title {
  font-size: clamp(34px, 7vw, 56px);
  margin: 12px 0 8px;
  color: var(--gold-soft);
}

.saved-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.empty-state {
  text-align: left;
}

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

.product-card,
.material-card {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 22px;
  padding: 18px;
}

.product-card h3 {
  margin: 14px 0 8px;
  font-size: 24px;
}

.product-card.featured { border-color: rgba(210,170,85,.27); }

.product-art {
  height: 220px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .12em;
}

.cognac-art {
  background:
    radial-gradient(circle at 32% 28%, rgba(255,205,150,.24), transparent 26%),
    linear-gradient(145deg, #6d4021, #1a100b 68%);
}

.black-art {
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,.09), transparent 26%),
    linear-gradient(145deg, #242424, #080808 68%);
}

.material-card strong,
.material-card span { display: block; }

.material-card strong {
  color: var(--gold-soft);
  margin-bottom: 8px;
}

.bottom-nav {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 28px), 650px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  background: rgba(12,12,12,.94);
  backdrop-filter: blur(16px);
  border-radius: 20px;
  z-index: 10;
}

.bottom-nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 14px;
  padding: 10px 8px;
  font-size: 12px;
}

.bottom-nav button.active {
  background: rgba(210,170,85,.13);
  color: var(--gold-soft);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  background: #f0d082;
  color: #0a0a0a;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 800;
  z-index: 20;
  box-shadow: 0 16px 44px rgba(0,0,0,.35);
}

@media (max-width: 760px) {
  .app-shell { padding-inline: 14px; }

  .hero,
  .fit-layout,
  .product-grid,
  .materials-grid {
    grid-template-columns: 1fr;
  }

  .hero { padding: 20px; }
  .product-visual-card { min-height: 220px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .fit-summary { position: static; }

  .screen-heading h2,
  .hero-copy h2 {
    font-size: clamp(36px, 11vw, 50px);
  }
}

@media (max-width: 440px) {
  .brand-copy h1 { font-size: 17px; }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .quick-grid { gap: 10px; }

  .feature-card {
    min-height: 150px;
    padding: 16px;
  }

  .fit-card,
  .fit-summary,
  .screen-panel {
    padding: 18px;
  }

  .fit-actions {
    position: sticky;
    bottom: 78px;
    background: linear-gradient(transparent, var(--panel-2) 30%);
    padding-top: 32px;
    padding-bottom: 6px;
  }

  .result-card { padding-bottom: 70px; }

  .saved-actions .btn {
    width: 100%;
  }
}
