/* ============================================================
   BRIOO DESIGN SYSTEM — brioo-design-system.css
   brioo.ai — Website Redesign · Phase 1
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=DM+Sans:wght@200;300;400;500&family=DM+Mono:wght@300;400&display=swap');

/* ============================================================
   1. CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* --- Colour Palette --- */
  --teal-deep:    #0D3840;
  --teal:         #1A5F6A;
  --teal-light:   #2A8A9A;
  --gold:         #C9A84C;
  --gold-light:   #E8C97A;
  --gold-pale:    rgba(201, 168, 76, 0.1);
  --smoke:        #F5F3EE;
  --white:        #FFFFFF;
  --ink:          #1C1C1E;
  --muted:        #6A6A6A;
  --body-text:    #3A3A3A;
  --border:       rgba(201, 168, 76, 0.2);

  /* --- Spacing Scale --- */
  --sp-1:   4px;
  --sp-2:   8px;
  --sp-3:   16px;
  --sp-4:   24px;
  --sp-5:   32px;
  --sp-6:   48px;
  --sp-7:   64px;
  --sp-8:   96px;

  /* --- Typography --- */
  --font-display:   'Cormorant Garamond', serif;
  --font-body:      'DM Sans', sans-serif;
  --font-mono:      'DM Mono', monospace;

  /* --- Border Radius --- */
  --radius-sm:  2px;
  --radius-md:  4px;
  --radius-lg:  6px;
  --radius-pill: 100px;

  /* --- Shadows --- */
  --shadow-sm:   0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md:   0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg:   0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-gold: 0 4px 16px rgba(201, 168, 76, 0.3);

  /* --- Transitions --- */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast:    200ms;
  --dur-med:     300ms;
  --dur-slow:    600ms;
  --dur-hero:    700ms;
}

/* ============================================================
   2. BASE RESET + BODY DEFAULTS
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--ink);
  background: var(--smoke);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--teal-light);
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}

a:hover {
  color: var(--teal);
}

::selection {
  background: var(--gold-pale);
  color: var(--teal-deep);
}

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */

/* --- Hero / Display --- */
.t-hero,
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 300;
  line-height: 1.2;
  color: var(--white);
}

.t-hero em,
h1 em {
  color: var(--gold-light);
  font-style: italic;
}

/* --- H2 — Section Headings --- */
h2,
.t-h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 300;
  line-height: 1.2;
  color: var(--teal-deep);
  margin-bottom: 1.5rem;
}

h2.on-dark,
.t-h2.on-dark {
  color: var(--white);
}

/* --- H3 — Subsection Headings --- */
h3,
.t-h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--teal);
  margin: 2.5rem 0 0.75rem;
}

h3.on-dark,
.t-h3.on-dark {
  color: var(--gold-light);
}

/* --- H4 — Labels --- */
h4,
.t-h4 {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.5rem 0 0.5rem;
}

/* --- Body Text --- */
p,
.t-body {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 300;
  color: var(--body-text);
  line-height: 1.75;
  margin-bottom: 0.9rem;
  max-width: 700px;
}

p.on-dark,
.t-body.on-dark {
  color: rgba(255, 255, 255, 0.55);
}

/* --- Eyebrow Label --- */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
  display: block;
}

.eyebrow.on-dark {
  color: rgba(201, 168, 76, 0.7);
}

/* --- Caption / Small --- */
.t-caption {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.5;
}

/* --- Monospace / Technical --- */
.t-mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--teal);
}

/* ============================================================
   4. REUSABLE COMPONENTS
   ============================================================ */

/* --- Section Container --- */
.section {
  padding: var(--sp-8) var(--sp-4);
}

.section-inner {
  max-width: 980px;
  margin: 0 auto;
}

/* --- Section Backgrounds --- */
.section-dark  { background: var(--teal-deep); }
.section-white { background: var(--white); }
.section-smoke { background: var(--smoke); }

/* --- Divider (48px gold line) --- */
.divider {
  width: 48px;
  height: 1px;
  background: var(--gold);
  opacity: 0.4;
  margin: 2rem 0;
}

/* --- Callout Box --- */
.callout {
  border-left: 3px solid var(--gold);
  background: var(--gold-pale);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 2rem 0;
}

.callout p {
  font-size: 0.88rem;
  color: var(--teal-deep);
  margin: 0;
  max-width: none;
  font-weight: 400;
}

/* --- Primary Button (Gold) --- */
.btn-primary {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-deep);
  background: var(--gold);
  padding: 0.85em 2em;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--dur-fast) ease,
    transform var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease;
}

.btn-primary:hover {
  background: #D4B560;
  color: var(--teal-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}

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

/* --- Ghost Button (White Border) --- */
.btn-ghost {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  background: transparent;
  padding: 0.85em 2em;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color var(--dur-fast) ease,
    color var(--dur-fast) ease,
    background var(--dur-fast) ease;
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201, 168, 76, 0.06);
}

/* --- Pill Tag --- */
.pill {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.4em 1.1em;
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: var(--radius-pill);
  color: rgba(255, 255, 255, 0.4);
}

/* ============================================================
   5. NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-5);
  z-index: 1000;
  background: transparent;
  transition:
    background var(--dur-med) ease,
    backdrop-filter var(--dur-med) ease;
}

.nav.scrolled {
  background: rgba(13, 56, 64, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  list-style: none;
}

.nav-links a {
  font-size: 0.78rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.04em;
  transition: color var(--dur-fast) ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
}

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

/* ============================================================
   6. MOTION / ANIMATION UTILITIES
   ============================================================ */

/* --- Keyframes --- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* --- Fade Up Class (for IntersectionObserver) --- */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}

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

/* --- Hero-specific fade (longer, deeper translate) --- */
.fade-up-hero {
  opacity: 0;
  transform: translateY(24px);
  animation-fill-mode: forwards;
  animation-duration: var(--dur-hero);
  animation-timing-function: var(--ease-out);
}

.fade-up-hero.animate {
  animation-name: fadeUp;
}

/* --- Stagger Children (up to 8) --- */
.stagger-children > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children > *:nth-child(2) { transition-delay: 80ms; }
.stagger-children > *:nth-child(3) { transition-delay: 160ms; }
.stagger-children > *:nth-child(4) { transition-delay: 240ms; }
.stagger-children > *:nth-child(5) { transition-delay: 320ms; }
.stagger-children > *:nth-child(6) { transition-delay: 400ms; }
.stagger-children > *:nth-child(7) { transition-delay: 480ms; }
.stagger-children > *:nth-child(8) { transition-delay: 560ms; }

/* --- Hero headline stagger (150ms apart, per spec) --- */
.stagger-hero > *:nth-child(1) { animation-delay: 0ms; }
.stagger-hero > *:nth-child(2) { animation-delay: 150ms; }
.stagger-hero > *:nth-child(3) { animation-delay: 300ms; }

/* --- Reduced motion preference --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fade-up {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   7. FOOTER
   ============================================================ */
.footer {
  background: var(--teal-deep);
  padding: var(--sp-7) var(--sp-4);
  position: relative;
  overflow: hidden;
}

.footer-inner {
  max-width: 980px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.footer-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0.04;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  color: var(--white);
}

.wordmark span {
  color: var(--gold);
}

/* ============================================================
   8. RESPONSIVE BREAKPOINTS — Mobile First
   ============================================================ */

/* --- Small (640px+) — Tablet portrait --- */
@media (min-width: 640px) {
  .section {
    padding: var(--sp-8) var(--sp-5);
  }
}

/* --- Medium (960px+) — Tablet landscape / small desktop --- */
@media (min-width: 960px) {
  .section {
    padding: var(--sp-8) var(--sp-6);
  }

  .nav {
    padding: 0 var(--sp-6);
  }
}

/* --- Large (1280px+) — Desktop --- */
@media (min-width: 1280px) {
  .section {
    padding: var(--sp-8) var(--sp-7);
  }

  .section-inner {
    max-width: 980px;
  }

  .nav {
    padding: 0 var(--sp-7);
  }
}

/* --- Mobile nav collapse (below 640px) --- */
@media (max-width: 639px) {
  .nav {
    padding: 0 var(--sp-3);
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(13, 56, 64, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--sp-3) 0;
    gap: 0;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    list-style: none;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem var(--sp-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  h1, .t-hero {
    font-size: clamp(2rem, 8vw, 2.6rem);
  }

  h2, .t-h2 {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }

  h3, .t-h3 {
    font-size: 1.25rem;
  }

  .btn-primary,
  .btn-ghost {
    width: 100%;
    text-align: center;
  }
}
