/* ============================================================
   SecondBrain Design System — shared-styles.css
   Brand: Professional Editorial
   Aesthetic: Bloomberg Terminal meets Australian real estate magazine
   ============================================================ */

/* -----------------------------------------------
   1. FONTS
   ----------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* -----------------------------------------------
   2. DESIGN TOKENS (CSS Custom Properties)
   ----------------------------------------------- */
:root {
  /* Brand Colors */
  --color-navy:      #0F1729;
  --color-charcoal:  #1A1F2E;
  --color-amber:     #D4A853;
  --color-gold:      #F5C542;
  --color-cream:     #FAF7F0;
  --color-white:     #FFFFFF;

  /* Derived / Functional Colors */
  --color-amber-dark:   #B8903F;
  --color-amber-light:  #E4C07A;
  --color-navy-light:   #1C2640;
  --color-border-dark:  rgba(212, 168, 83, 0.15);
  --color-border-light: rgba(15, 23, 41, 0.1);

  /* Text Colors */
  --text-on-dark:    #F0ECE3;
  --text-on-dark-muted: rgba(240, 236, 227, 0.65);
  --text-on-light:   #1A1F2E;
  --text-on-light-muted: rgba(26, 31, 46, 0.6);

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Spacing Scale */
  --space-xs:  0.25rem;   /* 4px  */
  --space-sm:  0.5rem;    /* 8px  */
  --space-md:  1rem;      /* 16px */
  --space-lg:  1.5rem;    /* 24px */
  --space-xl:  2rem;      /* 32px */
  --space-2xl: 3rem;      /* 48px */
  --space-3xl: 4rem;      /* 64px */
  --space-4xl: 6rem;      /* 96px */

  /* Border Radius */
  --radius-sm:   0.375rem;  /* 6px  */
  --radius-md:   0.5rem;    /* 8px  */
  --radius-lg:   0.75rem;   /* 12px */
  --radius-xl:   1rem;      /* 16px */
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg:  0 8px 30px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(212, 168, 83, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease-out;
  --transition-base: 250ms ease-out;
  --transition-slow: 400ms ease-out;
}

/* -----------------------------------------------
   3. BASE RESET / NORMALIZATION
   Works alongside Tailwind — only sets what
   Tailwind's preflight does not cover.
   ----------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* -----------------------------------------------
   4. TYPOGRAPHY SCALE
   ----------------------------------------------- */

/* Display heading — hero sections */
.text-display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 3rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* Heading hierarchy */
.text-h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.5rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.text-h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.text-h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.25;
}

.text-h4 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.3;
}

/* Body text */
.text-body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
}

.text-body-lg {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.6;
}

.text-body-sm {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Labels & small text */
.text-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-caption {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Responsive typography */
@media (min-width: 768px) {
  .text-display { font-size: 4rem; }
  .text-h1     { font-size: 3rem; }
  .text-h2     { font-size: 2.5rem; }
  .text-h3     { font-size: 1.75rem; }
}

@media (min-width: 1024px) {
  .text-display { font-size: 5rem; }
  .text-h1     { font-size: 3.5rem; }
  .text-h2     { font-size: 2.75rem; }
}

/* -----------------------------------------------
   5. LAYOUT
   ----------------------------------------------- */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

@media (min-width: 640px) {
  .container {
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
  }
}

/* -----------------------------------------------
   6. BUTTONS
   ----------------------------------------------- */
.btn-primary,
.btn-secondary,
.btn-ghost {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast),
              box-shadow var(--transition-fast),
              transform var(--transition-fast);
  white-space: nowrap;
  line-height: 1.4;
}

/* Primary — Amber with dark text */
.btn-primary {
  background-color: var(--color-amber);
  color: var(--color-navy);
  border-color: var(--color-amber);
}

.btn-primary:hover {
  background-color: var(--color-amber-dark);
  border-color: var(--color-amber-dark);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Secondary — Outlined */
.btn-secondary {
  background-color: transparent;
  color: var(--color-cream);
  border-color: rgba(250, 247, 240, 0.3);
}

.btn-secondary:hover {
  background-color: rgba(250, 247, 240, 0.08);
  border-color: var(--color-cream);
  color: var(--color-white);
}

/* Secondary on light backgrounds */
.section-light .btn-secondary,
.btn-secondary--dark {
  color: var(--color-navy);
  border-color: rgba(15, 23, 41, 0.25);
}

.section-light .btn-secondary:hover,
.btn-secondary--dark:hover {
  background-color: var(--color-navy);
  border-color: var(--color-navy);
  color: var(--color-white);
}

/* Ghost — Text only */
.btn-ghost {
  background-color: transparent;
  color: var(--color-amber);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-color: transparent;
}

.btn-ghost:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Button sizing */
.btn-lg {
  padding: 1rem 2.25rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.8125rem;
}

/* -----------------------------------------------
   7. CARDS
   ----------------------------------------------- */
.card {
  background-color: var(--color-navy-light);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-base),
              box-shadow var(--transition-base),
              transform var(--transition-base);
}

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

/* Card on light backgrounds */
.section-light .card,
.card--light {
  background-color: var(--color-white);
  border-color: var(--color-border-light);
}

.section-light .card:hover,
.card--light:hover {
  border-color: var(--color-amber);
  box-shadow: var(--shadow-md);
}

/* -----------------------------------------------
   8. BADGES
   ----------------------------------------------- */
.badge {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background-color: rgba(212, 168, 83, 0.12);
  color: var(--color-amber);
  border: 1px solid rgba(212, 168, 83, 0.2);
  white-space: nowrap;
}

.badge--gold {
  background-color: rgba(245, 197, 66, 0.12);
  color: var(--color-gold);
  border-color: rgba(245, 197, 66, 0.25);
}

.badge--light {
  background-color: rgba(15, 23, 41, 0.06);
  color: var(--text-on-light);
  border-color: rgba(15, 23, 41, 0.1);
}

/* -----------------------------------------------
   9. SECTION THEMES
   ----------------------------------------------- */
.section-dark {
  background-color: var(--color-navy);
  color: var(--text-on-dark);
}

.section-dark .text-muted {
  color: var(--text-on-dark-muted);
}

.section-light {
  background-color: var(--color-cream);
  color: var(--text-on-light);
}

.section-light .text-muted {
  color: var(--text-on-light-muted);
}

.section-gradient {
  background: linear-gradient(180deg, var(--color-navy) 0%, var(--color-charcoal) 100%);
  color: var(--text-on-dark);
}

.section-gradient .text-muted {
  color: var(--text-on-dark-muted);
}

/* -----------------------------------------------
   10. TRUST BAR
   ----------------------------------------------- */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border-dark);
  border-bottom: 1px solid var(--color-border-dark);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text-on-dark-muted);
}

.trust-bar__item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
}

.section-light .trust-bar {
  border-color: var(--color-border-light);
  color: var(--text-on-light-muted);
}

/* -----------------------------------------------
   11. STATS BAR
   ----------------------------------------------- */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2xl);
  padding: var(--space-xl) 0;
  text-align: center;
}

.stats-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stats-bar__number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 1.1;
  color: var(--color-amber);
}

.stats-bar__label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
  color: var(--text-on-dark-muted);
}

.section-light .stats-bar__label {
  color: var(--text-on-light-muted);
}

@media (min-width: 768px) {
  .stats-bar__number {
    font-size: 3.25rem;
  }
}

/* -----------------------------------------------
   12. VISUAL EFFECTS
   ----------------------------------------------- */

/* Grain overlay — apply to a parent with position:relative */
.grain-overlay {
  position: relative;
  isolation: isolate;
}

.grain-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  mix-blend-mode: overlay;
}

/* Gradient mesh — subtle radial gradients for hero backgrounds */
.gradient-mesh {
  position: relative;
  overflow: hidden;
}

.gradient-mesh::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(212, 168, 83, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 60%, rgba(245, 197, 66, 0.04) 0%, transparent 70%),
    radial-gradient(ellipse 70% 40% at 50% 80%, rgba(26, 31, 46, 0.3) 0%, transparent 70%);
  z-index: 0;
}

.gradient-mesh > * {
  position: relative;
  z-index: 1;
}

/* -----------------------------------------------
   13. ANIMATION KEYFRAMES
   ----------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-32px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

/* Animation utility classes */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out both;
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out both;
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease-out both;
}

.animate-slide-in-right {
  animation: slideInRight 0.6s ease-out both;
}

.animate-pulse {
  animation: pulse 2.5s ease-in-out infinite;
}

/* Staggered delay classes */
.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }
.delay-5 { animation-delay: 500ms; }
.delay-6 { animation-delay: 600ms; }

/* -----------------------------------------------
   14. UTILITY CLASSES
   ----------------------------------------------- */

/* Text colors */
.text-amber  { color: var(--color-amber); }
.text-gold   { color: var(--color-gold); }
.text-cream  { color: var(--color-cream); }
.text-navy   { color: var(--color-navy); }
.text-white  { color: var(--color-white); }
.text-muted  { /* handled contextually via section themes above */ }

/* Background colors */
.bg-navy     { background-color: var(--color-navy); }
.bg-charcoal { background-color: var(--color-charcoal); }
.bg-cream    { background-color: var(--color-cream); }
.bg-amber    { background-color: var(--color-amber); }
.bg-white    { background-color: var(--color-white); }

/* Font family utilities */
.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font-body); }

/* -----------------------------------------------
   15. RESPONSIVE HELPERS
   ----------------------------------------------- */

/* Hide/show at breakpoints — supplements Tailwind's responsive classes */
.hide-mobile  { display: none; }
.hide-desktop { display: block; }

@media (min-width: 768px) {
  .hide-mobile  { display: block; }
  .hide-desktop { display: none; }
}

/* Section padding — consistent vertical rhythm */
.section-padding {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
}

@media (min-width: 768px) {
  .section-padding {
    padding-top: var(--space-4xl);
    padding-bottom: var(--space-4xl);
  }
}
