/* ==========================================================================
   Troy McCartan — Personal Site
   Modern, premium, high-tech executive portfolio.
   Lightweight: pure CSS motion, no frameworks, no external fonts.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. Design tokens (CSS custom properties)
   --------------------------------------------------------------------------- */
:root {
  /* Colour system */
  --bg:          #050608;          /* near-black primary background */
  --bg-soft:     #0a0d12;          /* slightly raised surface */
  --surface:     #0d1117;          /* card surface */
  --surface-2:   #121821;          /* card hover surface */
  --accent:      #00baff;          /* primary blue accent */
  --accent-dim:  #0a86b8;          /* deeper accent for gradients */
  --silver:      #c7ccd6;          /* metallic silver */
  --silver-dim:  #7d8694;          /* muted silver for borders/edges */

  --text:        #eef2f7;          /* primary text */
  --text-soft:   #aab3c0;          /* secondary text */
  --text-mute:   #6b7480;          /* tertiary / labels */

  --line:        rgba(199, 204, 214, 0.12);   /* hairline borders */
  --line-strong: rgba(199, 204, 214, 0.22);

  /* Metallic silver edge gradient (used on cards / nav) */
  --edge: linear-gradient(135deg, rgba(199,204,214,.35), rgba(199,204,214,0) 40%, rgba(0,186,255,.25) 100%);

  /* Spacing & layout */
  --maxw: 1140px;
  --pad: clamp(1.1rem, 4vw, 2rem);
  --radius: 14px;
  --radius-sm: 10px;

  /* Type scale (fluid) */
  --fs-hero:   clamp(2.6rem, 8vw, 5.2rem);
  --fs-h2:     clamp(1.7rem, 4vw, 2.6rem);
  --fs-h3:     clamp(1.05rem, 2vw, 1.2rem);
  --fs-lead:   clamp(1.05rem, 2.2vw, 1.3rem);
  --fs-body:   1rem;
  --fs-small:  0.875rem;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 0.18s;
  --t-med: 0.35s;

  --nav-h: 64px;

  /* Body: system font stack (fast, no request). Display: one loaded family. */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont,
          "Segoe UI", Roboto, sans-serif;
}

/* ---------------------------------------------------------------------------
   2. Reset & base
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.08;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}
p { margin: 0; }
/* Display font on UI chrome for a cohesive, "designed" feel */
.nav__brand, .btn, .section__eyebrow, .hero__eyebrow, .card__num { font-family: var(--font-display); }
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* Accessible skip link */
.skip-link {
  position: absolute;
  left: 50%;
  top: -100px;
  transform: translateX(-50%);
  background: var(--accent);
  color: #001019;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 8px;
  z-index: 1000;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 0; }

/* Global visible focus state (not colour-only — uses outline + offset) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------------------
   3. Section scaffolding
   --------------------------------------------------------------------------- */
.section {
  position: relative;
  padding-block: clamp(4rem, 9vw, 7rem);
}

/* Hairline separators between sections */
.section + .section,
.footer { border-top: 1px solid var(--line); }

.section__eyebrow,
.hero__eyebrow {
  display: inline-block;
  font-size: var(--fs-small);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
}
/* Non-colour cue for eyebrow labels: a leading accent tick */
.section__eyebrow::before,
.hero__eyebrow::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 0.6rem;
}

.section__title {
  font-size: var(--fs-h2);
  max-width: 18ch;
  margin-bottom: 1.5rem;
  background: linear-gradient(180deg, #ffffff, #b9c1ce);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------------------------------------------------------------------
   4. Buttons
   --------------------------------------------------------------------------- */
.btn {
  --btn-bg: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  background: var(--btn-bg);
  color: var(--text);
  transition: transform var(--t-fast) var(--ease),
              box-shadow var(--t-med) var(--ease),
              border-color var(--t-fast) var(--ease),
              background var(--t-med) var(--ease);
  will-change: transform;
}
.btn--sm { padding: 0.65rem 1.1rem; }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #001722;
  border-color: transparent;
  box-shadow: 0 6px 20px -8px rgba(0, 186, 255, 0.6);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px rgba(0, 186, 255, 0.75);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn--ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 10px 26px -12px rgba(0, 186, 255, 0.55);
}

.btn__arrow { transition: transform var(--t-fast) var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }
.btn__icon { flex: none; }

/* ---------------------------------------------------------------------------
   5. Navigation
   --------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(5, 6, 8, 0.6);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  transition: background var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
/* Subtle metallic silver top edge */
.nav::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(199,204,214,.5), transparent);
  opacity: 0.6;
}
.nav.is-scrolled { background: rgba(5, 6, 8, 0.88); }

.nav__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  height: 100%;
  padding-inline: var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; }
/* Logo sits inside the fixed-height nav, so making it bigger never grows the bar */
.nav__brand-mark { display: inline-flex; align-items: center; }
.brand-logo { height: 42px; width: auto; display: block; }
/* TJM draw-on: visible by default; the .draw class plays the animation
   (present on load, then re-added on hover by main.js to replay it). */
.brand-logo .ln { stroke-dasharray: 1; stroke-dashoffset: 0; }
.brand-logo.draw .ln {
  animation: tjmDraw 0.85s var(--ease) both;
  animation-delay: var(--d, 0s);
}
@keyframes tjmDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .brand-logo.draw .ln { animation: none; stroke-dashoffset: 0; }
}
.nav__brand-name { letter-spacing: -0.01em; font-size: 0.98rem; }

.nav__menu { display: flex; align-items: center; gap: 0.35rem; }
.nav__link {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: 8px;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
/* Underline indicator — not colour-only (shape change communicates state) */
.nav__link::after {
  content: "";
  position: absolute;
  left: 0.85rem; right: 0.85rem;
  bottom: 0.3rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-fast) var(--ease);
}
.nav__link:hover { color: #fff; }
.nav__link:hover::after { transform: scaleX(0.5); }
.nav__link.is-active {
  color: #fff;
  background: rgba(0, 186, 255, 0.08);
}
.nav__link.is-active::after { transform: scaleX(1); }

/* Mobile toggle (hamburger) */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
}
.nav__toggle-bar {
  display: block;
  width: 20px; height: 2px;
  margin-inline: auto;
  background: var(--silver);
  border-radius: 2px;
  transition: transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------------------------------------------------------------------
   6. Hero
   --------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: clamp(3rem, 8vw, 5rem);
}

/* Decorative background stack */
.hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

/* Interactive constellation canvas (JS-driven). Sits above the grid/glow. */
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* When JS runs, the canvas replaces the static CSS-node fallback */
.js .hero__nodes { display: none; }

/* Fine technical blueprint grid */
.hero__grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(to right, rgba(199,204,214,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(199,204,214,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  /* Fade the grid toward edges so it reads as depth, not wallpaper */
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 40%, transparent 100%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 40%, transparent 100%);
}

/* Animated blue gradient glow */
.hero__glow {
  position: absolute;
  width: 70vw; height: 70vw;
  max-width: 820px; max-height: 820px;
  top: -18%; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at center,
              rgba(0,186,255,.28), rgba(0,186,255,.08) 38%, transparent 68%);
  filter: blur(20px);
  animation: glowPulse 9s ease-in-out infinite;
}

/* Slow-moving blue light sweep */
.hero__sweep {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
              transparent 35%, rgba(0,186,255,.10) 48%,
              rgba(199,204,214,.06) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: sweep 11s linear infinite;
  mix-blend-mode: screen;
}

/* Circuit-inspired floating nodes */
.hero__nodes span {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px 2px rgba(0,186,255,.6);
  opacity: 0.5;
  animation: float 14s ease-in-out infinite;
}
.hero__nodes span:nth-child(1) { top: 22%; left: 12%; animation-delay: 0s; }
.hero__nodes span:nth-child(2) { top: 70%; left: 18%; animation-delay: -2s; width: 4px; height: 4px; }
.hero__nodes span:nth-child(3) { top: 32%; left: 84%; animation-delay: -4s; }
.hero__nodes span:nth-child(4) { top: 78%; left: 78%; animation-delay: -6s; width: 4px; height: 4px; }
.hero__nodes span:nth-child(5) { top: 14%; left: 60%; animation-delay: -8s; width: 3px; height: 3px; }
.hero__nodes span:nth-child(6) { top: 55%; left: 6%;  animation-delay: -3s; width: 3px; height: 3px; }
.hero__nodes span:nth-child(7) { top: 88%; left: 46%; animation-delay: -5s; }
.hero__nodes span:nth-child(8) { top: 40%; left: 40%; animation-delay: -7s; width: 4px; height: 4px; opacity: .35; }

.hero__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  width: 100%;
}
.hero__text { max-width: 42rem; }
.hero__portrait { display: flex; justify-content: center; }
.hero__portrait .portrait { width: 100%; max-width: 380px; }

/* Stack on tablet/mobile: portrait first for an immediate personal hook */
@media (max-width: 900px) {
  .hero__content { grid-template-columns: 1fr; gap: clamp(1.6rem, 6vw, 2.5rem); }
  .hero__text { max-width: none; }
  .hero__portrait { order: -1; }
  .hero__portrait .portrait { max-width: 210px; }
}

.hero__title {
  font-size: var(--fs-hero);
  margin-block: 0.4rem 0.6rem;
  background: linear-gradient(180deg, #ffffff 0%, #cfd6e0 55%, #8b94a2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* metallic edge highlight */
  text-shadow: 0 1px 0 rgba(255,255,255,.04);
}

.hero__subtitle {
  font-size: var(--fs-lead);
  font-weight: 600;
  color: var(--silver);
  max-width: 34ch;
  margin-bottom: 1.2rem;
}

.hero__statement {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: var(--text-soft);
  max-width: 56ch;
  margin-bottom: 2.2rem;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* Scroll cue */
.hero__scroll {
  position: absolute;
  bottom: 1.6rem; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  display: grid;
  place-items: start center;
  padding-top: 8px;
  z-index: 1;
}
.hero__scroll-dot {
  width: 4px; height: 8px;
  border-radius: 4px;
  background: var(--accent);
  animation: scrollDot 1.8s ease-in-out infinite;
}

/* ---------------------------------------------------------------------------
   7. About (editorial two-column: heading | narrative)
   --------------------------------------------------------------------------- */
.about__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

/* Positioning / scope line — signals seniority and remit at a glance */
.about__scope {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.8vw, 1.22rem);
  line-height: 1.5;
  color: var(--silver);
  max-width: 56ch;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  margin-bottom: 1.5rem;
}

.about__body {
  display: grid;
  gap: 1.2rem;
  max-width: 60ch;
  color: var(--text-soft);
  font-size: var(--fs-lead);
}

/* Portrait frame: crisp rounded image, metallic edge, accent glow + corner brackets
   (used in the hero) */
.portrait {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
}
.portrait img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  /* Mirror the photo so the subject faces INTO the content — the gaze line then
     leads the eye toward the headline and CTA on the left, not off the page. */
  transform: scaleX(-1);
  border-radius: var(--radius);
  /* subtle inner definition so a light-background photo seats into the dark UI */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
/* Soft accent glow behind the frame */
.portrait::after {
  content: "";
  position: absolute;
  inset: -14% -14% -20% -14%;
  z-index: 0;
  background: radial-gradient(58% 58% at 32% 22%, rgba(0, 186, 255, 0.38), transparent 70%);
  filter: blur(34px);
  opacity: 0.65;
}
/* Metallic silver/accent edge */
.portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1px;
  background: var(--edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
/* Technical corner brackets (top-left + bottom-right) */
.portrait__deco { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.portrait__deco::before,
.portrait__deco::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border: 2px solid var(--accent);
}
.portrait__deco::before {
  top: -7px; left: -7px;
  border-right: 0; border-bottom: 0;
  border-top-left-radius: 7px;
}
.portrait__deco::after {
  bottom: -7px; right: -7px;
  border-left: 0; border-top: 0;
  border-bottom-right-radius: 7px;
}

/* Collapse the About columns on smaller screens */
@media (max-width: 820px) {
  .about__inner { grid-template-columns: 1fr; gap: 1.4rem; }
}

/* ---------------------------------------------------------------------------
   7b. Areas of Impact (compact "system map" cards)
   --------------------------------------------------------------------------- */
.impact__intro,
.expertise__intro {
  max-width: 64ch;
  color: var(--text-soft);
  font-size: var(--fs-lead);
  margin-bottom: 0.5rem;
}

.impact__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
  margin-top: 1.6rem;
}

.impact-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.5rem 1.4rem 1.55rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease),
              box-shadow var(--t-med) var(--ease),
              opacity 0.7s var(--ease),
              translate 0.7s var(--ease);
}
/* Top accent bar — a small "system" line that extends on hover */
.impact-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  height: 2px;
  width: 32px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transition: width var(--t-med) var(--ease);
}
/* Metallic corner bracket (top-right) — node/map detail */
.impact-card::after {
  content: "";
  position: absolute;
  top: 12px; right: 12px;
  width: 12px; height: 12px;
  border-top: 1px solid var(--silver-dim);
  border-right: 1px solid var(--silver-dim);
  opacity: 0.6;
  transition: border-color var(--t-med) var(--ease), opacity var(--t-med) var(--ease);
}
.impact-card:hover,
.impact-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 40px -24px rgba(0, 186, 255, 0.55);
}
.impact-card:hover::before,
.impact-card:focus-within::before { width: 64px; }
.impact-card:hover::after,
.impact-card:focus-within::after { border-color: var(--accent); opacity: 1; }

/* Icon node */
.impact-card__icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 10px;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, rgba(0, 186, 255, 0.12), rgba(255, 255, 255, 0.02));
  transition: box-shadow var(--t-med) var(--ease);
}
.impact-card__icon svg { width: 22px; height: 22px; }
.impact-card:hover .impact-card__icon {
  box-shadow: 0 0 18px -2px rgba(0, 186, 255, 0.55);
}

.impact-card__title {
  font-size: 1.02rem;
  line-height: 1.25;
  color: var(--text);
}
.impact-card__copy {
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--text-soft);
}

/* ---------------------------------------------------------------------------
   8. Expertise cards
   --------------------------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.card {
  position: relative;
  padding: 1.5rem 1.4rem 1.6rem;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease),
              box-shadow var(--t-med) var(--ease),
              opacity 0.7s var(--ease),
              translate 0.7s var(--ease);
}
/* Metallic edge detail via gradient border on a pseudo-element */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}
.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: 0 18px 40px -22px rgba(0, 186, 255, 0.5);
  background: linear-gradient(180deg, var(--surface-2), var(--bg-soft));
}
.card:hover::before,
.card:focus-within::before { opacity: 1; }

.card__num {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  opacity: 0.8;
}
.card__title {
  font-size: var(--fs-h3);
  margin: 0.5rem 0 0.5rem;
  color: var(--text);
}
.card__text { font-size: var(--fs-small); color: var(--text-soft); line-height: 1.6; }

/* ---------------------------------------------------------------------------
   9. Projects
   --------------------------------------------------------------------------- */
.projects__intro {
  max-width: 70ch;
  color: var(--text-soft);
  font-size: var(--fs-lead);
  margin-bottom: 2.5rem;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 1.5rem;
}

.project {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform var(--t-med) var(--ease),
              box-shadow var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease),
              opacity 0.7s var(--ease),
              translate 0.7s var(--ease);
}
.project:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  box-shadow: 0 26px 50px -28px rgba(0, 186, 255, 0.55);
}

.project__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0,186,255,.05), transparent),
    var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.5s var(--ease);
}
.project:hover .project__media img { transform: scale(1.04); }
/* Light sweep over the screenshot on hover */
.project__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(0,186,255,.16) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
}
.project:hover .project__media::after { transform: translateX(120%); }

.project__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.5rem 1.5rem 1.7rem;
}
/* Capability / role chips — map each project back to what it demonstrates */
.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
}
.project__tag {
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--text-soft);
  padding: 0.32rem 0.62rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}
/* The "what I did" chip is highlighted so capability vs. role reads instantly */
.project__tag--role {
  color: var(--accent);
  border-color: rgba(0, 186, 255, 0.4);
}

.project__title { font-size: clamp(1.25rem, 3vw, 1.5rem); color: var(--text); }
.project__text { font-size: var(--fs-small); color: var(--text-soft); line-height: 1.65; }
.project__body .btn { margin-top: 0.3rem; }

/* Group subheadings — make the breadth of work scannable */
.projects__group-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 2.8rem 0 1.3rem;
}
.projects__group-title::before {
  content: "";
  width: 9px; height: 9px;
  flex: none;
  border: 2px solid var(--accent);
  border-radius: 2px;
}
.projects__group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Video facade: thumbnail + play button; the real iframe loads only on click */
.project__video {
  aspect-ratio: 16 / 9;        /* overrides .project__media 16/10 for video */
  width: 100%;
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  background: #05070b;
  cursor: pointer;
}
.project__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;          /* clicks fall through to the button */
}
.project__play svg {
  width: 62px; height: 62px;
  padding: 17px;
  color: #001722;
  background: rgba(0, 186, 255, 0.92);
  border-radius: 50%;
  box-shadow: 0 10px 30px -6px rgba(0, 186, 255, 0.6);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.project--video:hover .project__play svg,
.project__video:focus-visible .project__play svg {
  transform: scale(1.08);
  background: var(--accent);
}
/* Loaded YouTube player keeps the same footprint */
.project__iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
}

/* Full-bleed media that shows the ENTIRE image (no 16:10 crop). Used on the
   Projects page for wide renders, feature graphics and panoramas. */
.project__media--full { aspect-ratio: auto; }
.project__media--full img { height: auto; }

/* Centered call-to-action row linking the home page <-> the full Projects page */
.projects__more {
  display: flex;
  justify-content: center;
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

/* Single full-width row (used for the brochure spread) */
.projects__grid--single { grid-template-columns: 1fr; }

/* Brochure: two pages shown side by side as one spread */
.project__spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.project__spread a {
  display: block;
  background: #fff;            /* brochure pages are light artwork */
  overflow: hidden;
}
.project__spread img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s var(--ease);
}
.project--wide:hover .project__spread img { transform: scale(1.02); }
.project__spread a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.project__hint {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-mute);
}

/* Stack the two brochure pages on small screens for readability */
@media (max-width: 640px) {
  .project__spread { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   10. Contact
   --------------------------------------------------------------------------- */
.contact__inner { max-width: 60ch; }
.contact__copy {
  font-size: var(--fs-lead);
  color: var(--text-soft);
  margin-bottom: 2rem;
}
.contact__cta { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ---------------------------------------------------------------------------
   11. Footer
   --------------------------------------------------------------------------- */
.footer { padding-block: 2rem; }
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.footer__brand { display: flex; align-items: center; gap: 1rem; }
.footer__logo {
  height: 30px;
  width: auto;
  opacity: 0.85;
  transition: opacity var(--t-fast) var(--ease);
}
.footer__brand:hover .footer__logo { opacity: 1; }
.footer__copy { font-size: var(--fs-small); color: var(--text-mute); }
.footer__copy a { color: var(--text-soft); text-decoration: underline; text-underline-offset: 2px; }
.footer__copy a:hover { color: var(--accent); }
.footer__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-small);
  color: var(--text-soft);
  transition: color var(--t-fast) var(--ease);
}
.footer__link:hover { color: var(--accent); }

/* ---------------------------------------------------------------------------
   11b. Cursor spotlight on expertise cards
   --------------------------------------------------------------------------- */
/* Keep card content above the glow layer so text stays crisp */
.card > * { position: relative; z-index: 1; }
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
              rgba(0, 186, 255, 0.16), transparent 60%);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}
.card:hover::after,
.card:focus-within::after { opacity: 1; }

/* ---------------------------------------------------------------------------
   11c. Scroll-reveal (JS-gated: without JS everything is visible by default)
        Uses the independent `translate` property so the resting/hover
        `transform` on cards stays free for the hover lift.
   --------------------------------------------------------------------------- */
/* Text blocks have no base transition of their own */
.js .section__eyebrow,
.js .section__title,
.js .about__scope,
.js .about__body,
.js .impact__intro,
.js .expertise__intro,
.js .projects__intro,
.js .projects__group-title,
.js .contact__copy,
.js .contact__cta {
  opacity: 0;
  translate: 0 26px;
  transition: opacity 0.7s var(--ease), translate 0.7s var(--ease);
}
/* Cards/projects/impact already declare a transition that includes opacity + translate */
.js .card,
.js .project,
.js .impact-card {
  opacity: 0;
  translate: 0 26px;
}
.js .is-visible {
  opacity: 1;
  translate: none;
}

/* ---------------------------------------------------------------------------
   12. Keyframes
   --------------------------------------------------------------------------- */
@keyframes glowPulse {
  0%, 100% { transform: translateX(-50%) scale(1);    opacity: 0.85; }
  50%      { transform: translateX(-50%) scale(1.12); opacity: 1; }
}
@keyframes sweep {
  0%   { background-position: 130% 0; }
  100% { background-position: -130% 0; }
}
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(10px, -14px); }
  50%      { transform: translate(-6px, 8px); }
  75%      { transform: translate(8px, 10px); }
}
@keyframes scrollDot {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ---------------------------------------------------------------------------
   13. Responsive — tablet / mobile navigation
   --------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .nav__toggle { display: flex; }

  /* Slide-down glass overlay menu */
  .nav__menu {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 1rem var(--pad) 1.4rem;
    background: rgba(7, 9, 13, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line-strong);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--t-med) var(--ease),
                opacity var(--t-med) var(--ease),
                visibility var(--t-med);
  }
  .nav__menu.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav__link {
    padding: 0.85rem 0.9rem;
    font-size: 1rem;
    border-radius: 10px;
  }
  .nav__link::after { display: none; }
  .nav__link.is-active { background: rgba(0, 186, 255, 0.1); }
  /* Non-colour active cue on mobile: left accent bar */
  .nav__link.is-active {
    box-shadow: inset 3px 0 0 var(--accent);
  }
}

/* ---------------------------------------------------------------------------
   14. (removed) content-visibility
   It was reserving a fixed ~600px placeholder per section, but the Projects
   section is much taller, so anchor jumps (#contact, #expertise) miscalculated
   the target and landed mid-Projects. The page is small enough that the
   optimization wasn't needed — correct in-page navigation matters more.
   --------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   15. Reduced-motion support
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero__glow, .hero__sweep, .hero__nodes span, .hero__scroll-dot { animation: none; }
  .hero__sweep { opacity: 0.4; }

  /* Show all reveal content immediately — no entrance animation */
  .js .section__eyebrow,
  .js .section__title,
  .js .about__scope,
  .js .about__body,
  .js .impact__intro,
  .js .expertise__intro,
  .js .projects__intro,
  .js .projects__group-title,
  .js .contact__copy,
  .js .contact__cta,
  .js .card,
  .js .project,
  .js .impact-card {
    opacity: 1;
    translate: none;
  }
}
