/* ===================================================================
   Optical — visual refresh layer
   Loaded AFTER styles.css. Derives the page's language from the one
   thing that was already distinctive: the nav's refractive glass.
   Nothing in this file touches .navbar / .mobile-nav-container.
   =================================================================== */

:root {
  /* Ink — near-navy, never pure black */
  --ink: #0B1020;
  --ink-2: #3D4763;
  --ink-3: #737E9C;

  /* Paper — cool white, so glass reads as glass */
  --paper: #FBFCFF;
  --paper-2: #EFF3FC;
  --hairline: #E2E8F5;

  /* Blue Gradient palette — light to deep */
  --alice-blue: #e3f2fdff;
  --icy-blue: #bbdefbff;
  --sky-blue: #90caf9ff;
  --cool-sky: #64b5f6ff;
  --cool-sky-2: #42a5f5ff;
  --dodger-blue: #2196f3ff;
  --brilliant-azure: #1e88e5ff;
  --twitter-blue: #1976d2ff;
  --ocean-deep: #1565c0ff;
  --cobalt-blue: #0d47a1ff;

  /* The full ramp, in order, as a gradient stop list */
  --blue-stops: var(--alice-blue), var(--icy-blue), var(--sky-blue), var(--cool-sky),
                var(--cool-sky-2), var(--dodger-blue), var(--brilliant-azure),
                var(--twitter-blue), var(--ocean-deep), var(--cobalt-blue);
  /* Out and back, so conic gradients close without a seam */
  --blue-loop: var(--blue-stops), var(--ocean-deep), var(--twitter-blue),
               var(--brilliant-azure), var(--dodger-blue), var(--cool-sky-2),
               var(--cool-sky), var(--sky-blue), var(--icy-blue), var(--alice-blue);

  /* Prism — spent only on signature moments */
  --azure: var(--dodger-blue);
  --violet: var(--ocean-deep);
  --teal: var(--sky-blue);
  --spectrum: linear-gradient(90deg, var(--blue-stops));

  /* Remap the original tokens so the whole site inherits the new palette */
  --color-primary: #1e88e5;
  --color-primary-rgb: 30, 136, 229;
  --color-text: var(--ink);
  --color-text-secondary: var(--ink-3);
  --color-bg: var(--paper);
  --color-bg-secondary: var(--paper-2);
  --color-border: var(--hairline);
  --color-surface: #FFFFFF;

  --shadow-sm: 0 1px 2px rgba(11, 16, 32, .04), 0 4px 12px rgba(11, 16, 32, .04);
  --shadow-md: 0 2px 4px rgba(11, 16, 32, .04), 0 12px 28px rgba(11, 16, 32, .07);
  --shadow-lg: 0 4px 8px rgba(11, 16, 32, .05), 0 24px 56px rgba(11, 16, 32, .10);

  --display: "Bricolage Grotesque", "Inter Tight", system-ui, sans-serif;
  --body: "Inter Tight", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

:root[data-theme="dark"] {
  --ink: #EEF1FA;
  --ink-2: #B4BDD4;
  --ink-3: #8792AE;
  --paper: #070A14;
  --paper-2: #0E1322;
  --hairline: #1E2537;
  --color-surface: #111725;
}

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ---- deep space ----------------------------------------------
   Dark mode only: a solid navy sky with a drifting starfield.
   The stars move on the compositor (transform / opacity), so the
   motion costs nothing. */

:root[data-theme="dark"] body {
  background: #050814;
}

/* Stars, two sizes, gently twinkling */
:root[data-theme="dark"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(227, 242, 253, .9), transparent),
    radial-gradient(1px 1px at 27% 72%, rgba(187, 222, 251, .8), transparent),
    radial-gradient(1.5px 1.5px at 41% 33%, rgba(227, 242, 253, .9), transparent),
    radial-gradient(1px 1px at 58% 84%, rgba(144, 202, 249, .8), transparent),
    radial-gradient(1px 1px at 66% 12%, rgba(227, 242, 253, .7), transparent),
    radial-gradient(1.5px 1.5px at 79% 46%, rgba(187, 222, 251, .9), transparent),
    radial-gradient(1px 1px at 88% 78%, rgba(227, 242, 253, .8), transparent),
    radial-gradient(1px 1px at 6% 55%, rgba(144, 202, 249, .7), transparent),
    radial-gradient(1px 1px at 93% 22%, rgba(227, 242, 253, .8), transparent),
    radial-gradient(1px 1px at 47% 58%, rgba(187, 222, 251, .6), transparent);
  background-size: 420px 420px;
  animation: starDrift 180s linear infinite, starTwinkle 7s ease-in-out infinite alternate;
}

@keyframes starDrift {
  to { background-position: -420px 420px; }
}

@keyframes starTwinkle {
  from { opacity: .55; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  :root[data-theme="dark"] body::after { animation: none; }
}

/* ---------- Hero ------------------------------------------------ */

/* The original centred content inside a 100vh row, which stranded the
   headline halfway down the page. Anchor it under the nav instead. */
.hero-section .row.min-vh-100 {
  min-height: auto !important;
  align-items: start;
  padding-top: clamp(4.5rem, 9vh, 7rem);
  padding-bottom: clamp(2rem, 4vh, 3.5rem);
}

.hero-section {
  position: relative;
  overflow: hidden;
  background: var(--paper);
}

/* Ambient refraction — the light the nav's glass is bending */
.hero-section::before {
  content: "";
  position: absolute;
  top: -20rem;
  right: -10rem;
  width: 46rem;
  height: 46rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 32%, rgba(100, 181, 246, .16), transparent 62%),
    radial-gradient(circle at 68% 58%, rgba(30, 136, 229, .13), transparent 60%),
    radial-gradient(circle at 50% 80%, rgba(13, 71, 161, .10), transparent 62%);
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}

.hero-section .container { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .01em;
  color: var(--ink-2);
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--hairline);
  border-radius: 100px;
  padding: .5rem 1rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}
:root[data-theme="dark"] .hero-badge { background: rgba(255, 255, 255, .05); }
.hero-badge .globe-icon { color: var(--azure); }

/* The name, set as the page's loudest moment — then nothing else shouts */
.hero-section .hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.4rem, 8.5vw, 6.4rem);
  line-height: .92;
  letter-spacing: -.045em;
  color: var(--ink);
  margin: 1.75rem 0 0;
}

.hero-section .hero-role {
  font-family: var(--mono);
  font-size: clamp(.8rem, 1.1vw, .95rem);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 1.1rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--hairline);
  max-width: 30rem;
}

.hero-section .hero-subtitle {
  font-size: clamp(1.02rem, 1.25vw, 1.16rem);
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 34rem;
  margin: 1.6rem 0 0;
}

/* Was a full blue paragraph that read like a broken link */
.hero-section .hero-highlight {
  color: var(--ink);
  font-weight: 500;
  background: none;
  box-shadow: inset 0 -.55em 0 rgba(45, 107, 249, .12);
}
:root[data-theme="dark"] .hero-section .hero-highlight {
  box-shadow: inset 0 -.55em 0 rgba(45, 107, 249, .22);
}

.hero-details {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.75rem;
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-3);
}
.hero-details i { color: var(--azure); margin-right: .4rem; }

/* ---------- Buttons --------------------------------------------- */

.hero-buttons { display: flex; gap: .85rem; flex-wrap: wrap; margin-top: 2.25rem !important; }

.hero-section .btn,
.btn-primary, .btn-outline-primary {
  font-family: var(--body);
  font-weight: 550;
  letter-spacing: -.01em;
  border-radius: 100px;
  padding: .85rem 1.85rem;
  font-size: .98rem;
  transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s, background .25s;
}

.btn-primary {
  background: var(--ink);
  border: 1px solid var(--ink);
  color: #fff;
  box-shadow: 0 6px 18px rgba(11, 16, 32, .16);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--azure);
  border-color: var(--azure);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(45, 107, 249, .32);
}

.btn-outline-primary {
  background: rgba(255, 255, 255, .6);
  border: 1px solid var(--hairline);
  color: var(--ink);
  backdrop-filter: blur(8px);
}
.btn-outline-primary:hover, .btn-outline-primary:focus-visible {
  background: #fff;
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
:root[data-theme="dark"] .btn-outline-primary { background: rgba(255,255,255,.05); color: var(--ink); }

/* ---------- Headshot: a lens, not a photo ----------------------- */

.hero-headshot-wrap { position: relative; }

.hero-headshot-wrap::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 252px; height: 252px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: conic-gradient(from 210deg, var(--blue-loop));
  filter: blur(18px);
  opacity: .62;
  z-index: 0;
}

.hero-headshot {
  position: relative;
  z-index: 1;
  width: 208px;
  height: 208px;
  border: 5px solid var(--paper);
  box-shadow: 0 18px 44px rgba(11, 16, 32, .16);
}

/* ---------- Signature: the stat rail ----------------------------
   Four disconnected white boxes became one pane of glass with
   hairline dividers — the nav's material, reused as structure.    */

.stat-cards {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 0 !important;
  margin-top: 2.75rem !important;
  background: rgba(255, 255, 255, .62);
  border: 1px solid var(--hairline);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  position: relative;
}
:root[data-theme="dark"] .stat-cards { background: rgba(255, 255, 255, .045); }

/* the refracted edge */
.stat-cards::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--spectrum);
  opacity: .85;
}

.stat-card {
  background: transparent !important;
  border: 0 !important;
  border-right: 1px solid var(--hairline) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 1.5rem .75rem 1.35rem !important;
  text-align: center;
}
.stat-card:last-child { border-right: 0 !important; }
.stat-card:hover { background: rgba(45, 107, 249, .045) !important; transform: none !important; }

.stat-icon { display: none; } /* four near-identical glyphs, no information */

.stat-number {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--ink);
}

.stat-label {
  font-family: var(--mono);
  font-size: 10.5px !important;
  font-weight: 400 !important;
  letter-spacing: .07em !important;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: .5rem;
  line-height: 1.35;
}

/* ---------- Sections & headings --------------------------------- */

section { position: relative; }

.section-title {
  font-family: var(--display) !important;
  font-weight: 800;
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  letter-spacing: -.035em;
  line-height: 1.03;
  color: var(--ink);
}

.section-subtitle, .section-title + p {
  font-size: 1.02rem;
  color: var(--ink-3);
  max-width: 42rem;
}

/* ---------- Cards ------------------------------------------------ */

.project-card, .skill-card, .exp-card {
  background: var(--color-surface);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s, border-color .3s;
}
.project-card:hover, .skill-card:hover, .exp-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(45, 107, 249, .35);
}

.project-card h3, .skill-card h3, .exp-card h3,
.project-title, .exp-role {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -.02em;
}

/* ---------- Contact form ---------------------------------------- */

.form-control {
  border-radius: 12px;
  border: 1px solid var(--hairline);
  padding: .8rem 1rem;
  font-family: var(--body);
  background: var(--color-surface);
  color: var(--ink);
}
.form-control:focus {
  border-color: var(--azure);
  box-shadow: 0 0 0 4px rgba(45, 107, 249, .14);
}

/* ---------- Quality floor --------------------------------------- */

a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 3px;
  border-radius: 8px;
}

@media (max-width: 991px) {
  .hero-section .row.min-vh-100 { padding-top: 6.5rem; }
  .hero-headshot-wrap { margin-top: 3rem; }
}

@media (max-width: 640px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-card:nth-child(2) { border-right: 0 !important; }
  .stat-card:nth-child(-n+2) { border-bottom: 1px solid var(--hairline) !important; }
  .hero-details { gap: .4rem 1.1rem; }
  .hero-buttons .btn { flex: 1 1 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Dark-mode corrections -------------------------------
   --ink inverts to near-white in dark, so an ink-filled button needs
   ink-coloured text, not white. Also stop the inherited gradient
   text-fill from half-colouring the stat numerals.                */

:root[data-theme="dark"] .btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #070A14;
}
:root[data-theme="dark"] .btn-primary:hover,
:root[data-theme="dark"] .btn-primary:focus-visible {
  background: var(--azure);
  border-color: var(--azure);
  color: #fff;
}

.stat-number {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: var(--ink) !important;
  color: var(--ink) !important;
}

/* ---------- Prism glow behind the name --------------------------
   Same conic light as the headshot halo, stretched into an ellipse
   that follows the headline. Sits behind the glyphs, never over.  */

.hero-section .hero-title {
  position: relative;
  z-index: 1;
  display: inline-block;
}

.hero-section .hero-title::before {
  content: "";
  position: absolute;
  inset: -46% -5%;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from 210deg, var(--blue-loop));
  filter: blur(38px);
  opacity: .42;
  pointer-events: none;
}

:root[data-theme="dark"] .hero-section .hero-title::before {
  opacity: .5;
  filter: blur(44px);
}

@media (max-width: 640px) {
  .hero-section .hero-title::before { filter: blur(32px); inset: -26% -10%; }
}

/* ---------- Flowing light ----------------------------------------
   Continuous, never oscillating. An ease-in-out alternate has dead
   zones at each turnaround where the motion stalls and reads as
   frozen — so everything here runs linear and loops seamlessly.
   Two layers at different periods interfere with each other, and
   that interference is what makes it ripple rather than spin.
   ================================================================ */

@property --glow-angle {
  syntax: "<angle>";
  initial-value: 210deg;
  inherits: false;
}

/* Layer 1 — the colour body, rotating steadily. */
.hero-section .hero-title::before {
  background: conic-gradient(from var(--glow-angle), var(--blue-loop));
  animation: glowSpin 30s linear infinite,
             glowPulse 11s ease-in-out infinite;
}

@keyframes glowSpin {
  from { --glow-angle: 0deg; }
  to   { --glow-angle: 360deg; }
}

@keyframes glowPulse {
  0%, 100% { opacity: .38; }
  50%      { opacity: .52; }
}

/* Layer 2 — the ripple. Soft blobs sliding on a different period, so
   the bright seam wanders instead of tracing a circle. */
.hero-section .hero-title::after {
  content: "";
  position: absolute;
  inset: -50% -8%;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(40% 60% at 26% 40%, rgba(144, 202, 249, .55), transparent 70%),
    radial-gradient(44% 58% at 72% 62%, rgba(21, 101, 192, .48), transparent 70%),
    radial-gradient(38% 52% at 50% 30%, rgba(33, 150, 243, .45), transparent 72%);
  filter: blur(34px);
  opacity: .5;
  animation: ripple 17s ease-in-out infinite;
}

@keyframes ripple {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  25%  { transform: translate3d(3.5%, -2.5%, 0) scale(1.07); }
  50%  { transform: translate3d(-2%, 3%, 0) scale(1.03); }
  75%  { transform: translate3d(-3.5%, -1.5%, 0) scale(1.08); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

:root[data-theme="dark"] .hero-section .hero-title::before { animation: glowSpin 30s linear infinite, glowPulseDark 11s ease-in-out infinite; }
@keyframes glowPulseDark { 0%, 100% { opacity: .46; } 50% { opacity: .62; } }
:root[data-theme="dark"] .hero-section .hero-title::after { opacity: .58; }

/* Halo — same steady rotation, plus a gentle swell on its own clock. */
.hero-headshot-wrap::before {
  animation: haloSpin 26s linear infinite, haloSwell 9s ease-in-out infinite;
  will-change: transform;
}
@keyframes haloSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes haloSwell {
  0%, 100% { opacity: .46; }
  50%      { opacity: .60; }
}

.hero-section::before { animation: washDrift 48s ease-in-out infinite alternate; }
@keyframes washDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-2.5rem, 1.25rem) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-section .hero-title::before,
  .hero-section .hero-title::after,
  .hero-headshot-wrap::before,
  .hero-section::before { animation: none !important; }
}

/* ---------- Headshot: no ring, just the moving light -------------
   styles.css puts a 4px tinted border on the image and swaps it blue
   on hover, so all three states get pinned to none. The glow is the
   only edge treatment. */

.hero-headshot,
.hero-headshot:hover,
.hero-headshot:focus-visible {
  border: 0 !important;
}

.hero-headshot:hover {
  box-shadow: 0 20px 48px rgba(11, 16, 32, .22);
  transform: scale(1.03);
}

:root[data-theme="dark"] .hero-headshot:hover {
  box-shadow: 0 20px 48px rgba(0, 0, 0, .55);
}

/* ---------- Hero eyebrow -----------------------------------------
   Same mono treatment as .hero-role, minus its rule — the line under
   the name should stay a single divider, not become a pair. The top
   margin moves here from .hero-title so the badge spacing holds. */

.hero-section .hero-eyebrow {
  font-family: var(--mono);
  font-size: clamp(.8rem, 1.1vw, .95rem);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 1.9rem 0 .55rem;
}

.hero-section .hero-title { margin-top: 0; }

/* ---------- Nav resume button ------------------------------------
   Ghost by default, solid on hover. Scoped by #mainNav so the hero's
   .btn-primary keeps its filled treatment, and so this outranks the
   theme-level .btn-primary rules without an !important. */

#mainNav .btn-primary {
  background: transparent;
  border: 1px solid rgba(11, 16, 32, .22);
  color: var(--ink);
  box-shadow: none;
}

#mainNav .btn-primary:hover,
#mainNav .btn-primary:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(11, 16, 32, .18);
}

/* --hairline is near-black in dark, so it would vanish on the dark
   nav — the ghost border needs light ink there instead. */
:root[data-theme="dark"] #mainNav .btn-primary {
  border-color: rgba(255, 255, 255, .3);
}
:root[data-theme="dark"] #mainNav .btn-primary:hover,
:root[data-theme="dark"] #mainNav .btn-primary:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: #070A14;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
}

/* ---------- Arcade ----------------------------------------------
   Sits below the footer as a deliberate coda. The game runs in an
   iframe: it owns a full-viewport canvas, fixed-position chrome and
   preventDefault on arrows/space, none of which can be allowed to
   leak into the portfolio document. */

.arcade {
  background: var(--paper-2);
  border-top: 1px solid var(--hairline);
  padding: clamp(3.5rem, 8vh, 6rem) 0 clamp(4rem, 9vh, 7rem);
  text-align: center;
}

.arcade__eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 .9rem;
}

/* Not .section-title: that class is driven by a gsap.from() which pins
   it at opacity 0 until ScrollTrigger fires. Below the footer that is a
   good way to end up with an invisible heading. */
.arcade__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  letter-spacing: -.035em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 .8rem;
  opacity: 1;
}

.arcade__note {
  font-size: .98rem;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 34rem;
  margin: 0 auto 2rem;
}

.arcade__key {
  font-family: var(--mono);
  font-size: .78em;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: .15em .5em;
  background: var(--color-surface);
  color: var(--ink);
  white-space: nowrap;
}

.arcade__screen {
  position: relative;
  max-width: 62rem;
  margin: 0 auto;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-lg);
}

/* the same refracted edge as the stat rail, tying it to the page */
.arcade__screen::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--spectrum);
  opacity: .85;
  z-index: 1;
  pointer-events: none;
}

.arcade__screen iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.arcade__links {
  margin: 1.5rem 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}
.arcade__links a { color: var(--azure); text-decoration: none; }
.arcade__links a:hover { text-decoration: underline; }
.arcade__links span { margin: 0 .6rem; }

@media (max-width: 640px) {
  .arcade__screen { aspect-ratio: 3 / 4; border-radius: 14px; }
}

/* ---------- Let the starfield through ---------------------------
   #particleCanvas is fixed at z-index -1, so it was already drawing
   behind the whole page — the hero just painted an opaque --paper
   over it. body keeps the base colour; the hero goes transparent so
   the stars read at the top of the page too. */

body { background: var(--paper); }

.hero-section { background: transparent; }

/* The ambient prism wash sits above the stars but below the content,
   so the two read as one depth rather than fighting. */
.hero-section::before { z-index: 0; }
.hero-section .container { position: relative; z-index: 1; }

/* Sections further down keep their own surfaces; only the first two
   screens are "sky". */
#work { background: transparent; }

/* ---------- Ambient orbs: white glow ----------------------------
   The big drifting shapes behind the hero. Previously azure/violet/
   teal; now soft white light. The name glow and headshot halo keep
   their prism colour — this is only the background field. */

.hero-section::before {
  background:
    radial-gradient(circle at 32% 32%, rgba(255, 255, 255, .16), transparent 60%),
    radial-gradient(circle at 68% 58%, rgba(255, 255, 255, .11), transparent 58%),
    radial-gradient(circle at 50% 82%, rgba(255, 255, 255, .08), transparent 62%);
  filter: blur(34px);
}

/* A second, larger orb on its own slow path so the field never looks
   like one shape sliding around. */
.hero-section::after {
  content: "";
  position: absolute;
  top: 22%;
  left: -16rem;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 45%, rgba(255, 255, 255, .10), transparent 64%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
  animation: orbDrift 56s ease-in-out infinite alternate;
}

@keyframes orbDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(5rem, -3rem) scale(1.12); }
}

/* On near-white paper a white orb is invisible, so light mode gets a
   cool grey-blue of the same softness instead of nothing at all. */
:root:not([data-theme="dark"]) .hero-section::before {
  background:
    radial-gradient(circle at 32% 32%, rgba(120, 142, 190, .17), transparent 60%),
    radial-gradient(circle at 68% 58%, rgba(120, 142, 190, .12), transparent 58%),
    radial-gradient(circle at 50% 82%, rgba(120, 142, 190, .09), transparent 62%);
}
:root:not([data-theme="dark"]) .hero-section::after {
  background: radial-gradient(circle at 45% 45%, rgba(120, 142, 190, .11), transparent 64%);
}

@media (prefers-reduced-motion: reduce) {
  .hero-section::after { animation: none !important; }
}

/* ---------- Stat rail, refined -----------------------------------
   Every label is now two words, so each wraps to exactly two lines and
   the numbers share a baseline. Previously "Avg. Traffic Boost" ran to
   three lines and pushed its number out of line with the others. */

.stat-cards {
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.stat-card {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: .55rem;
  padding: 1.7rem .9rem 1.55rem !important;
  transition: background .25s ease;
}

.stat-number {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.75rem, 2.6vw, 2.35rem);
  letter-spacing: -.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums; /* keeps 10+ / 50+ / 35% optically even */
}

.stat-label {
  font-family: var(--mono);
  font-size: 10px !important;
  font-weight: 400 !important;
  letter-spacing: .1em !important;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.5;
  margin: 0;
  /* reserve both lines so a one-line label can't shift the row */
  min-height: 2.05em;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  max-width: 9.5em;
}

/* Each cell picks up one stop of the spectrum on hover, so the top
   hairline and the cells read as the same system. */
.stat-card:hover { background: rgba(45, 107, 249, .06) !important; }
.stat-card:nth-child(2):hover { background: rgba(124, 77, 255, .06) !important; }
.stat-card:nth-child(3):hover { background: rgba(0, 191, 166, .06) !important; }
.stat-card:nth-child(4):hover { background: rgba(45, 107, 249, .06) !important; }

.stat-card:hover .stat-label { color: var(--ink-2); }

@media (max-width: 640px) {
  .stat-card { padding: 1.35rem .6rem 1.25rem !important; }
  .stat-label { font-size: 9.5px !important; }
}

/* styles.css floats each cell on a staggered 5s cycle. That worked when
   these were four separate cards; inside one glass rail it just makes the
   numbers bob out of line with each other. */
.stat-card:nth-child(1),
.stat-card:nth-child(2),
.stat-card:nth-child(3),
.stat-card:nth-child(4) {
  animation: none !important;
  transform: none !important;
}

/* ================================================================
   Stat rail — mission console
   Reads as instrumentation rather than a card row: translucent glass
   so the real starfield passes behind it, a hairline grid, light-beam
   dividers, and a small orbit glyph per readout.

   Deliberately NOT arc/ring gauges: an arc implies a scale, and three
   of these four values ("10+", "50+", "35%") have no defined maximum,
   so any arc length would be invented.
   ================================================================ */

.stat-cards {
  background: rgba(10, 16, 30, .55) !important;
  border: 1px solid rgba(120, 190, 255, .16) !important;
  border-radius: 16px;
  backdrop-filter: blur(9px) saturate(130%);
  -webkit-backdrop-filter: blur(9px) saturate(130%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, .45),
    inset 0 1px 0 rgba(255, 255, 255, .07);
  position: relative;
  overflow: hidden;
}

:root:not([data-theme="dark"]) .stat-cards {
  background: rgba(255, 255, 255, .66) !important;
  border-color: rgba(45, 107, 249, .18) !important;
  box-shadow: var(--shadow-md);
}

/* instrument grid */
.stat-cards::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(120, 190, 255, .05) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(120, 190, 255, .05) 0 1px, transparent 1px 22px);
  opacity: .55;
}
:root:not([data-theme="dark"]) .stat-cards::after { opacity: .3; }

/* Dividers become light beams: brightest at the middle, fading out at
   the panel edges, instead of a hard full-height rule. */
.stat-card { border-right: 0 !important; position: relative; }

.stat-card + .stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14%;
  bottom: 14%;
  width: 1px;
  background: linear-gradient(to bottom,
              transparent, rgba(120, 190, 255, .30) 22%,
              rgba(120, 190, 255, .30) 78%, transparent);
}
:root:not([data-theme="dark"]) .stat-card + .stat-card::before {
  background: linear-gradient(to bottom,
              transparent, rgba(30, 136, 229, .28) 22%,
              rgba(30, 136, 229, .28) 78%, transparent);
}

/* ---- orbit glyph -----------------------------------------------
   Re-uses the existing .stat-icon element; the Font Awesome glyph
   inside it stays hidden. Same mark on all four — rhythm, not data. */

.stat-icon {
  display: block !important;
  position: relative;
  width: 26px;
  height: 26px;
  margin: 0 0 .15rem;
  opacity: .85;
}
.stat-icon i { display: none; }

.stat-icon::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px solid rgba(120, 190, 255, .38);
}

.stat-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -2px 0 0 -2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px 1px rgba(0, 191, 166, .75);
  animation: orbitDot 9s linear infinite;
}

.stat-card:nth-child(2) .stat-icon::after { background: var(--azure); box-shadow: 0 0 8px 1px rgba(45,107,249,.75); animation-duration: 11s; }
.stat-card:nth-child(3) .stat-icon::after { background: var(--violet); box-shadow: 0 0 8px 1px rgba(124,77,255,.75); animation-duration: 7.5s; }
.stat-card:nth-child(4) .stat-icon::after { animation-duration: 13s; }

@keyframes orbitDot {
  from { transform: rotate(0deg) translateX(10px); }
  to   { transform: rotate(360deg) translateX(10px); }
}

:root:not([data-theme="dark"]) .stat-icon::before { border-color: rgba(45, 107, 249, .3); }

/* ---- readouts --------------------------------------------------- */

.stat-number {
  text-shadow: 0 0 22px rgba(120, 190, 255, .35);
}
:root:not([data-theme="dark"]) .stat-number { text-shadow: none; }

.stat-label {
  color: var(--ink-3);
  opacity: .95;
}

.stat-card:hover { background: rgba(120, 190, 255, .07) !important; }
.stat-card:hover .stat-icon { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .stat-icon::after { animation: none !important; }
}

/* ================================================================
   Deep space — sections
   The dark sections were flat #111111 slabs that cut the starfield
   off at each boundary, so the page read as alternating rooms. They
   become translucent veils instead: the same fixed sky runs behind
   everything, just dimmer where a section sits "further away".
   Separation comes from atmospheric depth, not a different fill.
   ================================================================ */

/* styles.css sets --color-bg-secondary to a neutral #111111 in dark,
   which is grey-black against a near-navy palette. That mismatch is
   most of why those sections read as slabs. */
:root[data-theme="dark"] {
  --color-bg-secondary: #0A0E1A;
  --void: #05070F;
  --veil: rgba(5, 9, 20, .55);
}
:root:not([data-theme="dark"]) {
  --void: #EEF2FB;
  --veil: rgba(238, 242, 251, .72);
}

/* ---- the veil --------------------------------------------------- */

.section-alt,
.footer,
.arcade {
  background-color: var(--veil) !important;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  position: relative;
}

/* ---- horizon --------------------------------------------------
   Each veiled section opens with a hairline that fades to nothing at
   both ends — the same mark as the stat rail's top edge and the
   arcade screen. It marks a real boundary, so it earns its place. */

.section-alt::before,
.footer::before,
.arcade::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-stops), transparent);
  opacity: .6;
  pointer-events: none;
}

.footer { border-top: 0 !important; }

/* ---- one nebula ------------------------------------------------
   Placed only in About — the one section with no visual event of its
   own. Spending the colour once rather than scattering a cloud into
   every section. */

#about { position: relative; overflow: hidden; }

#about::before {
  content: "";
  position: absolute;
  top: -18%;
  right: -12%;
  width: 52rem;
  height: 42rem;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 38% 42%, rgba(100, 181, 246, .16), transparent 62%),
    radial-gradient(circle at 66% 58%, rgba(21, 101, 192, .12), transparent 60%);
  filter: blur(50px);
  animation: nebulaDrift 70s ease-in-out infinite alternate;
}

#about > .container { position: relative; z-index: 1; }

@keyframes nebulaDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-4rem, 2.5rem) scale(1.12); }
}

:root:not([data-theme="dark"]) #about::before {
  background:
    radial-gradient(circle at 38% 42%, rgba(100, 181, 246, .10), transparent 62%),
    radial-gradient(circle at 66% 58%, rgba(21, 101, 192, .08), transparent 60%);
}

/* ---- instrument glass ------------------------------------------
   Cards match the stat rail's console treatment so the whole page is
   one system. No hairline grid at card scale — at this size it reads
   as clutter rather than instrumentation. */

.skill-card,
.project-card,
.exp-card {
  background: rgba(12, 18, 34, .58) !important;
  border: 1px solid rgba(120, 190, 255, .14) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .34);
}

.skill-card:hover,
.project-card:hover,
.exp-card:hover {
  border-color: rgba(120, 190, 255, .34) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .46);
}

:root:not([data-theme="dark"]) .skill-card,
:root:not([data-theme="dark"]) .project-card,
:root:not([data-theme="dark"]) .exp-card {
  background: rgba(255, 255, 255, .78) !important;
  border-color: rgba(45, 107, 249, .16) !important;
  box-shadow: var(--shadow-sm);
}
:root:not([data-theme="dark"]) .skill-card:hover,
:root:not([data-theme="dark"]) .project-card:hover,
:root:not([data-theme="dark"]) .exp-card:hover {
  border-color: rgba(45, 107, 249, .38) !important;
  box-shadow: var(--shadow-lg);
}

/* The contact form is a console panel too. */
.form-control {
  background: rgba(12, 18, 34, .5);
  border-color: rgba(120, 190, 255, .16);
}
:root:not([data-theme="dark"]) .form-control {
  background: rgba(255, 255, 255, .82);
  border-color: rgba(45, 107, 249, .16);
}

@media (prefers-reduced-motion: reduce) {
  #about::before { animation: none !important; }
}

/* Hardcoded #c76034 rust — the one warm colour left on the page, and it
   fights the whole palette. Teal reads as "clear to proceed" and is
   already in the system. */
.about-available {
  color: var(--teal) !important;
  font-weight: 550;
}
:root:not([data-theme="dark"]) .about-available { color: #00877A !important; }
