@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500&display=swap');

/* ── Core Variables ── */
:root {
  --deep-space:     #08101E;
  --midnight:       #1C2B45;
  --navy-light:     #2A3F5F;
  --compass-gold:   #C9A052;
  --gold-muted:     #A07D3A;
  --gold-light:     #E8C97A;
  --vellum:         #F0E6C8;
  --vellum-light:   #F7F2E8;
  --data-teal:      #2DD4BF;
  --teal-muted:     #1DA896;
  --white:          #FFFFFF;
  --gray-100:       #F4F4F2;
  --gray-200:       #E8E8E4;
  --gray-400:       #9A9A94;
  --gray-600:       #5A5A54;
  --danger:         #E24B4A;
  --success:        #2DD4BF;

  --font-display:   'Cormorant Garamond', Georgia, serif;
  --font-body:      'DM Sans', system-ui, sans-serif;

  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --radius-xl:      24px;

  --shadow-sm:      0 1px 3px rgba(0,0,0,0.12);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.16);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.24);

  --transition:     all 0.2s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--vellum);
  background: var(--deep-space);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--compass-gold); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-light); }
img { max-width: 100%; display: block; }

/* ── Typography ── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  color: var(--vellum);
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.2rem; }

.display {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.text-gold   { color: var(--compass-gold); }
.text-teal   { color: var(--data-teal); }
.text-muted  { color: var(--gray-400); }
.text-center { text-align: center; }
.italic      { font-style: italic; }

/* ── Layout ── */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem 0;
  background: rgba(8, 16, 30, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 0.5px solid rgba(201, 160, 82, 0.15);
}

.nav__inner { display: flex; align-items: center; justify-content: space-between; }
.nav__logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav__logo-img { height: 30px; width: auto; display: block; }
.auth-logo__img { height: 46px; width: auto; margin: 0 auto; display: block; }

.nav__wordmark {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--vellum);
  line-height: 1;
}
.nav__wordmark span { color: var(--compass-gold); }

.nav__tld {
  font-family: 'DM Sans', monospace;
  font-size: 0.65rem;
  color: var(--navy-light);
  letter-spacing: 2px;
  margin-top: 2px;
}

.nav__links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav__links a { font-size: 0.875rem; font-weight: 400; color: var(--gray-400); transition: var(--transition); }
.nav__links a:hover { color: var(--vellum); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary { background: var(--compass-gold); color: var(--deep-space); border-color: var(--compass-gold); }
.btn--primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: var(--deep-space);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(201, 160, 82, 0.35);
}

.btn--outline { background: transparent; color: var(--vellum); border-color: rgba(240, 230, 200, 0.25); }
.btn--outline:hover { border-color: var(--compass-gold); color: var(--compass-gold); }

.btn--ghost { background: transparent; color: var(--gray-400); border-color: transparent; }
.btn--ghost:hover { color: var(--vellum); }

.btn--full { width: 100%; }
.btn--lg { font-size: 1rem; padding: 0.85rem 2rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 1.1rem; }

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-400);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(240, 230, 200, 0.12);
  border-radius: var(--radius-md);
  color: var(--vellum);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-input::placeholder { color: var(--gray-600); }
.form-input:focus {
  border-color: rgba(201, 160, 82, 0.5);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 3px rgba(201, 160, 82, 0.08);
}
.form-input.error { border-color: var(--danger); }

.form-hint { font-size: 0.78rem; color: var(--gray-600); }
.form-error { font-size: 0.8rem; color: var(--danger); display: none; }
.form-error.visible { display: block; }

/* ── Auth Pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem 3rem;
  position: relative;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: rgba(28, 43, 69, 0.5);
  border: 1px solid rgba(201, 160, 82, 0.12);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(12px);
}

.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo__mark { display: inline-block; margin-bottom: 0.75rem; }
.auth-logo__wordmark { font-family: var(--font-display); font-size: 2rem; color: var(--vellum); }
.auth-logo__wordmark span { color: var(--compass-gold); }

.auth-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--vellum);
  margin-bottom: 0.35rem;
  text-align: center;
}

.auth-subtitle { font-size: 0.875rem; color: var(--gray-400); text-align: center; margin-bottom: 2rem; }
.auth-switch { text-align: center; margin-top: 1.5rem; font-size: 0.875rem; color: var(--gray-400); }

/* ── Alert ── */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius-md); font-size: 0.875rem; margin-bottom: 1.25rem; display: none; }
.alert.visible { display: block; }
.alert--error { background: rgba(226, 75, 74, 0.1); border: 1px solid rgba(226, 75, 74, 0.25); color: #F09595; }
.alert--success { background: rgba(45, 212, 191, 0.1); border: 1px solid rgba(45, 212, 191, 0.25); color: var(--data-teal); }

/* ── Bookmark mark ── */
.corvela-mark svg { display: block; }

/* ── Hero ── */
.hero { min-height: 100vh; display: flex; align-items: center; padding: 8rem 0 5rem; position: relative; }
.hero__content { max-width: 680px; position: relative; z-index: 1; }

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--compass-gold);
  margin-bottom: 1.5rem;
}
.hero__eyebrow::before { content: ''; display: inline-block; width: 20px; height: 1px; background: var(--compass-gold); }

.hero__title { margin-bottom: 1.25rem; }
.hero__body { font-size: 1.1rem; color: var(--gray-400); line-height: 1.75; max-width: 540px; margin-bottom: 2.5rem; }
.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── Features ── */
.features { padding: 6rem 0; border-top: 1px solid rgba(201, 160, 82, 0.08); }
.features__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 3rem; }

.feature-card {
  background: rgba(28, 43, 69, 0.3);
  border: 1px solid rgba(201, 160, 82, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: var(--transition);
}
.feature-card:hover { border-color: rgba(201, 160, 82, 0.2); transform: translateY(-2px); }
.feature-card__title { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.5rem; color: var(--vellum); }
.feature-card__body { font-size: 0.9rem; color: var(--gray-400); line-height: 1.65; }

/* ── Footer ── */
.footer { padding: 2rem 0; border-top: 1px solid rgba(201, 160, 82, 0.08); text-align: center; }
.footer__text { font-size: 0.8rem; color: var(--gray-600); }

/* ── Utility ── */
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; }
.hidden { display: none; }

/* ── App Shell ──
   Shared structure for every authenticated page (dashboard, shop, library,
   analytics...). Reuses .nav / .container so logged-in pages feel like the
   same application as the marketing site, not a separate product. */
.app-shell {
  min-height: 100vh;
  padding: 7rem 0 4rem;
  position: relative;
  z-index: 1;
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.app-header__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--vellum);
  margin-bottom: 0.25rem;
}

.app-header__sub {
  font-size: 0.9rem;
  color: var(--gray-400);
}

/* ── Cards ── */
.card {
  background: rgba(28, 43, 69, 0.4);
  border: 1px solid rgba(201, 160, 82, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.card--dashed {
  background: rgba(28, 43, 69, 0.25);
  border: 1px dashed rgba(201, 160, 82, 0.18);
  text-align: center;
  color: var(--gray-400);
  font-size: 0.9rem;
  line-height: 1.7;
  padding: 2.5rem 2rem;
}

/* ── Stat cards ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(28, 43, 69, 0.4);
  border: 1px solid rgba(201, 160, 82, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: rgba(201, 160, 82, 0.22);
  transform: translateY(-1px);
}

.stat-card--gold {
  border-color: rgba(201, 160, 82, 0.2);
  background: rgba(201, 160, 82, 0.05);
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--compass-gold);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card__label {
  font-size: 0.76rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  vertical-align: middle;
}

.badge--gold {
  background: rgba(201, 160, 82, 0.12);
  color: var(--compass-gold);
  border: 1px solid rgba(201, 160, 82, 0.25);
}

.badge--teal {
  background: rgba(45, 212, 191, 0.1);
  color: var(--data-teal);
  border: 1px solid rgba(45, 212, 191, 0.25);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav__links { display: none; }
  .hero { padding: 6rem 0 4rem; }
  .auth-card { padding: 2rem 1.5rem; }
  .hero__actions { flex-direction: column; }
  .btn--lg { width: 100%; justify-content: center; }
  .app-shell { padding: 6rem 0 3rem; }
}

/* ── Shop ── */
.shop-filters { display: flex; gap: 8px; margin-bottom: 2rem; flex-wrap: wrap; }
.shop-filter {
  padding: 0.5rem 1.1rem; border-radius: 20px; border: 1px solid rgba(201,160,82,0.15);
  background: transparent; color: var(--gray-400); font-family: var(--font-body);
  font-size: 0.85rem; cursor: pointer; transition: var(--transition);
}
.shop-filter.active { background: rgba(201,160,82,0.12); color: var(--compass-gold); border-color: rgba(201,160,82,0.3); }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.5rem; }

.product-card {
  background: rgba(28,43,69,0.35); border: 1px solid rgba(201,160,82,0.1); border-radius: var(--radius-lg);
  overflow: hidden; text-decoration: none; display: block; transition: var(--transition);
}
.product-card:hover { border-color: rgba(201,160,82,0.25); transform: translateY(-3px); }
.product-card__cover { aspect-ratio: 2/3; background: rgba(12,24,44,0.6); overflow: hidden; }
.product-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: rgba(201,160,82,0.04);
}
.product-card__body { padding: 0.9rem; }
.product-card__title {
  font-family: var(--font-display); font-size: 0.95rem; color: var(--vellum); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card__price { color: var(--compass-gold); font-size: 0.9rem; margin-top: 6px; }
.condition-badges { display: flex; gap: 4px; margin-top: 6px; }
.condition-badge {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 6px;
  border-radius: 10px; background: rgba(201,160,82,0.1); color: var(--compass-gold);
}

/* ── Product detail ── */
.product-detail { display: grid; grid-template-columns: 280px 1fr; gap: 2.5rem; }
.product-detail__cover { border-radius: var(--radius-lg); overflow: hidden; background: rgba(12,24,44,0.6); }
.product-detail__cover img { width: 100%; display: block; }
.variant-option {
  display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem;
  border: 1px solid rgba(201,160,82,0.12); border-radius: var(--radius-md); margin-bottom: 0.75rem;
  cursor: pointer; transition: var(--transition);
}
.variant-option:hover { border-color: rgba(201,160,82,0.3); }
.variant-option.selected { border-color: var(--compass-gold); background: rgba(201,160,82,0.05); }
.variant-option__price { color: var(--compass-gold); font-family: var(--font-display); font-size: 1.2rem; }
.variant-option__meta { font-size: 0.78rem; color: var(--gray-400); margin-top: 2px; }

/* ── Cart ── */
.cart-badge {
  position: relative; display: inline-flex; align-items: center;
}
.cart-count {
  position: absolute; top: -6px; right: -8px; background: var(--compass-gold); color: var(--deep-space);
  font-size: 0.65rem; font-weight: 600; border-radius: 50%; width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
}
.cart-row { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid rgba(201,160,82,0.08); }
.cart-row img { width: 50px; height: 74px; object-fit: cover; border-radius: 4px; }

.cart-remove-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: transparent; border: 1px solid rgba(240,230,200,0.15);
  color: var(--gray-400); cursor: pointer; transition: var(--transition); flex-shrink: 0;
}
.cart-remove-btn:hover { background: rgba(226,75,74,0.1); border-color: rgba(226,75,74,0.3); color: var(--danger); }