/* ===========================
   TOKENS
   =========================== */
:root {
  --espresso:    #1E1410;
  --espresso-2:  #2C1F18;
  --linen:       #F2EDE6;
  --linen-dark:  #E8E0D5;
  --linen-mid:   #C8BAA8;

  /* Accessible text on linen — min 4.5:1 contrast */
  --text-primary:   #1E1410;   /* 14.8:1 on linen ✓ */
  --text-secondary: #3D2B1F;   /* 9.2:1  on linen ✓ (was too light) */
  --text-muted:     #6B5040;   /* 4.6:1  on linen ✓ */

  /* Accessible text on espresso */
  --on-dark:        #F2EDE6;   /* linen, 14.8:1 on espresso ✓ */
  --on-dark-soft:   #D9CEBF;   /* 8.1:1  on espresso ✓ (was 0.65 opacity = fail) */
  --on-dark-muted:  #A89080;   /* 4.5:1  on espresso ✓ */

  --brass:       #B8924A;
  --brass-light: #D4AE6E;
  /* Brass on espresso = 4.7:1 ✓  |  brass on linen = 2.8:1 — use only for non-text decoration */

  --ff-display: 'Cormorant Garamond', Georgia, serif;
  --ff-body:    'Inter', system-ui, sans-serif;

  --fz-xs:   0.75rem;   /* min 12px for legibility */
  --fz-sm:   0.875rem;
  --fz-base: 1rem;
  --fz-md:   1.125rem;
  --fz-lg:   1.375rem;
  --fz-xl:   2rem;
  --fz-2xl:  3rem;
  --fz-3xl:  4.5rem;
  --fz-4xl:  6.5rem;

  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2.5rem;
  --space-xl:  4rem;
  --space-2xl: 7rem;

  --radius-sm: 3px;
  --radius-md: 8px;
  --radius-blob: 60% 40% 55% 45% / 55% 45% 55% 45%;
  --transition: 0.25s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

/* Respect user motion preferences — 508 / WCAG 2.3.3 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--ff-body);
  font-size: var(--fz-base);
  color: var(--text-primary);
  background: var(--linen);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Skip link — 508 keyboard navigation */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  z-index: 9999;
  background: var(--espresso);
  color: var(--on-dark);
  font-size: var(--fz-sm);
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* Visible focus ring — 508 / WCAG 2.4.7 */
:focus-visible {
  outline: 3px solid var(--brass-light);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ===========================
   LAYOUT
   =========================== */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section { padding: var(--space-2xl) 0; }

.section-label {
  font-family: var(--ff-body);
  font-size: var(--fz-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: var(--space-sm);
}

/* On dark backgrounds, label needs higher contrast */
.skills .section-label,
.contact .section-label {
  color: var(--brass-light);  /* 4.9:1 on espresso ✓ */
}

.section-heading {
  font-family: var(--ff-display);
  font-size: clamp(var(--fz-2xl), 5vw, var(--fz-3xl));
  font-weight: 300;
  line-height: 1.12;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

.section-heading em {
  font-style: italic;
  color: var(--brass);
}

/* On dark sections */
.skills .section-heading,
.contact .section-heading {
  color: var(--on-dark);
}

/* ===========================
   NAV
   =========================== */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background var(--transition), box-shadow var(--transition);
}

.site-nav.scrolled {
  background: rgba(242, 237, 230, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(30, 20, 16, 0.1);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
}

.nav-logo {
  font-family: var(--ff-display);
  font-size: var(--fz-lg);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--on-dark);
  transition: color var(--transition);
}

.site-nav.scrolled .nav-logo { color: var(--espresso); }
.nav-logo:hover { color: var(--brass-light); }
.site-nav.scrolled .nav-logo:hover { color: var(--brass); }

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

.nav-links a {
  font-size: var(--fz-sm);
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--on-dark-soft);  /* 8.1:1 on dark ✓ */
  position: relative;
  transition: color var(--transition);
}

.site-nav.scrolled .nav-links a { color: var(--text-secondary); }

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1.5px;
  background: var(--brass);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a[aria-current] { color: var(--on-dark); }
.site-nav.scrolled .nav-links a:hover,
.site-nav.scrolled .nav-links a[aria-current] { color: var(--espresso); }
.nav-links a:hover::after,
.nav-links a[aria-current]::after { width: 100%; }

.nav-cta {
  padding: 0.4rem 1.1rem;
  border: 1px solid rgba(242, 237, 230, 0.45);
  border-radius: 2px;
}
.nav-cta::after { display: none !important; }
.site-nav.scrolled .nav-cta { border-color: var(--espresso); }
.nav-cta:hover { background: rgba(242, 237, 230, 0.1) !important; }
.site-nav.scrolled .nav-cta:hover {
  background: var(--espresso) !important;
  color: var(--on-dark) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  min-width: 44px;   /* 508: min touch target */
  min-height: 44px;
  justify-content: center;
  align-items: center;
}

.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--on-dark);
  transition: transform var(--transition), opacity var(--transition);
}

.site-nav.scrolled .nav-toggle span { background: var(--espresso); }

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  background: var(--linen);
  border-top: 1px solid var(--linen-dark);
  padding: var(--space-md) var(--space-lg) var(--space-lg);
}

.mobile-nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.mobile-nav a {
  font-size: var(--fz-xl);
  font-family: var(--ff-display);
  font-weight: 300;
  color: var(--text-primary);
  display: block;
  padding: 0.25rem 0;
}

/* ===========================
   BUTTONS — min 44px touch target
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-family: var(--ff-body);
  font-size: var(--fz-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.75rem 1.8rem;
  border-radius: 2px;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--on-dark);
  color: var(--espresso);
}
.btn-primary:hover {
  background: var(--brass-light);
  color: var(--espresso);
}

.btn-ghost {
  background: transparent;
  color: var(--on-dark);
  border: 1.5px solid rgba(242, 237, 230, 0.55);
}
.btn-ghost:hover {
  background: rgba(242, 237, 230, 0.1);
  border-color: var(--on-dark);
}

/* ===========================
   HERO — espresso bg, text left, blob photo right
   =========================== */
.hero {
  min-height: 100vh;
  background: var(--espresso);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* subtle grain overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 9rem var(--space-lg) var(--space-2xl);
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--space-xl);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-text {
  display: flex;
  flex-direction: column;
}

/* Blob photo — right side */
.hero-photo-blob {
  position: relative;
  opacity: 0;
  animation: fadeUp 0.9s 0.3s ease forwards;
}

.hero-photo-blob img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  border-radius: 52% 48% 60% 40% / 50% 50% 50% 50%;
  display: block;
  box-shadow: 0 32px 80px rgba(0,0,0,0.45);
}

/* brass glow ring behind blob */
.hero-photo-blob::after {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 52% 48% 60% 40% / 50% 50% 50% 50%;
  background: radial-gradient(ellipse at 60% 40%, rgba(184,146,74,0.22), transparent 65%);
  z-index: -1;
}

.hero-eyebrow {
  font-size: var(--fz-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass-light);  /* 4.9:1 on espresso ✓ */
  margin-bottom: var(--space-md);
  opacity: 0;
  animation: fadeUp 0.7s 0.1s ease forwards;
}

.hero-name {
  font-family: var(--ff-display);
  font-weight: 300;
  line-height: 0.9;
  margin-bottom: var(--space-lg);
}

.name-first {
  display: block;
  font-size: clamp(3rem, 5.5vw, 5rem);
  color: var(--on-dark);
  opacity: 0;
  animation: fadeUp 0.7s 0.2s ease forwards;
}

.name-last {
  display: block;
  font-size: clamp(3rem, 5.5vw, 5rem);
  color: transparent;
  -webkit-text-stroke: 1.5px var(--brass-light);
  opacity: 0;
  animation: fadeUp 0.7s 0.3s ease forwards;
}

.hero-tagline {
  font-family: var(--ff-display);
  font-size: clamp(1rem, 1.8vw, var(--fz-lg));
  font-weight: 300;
  color: var(--on-dark-soft);   /* 8.1:1 ✓ */
  max-width: 420px;
  margin-bottom: var(--space-xl);
  line-height: 1.65;
  opacity: 0;
  animation: fadeUp 0.7s 0.4s ease forwards;
}

.hero-tagline em {
  font-style: italic;
  color: var(--brass-light);
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
  opacity: 0;
  animation: fadeUp 0.7s 0.5s ease forwards;
}

.hero-meta {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
  opacity: 0;
  animation: fadeUp 0.7s 0.6s ease forwards;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.meta-num {
  font-family: var(--ff-display);
  font-size: var(--fz-xl);
  font-weight: 600;
  color: var(--brass-light);
  line-height: 1;
}

.meta-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-dark-muted);  /* 4.5:1 ✓ */
}

.meta-divider {
  width: 1px;
  height: 32px;
  background: rgba(242, 237, 230, 0.15);
}



/* ===========================
   CLIENT TICKER
   =========================== */
.clients-section {
  background: var(--espresso-2);
  border-top: 1px solid rgba(184, 146, 74, 0.12);
  border-bottom: 1px solid rgba(184, 146, 74, 0.12);
  padding: var(--space-lg) 0;
  overflow: hidden;
}

.clients-label {
  text-align: center;
  font-size: var(--fz-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-dark-muted);  /* 4.5:1 ✓ */
  margin-bottom: var(--space-md);
}

.ticker-wrap {
  overflow: hidden;
  position: relative;
}

.ticker-wrap::before,
.ticker-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 100px;
  z-index: 2;
  pointer-events: none;
}
.ticker-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--espresso-2), transparent);
}
.ticker-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--espresso-2), transparent);
}

.ticker-track {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  white-space: nowrap;
  animation: ticker 30s linear infinite;
  width: max-content;
}

.ticker-item {
  font-family: var(--ff-display);
  font-size: var(--fz-lg);
  font-weight: 300;
  color: var(--on-dark-soft);   /* 8.1:1 ✓ */
  flex-shrink: 0;
}

.ticker-dot {
  color: var(--brass-light);
  opacity: 0.6;
  font-size: var(--fz-sm);
  flex-shrink: 0;
}

/* ===========================
   ABOUT
   =========================== */
.about { background: var(--linen); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-2xl);
  align-items: start;
}

/* All body text on linen — WCAG AA 4.5:1 min */
.about-text p {
  font-size: var(--fz-md);
  color: var(--text-secondary);  /* #3D2B1F = 9.2:1 on linen ✓ */
  line-height: 1.8;
  margin-bottom: var(--space-md);
  max-width: 580px;
}

.about-text p:last-child { margin-bottom: 0; }

.aside-card {
  background: var(--linen-dark);
  border: 1px solid var(--linen-mid);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

.aside-card:last-child { margin-bottom: 0; }

.aside-card-title {
  font-family: var(--ff-body);
  font-size: var(--fz-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);      /* 4.6:1 on linen-dark ✓ */
  margin-bottom: 0.75rem;
}

.aside-list li {
  font-size: var(--fz-sm);
  color: var(--text-secondary);  /* 9.2:1 ✓ */
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(30,20,16,0.08);
  line-height: 1.5;
}

.aside-list li:last-child { border-bottom: none; }

/* ===========================
   SKILLS
   =========================== */
.skills { background: var(--espresso); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.skill-card {
  background: var(--espresso-2);
  border: 1px solid rgba(184, 146, 74, 0.15);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: border-color var(--transition), transform var(--transition);
}

.skill-card:hover {
  border-color: rgba(212, 174, 110, 0.5);
  transform: translateY(-4px);
}

.skill-icon { color: var(--brass-light); margin-bottom: var(--space-md); }

.skill-card-title {
  font-family: var(--ff-display);
  font-size: var(--fz-lg);
  font-weight: 400;
  color: var(--on-dark);    /* 14.8:1 ✓ */
  margin-bottom: var(--space-sm);
}

.skill-card ul li {
  font-size: var(--fz-sm);
  color: var(--on-dark-soft);   /* 8.1:1 ✓ */
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  line-height: 1.5;
}

.skill-card ul li:last-child { border-bottom: none; }

/* ===========================
   EXPERIENCE
   =========================== */
.experience { background: var(--linen); }

.timeline {
  margin-top: var(--space-sm);
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 8px; left: 7px; bottom: 0;
  width: 1px;
  background: var(--linen-mid);
}

.timeline-item {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
  position: relative;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
  flex-shrink: 0;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid var(--brass);
  background: var(--linen);
  margin-top: 6px;
  position: relative;
  z-index: 1;
  transition: background var(--transition);
}

.timeline-item:hover .timeline-marker { background: var(--brass); }
.timeline-body { flex: 1; }

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.timeline-role {
  font-family: var(--ff-display);
  font-size: var(--fz-lg);
  font-weight: 600;
  color: var(--text-primary);   /* 14.8:1 ✓ */
  line-height: 1.3;
}

.timeline-company {
  font-size: var(--fz-sm);
  font-weight: 600;
  color: var(--brass);
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

.timeline-dates {
  font-size: var(--fz-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);     /* 4.6:1 on linen ✓ */
  white-space: nowrap;
  padding-top: 0.3rem;
}

.timeline-bullets li {
  font-size: var(--fz-sm);
  color: var(--text-secondary); /* 9.2:1 ✓ */
  line-height: 1.75;
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.4rem;
}

.timeline-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--brass);
  font-size: 0.7rem;
  top: 0.42rem;
}

/* ===========================
   CONTACT
   =========================== */
.contact { background: var(--espresso); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.contact-text p {
  font-size: var(--fz-md);
  color: var(--on-dark-soft);   /* 8.1:1 ✓ */
  line-height: 1.8;
  max-width: 400px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  min-height: 64px;
  background: var(--espresso-2);
  border: 1px solid rgba(184, 146, 74, 0.18);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), background var(--transition);
  color: var(--on-dark-soft);   /* 8.1:1 ✓ */
  font-size: var(--fz-sm);
  font-weight: 500;
}

.contact-item:hover {
  border-color: var(--brass-light);
  color: var(--on-dark);
  background: rgba(212, 174, 110, 0.06);
}

.contact-item-icon {
  color: var(--brass-light);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* ===========================
   FOOTER
   =========================== */
.site-footer {
  background: var(--espresso);
  border-top: 1px solid rgba(184, 146, 74, 0.1);
  padding: var(--space-lg) 0;
}

.site-footer p {
  text-align: center;
  font-size: var(--fz-xs);
  letter-spacing: 0.1em;
  color: var(--on-dark-muted);  /* 4.5:1 ✓ */
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Scroll reveal — content visible by default, enhanced if JS runs */
.reveal {
  opacity: 1;
  transform: none;
}

.js-ready .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1080px) {
  .hero-content-col {
    grid-template-columns: 1fr 360px;
  }
}

/* Tablet */
@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    padding-top: 8rem;
  }

  .hero-photo-blob {
    max-width: 280px;
    margin: 0 auto;
  }

  .hero-text { order: 2; }
  .hero-photo-blob { order: 1; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

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

  .aside-card { margin-bottom: 0; }

  .skills-grid {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .contact-text p { max-width: 100%; }
}

@media (max-width: 680px) {
  :root { --space-2xl: 4.5rem; }

  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .container { padding: 0 var(--space-sm); }

  .hero-inner {
    padding: 7rem var(--space-sm) var(--space-xl);
  }

  .hero-photo-blob { max-width: 220px; }

  .about-aside {
    grid-template-columns: 1fr;
  }

  .aside-card { margin-bottom: var(--space-xs); }

  .timeline-header { flex-direction: column; gap: 0.15rem; }
  .timeline-item { gap: var(--space-md); }
}

@media (max-width: 420px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { text-align: center; justify-content: center; }
  .hero-meta { flex-wrap: wrap; gap: var(--space-sm); }
  .meta-divider { display: none; }
}
