/* ============================================================
   AMPERLY — Brand System CSS v1.0
   amperly.com.au · Purple Peppercorn Pty Ltd
   Built: 29 May 2026
   Companion to: AMPERLY-WEB-FUNCTIONAL-SPEC-v1.md
   ============================================================ */

/* ============================================================
   SECTION 1 — GOOGLE FONTS IMPORT
   ============================================================ */

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

/* ============================================================
   SECTION 2 — DESIGN TOKENS (CSS Custom Properties)
   ============================================================ */

:root {

  /* --- Primary Palette --- */
  --color-midnight:    #1C2B3A;   /* Nav, headings, CTAs, trust */
  --color-parchment:   #F7F3EE;   /* ALL page backgrounds — 60% rule */
  --color-terracotta:  #C96B4A;   /* Buttons, active states, emotional highlights */
  --color-eucalyptus:  #4B7C6A;   /* Verified, online, Australian identity */

  /* --- Extended UI Palette --- */
  --color-charcoal:    #2A2A2A;   /* Body copy */
  --color-grey:        #8B9299;   /* Labels, placeholders, subtext */
  --color-linen:       #EDE9E3;   /* Card backgrounds, input fields */
  --color-stone:       #D9D4CC;   /* Borders, dividers */
  --color-sage:        #6B9E7A;   /* Success, confirmed states */
  --color-amber:       #D4922A;   /* Sponsored badge, soft alerts */
  --color-rose:        #B85555;   /* Error states */

  /* --- Semantic Aliases --- */
  --color-bg:          var(--color-parchment);
  --color-surface:     var(--color-linen);
  --color-border:      var(--color-stone);
  --color-text:        var(--color-charcoal);
  --color-text-muted:  var(--color-grey);
  --color-heading:     var(--color-midnight);
  --color-action:      var(--color-terracotta);
  --color-trust:       var(--color-eucalyptus);
  --color-error:       var(--color-rose);
  --color-success:     var(--color-sage);
  --color-warning:     var(--color-amber);

  /* --- Typography --- */
  --font-serif:        'Lora', Georgia, 'Times New Roman', serif;
  --font-sans:         'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:         'DM Mono', 'Courier New', monospace;

  /* --- Type Scale --- */
  --text-xs:     0.6875rem;   /* 11px */
  --text-sm:     0.75rem;     /* 12px */
  --text-base:   0.875rem;    /* 14px — UI default */
  --text-md:     1rem;        /* 16px — body */
  --text-lg:     1.125rem;    /* 18px */
  --text-xl:     1.25rem;     /* 20px */
  --text-2xl:    1.5rem;      /* 24px */
  --text-3xl:    1.875rem;    /* 30px */
  --text-4xl:    2.25rem;     /* 36px */
  --text-5xl:    3rem;        /* 48px */
  --text-6xl:    3.75rem;     /* 60px */
  --text-hero:   clamp(2.25rem, 5vw, 3.5rem); /* Fluid hero */

  /* --- Font Weights --- */
  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semibold: 600;
  --weight-bold:    700;

  /* --- Line Heights --- */
  --leading-tight:   1.15;
  --leading-snug:    1.3;
  --leading-normal:  1.5;
  --leading-relaxed: 1.65;
  --leading-loose:   1.8;

  /* --- Letter Spacing --- */
  --tracking-tight:  -0.02em;
  --tracking-normal:  0;
  --tracking-wide:    0.04em;
  --tracking-wider:   0.08em;
  --tracking-widest:  0.14em;

  /* --- Spacing Scale --- */
  --space-1:    0.25rem;   /*  4px */
  --space-2:    0.5rem;    /*  8px */
  --space-3:    0.75rem;   /* 12px */
  --space-4:    1rem;      /* 16px */
  --space-5:    1.25rem;   /* 20px */
  --space-6:    1.5rem;    /* 24px */
  --space-8:    2rem;      /* 32px */
  --space-10:   2.5rem;    /* 40px */
  --space-12:   3rem;      /* 48px */
  --space-16:   4rem;      /* 64px */
  --space-20:   5rem;      /* 80px */
  --space-24:   6rem;      /* 96px */

  /* --- Border Radius --- */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-xs:   0 1px 2px rgba(28,43,58,0.06);
  --shadow-sm:   0 2px 6px rgba(28,43,58,0.08);
  --shadow-md:   0 4px 16px rgba(28,43,58,0.10);
  --shadow-lg:   0 8px 32px rgba(28,43,58,0.13);
  --shadow-xl:   0 16px 48px rgba(28,43,58,0.16);

  /* --- Layout --- */
  --max-width:       1280px;
  --content-width:   1024px;
  --narrow-width:    720px;
  --sidebar-width:   280px;

  /* --- Z-index layers --- */
  --z-base:    0;
  --z-raised:  10;
  --z-dropdown: 100;
  --z-sticky:  200;
  --z-fixed:   300;
  --z-modal:   400;
  --z-toast:   500;
  --z-tooltip: 600;

  /* --- Transitions --- */
  --transition-fast:   120ms ease;
  --transition-base:   200ms ease;
  --transition-slow:   300ms ease;
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Nav height --- */
  --nav-height: 64px;
  --nav-height-mobile: 56px;
}


/* ============================================================
   SECTION 3 — RESET & BASE
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--color-parchment);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Skip to content — accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-tooltip);
  padding: var(--space-2) var(--space-4);
  background: var(--color-midnight);
  color: var(--color-parchment);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: var(--space-4);
  outline: 2px solid var(--color-terracotta);
  outline-offset: 2px;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-terracotta);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}
a:hover { opacity: 0.8; }
a:focus-visible {
  outline: 2px solid var(--color-terracotta);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

ul, ol { list-style: none; }

button {
  cursor: pointer;
  font-family: var(--font-sans);
  border: none;
  background: none;
}

input, textarea, select {
  font-family: var(--font-sans);
}

/* ============================================================
   SECTION 4 — TYPOGRAPHY SYSTEM
   ============================================================ */

/* --- Headings --- */
h1, .h1 {
  font-family: var(--font-serif);
  font-size: var(--text-hero);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-heading);
}

h2, .h2 {
  font-family: var(--font-serif);
  font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl));
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--color-heading);
}

h3, .h3 {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--color-heading);
}

h4, .h4 {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-normal);
  color: var(--color-heading);
}

h5, .h5 {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--color-heading);
}

h6, .h6 {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-heading);
}

/* --- Body copy --- */
p {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
}

/* --- Section label (DM Mono, Terracotta, uppercase) --- */
.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  color: var(--color-terracotta);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  display: block;
  margin-bottom: var(--space-4);
}

/* --- Muted text --- */
.text-muted {
  color: var(--color-grey);
}

/* --- Mono numbers / stats --- */
.mono, .stat-number {
  font-family: var(--font-mono);
  font-weight: var(--weight-regular);
}

/* --- Italic serif accent --- */
.serif-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--weight-regular);
}

/* ============================================================
   SECTION 5 — LAYOUT UTILITIES
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.container-content {
  width: 100%;
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.container-narrow {
  width: 100%;
  max-width: var(--narrow-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

/* --- Section padding --- */
.section {
  padding-top: var(--space-20);
  padding-bottom: var(--space-20);
}

.section-sm {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.section-lg {
  padding-top: clamp(var(--space-20), 8vw, 7rem);
  padding-bottom: clamp(var(--space-20), 8vw, 7rem);
}

/* --- Background surface variants --- */
.bg-parchment  { background-color: var(--color-parchment); }
.bg-linen      { background-color: var(--color-linen); }
.bg-midnight   { background-color: var(--color-midnight); }
.bg-white      { background-color: #ffffff; }

/* --- Grid systems --- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

/* --- Flex helpers --- */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-2   { gap: var(--space-2); }
.flex-gap-3   { gap: var(--space-3); }
.flex-gap-4   { gap: var(--space-4); }


/* ============================================================
   SECTION 6 — BUTTONS
   ============================================================ */

/* --- Base button --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.6875rem var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: 0.01em;
  border-radius: var(--radius-full);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast);
  min-height: 44px;
  min-width: 44px;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 2px solid var(--color-terracotta);
  outline-offset: 2px;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- Primary button (Terracotta fill) --- */
.btn-primary {
  background-color: var(--color-terracotta);
  border-color: var(--color-terracotta);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: #b35e3f;
  border-color: #b35e3f;
  box-shadow: var(--shadow-md);
  opacity: 1;
}
.btn-primary:active {
  background-color: #9e5237;
}

/* --- Secondary button (Midnight Slate fill) --- */
.btn-secondary {
  background-color: var(--color-midnight);
  border-color: var(--color-midnight);
  color: var(--color-parchment);
}
.btn-secondary:hover {
  background-color: #243649;
  box-shadow: var(--shadow-md);
  opacity: 1;
}

/* --- Ghost button (outlined, transparent fill) --- */
.btn-ghost {
  background-color: transparent;
  border-color: var(--color-stone);
  color: var(--color-midnight);
}
.btn-ghost:hover {
  background-color: var(--color-linen);
  border-color: var(--color-midnight);
  opacity: 1;
}

/* --- Ghost Terracotta (outlined Terracotta, used for upsells) --- */
.btn-ghost-terracotta {
  background-color: transparent;
  border-color: var(--color-terracotta);
  color: var(--color-terracotta);
}
.btn-ghost-terracotta:hover {
  background-color: rgba(201, 107, 74, 0.06);
  opacity: 1;
}

/* --- Ghost Dark (for use on dark/Midnight backgrounds) --- */
.btn-ghost-dark {
  background-color: transparent;
  border-color: rgba(247, 243, 238, 0.3);
  color: var(--color-parchment);
}
.btn-ghost-dark:hover {
  background-color: rgba(247, 243, 238, 0.08);
  border-color: rgba(247, 243, 238, 0.6);
  opacity: 1;
}

/* --- Size modifiers --- */
.btn-sm {
  padding: 0.5rem var(--space-4);
  font-size: var(--text-sm);
  min-height: 36px;
}

.btn-lg {
  padding: 0.9375rem var(--space-8);
  font-size: var(--text-md);
  min-height: 52px;
}

.btn-full {
  width: 100%;
}

/* --- Icon button --- */
.btn-icon {
  padding: var(--space-2);
  border-radius: var(--radius-md);
  min-width: 44px;
  min-height: 44px;
}


/* ============================================================
   SECTION 7 — FORM ELEMENTS
   ============================================================ */

/* --- Form group --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

/* --- Label --- */
.form-label {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-midnight);
  letter-spacing: 0.01em;
}

.form-label-optional {
  font-weight: var(--weight-regular);
  color: var(--color-grey);
  font-size: var(--text-xs);
  margin-left: var(--space-2);
}

/* --- Input, Textarea, Select --- */
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.6875rem var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  color: var(--color-midnight);
  background-color: var(--color-linen);
  border: 1.5px solid var(--color-stone);
  border-radius: var(--radius-md);
  min-height: 44px;
  transition:
    border-color var(--transition-base),
    background-color var(--transition-base),
    box-shadow var(--transition-base);
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-grey);
  font-weight: var(--weight-regular);
}

.form-input:hover,
.form-textarea:hover {
  border-color: var(--color-midnight);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-midnight);
  background-color: #f9f6f1;
  box-shadow: 0 0 0 3px rgba(28, 43, 58, 0.08);
}

/* --- Input with icon --- */
.input-wrapper {
  position: relative;
}

.input-wrapper .input-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-grey);
  pointer-events: none;
}

.input-wrapper .form-input {
  padding-left: 2.75rem;
}

/* --- Textarea --- */
.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: var(--leading-relaxed);
}

/* --- Input error state --- */
.form-input.is-error,
.form-textarea.is-error {
  border-color: var(--color-rose);
  background-color: rgba(184, 85, 85, 0.04);
}

.form-input.is-error:focus,
.form-textarea.is-error:focus {
  box-shadow: 0 0 0 3px rgba(184, 85, 85, 0.12);
}

.form-error {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: var(--weight-regular);
  color: var(--color-rose);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: 0.125rem;
}

/* --- Input success state --- */
.form-input.is-success {
  border-color: var(--color-sage);
}

/* --- Checkbox / Radio --- */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.form-check-input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1.5px solid var(--color-stone);
  border-radius: var(--radius-sm);
  background-color: var(--color-linen);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  top: 1px;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.form-check-input:checked {
  background-color: var(--color-midnight);
  border-color: var(--color-midnight);
}

.form-check-input:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: 2px solid #ffffff;
  border-top: none;
  border-left: none;
  transform: rotate(40deg);
}

.form-check-input:focus-visible {
  outline: 2px solid var(--color-terracotta);
  outline-offset: 2px;
}

.form-check-label {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  color: var(--color-midnight);
  line-height: 1.45;
  cursor: pointer;
}

/* --- Character counter --- */
.char-counter {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-grey);
  text-align: right;
  margin-top: var(--space-1);
}

.char-counter.is-warning { color: var(--color-amber); }
.char-counter.is-error   { color: var(--color-rose); }

/* --- Form banner error (server errors) --- */
.form-banner-error {
  padding: var(--space-3) var(--space-4);
  background-color: rgba(184, 85, 85, 0.08);
  border: 1px solid rgba(184, 85, 85, 0.25);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--color-rose);
  margin-bottom: var(--space-5);
}


/* ============================================================
   SECTION 8 — BADGES
   ============================================================ */

/* --- Base badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.1875rem var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  border-radius: var(--radius-full);
  white-space: nowrap;
  line-height: 1;
}

/* --- Online / Live badge (Eucalyptus) --- */
.badge-online {
  background-color: rgba(75, 124, 106, 0.12);
  color: var(--color-eucalyptus);
  border: 1px solid rgba(75, 124, 106, 0.2);
}

.badge-online::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-eucalyptus);
  animation: pulse-online 2.4s ease-in-out infinite;
}

@keyframes pulse-online {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- Verified badge --- */
.badge-verified {
  background-color: rgba(75, 124, 106, 0.08);
  color: var(--color-eucalyptus);
  border: 1px solid rgba(75, 124, 106, 0.2);
}

/* --- Founding Member badge (premium/legacy) --- */
.badge-founding {
  background-color: rgba(212, 146, 42, 0.12);
  color: var(--color-amber);
  border: 1px solid rgba(212, 146, 42, 0.25);
}

/* --- Plus badge --- */
.badge-plus {
  background-color: var(--color-midnight);
  color: var(--color-parchment);
}

/* --- Sponsored badge (ACCC compliance — must be visually distinct) --- */
.badge-sponsored {
  background-color: rgba(212, 146, 42, 0.15);
  color: var(--color-amber);
  border: 1px solid rgba(212, 146, 42, 0.3);
  font-size: 0.6rem;
}

/* --- New badge --- */
.badge-new {
  background-color: rgba(201, 107, 74, 0.1);
  color: var(--color-terracotta);
  border: 1px solid rgba(201, 107, 74, 0.2);
}

/* --- Early Adopter badge --- */
.badge-early {
  background: linear-gradient(135deg, rgba(28,43,58,0.08), rgba(201,107,74,0.08));
  color: var(--color-midnight);
  border: 1px solid var(--color-stone);
}

/* --- Unread count badge (Terracotta circle) --- */
.badge-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-1);
  background-color: var(--color-terracotta);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: var(--weight-regular);
  border-radius: var(--radius-full);
  line-height: 1;
}

/* --- Lock badge (Plus-locked feature) --- */
.badge-locked {
  background-color: var(--color-stone);
  color: var(--color-grey);
}


/* ============================================================
   SECTION 9 — CARDS
   ============================================================ */

/* --- Base card --- */
.card {
  background-color: #ffffff;
  border: 1.5px solid var(--color-stone);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card-surface {
  background-color: var(--color-linen);
  border: 1.5px solid var(--color-stone);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-body {
  padding: var(--space-5);
}

/* --- User card (Browse / feed.html) --- */
.user-card {
  background-color: #ffffff;
  border: 1.5px solid var(--color-stone);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  position: relative;
}

.user-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.user-card-photo {
  aspect-ratio: 4 / 5;
  background-color: var(--color-linen);
  overflow: hidden;
  position: relative;
}

.user-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-card-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-linen) 0%, #e0dbd3 100%);
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  font-weight: var(--weight-semibold);
  color: var(--color-terracotta);
  text-transform: uppercase;
}

.user-card-online {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
}

.user-card-body {
  padding: var(--space-4);
}

.user-card-name {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-midnight);
  margin-bottom: var(--space-1);
}

.user-card-meta {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  color: var(--color-grey);
  margin-bottom: var(--space-3);
}

.user-card-bio {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-charcoal);
  line-height: var(--leading-normal);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--space-4);
}

/* --- Room card (sidebar list item) --- */
.room-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  border-left: 3px solid transparent;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.room-item:hover {
  background-color: var(--color-parchment);
}

.room-item.is-active {
  background-color: var(--color-linen);
  border-left-color: var(--color-terracotta);
}

.room-item-emoji {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.room-item-content {
  flex: 1;
  min-width: 0;
}

.room-item-name {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-midnight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-item-count {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: var(--weight-regular);
  color: var(--color-grey);
}

.room-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
  flex-shrink: 0;
}

/* --- Story card --- */
.story-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 9 / 16;
  background-color: var(--color-midnight);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.story-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.story-card-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.story-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(28,43,58,0.85) 0%, rgba(28,43,58,0) 50%);
}

.story-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4);
}

.story-card-author {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-parchment);
  margin-bottom: var(--space-1);
}

.story-card-time {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(247, 243, 238, 0.7);
}

.story-card-like {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-parchment);
}

/* --- Profile preview card (hero section) --- */
.profile-preview-card {
  background-color: #ffffff;
  border: 1.5px solid var(--color-stone);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
}

.profile-preview-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: #ffffff;
  text-transform: uppercase;
  flex-shrink: 0;
}

.avatar-terracotta { background-color: var(--color-terracotta); }
.avatar-eucalyptus { background-color: var(--color-eucalyptus); }
.avatar-midnight   { background-color: var(--color-midnight); }
.avatar-amber      { background-color: var(--color-amber); }

.profile-preview-info {
  flex: 1;
  min-width: 0;
}

.profile-preview-name {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-midnight);
}

.profile-preview-meta {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-grey);
}

.profile-preview-bio {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Conversation preview card (auth page) --- */
.conversation-card {
  background-color: var(--color-parchment);
  border: 1.5px solid var(--color-stone);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}

.conversation-card-author {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-midnight);
  margin-bottom: var(--space-2);
}

.conversation-card-text {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-charcoal);
  line-height: var(--leading-relaxed);
}

/* --- Invite link card --- */
.invite-card {
  background-color: var(--color-linen);
  border: 1.5px solid var(--color-stone);
  border-left: 4px solid var(--color-eucalyptus);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

/* --- Upsell / Who Viewed banner --- */
.upsell-banner {
  background-color: var(--color-linen);
  border: 1.5px solid var(--color-stone);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.upsell-banner-text {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-midnight);
}

.upsell-banner-text strong {
  font-weight: var(--weight-semibold);
}


/* ============================================================
   SECTION 10 — NAVIGATION
   ============================================================ */

/* --- Marketing nav (anonymous pages) --- */
.nav-marketing {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition:
    background-color var(--transition-slow),
    border-color var(--transition-slow),
    backdrop-filter var(--transition-slow);
  border-bottom: 1px solid transparent;
}

.nav-marketing.is-scrolled {
  background-color: rgba(247, 243, 238, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--color-stone);
}

.nav-marketing-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo:hover { opacity: 0.85; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* --- App nav (authenticated pages) --- */
.nav-app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  height: var(--nav-height);
  background-color: rgba(247, 243, 238, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-stone);
  display: flex;
  align-items: center;
}

.nav-app-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-app-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
}

.nav-app-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-grey);
  text-decoration: none;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-app-link:hover {
  color: var(--color-midnight);
  background-color: var(--color-linen);
  opacity: 1;
}

.nav-app-link.is-active {
  color: var(--color-midnight);
  background-color: var(--color-linen);
}

/* --- Nav avatar --- */
.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--color-terracotta);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: #ffffff;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.nav-avatar:hover {
  opacity: 0.9;
  transform: scale(1.05);
}


/* ============================================================
   SECTION 11 — MODALS & OVERLAYS
   ============================================================ */

/* --- Backdrop --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(28, 43, 58, 0.6);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* --- Modal container --- */
.modal {
  background-color: #ffffff;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  position: relative;
}

.modal-header {
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--color-stone);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--color-midnight);
  line-height: var(--leading-snug);
}

.modal-body {
  padding: var(--space-5) var(--space-6);
}

.modal-footer {
  padding: var(--space-4) var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.modal-dismiss {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-grey);
  background: none;
  border: none;
  cursor: pointer;
  text-align: center;
  padding: var(--space-2);
  transition: color var(--transition-fast);
}
.modal-dismiss:hover { color: var(--color-midnight); }

/* --- Upgrade prompt modal --- */
.upgrade-modal .modal-header {
  border-bottom: none;
  padding-bottom: 0;
}

/* --- Incoming call banner --- */
.call-banner {
  background-color: var(--color-linen);
  border-bottom: 1px solid var(--color-stone);
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.call-banner-text {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-midnight);
}

.call-banner-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* --- Video call overlay --- */
.video-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(28, 43, 58, 0.95);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.video-remote {
  width: 100%;
  max-width: 800px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-xl);
  background-color: rgba(247, 243, 238, 0.08);
  border: 1px solid rgba(247, 243, 238, 0.15);
  overflow: hidden;
}

.video-local {
  position: absolute;
  bottom: 7rem;
  right: var(--space-6);
  width: 140px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  background-color: rgba(247, 243, 238, 0.1);
  border: 2px solid rgba(247, 243, 238, 0.2);
  overflow: hidden;
}

.video-timer {
  font-family: var(--font-mono);
  color: var(--color-parchment);
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
}

.video-controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.btn-end-call {
  background-color: var(--color-rose);
  color: #ffffff;
  border-radius: var(--radius-full);
  padding: var(--space-4) var(--space-8);
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-base);
}
.btn-end-call:hover { background-color: #a14949; }


/* ============================================================
   SECTION 12 — CHAT COMPONENTS (rooms.html)
   ============================================================ */

/* --- App layout wrapper --- */
.app-layout {
  display: flex;
  height: calc(100vh - var(--nav-height));
  margin-top: var(--nav-height);
  overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background-color: #ffffff;
  border-right: 1px solid var(--color-stone);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: var(--weight-regular);
  color: var(--color-grey);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  padding: var(--space-5) var(--space-4) var(--space-2);
  display: block;
}

/* --- Main chat area --- */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--color-parchment);
}

/* --- Chat header --- */
.chat-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--color-stone);
  padding: 0 var(--space-5);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chat-header-title {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-midnight);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* --- Messages area --- */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  scroll-behavior: smooth;
}

/* --- Individual message --- */
.message {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  position: relative;
}

.message-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: #ffffff;
  text-transform: uppercase;
  flex-shrink: 0;
}

.message-content {
  max-width: 72%;
}

.message-sender {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: var(--weight-semibold);
  color: var(--color-midnight);
  margin-bottom: var(--space-1);
}

.message-bubble {
  background-color: #ffffff;
  border: 1px solid var(--color-stone);
  border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  color: var(--color-midnight);
  line-height: var(--leading-relaxed);
}

.message.is-own {
  flex-direction: row-reverse;
}

.message.is-own .message-bubble {
  background-color: var(--color-midnight);
  color: var(--color-parchment);
  border-color: var(--color-midnight);
  border-radius: var(--radius-lg) 0 var(--radius-lg) var(--radius-lg);
}

.message.is-own .message-content {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
}

.message-time {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-grey);
  margin-top: var(--space-1);
}

/* --- Date divider --- */
.date-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.date-divider-line {
  flex: 1;
  height: 1px;
  background-color: var(--color-stone);
}

.date-divider-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-grey);
  white-space: nowrap;
}

/* --- New messages indicator --- */
.new-messages-indicator {
  position: sticky;
  bottom: var(--space-3);
  display: flex;
  justify-content: center;
}

.new-messages-pill {
  background-color: var(--color-terracotta);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

/* --- Message input bar --- */
.message-input-bar {
  background-color: #ffffff;
  border-top: 1px solid var(--color-stone);
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.message-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  color: var(--color-midnight);
  resize: none;
  max-height: 100px;
  line-height: var(--leading-relaxed);
}

.message-input::placeholder {
  color: var(--color-grey);
}

.message-emoji-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-grey);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}
.message-emoji-btn:hover {
  color: var(--color-midnight);
  background-color: var(--color-linen);
}

/* --- DM list item --- */
.dm-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  border-left: 3px solid transparent;
}

.dm-item:hover { background-color: var(--color-parchment); }
.dm-item.is-active {
  background-color: var(--color-linen);
  border-left-color: var(--color-terracotta);
}

.dm-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-full);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: #ffffff;
  background-color: var(--color-linen);
  color: var(--color-midnight);
}

.dm-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background-color: var(--color-eucalyptus);
  border-radius: 50%;
  border: 2px solid #ffffff;
}

.dm-info {
  flex: 1;
  min-width: 0;
}

.dm-name {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-midnight);
}

.dm-preview {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--color-grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-time {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-grey);
  flex-shrink: 0;
}

/* --- Empty state (chat) --- */
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12);
}


/* ============================================================
   SECTION 13 — TOAST NOTIFICATIONS
   ============================================================ */

.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background-color: var(--color-midnight);
  color: var(--color-parchment);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  pointer-events: auto;
  min-width: 220px;
  max-width: 360px;
  animation: toast-in 200ms ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast.is-success { background-color: var(--color-eucalyptus); color: #ffffff; }
.toast.is-warning { background-color: var(--color-amber); color: #ffffff; }
.toast.is-error   { background-color: var(--color-rose); color: #ffffff; }

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}


/* ============================================================
   SECTION 14 — EMPTY STATES
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  color: var(--color-eucalyptus);
  margin-bottom: var(--space-5);
  opacity: 0.7;
}

.empty-state-title {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-midnight);
  margin-bottom: var(--space-2);
}

.empty-state-body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  color: var(--color-grey);
  max-width: 320px;
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}


/* ============================================================
   SECTION 15 — SKELETON LOADING STATES
   ============================================================ */

@keyframes shimmer {
  0%   { background-position: -468px 0; }
  100% { background-position: 468px 0; }
}

.skeleton {
  background: linear-gradient(
    to right,
    var(--color-stone) 8%,
    #e8e3db 18%,
    var(--color-stone) 33%
  );
  background-size: 936px 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 1em;
  border-radius: var(--radius-sm);
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-card {
  height: 200px;
  border-radius: var(--radius-xl);
}


/* ============================================================
   SECTION 16 — TRUST PILLS & STATS
   ============================================================ */

.trust-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background-color: rgba(75, 124, 106, 0.08);
  border: 1px solid rgba(75, 124, 106, 0.18);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-eucalyptus);
  white-space: nowrap;
}

/* --- Stats bar --- */
.stats-bar {
  background-color: var(--color-linen);
  padding: var(--space-6) 0;
}

.stats-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: var(--weight-regular);
  color: var(--color-midnight);
  display: block;
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-number.is-live {
  color: var(--color-eucalyptus);
}

.stat-label {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-grey);
  letter-spacing: var(--tracking-wide);
}

.stat-separator {
  width: 1px;
  height: 40px;
  background-color: var(--color-stone);
}


/* ============================================================
   SECTION 17 — FOOTER
   ============================================================ */

.footer {
  background-color: var(--color-midnight);
  padding: var(--space-12) 0 var(--space-8);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-8);
  padding-bottom: var(--space-10);
  border-bottom: 1px solid rgba(247, 243, 238, 0.12);
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  align-items: center;
}

.footer-link {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: rgba(247, 243, 238, 0.6);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.footer-link:hover {
  color: var(--color-parchment);
  opacity: 1;
}

.footer-bottom {
  padding-top: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(247, 243, 238, 0.4);
  line-height: var(--leading-relaxed);
}


/* ============================================================
   SECTION 18 — INTEREST TILES (Onboarding)
   ============================================================ */

.interest-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.interest-tile {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-linen);
  border: 1.5px solid var(--color-stone);
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-midnight);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  user-select: none;
}

.interest-tile:hover {
  border-color: var(--color-midnight);
  background-color: #e6e1da;
}

.interest-tile.is-selected {
  background-color: rgba(201, 107, 74, 0.08);
  border-color: var(--color-terracotta);
  color: var(--color-terracotta);
}

/* --- Progress indicator --- */
.progress-indicator {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-grey);
  text-align: right;
  letter-spacing: var(--tracking-wide);
}


/* ============================================================
   SECTION 19 — PROFILE STATS
   ============================================================ */

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.profile-stat-card {
  background-color: var(--color-linen);
  border: 1.5px solid var(--color-stone);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
}

.profile-stat-number {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: var(--weight-regular);
  color: var(--color-midnight);
  display: block;
  line-height: 1;
  margin-bottom: var(--space-2);
}

.profile-stat-label {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-grey);
}


/* ============================================================
   SECTION 20 — FILTER BAR (feed.html)
   ============================================================ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  flex-wrap: wrap;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-linen);
  border: 1.5px solid var(--color-stone);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-midnight);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
  user-select: none;
}

.filter-pill:hover {
  border-color: var(--color-midnight);
}

.filter-pill.is-active {
  background-color: var(--color-terracotta);
  border-color: var(--color-terracotta);
  color: #ffffff;
}

.filter-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-grey);
  margin-left: var(--space-2);
}

.filter-clear {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-grey);
  cursor: pointer;
  background: none;
  border: none;
  padding: var(--space-2) var(--space-3);
  transition: color var(--transition-fast);
}
.filter-clear:hover { color: var(--color-midnight); }

/* --- Toggle pill (Online now) --- */
.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-linen);
  border: 1.5px solid var(--color-stone);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-midnight);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle-pill.is-on {
  background-color: rgba(75, 124, 106, 0.1);
  border-color: var(--color-eucalyptus);
  color: var(--color-eucalyptus);
}

/* ============================================================
   SECTION 21 — AUTH TABS
   ============================================================ */

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background-color: var(--color-linen);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
  margin-bottom: var(--space-6);
  gap: var(--space-1);
}

.auth-tab {
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-grey);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: background-color var(--transition-base), color var(--transition-base);
}

.auth-tab.is-active {
  background-color: var(--color-midnight);
  color: var(--color-parchment);
}


/* ============================================================
   SECTION 22 — PRICING TABLES (brand.html)
   ============================================================ */

.pricing-card {
  background-color: #ffffff;
  border: 1.5px solid var(--color-stone);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.pricing-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pricing-card.is-featured {
  border-color: var(--color-terracotta);
  box-shadow: 0 0 0 3px rgba(201, 107, 74, 0.1);
}

.pricing-card-header {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-midnight);
  margin-bottom: var(--space-4);
}

.pricing-figure {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  font-weight: var(--weight-regular);
  color: var(--color-terracotta);
  line-height: 1;
  margin-bottom: var(--space-4);
}

.pricing-figure sup {
  font-size: var(--text-xl);
  vertical-align: top;
  margin-top: var(--space-1);
}

.pricing-divider {
  height: 1px;
  background-color: var(--color-stone);
  margin: var(--space-4) 0;
}

.pricing-feature {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-charcoal);
  padding: var(--space-2) 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--color-linen);
}

.pricing-feature:last-child { border-bottom: none; }

.pricing-feature-tick {
  color: var(--color-eucalyptus);
  flex-shrink: 0;
}


/* ============================================================
   SECTION 23 — LEGAL PAGE LAYOUT
   ============================================================ */

.legal-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-16) var(--space-6) var(--space-20);
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-10);
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-6));
}

.legal-toc-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-grey);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.legal-toc-link {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-grey);
  padding: var(--space-2) 0;
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: var(--space-3);
  transition: color var(--transition-fast), border-color var(--transition-fast);
  line-height: var(--leading-normal);
}

.legal-toc-link:hover {
  color: var(--color-midnight);
  opacity: 1;
}

.legal-toc-link.is-active {
  color: var(--color-terracotta);
  border-left-color: var(--color-terracotta);
}

.legal-article {
  background-color: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--space-10);
}

.legal-article h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-3);
}

.legal-article h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}

.legal-article h3 {
  font-size: var(--text-lg);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.legal-article p {
  margin-bottom: var(--space-4);
}

.legal-article a {
  color: var(--color-terracotta);
  text-decoration: underline;
}

.legal-updated {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-grey);
  margin-bottom: var(--space-8);
}


/* ============================================================
   SECTION 24 — SEO LANDING PAGE COMPONENTS
   ============================================================ */

.seo-hero {
  padding: calc(var(--nav-height) + var(--space-20)) 0 var(--space-20);
  background-color: var(--color-parchment);
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background-color: rgba(75, 124, 106, 0.08);
  border: 1px solid rgba(75, 124, 106, 0.18);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-eucalyptus);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}


/* ============================================================
   SECTION 25 — RESPONSIVE BREAKPOINTS
   ============================================================ */

/* --- Mobile: < 640px --- */
@media (max-width: 639px) {
  :root {
    --nav-height: var(--nav-height-mobile);
  }

  .container,
  .container-content,
  .container-narrow {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .section {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }

  .section-lg {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .stats-bar-inner {
    gap: var(--space-8);
  }

  .stat-separator { display: none; }

  /* Nav: logo + single CTA only */
  .nav-marketing .nav-sign-in {
    display: none;
  }

  /* Auth: single column */
  .auth-split-left {
    display: none;
  }

  /* App layout: full screen toggle */
  .sidebar {
    position: fixed;
    inset: 0;
    z-index: var(--z-fixed);
    width: 100%;
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    display: none;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .toast-container {
    right: var(--space-4);
    left: var(--space-4);
    bottom: var(--space-4);
    align-items: stretch;
  }

  .toast {
    max-width: 100%;
  }

  .footer-top {
    flex-direction: column;
    gap: var(--space-6);
  }

  .footer-links {
    gap: var(--space-4);
  }

  .upsell-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-bar {
    gap: var(--space-2);
  }
}

/* --- Tablet: 640px–1023px --- */
@media (min-width: 640px) and (max-width: 1023px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    width: 240px;
    min-width: 240px;
  }

  .legal-layout {
    grid-template-columns: 200px 1fr;
    gap: var(--space-6);
  }
}

/* --- Desktop: ≥ 1024px --- */
@media (min-width: 1024px) {
  .sidebar.mobile-only {
    transform: none;
  }
}


/* ============================================================
   SECTION 26 — ANIMATION UTILITIES
   ============================================================ */

/* --- Count-up animation helper (JS targets .count-up) --- */
.count-up {
  display: inline-block;
}

/* --- Fade-in on viewport entry --- */
.fade-in-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.fade-in-up:nth-child(1) { transition-delay: 0ms; }
.fade-in-up:nth-child(2) { transition-delay: 80ms; }
.fade-in-up:nth-child(3) { transition-delay: 160ms; }
.fade-in-up:nth-child(4) { transition-delay: 240ms; }

/* --- Pulse dot (online indicator variant) --- */
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.pulse-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}


/* ============================================================
   SECTION 27 — UTILITY CLASSES
   ============================================================ */

/* --- Display --- */
.hidden   { display: none !important; }
.sr-only  {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Text alignment --- */
.text-left    { text-align: left; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }

/* --- Text colours --- */
.text-midnight   { color: var(--color-midnight) !important; }
.text-terracotta { color: var(--color-terracotta) !important; }
.text-eucalyptus { color: var(--color-eucalyptus) !important; }
.text-grey       { color: var(--color-grey) !important; }
.text-parchment  { color: var(--color-parchment) !important; }

/* --- Spacing helpers (margin-bottom) --- */
.mb-2  { margin-bottom: var(--space-2); }
.mb-3  { margin-bottom: var(--space-3); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-5  { margin-bottom: var(--space-5); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }
.mb-12 { margin-bottom: var(--space-12); }

/* --- Padding helpers --- */
.pt-nav { padding-top: var(--nav-height); }

/* --- Border radius helpers --- */
.rounded    { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* --- Overflow --- */
.overflow-hidden { overflow: hidden; }
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Cursor --- */
.cursor-pointer { cursor: pointer; }

/* --- Width --- */
.w-full  { width: 100%; }
.w-auto  { width: auto; }
.min-w-0 { min-width: 0; }

/* --- Flex helpers --- */
.flex-1        { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center  { align-items: center; }
.justify-end   { justify-content: flex-end; }

/* --- Divider --- */
.divider {
  height: 1px;
  background-color: var(--color-stone);
  border: none;
  margin: var(--space-5) 0;
}

/* ============================================================
   END OF brand-system.css
   Amperly v1.0 · Purple Peppercorn Pty Ltd
   ============================================================ */
