*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --deep-ink: #0C1829;
  --blueprint: #2C5282;
  --bp-med: rgba(44,82,130,0.5);
  --bp-light: rgba(44,82,130,0.2);
  --bp-faint: rgba(44,82,130,0.06);
  --slate: #334155;
  --steel: #64748B;
  --fog: #94A3B8;
  --warm-white: #F7F5F0;
  --parchment: #EFECE5;
  --white: #FFFFFF;
  --signal-green: #3EB370;
  --muted-blue: #8BA3C1;
  --green-glow: rgba(62,179,112,0.15);
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--deep-ink);
  background: var(--deep-ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ========================================
   NAV
   ======================================== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
  background: rgba(247,245,240,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bp-light);
  transition: background 0.5s ease, border-color 0.5s ease;
}
nav.nav-dark {
  background: rgba(12,24,41,0.92);
  border-bottom-color: rgba(44,82,130,0.25);
}

.nav-logo { line-height: 1.05; text-decoration: none; display: block; }
.nav-logo .lf {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500; font-size: 15px;
  display: block; color: var(--steel);
  transition: color 0.4s;
}
.nav-logo .ll {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 15px;
  display: block; color: var(--deep-ink);
  transition: color 0.4s;
}
nav.nav-dark .lf { color: var(--fog); }
nav.nav-dark .ll { color: var(--warm-white); }

.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links li { flex: 0 0 auto; }
.nav-links a {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500; font-size: 13px;
  text-decoration: none;
  letter-spacing: 0.5px;
  color: var(--steel);
  transition: color 0.25s, font-family 0.15s;
  position: relative;
  display: inline-block;
  text-align: center;
}
/* Reserve the wider (mono) width so font swap doesn't reflow */
.nav-links a::after {
  content: attr(data-text);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500; font-size: 13px;
  letter-spacing: 0.5px;
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}
nav.nav-dark .nav-links a { color: var(--fog); }

/* Signal Green hover — always, on both light and dark nav */
.nav-links a:hover,
nav.nav-dark .nav-links a:hover {
  color: var(--signal-green) !important;
  font-family: 'IBM Plex Mono', monospace;
}
.nav-links a.active { color: var(--deep-ink); font-weight: 600; }
nav.nav-dark .nav-links a.active { color: var(--warm-white); }


/* ========================================
   SCROLL REVEAL with green flash
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.rv1 { transition-delay: 0.1s; }
.rv2 { transition-delay: 0.2s; }
.rv3 { transition-delay: 0.3s; }

/* Green reveal flash — a left-border pulse on reveal */
.reveal-accent {
  border-left: 2px solid transparent;
  transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.6s ease;
}
.reveal-accent.visible {
  animation: greenPulse 1.2s ease forwards;
}
@keyframes greenPulse {
  0% { border-left-color: var(--signal-green); }
  100% { border-left-color: transparent; }
}

/* ========================================
   TITLE BLOCK (blueprint annotation)
   ======================================== */
.tb {
  position: absolute;
  bottom: 0; right: 0;
  border-top: 1.5px solid var(--blueprint);
  border-left: 1.5px solid var(--blueprint);
  padding: 8px 14px;
  display: flex; gap: 16px;
}
.tb span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--blueprint);
  opacity: 0.6;
}
.tb-dark span { color: var(--fog); opacity: 0.4; }
.tb-dark { border-color: rgba(44,82,130,0.4); }

/* ========================================
   DIMENSION LINES
   ======================================== */
.dim-line {
  position: relative;
  height: 7px;
  margin-top: 8px;
}
.dim-line-body {
  position: absolute;
  top: 3px; left: 0; right: 0;
  height: 1.5px;
  background: var(--blueprint);
}
.dim-line .tick {
  position: absolute;
  top: 0; width: 1.5px; height: 7px;
  background: var(--blueprint);
}
.dim-line .tick-l { left: 0; }
.dim-line .tick-r { right: 0; }

/* ========================================
   HOME — HERO (dark section)
   ======================================== */
.home-hero {
  background: var(--deep-ink);
  padding: 92px 48px 48px;
}
.home-sheet {
  border: 1.5px solid var(--blueprint);
  padding: 80px 56px 56px;
  min-height: 380px;
  display: flex; align-items: center;
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  /* Faint grid — subtle */
  background-image:
    linear-gradient(rgba(44,82,130,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44,82,130,0.07) 1px, transparent 1px);
  background-size: 48px 48px;
}

.hc { max-width: 680px; position: relative; z-index: 1; }
.hc .nm-f {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500; font-size: 56px;
  color: var(--muted-blue); line-height: 1.05;
}
.hc .nm-l {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 56px;
  color: var(--warm-white); line-height: 1.05;
}
.hc .sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; color: var(--fog);
  letter-spacing: 1.5px; margin-top: 16px;
  text-transform: uppercase;
}
.hc .pos {
  font-family: 'Source Serif 4', serif;
  font-size: 18px; color: var(--fog);
  max-width: 440px; line-height: 1.65;
  margin-top: 28px;
}
.hc .dim-line-hero {
  margin-top: 12px;
  width: 140px;
}
.hc .dim-line-hero .dim-line-body { background: var(--warm-white); }
.hc .dim-line-hero .tick { background: var(--blueprint); }

/* ========================================
   HOME — NAV BOXES (warm section)
   ======================================== */
.nav-boxes {
  padding: 48px 48px;
  background: var(--warm-white);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}
.nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5px;
  background: var(--blueprint);
  border: 1.5px solid var(--blueprint);
  width: 100%;
  max-width: 920px;
}
.nav-box {
  background: var(--warm-white);
  padding: 36px 40px;
  cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s;
  text-decoration: none; display: block;
  position: relative;
  overflow: hidden;
}
.nav-box::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--signal-green);
  transform: scaleX(0);
  transition: transform 0.35s ease;
  transform-origin: left;
}
.nav-box:hover::after { transform: scaleX(1); }
.nav-box:hover .nb-title { color: var(--blueprint); }
.nav-box:hover .nb-arrow {
  color: var(--signal-green);
  font-family: 'IBM Plex Mono', monospace;
}
.nb-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; color: var(--blueprint);
  margin-bottom: 12px;
}
.nb-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 20px;
  color: var(--deep-ink); margin-bottom: 8px;
  transition: color 0.3s;
}
.nb-desc {
  font-family: 'Source Serif 4', serif;
  font-size: 14px; color: var(--steel);
  line-height: 1.55;
}
.nb-arrow {
  font-size: 14px; color: var(--fog);
  margin-top: 16px;
  transition: color 0.3s, font-family 0.15s;
}

/* ========================================
   CONTACT STRIPS
   ======================================== */
.cs-dark {
  background: var(--deep-ink);
  padding: 72px 48px;
}
.cs-dark .cs-inner { max-width: 860px; margin: 0 auto; }
.cs-dark .cs-text {
  font-family: 'Source Serif 4', serif;
  font-size: 18px; color: var(--fog);
  margin-bottom: 20px;
}
.cs-dark .cs-link {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500; font-size: 20px;
  color: var(--warm-white); text-decoration: none;
  border-bottom: 1.5px solid var(--steel);
  padding-bottom: 2px;
  transition: color 0.3s, border-color 0.3s, font-family 0.15s;
}
.cs-dark .cs-link:hover {
  color: var(--signal-green);
  border-color: var(--signal-green);
  font-family: 'IBM Plex Mono', monospace;
}

.cs-parch {
  background: var(--parchment);
  padding: 72px 48px;
}
.cs-parch .cs-inner { max-width: 860px; margin: 0 auto; }
.cs-parch .cs-text {
  font-family: 'Source Serif 4', serif;
  font-size: 18px; color: var(--slate);
  margin-bottom: 20px;
}
.cs-parch .cs-link {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500; font-size: 20px;
  color: var(--deep-ink); text-decoration: none;
  border-bottom: 1.5px solid var(--bp-light);
  padding-bottom: 2px;
  transition: color 0.3s, border-color 0.3s, font-family 0.15s;
}
.cs-parch .cs-link:hover {
  color: var(--signal-green);
  border-color: var(--signal-green);
  font-family: 'IBM Plex Mono', monospace;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
  padding: 24px 48px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; color: var(--fog);
  text-align: right;
}
footer.ft-warm { background: var(--warm-white); }
footer.ft-parch { background: var(--parchment); }
footer.ft-dark { background: var(--deep-ink); color: var(--steel); }
footer a { color: inherit; text-decoration: none; }

/* ========================================
   WORK PAGE
   ======================================== */
.work-header {
  background: var(--warm-white);
  padding: 92px 48px 0;
}
.work-header-sheet {
  border: 1.5px solid var(--blueprint);
  padding: 56px;
  position: relative;
  min-height: 180px;
  display: flex; align-items: flex-end;
  max-width: 920px;
  margin: 0 auto;
  background-image:
    linear-gradient(var(--bp-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-faint) 1px, transparent 1px);
  background-size: 48px 48px;
}
.wh-content { position: relative; z-index: 1; }
.wh-label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--blueprint); margin-bottom: 8px;
}
.wh-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 36px;
  color: var(--deep-ink);
}
.wh-sub {
  font-family: 'Source Serif 4', serif;
  font-size: 17px; color: var(--slate);
  margin-top: 12px; max-width: 500px;
  line-height: 1.6;
}

/* Work — narrative lead */
.work-narrative {
  padding: 0 48px;
  background: var(--warm-white);
}
.work-narrative-sheet {
  border: 1.5px solid var(--blueprint);
  border-top: none;
  background: var(--white);
  padding: 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 920px;
  margin: 0 auto;
}
.work-narrative-text {
  font-family: 'Source Serif 4', serif;
  font-size: 17px; color: var(--slate);
  line-height: 1.8;
}

/* Work — horizontal card rail */
.work-rail-wrap {
  background: var(--parchment);
  padding: 48px 0 24px;
}
.work-rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  max-width: 920px;
  margin: 0 auto;
  scrollbar-width: none;
}
.work-rail::-webkit-scrollbar { display: none; }

.work-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--white);
  border: 1.5px solid var(--blueprint);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background 0.3s;
}
.work-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--signal-green);
  transform: scaleX(0);
  transition: transform 0.35s ease;
  transform-origin: left;
}
.work-card:hover::after { transform: scaleX(1); }
.work-card:hover { background: rgba(44,82,130,0.03); }

.work-card-role {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500; font-size: 9px;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--blueprint);
  margin-bottom: 8px;
}
.work-card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 17px;
  color: var(--deep-ink);
  margin-bottom: 10px;
}
.work-card-detail {
  font-family: 'Source Serif 4', serif;
  font-size: 13px; color: var(--slate);
  line-height: 1.55;
}

/* Education */
.edu-strip {
  background: var(--parchment);
  padding: 24px 48px 48px;
}
.edu-inner { max-width: 860px; margin: 0 auto; }
.edu-label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--blueprint); margin-bottom: 28px;
}
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
}
.edu-item {
  padding-left: 16px;
  border-left: 2px solid var(--blueprint);
  transition: border-color 0.3s;
}
.edu-item:hover { border-left-color: var(--signal-green); }
.edu-school {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 14px;
  color: var(--deep-ink); margin-bottom: 4px;
}
.edu-detail {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; color: var(--steel);
  line-height: 1.5;
}

/* ========================================
   SERVICES PAGE
   ======================================== */
.svc-header {
  background: var(--warm-white);
  padding: 92px 48px 0;
}
.svc-header-sheet {
  border: 1.5px solid var(--blueprint);
  padding: 56px;
  position: relative;
  min-height: 180px;
  display: flex; align-items: flex-end;
  max-width: 920px;
  margin: 0 auto;
  background-image:
    linear-gradient(var(--bp-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-faint) 1px, transparent 1px);
  background-size: 48px 48px;
}
.sh-content { position: relative; z-index: 1; }
.sh-label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--blueprint); margin-bottom: 8px;
}
.sh-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 36px;
  color: var(--deep-ink);
}
.sh-sub {
  font-family: 'Source Serif 4', serif;
  font-size: 17px; color: var(--slate);
  margin-top: 12px; max-width: 500px;
  line-height: 1.6;
}

/* Services body */
.svc-body { padding: 0 48px; background: var(--warm-white); }
.svc-sheet {
  border: 1.5px solid var(--blueprint);
  border-top: none;
  background: var(--white);
  max-width: 920px;
  margin: 0 auto;
}
.svc-intro {
  padding: 48px 56px;
  border-bottom: 1px solid var(--bp-light);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.svc-intro-text {
  font-family: 'Source Serif 4', serif;
  font-size: 18px; color: var(--slate);
  line-height: 1.75; max-width: 560px;
}

.svc-skills {
  padding: 48px 56px;
  border-bottom: 1px solid var(--bp-light);
}
.svc-skills-label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--blueprint); margin-bottom: 28px;
}
.svc-skill {
  margin-bottom: 28px;
  padding-left: 20px;
  border-left: 2px solid var(--blueprint);
  transition: border-color 0.3s;
}
.svc-skill:last-child { margin-bottom: 0; }
.svc-skill:hover { border-left-color: var(--signal-green); }
.svc-skill-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 15px;
  color: var(--deep-ink); margin-bottom: 4px;
}
.svc-skill-text {
  font-family: 'Source Serif 4', serif;
  font-size: 14px; color: var(--slate);
  line-height: 1.65;
}

.svc-process { padding: 44px 56px; }
.svc-process-text {
  font-family: 'Source Serif 4', serif;
  font-size: 15px; color: var(--steel);
  line-height: 1.7; max-width: 520px;
}

/* ========================================
   CONTACT PAGE
   ======================================== */
.contact-full {
  min-height: 100vh;
  background: var(--warm-white);
  display: flex; align-items: center; justify-content: center;
  padding: 92px 48px 48px;
}
.contact-sheet {
  border: 1.5px solid var(--blueprint);
  padding: 80px 56px;
  position: relative;
  width: 100%;
  max-width: 700px;
  background-image:
    linear-gradient(var(--bp-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-faint) 1px, transparent 1px);
  background-size: 48px 48px;
}
.contact-sheet .ct-text {
  font-family: 'Source Serif 4', serif;
  font-size: 20px; color: var(--slate);
  max-width: 400px; line-height: 1.65;
  margin-bottom: 32px;
}
.contact-sheet .ct-email {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500; font-size: 28px;
  color: var(--deep-ink); text-decoration: none;
  border-bottom: 2px solid var(--blueprint);
  padding-bottom: 3px;
  transition: color 0.3s, border-color 0.3s, font-family 0.15s;
}
.contact-sheet .ct-email:hover {
  color: var(--signal-green);
  border-color: var(--signal-green);
  font-family: 'IBM Plex Mono', monospace;
}

/* ========================================
   DARK MODE (prefers-color-scheme)
   ======================================== */
@media (prefers-color-scheme: dark) {

  /* --- Light-section backgrounds → dark navy --- */
  .nav-boxes,
  .work-header,
  .work-narrative,
  .svc-header,
  .svc-body,
  .contact-full { background: #131E30; }

  .work-rail-wrap,
  .edu-strip,
  .cs-parch { background: #172236; }

  .work-narrative-sheet,
  .svc-sheet,
  .work-card { background: #1A2740; }

  .nav-box { background: #131E30; }

  /* --- Nav (light state) --- */
  nav {
    background: rgba(19,30,48,0.92);
    border-bottom-color: rgba(44,82,130,0.25);
  }
  .nav-logo .lf { color: var(--fog); }
  .nav-logo .ll { color: var(--warm-white); }
  .nav-links a { color: var(--fog); }
  .nav-links a.active { color: var(--warm-white); }

  /* --- Footer light variants --- */
  footer.ft-warm { background: #131E30; }
  footer.ft-parch { background: #172236; }

  /* --- Text color flips on light sections --- */

  /* Page titles (was deep-ink) */
  .wh-title,
  .sh-title,
  .nb-title,
  .edu-school,
  .svc-skill-title,
  .work-card-title { color: var(--warm-white); }

  /* Body text (was slate) */
  .wh-sub,
  .sh-sub,
  .work-narrative-text,
  .svc-intro-text,
  .svc-skill-text,
  .work-card-detail,
  .nb-desc,
  .contact-sheet .ct-text { color: var(--fog); }

  /* Small UI text (was steel) */
  .edu-detail,
  .svc-process-text { color: var(--muted-blue); }

  /* Contact email link */
  .contact-sheet .ct-email { color: var(--warm-white); }

  /* Parchment strip text */
  .cs-parch .cs-text { color: var(--fog); }
  .cs-parch .cs-link { color: var(--warm-white); }

  /* Blueprint sheet grids — slightly brighter lines on dark */
  .home-sheet,
  .work-header-sheet,
  .svc-header-sheet,
  .contact-sheet {
    background-image:
      linear-gradient(rgba(44,82,130,0.12) 1px, transparent 1px),
      linear-gradient(90deg, rgba(44,82,130,0.12) 1px, transparent 1px);
    background-size: 48px 48px;
  }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  nav { padding: 16px 24px; }
  .home-hero { padding: 80px 24px 24px; }
  .home-sheet { padding: 48px 24px 48px; min-height: 300px; }
  .nav-boxes { padding: 32px 24px; min-height: auto; }
  .nav-grid { grid-template-columns: 1fr; }

  .work-header { padding: 80px 24px 0; }
  .work-header-sheet { padding: 36px 24px; }
  .work-narrative { padding: 0 24px; }
  .work-narrative-sheet { padding: 28px 24px; grid-template-columns: 1fr; gap: 20px; }
  .work-rail { padding: 0 24px; max-width: none; }
  .work-card { flex: 0 0 240px; min-height: 160px; }

  .svc-header { padding: 80px 24px 0; }
  .svc-header-sheet { padding: 36px 24px; }
  .svc-body { padding: 0 24px; }
  .svc-intro, .svc-skills, .svc-process { padding: 28px 24px; }
  .svc-intro { grid-template-columns: 1fr; gap: 20px; }

  .contact-full { padding: 80px 24px 24px; }
  .contact-sheet { padding: 48px 24px; }
  .contact-sheet .ct-email { font-size: 20px; }

  .edu-strip { padding: 32px 24px; }
  .edu-grid { grid-template-columns: 1fr; gap: 20px; }

  .cs-dark, .cs-parch { padding: 48px 24px; }
  footer { padding: 20px 24px; }

  .hc .nm-f, .hc .nm-l { font-size: 40px; }
  .wh-title, .sh-title { font-size: 28px; }
  .proj-title { font-size: 18px; }
  .nav-box { padding: 28px 24px; }

  /* Hide faint grid on mobile — per brand guide */
  .home-sheet,
  .work-header-sheet,
  .svc-header-sheet,
  .contact-sheet { background-image: none; }
}

@media (max-width: 480px) {
  .hc .nm-f, .hc .nm-l { font-size: 32px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 12px; }
}
