/* ============================================================
   J.R. HAWTHORNE — MAIN.CSS
   Global styles, CSS custom properties, typography, layout
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Cinzel+Decorative:wght@400;700&family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&family=Inter:wght@300;400;500;600&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
  /* ── Color Palette ── */
  --color-void:        #0a0a0c;   /* Deepest background */
  --color-obsidian:    #111115;   /* Page background */
  --color-surface:     #16161c;   /* Card / section surfaces */
  --color-surface-2:   #1e1e27;   /* Elevated surface */
  --color-border:      #2a2a38;   /* Subtle borders */
  --color-border-light:#3a3a50;   /* Hover borders */

  --color-gold:        #c9933a;   /* Primary accent — muted amber gold */
  --color-gold-bright: #e8b455;   /* Hover/active gold */
  --color-gold-dim:    #7a5520;   /* Dimmed gold for subtle elements */
  --color-gold-glow:   rgba(201, 147, 58, 0.18); /* Glow / shadow */

  --color-text-primary:   #e8e4d9; /* Main body text — warm off-white */
  --color-text-secondary: #a09888; /* Secondary / supporting text */
  --color-text-muted:     #5e5a52; /* Muted labels, metadata */
  --color-text-gold:      #c9933a; /* Gold text for accents */

  /* ── Typography ── */
  --font-display:  'Cinzel Decorative', 'Cinzel', serif;
  --font-heading:  'Cinzel', serif;
  --font-body:     'EB Garamond', Georgia, serif;
  --font-ui:       'Inter', system-ui, sans-serif;

  /* ── Type Scale ── */
  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1.0625rem; /* 17px — slightly larger for Garamond legibility */
  --text-lg:   1.25rem;   /* 20px */
  --text-xl:   1.5rem;    /* 24px */
  --text-2xl:  2rem;      /* 32px */
  --text-3xl:  2.75rem;   /* 44px */
  --text-4xl:  3.75rem;   /* 60px */
  --text-5xl:  5rem;      /* 80px */

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

  /* ── Effects ── */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --shadow-gold: 0 0 30px rgba(201, 147, 58, 0.12), 0 0 60px rgba(201, 147, 58, 0.06);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.4);

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

  /* ── Layout ── */
  --max-width:        1200px;
  --max-width-narrow: 800px;
  --nav-height:       72px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background-color: var(--color-obsidian);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-gold-bright);
}

a:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 2px;
}

ul, ol {
  list-style: none;
}

/* ============================================================
   TYPOGRAPHY SYSTEM
   ============================================================ */

/* Display — Cinzel Decorative, used sparingly for the site name / hero title only */
.text-display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.1;
}

/* Headings — Cinzel */
h1, h2, h3, h4, h5, h6,
.heading {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-primary);
  letter-spacing: 0.03em;
}

h1 { font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl)); }
h2 { font-size: clamp(var(--text-xl),  3.5vw, var(--text-3xl)); }
h3 { font-size: clamp(var(--text-lg),  2.5vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); letter-spacing: 0.08em; text-transform: uppercase; }

p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--color-text-primary);
}

/* Section eyebrow label */
.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  display: block;
  margin-bottom: var(--space-3);
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--narrow {
  max-width: var(--max-width-narrow);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.section {
  padding-block: var(--space-24);
}

.section--sm {
  padding-block: var(--space-16);
}

.section--lg {
  padding-block: var(--space-32);
}

/* ============================================================
   ORNAMENTAL DIVIDER
   ============================================================ */
.ornament {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-block: var(--space-8);
}

.ornament::before,
.ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--color-gold-dim) 40%,
    var(--color-gold) 50%,
    var(--color-gold-dim) 60%,
    transparent
  );
}

.ornament--center::before { background: linear-gradient(to right, transparent, var(--color-gold-dim)); }
.ornament--center::after  { background: linear-gradient(to left, transparent, var(--color-gold-dim)); }

/* ============================================================
   ATMOSPHERIC BACKGROUND TEXTURES (CSS-only, no images needed)
   ============================================================ */

/* Grain noise overlay */
.bg-atmospheric {
  position: relative;
  isolation: isolate;
}

.bg-atmospheric::after {
  content: '';
  position: absolute;
  inset: 0;
  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)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

/* Surface variants */
.bg-void     { background-color: var(--color-void); }
.bg-obsidian { background-color: var(--color-obsidian); }
.bg-surface  { background-color: var(--color-surface); }

/* ============================================================
   SCROLL ANIMATION (subtle fade-up on scroll)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */
/* Mobile-first. Breakpoints:
   sm:  480px
   md:  768px
   lg:  1024px
   xl:  1200px
*/
