:root {
  --bg: #f5f2ed;
  --bg-2: #ffffff;
  --bg-3: #efeae3;
  --ink: #1c1917;
  --muted: #5e5852;
  --quiet: #8a847c;
  --line: #e4ddd4;
  --gold: #6b3e2e;
  --gold-2: #8d4b2b;
  --leather: #6b3e2e;
  --oxblood: #6a2430;
  --danger: #b42318;
  --shadow: 0 10px 30px rgba(28, 25, 23, 0.06);
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Figtree", "Segoe UI", sans-serif;
  --header: 68px;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.page { display: none; position: relative; z-index: 1; }
.page.active { display: block; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 40px;
  background: rgba(245, 242, 237, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  cursor: pointer;
}
.brand-mark {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.2em;
}
.brand-sub {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.nav button {
  background: transparent;
  border: 0;
  color: var(--quiet);
  padding: 8px 12px;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 11px;
}
.nav button.active,
.nav button:hover { color: var(--ink); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ghost, .gold, .icon-btn {
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
}
.gold {
  background: var(--ink);
  color: #f5f2ed;
  border-color: var(--ink);
  font-weight: 600;
}
.ghost:hover, .icon-btn:hover { border-color: var(--ink); }
.icon-btn { padding: 10px 12px; min-width: 42px; }

.user-chip {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg-2);
}
.user-chip img, .user-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.user-fallback {
  display: grid;
  place-items: center;
  background: var(--leather);
  color: #fff;
  font-size: 12px;
}
.user-chip span { font-size: 13px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 48px 40px 24px;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 560px;
}
.eyebrow {
  color: var(--gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 11px;
  margin-bottom: 14px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; }
h1 {
  font-size: clamp(40px, 5.5vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
h1 em { font-style: italic; color: var(--gold); }
.lede {
  margin: 20px 0 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 46ch;
}
.hero-actions, .row { display: flex; gap: 10px; flex-wrap: wrap; }
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.stats b { display: block; font-family: var(--serif); font-size: 24px; }
.stats span { color: var(--quiet); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

.hero-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 460px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.hero-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 460px;
}
.hero-frame figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: end;
  background: linear-gradient(transparent, rgba(28, 25, 23, 0.72));
  color: #f5f2ed;
  margin: 0;
  padding: 64px 24px 20px;
}
.price-tag {
  font-family: var(--serif);
  font-size: 28px;
}
.badge {
  border: 1px solid rgba(245, 242, 237, 0.45);
  padding: 5px 8px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section {
  padding: 48px 40px 72px;
  max-width: 1280px;
  margin: 0 auto;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 24px;
}
.section-head p { color: var(--muted); max-width: 46ch; line-height: 1.5; margin: 0; }
h2 { font-size: clamp(28px, 3.4vw, 40px); }

.catalog-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 24px;
}
.catalog-bar input[type="search"] {
  flex: 1;
  min-width: 200px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.catalog-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.catalog-filters button {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--muted);
}
.catalog-filters button.on {
  background: var(--ink);
  color: #f5f2ed;
  border-color: var(--ink);
}
.catalog-count {
  margin-left: auto;
  color: var(--quiet);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.home-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--ink); }
.card-media {
  position: relative;
  height: 220px;
  background: var(--bg-3);
}
.card-photo {
  height: 220px;
  width: 100%;
  object-fit: cover;
  background: var(--bg-3);
}
.card-flat, .product-flat {
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--bg);
}
.card-flat[hidden], .product-flat[hidden], .card-photo[hidden], #productImage[hidden] { display: none; }
.flat-svg { width: auto; height: 92%; max-width: 100%; }
.view-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.view-tabs button {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 8px 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--quiet);
}
.view-tabs button:last-child { border-right: 0; }
.view-tabs button.on { color: var(--ink); font-weight: 600; background: var(--bg); }
.card-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.card-body h3 { font-size: 22px; }
.card-body p { display: none; }
.card-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; }
.tag { color: var(--quiet); letter-spacing: 0.12em; text-transform: uppercase; font-size: 10px; }

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: start;
}

.studio {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.player {
  position: relative;
  background: #1c1917;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}
#measureCanvas { width: 100%; height: 100%; display: block; }
#measureFilm {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #1c1917;
}
.player-ui {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: #f5f2ed;
}
.progress {
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 99px;
  cursor: pointer;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: #f5f2ed;
  border-radius: 99px;
}
.caption {
  margin-top: 14px;
  color: var(--muted);
  min-height: 3.2em;
  line-height: 1.5;
}
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.steps button {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--quiet);
}
.steps button.on { color: #f5f2ed; background: var(--ink); border-color: var(--ink); }

.measure-form {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.measure-form h2 { font-size: 32px; margin-bottom: 6px; }
.unit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 18px;
  color: var(--quiet);
}
.seg {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  background: transparent;
  border: 0;
  padding: 7px 12px;
  cursor: pointer;
  color: var(--muted);
}
.seg button.on { background: var(--ink); color: #f5f2ed; font-weight: 600; }

.field { margin-bottom: 12px; }
.field.live {
  padding: 8px 10px;
  margin-left: -10px;
  margin-right: -10px;
  border-radius: 10px;
  background: rgba(107, 62, 46, 0.08);
  outline: 1px solid rgba(107, 62, 46, 0.35);
}
.field.live input { border-color: var(--gold); }
.field label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.field label small { color: var(--quiet); font-size: 11px; }
.field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
}
.field input:focus { outline: 1px solid var(--ink); }
.form-note { color: var(--quiet); font-size: 12px; margin: 8px 0 16px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.tryon-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}
.stage {
  background: #1c1917;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  min-height: 560px;
  position: relative;
  overflow: hidden;
}
#tryonVideo, #tryonCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#tryonCanvas { z-index: 2; cursor: grab; }
#tryonCanvas.dragging { cursor: grabbing; }
.stage-guide {
  position: absolute;
  inset: 40px;
  border: 1px dashed rgba(245,242,237,0.28);
  border-radius: 40% 40% 32% 32%;
  z-index: 3;
  pointer-events: none;
}
.stage-hint {
  position: absolute;
  z-index: 4;
  left: 18px;
  bottom: 18px;
  color: #f5f2ed;
  font-size: 13px;
  background: rgba(0,0,0,0.45);
  padding: 8px 12px;
  border-radius: 8px;
}

.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.jacket-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 18px; }
.jacket-pick {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  text-align: left;
}
.jacket-pick.on { border-color: var(--ink); }
.swatch {
  height: 42px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.control { margin: 14px 0; }
.control label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--ink); }
.hidden-file { display: none; }

.product-view {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  padding: 36px 40px 72px;
  max-width: 1280px;
  margin: 0 auto;
}
.product-gallery { display: flex; flex-direction: column; gap: 12px; }
.product-stage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
  min-height: 62vh;
}
.product-stage img {
  width: 100%;
  height: 62vh;
  object-fit: cover;
  background: var(--bg-3);
}
.product-flat { min-height: 62vh; }
.product-flat .flat-svg { height: 58vh; }
#productThumbs.view-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px 10px !important;
}
.thumb img, .thumb .flat-svg {
  height: 64px;
  width: 48px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg);
}
.thumb .flat-svg { width: 40px; height: 56px; }
.angle-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.angle-row b { color: var(--ink); font-weight: 600; }
.product-copy h1 { font-size: clamp(36px, 4.5vw, 56px); }
.product-copy .lede { margin-top: 16px; }
.specs { margin: 24px 0; display: grid; gap: 10px; }
.specs div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  color: var(--muted);
}
.specs b { color: var(--ink); }

.account-wrap, .cart-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}
.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}
.account-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.account-card.wide { grid-column: 1 / -1; }
.account-card h3 {
  font-family: var(--serif);
  font-size: 26px;
  margin: 0 0 6px;
}
.tape-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.tape-table th, .tape-table td {
  text-align: left;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.tape-table td { text-align: right; color: var(--ink); }
.fields-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field select, .field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
}
.field textarea { min-height: 88px; resize: vertical; }
.field select:focus, .field textarea:focus { outline: 1px solid var(--ink); }
.orders { display: grid; gap: 10px; margin-top: 16px; }
.order, .cart-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.order-full { align-items: flex-start; }
.order-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.status-pill {
  display: inline-block;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 20px;
}
.modal-back.open { display: flex; }
.modal {
  width: min(440px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.modal h2 { font-size: 32px; margin-bottom: 8px; }
.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  margin: 18px 0 10px;
}
.google-btn svg { width: 18px; height: 18px; }
#googleButton { min-height: 44px; display: flex; justify-content: center; margin: 8px 0 12px; }
.or {
  text-align: center;
  color: var(--quiet);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 12px 0;
}
.config-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0 14px;
}
.auth-code {
  font-size: 28px;
  letter-spacing: 0.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.modal .gold { margin-top: 8px; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #f5f2ed;
  padding: 12px 18px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 90;
  font-weight: 600;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

footer {
  border-top: 1px solid var(--line);
  padding: 24px 40px 36px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--quiet);
  position: relative;
  z-index: 1;
  font-size: 13px;
  max-width: 1280px;
  margin: 0 auto;
}

.empty { color: var(--quiet); padding: 24px 0; }

@media (max-width: 1100px) {
  .catalog-grid, .home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .hero, .split, .tryon-layout, .product-view, .account-grid, .fields-2 {
    grid-template-columns: 1fr;
  }
  .catalog-grid, .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-header { flex-wrap: wrap; padding: 12px 16px; }
  .nav { order: 3; width: 100%; justify-content: flex-start; }
  .hero, .section, .product-view, .account-wrap, .cart-wrap { padding-left: 16px; padding-right: 16px; }
  .hero-frame, .hero-frame img { min-height: 320px; }
  .catalog-count { margin-left: 0; width: 100%; }
}

/* ---- Policy pages (privacy / terms / shipping / contact) ---- */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px;
  border-bottom: 1px solid rgba(28, 25, 23, 0.08);
}

.site-head .brand-mark {
  font-family: Georgia, serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
}

.site-head nav a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-head nav a:hover {
  color: var(--ink);
  border-bottom-color: currentColor;
}

.policy {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 28px 84px;
  line-height: 1.72;
}

.policy h1 {
  font-family: Georgia, serif;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.15;
  margin: 10px 0 26px;
  color: var(--ink);
}

.policy h2 {
  font-family: Georgia, serif;
  font-size: 19px;
  margin: 34px 0 10px;
  color: var(--ink);
}

.policy p,
.policy li {
  font-size: 15px;
  color: var(--muted);
}

.policy ul {
  padding-left: 20px;
  margin: 10px 0 18px;
}

.policy li {
  margin-bottom: 8px;
}

.policy a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(28, 25, 23, 0.3);
}

.policy a:hover {
  border-bottom-color: var(--ink);
}

.policy-note {
  margin-top: 44px;
  padding: 16px 18px;
  background: var(--bg-3);
  border-radius: 10px;
  font-size: 13px !important;
  line-height: 1.6;
}

footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(28, 25, 23, 0.25);
}

footer a:hover {
  border-bottom-color: currentColor;
}
