@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;1,500;1,600&display=swap');

:root {
  --card: #faf7f1;
  --ink: #1c1a17;
  --offwhite: #f3efe6;
  --muted-on-light: #756b5c;
  --muted-on-dark: rgba(243,239,230,0.7);
  --border-on-light: #e7e0d2;
  --border-on-dark: rgba(243,239,230,0.2);
  --accent: #c1793a;
  --accent-ink: #7a4a1f;
  --danger: #c94f3f;
  --success: #3f8f5f;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

/* ---------- Blurred mountain backdrop ---------- */
.mountain-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
}
.mountain-bg svg { width: 100%; height: 100%; display: block; }
.mountain-scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(10,12,14,0.58) 0%, rgba(10,12,14,0.32) 30%, rgba(10,12,14,0.5) 65%, rgba(10,12,14,0.82) 100%);
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #12161a;
  color: var(--offwhite);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Sticky pill nav ---------- */
.nav-wrap {
  position: sticky;
  top: 14px;
  z-index: 500;
  display: flex;
  justify-content: center;
  padding: 0 16px;
}
.topbar {
  width: 100%;
  max-width: 1100px;
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 14px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}
.brand {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.site-nav { display: flex; gap: 24px; }
.site-nav a { color: var(--muted-on-light); text-decoration: none; font-size: 13px; font-weight: 600; }
.site-nav a:hover, .site-nav a.active { color: var(--ink); }
#authArea { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted-on-light); }
#authArea button {
  background: var(--ink);
  color: var(--offwhite);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 24px 40px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
  font-weight: 600;
  margin-bottom: 22px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--border-on-dark); display: inline-block; }
.hero-title {
  font-size: clamp(34px, 5.5vw, 58px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  max-width: 720px;
  color: var(--offwhite);
  text-shadow: 0 2px 24px rgba(0,0,0,0.35);
}
.hero-title em { font-style: italic; font-weight: 600; color: var(--accent); }
.hero-sub {
  color: var(--muted-on-dark);
  font-size: 16px;
  line-height: 1.6;
  max-width: 560px;
  margin: 0 0 28px;
}
.hero-cta {
  background: var(--offwhite);
  color: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
  max-width: 640px;
}
.stat-num { font-size: 30px; font-weight: 800; letter-spacing: -0.01em; color: var(--offwhite); }
.stat-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-on-dark); margin-top: 4px; }

/* ---------- Trust bar ---------- */
.trust-bar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 24px;
  border-top: 1px solid var(--border-on-dark);
  border-bottom: 1px solid var(--border-on-dark);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.trust-item {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
  text-align: center;
  font-weight: 600;
}

/* ---------- RUO banner ---------- */
.ruo-banner {
  background: rgba(10,12,14,0.55);
  color: var(--muted-on-dark);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 12px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border-on-dark);
}

/* ---------- Main layout ---------- */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}
#catalogSection, #gate, #pendingNotice { grid-column: 1; }
.cart { grid-column: 2; grid-row: 1 / span 2; align-self: start; position: sticky; top: 100px; }

.panel, .cart {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border-on-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.panel h2, .cart h3 { margin-top: 0; letter-spacing: -0.01em; }
.hint { color: var(--muted-on-light); font-size: 13px; }

#catalogSection h2 {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
  font-weight: 700;
  margin-bottom: 6px;
}
#catalogSection .hint { color: var(--muted-on-dark); margin-bottom: 24px; }

/* ---------- Catalog grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border-on-light);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,0.35); }
.card-media {
  height: 152px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #efe9dc, #e2d9c6);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
}
.card-media svg { width: 100%; height: 100%; }
.card .group { font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted-on-light); font-weight: 700; margin-bottom: 6px; }
.card h4 { margin: 0 0 4px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.card .spec { color: var(--muted-on-light); font-size: 12px; margin-bottom: 10px; }
.card .price { font-weight: 800; color: var(--ink); margin-bottom: 12px; font-size: 15px; }
.card button, .cart button, form button {
  background: var(--ink);
  color: var(--offwhite);
  border: none;
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  width: 100%;
}
.card button:disabled { background: #e9e2d3; color: var(--muted-on-light); cursor: not-allowed; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 20px; background: #efe9dc; border-radius: 999px; padding: 4px; width: fit-content; }
.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted-on-light);
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.tab-btn.active { background: var(--ink); color: var(--offwhite); }

/* ---------- Forms ---------- */
form label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted-on-light); font-weight: 600; }
form input {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-on-light);
  background: #f4efe4;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}
form select {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-on-light);
  background: #f4efe4;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}
form input:focus, form select:focus { outline: none; border-color: var(--accent); background: var(--card); }
.calc-result {
  margin-top: 8px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: #f4efe4;
  border: 1px solid var(--border-on-light);
}
.calc-result-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-on-light); font-weight: 700; margin-bottom: 6px; }
.calc-result-value { font-size: 16px; font-weight: 700; color: var(--ink); }
.form-msg { font-size: 13px; color: var(--danger); min-height: 18px; margin-top: 8px; }
.terms-box {
  background: #f4efe4;
  border: 1px solid var(--border-on-light);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 14px;
  max-height: 160px;
  overflow-y: auto;
  font-size: 12px;
  color: var(--muted-on-light);
}
.terms-box strong { color: var(--ink); display: block; margin-bottom: 6px; }
.terms-box ul { margin: 0; padding-left: 18px; }
.terms-box li { margin-bottom: 6px; }
.checkbox-label {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--ink) !important;
  margin-bottom: 16px;
  font-weight: 400 !important;
}
.checkbox-label input[type="checkbox"] { width: auto; margin: 2px 0 0; }

/* ---------- Cart ---------- */
#cartItems { font-size: 13px; margin-bottom: 12px; }
.cart-row { display: flex; justify-content: space-between; margin-bottom: 8px; }
#cartTotal { font-weight: 700; margin: 12px 0; font-size: 14px; }

.status-pill { font-size: 11px; padding: 3px 10px; border-radius: 999px; background: #f4e9d2; color: #8a6216; font-weight: 700; }
.status-approved { background: #dff2e6; color: var(--success); }

/* ---------- Entry gate modal ---------- */
.entry-gate {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.entry-gate-box {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 460px;
  text-align: left;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.entry-gate-box .brand { color: var(--muted-on-light); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; }
.entry-gate-box h2 { margin: 6px 0 14px; font-size: 22px; letter-spacing: -0.01em; }
.entry-gate-box p { color: var(--muted-on-light); font-size: 14px; line-height: 1.5; }
.entry-gate-box ul { color: var(--muted-on-light); font-size: 14px; padding-left: 18px; }
.entry-gate-box li { margin-bottom: 8px; }
.entry-gate-actions { display: flex; gap: 10px; margin-top: 24px; }
.entry-gate-actions button {
  flex: 1;
  padding: 13px;
  font-size: 14px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  cursor: pointer;
}
.entry-gate-actions button:first-child { background: var(--ink); color: var(--offwhite); }
.entry-gate-actions .secondary {
  background: transparent;
  border: 1px solid var(--border-on-light) !important;
  color: var(--muted-on-light);
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
  border-top: 1px solid var(--border-on-dark);
  color: var(--muted-on-dark);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  main { grid-template-columns: 1fr; }
  .cart { grid-column: 1; grid-row: auto; position: static; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .trust-bar { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 640px) {
  .site-nav { display: none; }
}

.calc-grid {
  margin: 0 auto;
  padding: 48px 24px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 700px) {
  .calc-grid { grid-template-columns: 1fr; }
}
