/* ─────────────────────────────────────────────
   Barbara Maria Stafford — Shared Stylesheet
   ───────────────────────────────────────────── */

/* ── CUSTOM PROPERTIES ── */
:root {
  /* Colors */
  --bg:        #FAF9F6;
  --bg-warm:   #F3F0EB;
  --text:      #1C1C1C;
  --text-mid:  #555555;
  --text-light:#888888;
  --accent:    #B5614A;
  --accent-dk: #8F4A37;
  --accent-lt: #D4876F;
  --border:    #E2DDD7;
  --white:     #FFFFFF;

  /* Typography */
  --serif:  'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans:   'Inter', system-ui, -apple-system, sans-serif;

  /* Scale */
  --text-xs:   0.72rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.35rem;
  --text-2xl:  1.75rem;
  --text-3xl:  2.4rem;
  --text-4xl:  3.2rem;
  --text-5xl:  4.5rem;

  /* Spacing */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-12: 6rem;
  --space-16: 8rem;

  /* Layout */
  --max-w:    1100px;
  --max-w-md: 720px;
  --gutter:   6%;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.18s;
  --t-base: 0.32s;
  --t-slow: 0.6s;
}

/* ── RESET & BASE ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}
h1 { font-size: clamp(2.4rem, 6vw, var(--text-5xl)); }
h2 { font-size: clamp(1.8rem, 4vw, var(--text-3xl)); }
h3 { font-size: clamp(1.3rem, 2.5vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); font-family: var(--sans); font-weight: 600; }
p { font-size: var(--text-base); color: var(--text-mid); line-height: 1.8; margin-bottom: 1.2em; }
p:last-child { margin-bottom: 0; }

/* ── LAYOUT ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container--narrow {
  max-width: var(--max-w-md);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
section { padding: var(--space-16) var(--gutter); }
.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ── SECTION LABELS ── */
.section-label {
  font-family: var(--sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: var(--space-2);
}
.section-divider {
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin: var(--space-3) 0 var(--space-6);
}

/* ── NAV ── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(250,249,246,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--t-base) var(--ease);
}
#nav.elevated { box-shadow: 0 2px 20px rgba(0,0,0,0.07); }
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: flex; align-items: center; gap: clamp(1rem, 2vw, var(--space-4));
}
.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-mid);
  position: relative;
  padding-bottom: 2px;
  transition: color var(--t-fast);
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-base) var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after { transform: scaleX(1); }

/* Hamburger */
.nav-hamburger {
  display: none; flex-direction: column; justify-content: space-between;
  width: 22px; height: 15px; background: none; border: none; padding: 0;
}
.nav-hamburger span {
  display: block; width: 100%; height: 1.5px; background: var(--text);
  transition: all var(--t-base) var(--ease);
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.75px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.75px) rotate(-45deg); }

/* Mobile drawer */
.nav-drawer {
  position: fixed; top: 64px; left: 0; right: 0; bottom: 0; z-index: 999;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-4);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base) var(--ease);
}
.nav-drawer.open { opacity: 1; pointer-events: all; }
.nav-drawer a {
  font-family: var(--serif); font-size: var(--text-2xl); color: var(--text);
  transition: color var(--t-fast);
}
.nav-drawer a:hover { color: var(--accent); }

/* ── PAGE HERO ── */
.page-hero {
  padding-top: calc(64px + var(--space-12));
  padding-bottom: var(--space-12);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.page-hero-inner { max-width: var(--max-w); margin: 0 auto; }
.page-hero h1 { margin-bottom: var(--space-3); }
.page-hero p {
  font-size: var(--text-lg); color: var(--text-mid);
  max-width: 600px; line-height: 1.8;
}

/* ── ACCENT LINE ── */
.accent-rule {
  border: none; border-top: 1px solid var(--border);
  margin: var(--space-8) 0;
}
.accent-rule--bold {
  border-top-width: 2px;
  border-top-color: var(--accent);
  width: 48px;
  margin-left: 0;
}

/* ── BUTTONS ── */
.btn {
  display: inline-block;
  font-family: var(--sans); font-size: var(--text-sm); font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.7rem 1.6rem;
  border-radius: 2px;
  transition: all var(--t-base) var(--ease);
  text-decoration: none;
}
.btn-accent {
  background: var(--accent); color: var(--white); border: 1px solid var(--accent);
}
.btn-accent:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
.btn-outline {
  background: transparent; color: var(--accent); border: 1px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: var(--white); }

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  transition: box-shadow var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}
.card-body { padding: var(--space-4); }
.card-body h3 { font-size: var(--text-xl); margin-bottom: var(--space-1); }
.card-body .year {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); display: block; margin-bottom: var(--space-2);
}
.card-body p { font-size: var(--text-sm); margin-bottom: var(--space-3); }

/* ── FADE-IN ANIMATION ── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-in.delay-1 { transition-delay: 0.1s; }
.fade-in.delay-2 { transition-delay: 0.2s; }
.fade-in.delay-3 { transition-delay: 0.3s; }
.fade-in.delay-4 { transition-delay: 0.4s; }
.fade-in.delay-5 { transition-delay: 0.5s; }

/* ── FOOTER ── */
#footer {
  background: var(--text);
  color: rgba(255,255,255,0.6);
  padding: var(--space-8) var(--gutter);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: var(--space-4);
}
.footer-name {
  font-family: var(--serif); font-size: var(--text-lg);
  color: var(--white); font-weight: 700; display: block; margin-bottom: 0.4rem;
}
.footer-tagline { font-size: var(--text-sm); max-width: 380px; line-height: 1.7; }
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; text-align: right; }
.footer-links a { font-size: var(--text-sm); color: rgba(255,255,255,0.55); transition: color var(--t-fast); }
.footer-links a:hover { color: var(--white); }
.footer-bottom {
  max-width: var(--max-w);
  margin: var(--space-4) auto 0;
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--space-2);
  font-size: var(--text-xs); color: rgba(255,255,255,0.35);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  :root { --gutter: 5%; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
}
@media (max-width: 640px) {
  :root { --gutter: 5%; }
  section { padding: var(--space-12) var(--gutter); }
  .footer-inner { flex-direction: column; }
  .footer-links { text-align: left; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ── PRINT (for CV page) ── */
@media print {
  #nav, #footer, .btn, .fade-in { display: none !important; opacity: 1 !important; transform: none !important; }
  body { font-size: 11pt; color: #000; background: #fff; }
  h1, h2, h3, h4 { color: #000; }
  a { color: #000; text-decoration: underline; }
  section { padding: 1.5rem 0; }
  .cv-section { page-break-inside: avoid; }
}
