/* ═══════════════════════════════════════════════════════════════════════════
   VERUM — Design System 12: The Curated Diagnostic
   Warm Teal palette · No-Line rule · Tonal layering · Dual typography
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  /* Primary — Warm Teal */
  --v-primary:              #00585e;
  --v-primary-container:    #00727a;
  --v-on-primary:           #ffffff;
  --v-primary-fixed:        color-mix(in srgb, #00585e 10%, #f6fafe);

  /* Secondary — Silver Ash */
  --v-secondary:            #515f74;
  --v-secondary-container:  #dce2f5;
  --v-on-secondary:         #ffffff;
  --v-on-secondary-container: #3a4760;

  /* Surface hierarchy — tonal layering, NEVER 1px borders for structure */
  --v-surface:              #f6fafe;   /* base — page background */
  --v-surface-low:          #f0f4f8;   /* secondary content areas */
  --v-surface-mid:          #e9edf1;   /* grouped sections */
  --v-surface-high:         #dfe3e7;   /* nested elements */
  --v-surface-highest:      #d4d8dc;   /* deepest inset */
  --v-surface-white:        #ffffff;   /* lifted cards / modals */

  /* Text */
  --v-on-surface:           #171c1f;
  --v-on-surface-variant:   #3f484e;
  --v-muted:                #6b7580;

  /* Structural — ghost border ONLY when accessibility requires it */
  --v-outline:              rgba(190, 201, 202, 0.15);
  --v-outline-focus:        #00585e;

  /* Shadows — ambient only, never heavy */
  --v-shadow-card:   0 0 32px 0 rgba(23, 28, 31, 0.06);
  --v-shadow-modal:  0 0 48px 0 rgba(23, 28, 31, 0.08);
  --v-shadow-fab:    0 4px 16px rgba(0, 88, 94, 0.32);

  /* Typography */
  --v-font-serif:  'Noto Serif', Georgia, serif;
  --v-font-sans:   'Manrope', 'Inter', system-ui, sans-serif;

  /* Spacing scale */
  --v-space-1: 0.25rem;
  --v-space-2: 0.5rem;
  --v-space-3: 0.75rem;
  --v-space-4: 1rem;
  --v-space-5: 1.25rem;
  --v-space-6: 1.5rem;
  --v-space-8: 2rem;
  --v-space-10: 2.5rem;
  --v-space-12: 3rem;
  --v-space-16: 4rem;

  /* Radius — architectural, not pill */
  --v-radius-sm: 0.125rem;
  --v-radius:    0.25rem;
  --v-radius-lg: 0.5rem;

  /* Transitions */
  --v-ease: 0.15s ease;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;
}
body {
  font-family: var(--v-font-sans);
  background: var(--v-surface);
  color: var(--v-on-surface);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ── Typography ─────────────────────────────────────────────────────────── */

/* VERUM wordmark — serif, all caps, always */
.v-wordmark {
  font-family: var(--v-font-serif);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--v-primary);
  text-decoration: none;
}

/* Serif — brand moments, section headlines only */
.v-display {
  font-family: var(--v-font-serif);
  font-weight: 600;
  line-height: 1.15;
  color: var(--v-on-surface);
}
.v-display-lg { font-size: clamp(2rem,   6vw, 3.5rem); }
.v-display-md { font-size: clamp(1.5rem, 4vw, 2.5rem); }
.v-display-sm { font-size: clamp(1.25rem,3vw, 1.75rem); }

/* Sans — everything functional */
.v-title-lg { font-size: 1.25rem;  font-weight: 700;  line-height: 1.3; }
.v-title-md { font-size: 1.125rem; font-weight: 600;  line-height: 1.4; }
.v-title-sm { font-size: 1rem;     font-weight: 600;  line-height: 1.4; }
.v-body-lg  { font-size: 1rem;     font-weight: 400;  line-height: 1.65;}
.v-body-md  { font-size: 0.9375rem;font-weight: 400;  line-height: 1.6; }
.v-body-sm  { font-size: 0.875rem; font-weight: 400;  line-height: 1.55;}

/* Label — Manrope, uppercase, tracked: for categories, metadata */
.v-label {
  font-family: var(--v-font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--v-primary);
}

/* ── Layout helpers ─────────────────────────────────────────────────────── */
.v-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--v-space-6);
}
.v-container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--v-space-6);
}
@media (max-width: 640px) {
  .v-container,
  .v-container-narrow { padding: 0 var(--v-space-4); }
}

/* ── Surface layers — tonal, no borders ────────────────────────────────── */
.v-surface       { background: var(--v-surface); }
.v-surface-low   { background: var(--v-surface-low); }
.v-surface-mid   { background: var(--v-surface-mid); }
.v-surface-white { background: var(--v-surface-white); }

/* ── Cards — no borders, tonal lift via background ─────────────────────── */
.v-card {
  background: var(--v-surface-white);
  border-radius: var(--v-radius-lg);
  padding: var(--v-space-8);
  box-shadow: var(--v-shadow-card);
}
.v-card-sm {
  background: var(--v-surface-white);
  border-radius: var(--v-radius-lg);
  padding: var(--v-space-6);
  box-shadow: var(--v-shadow-card);
}

/* Atelier Insight card — signature component */
.v-insight {
  background: var(--v-primary-fixed);
  border-radius: var(--v-radius-lg);
  padding: var(--v-space-6);
}
.v-insight-title {
  font-family: var(--v-font-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--v-primary);
  margin-bottom: var(--v-space-2);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.v-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--v-space-2);
  border: none;
  border-radius: var(--v-radius-lg);
  font-family: var(--v-font-sans);
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--v-ease);
  white-space: nowrap;
}
.v-btn:hover { opacity: 0.88; }
.v-btn:disabled { opacity: 0.4; cursor: default; }

/* Primary — warm teal gradient */
.v-btn-primary {
  background: linear-gradient(135deg, var(--v-primary), var(--v-primary-container));
  color: var(--v-on-primary);
  padding: var(--v-space-3) var(--v-space-6);
  font-size: 0.9375rem;
}
/* Primary large */
.v-btn-primary-lg {
  padding: var(--v-space-4) var(--v-space-8);
  font-size: 1rem;
}

/* Secondary — surface fill */
.v-btn-secondary {
  background: var(--v-surface-high);
  color: var(--v-primary);
  padding: var(--v-space-3) var(--v-space-6);
  font-size: 0.9375rem;
}

/* Tertiary — text only */
.v-btn-tertiary {
  background: none;
  color: var(--v-primary);
  padding: var(--v-space-2) var(--v-space-3);
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  border-radius: 0;
}

/* ── Input fields — editorial precision ────────────────────────────────── */
.v-input {
  width: 100%;
  background: var(--v-surface-low);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--v-radius-sm) var(--v-radius-sm) 0 0;
  padding: var(--v-space-3) var(--v-space-4);
  font-family: var(--v-font-sans);
  font-size: 1rem;
  color: var(--v-on-surface);
  outline: none;
  transition: border-color var(--v-ease);
}
.v-input:focus { border-bottom-color: var(--v-primary); }
.v-input::placeholder { color: var(--v-muted); }

/* ── Chips — pill shape, contrast against card radii ───────────────────── */
.v-chip {
  display: inline-flex;
  align-items: center;
  padding: var(--v-space-1) var(--v-space-3);
  background: var(--v-secondary-container);
  color: var(--v-on-secondary-container);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  white-space: nowrap;
  cursor: default;
}
.v-chip-primary {
  background: var(--v-primary);
  color: var(--v-on-primary);
}
.v-chip-teal {
  background: color-mix(in srgb, var(--v-primary) 15%, white);
  color: var(--v-primary);
}
.v-chip-interactive {
  cursor: pointer;
  transition: opacity var(--v-ease);
}
.v-chip-interactive:hover { opacity: 0.8; }

/* ── Glassmorphism — nav bars, floating panels ─────────────────────────── */
.v-glass {
  background: rgba(246, 250, 254, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ── Top navigation (desktop) ───────────────────────────────────────────── */
#v-topnav {
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--v-outline);
}
.v-topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}
.v-topnav-links {
  display: flex;
  align-items: center;
  gap: var(--v-space-8);
}
.v-topnav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--v-on-surface-variant);
  text-decoration: none;
  transition: color var(--v-ease);
}
.v-topnav-links a:hover,
.v-topnav-links a.active { color: var(--v-primary); }

/* Hide top nav on mobile — bottom tab used instead */
@media (max-width: 768px) {
  .v-topnav-links,
  .v-topnav-cta { display: none; }
}

/* ── Bottom tab bar (mobile) ────────────────────────────────────────────── */
#v-bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: none;
  border-top: 1px solid var(--v-outline);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 768px) { #v-bottomnav { display: flex; } }

.v-bottomnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--v-space-2) var(--v-space-1);
  color: var(--v-on-surface-variant);
  text-decoration: none;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: color var(--v-ease);
  border: none;
  background: none;
}
.v-bottomnav-item:hover,
.v-bottomnav-item.active { color: var(--v-primary); }

/* ── V button — floating AI assistant trigger ───────────────────────────── */
#v-fab {
  position: fixed;
  z-index: 300;
  bottom: calc(4.5rem + env(safe-area-inset-bottom));
  right: var(--v-space-6);
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--v-primary), var(--v-primary-container));
  color: var(--v-on-primary);
  border: none;
  font-family: var(--v-font-serif);
  font-weight: 700;
  font-size: 1.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--v-shadow-fab);
  transition: transform var(--v-ease), box-shadow var(--v-ease);
}
#v-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 24px rgba(0, 88, 94, 0.42);
}
/* On desktop, bottom stays fixed without the tab bar offset */
@media (min-width: 769px) {
  #v-fab { bottom: var(--v-space-8); }
}

/* ── Page body padding — clears bottom nav on mobile ───────────────────── */
.v-page {
  padding-bottom: calc(5rem + env(safe-area-inset-bottom));
}
@media (min-width: 769px) { .v-page { padding-bottom: var(--v-space-16); } }

/* ── Utility ────────────────────────────────────────────────────────────── */
.v-teal          { color: var(--v-primary); }
.v-muted         { color: var(--v-muted); }
.v-serif         { font-family: var(--v-font-serif); }
.v-divider       { border: none; border-top: 1px solid var(--v-outline); margin: var(--v-space-6) 0; }
.v-stack         { display: flex; flex-direction: column; }
.v-row           { display: flex; align-items: center; }
.v-gap-2         { gap: var(--v-space-2); }
.v-gap-3         { gap: var(--v-space-3); }
.v-gap-4         { gap: var(--v-space-4); }
.v-gap-6         { gap: var(--v-space-6); }
.v-wrap          { flex-wrap: wrap; }
.sr-only         { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
