@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #080b12;
  --bg-elevated: #10151f;
  --text: #edf2ff;
  --muted: #9ca7bb;
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(13, 18, 29, 0.62);
  --accent: #b8a3ff;
  --accent2: #73d8c7;
  --petal: #f6b6cc;
  --petal-start: #ffd7e5;
  --petal-end: #e88fac;
  --petal-glow: rgba(246,182,204,.28);
  --petal-highlight: #fff6fa;
  --focus: #9be7d8;
  --nav-h: 76px;
  --anchor-offset: 94px;
  --space: clamp(1.25rem, 4vw, 2.5rem);
  --section-gap: 1cm;
  --ease: cubic-bezier(0.22, 0.8, 0.28, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--anchor-offset); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  overflow-x: hidden;
  line-height: 1.5;
}

body.is-loading,
body.menu-open { overflow: hidden; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -10;
  background:
    radial-gradient(circle at 15% 20%, rgba(105, 82, 180, 0.2), transparent 30%),
    radial-gradient(circle at 80% 70%, rgba(44, 156, 147, 0.12), transparent 28%),
    #080b12;
  transition: filter 0.8s var(--ease);
}

body[data-scene="1"]::before { filter: hue-rotate(12deg); }
body[data-scene="2"]::before { filter: hue-rotate(28deg); }
body[data-scene="3"]::before { filter: hue-rotate(50deg); }
body[data-scene="4"]::before { filter: hue-rotate(75deg); }
body[data-scene="5"]::before { filter: hue-rotate(100deg); }
body[data-scene="6"]::before { filter: hue-rotate(125deg); }
body[data-scene="7"]::before { filter: hue-rotate(150deg); }
body[data-scene="8"]::before { filter: hue-rotate(175deg); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  padding: 10px 16px;
  background: #fff;
  color: #0b0d13;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: none;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 120;
  background: transparent;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform-origin: left;
}

/* —— Loader —— */
.cinematic-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  text-align: center;
  background: #070910;
  gap: 8px;
  transition: opacity 0.45s var(--ease), visibility 0.45s var(--ease);
}

.cinematic-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent2);
  font-weight: 700;
  animation: loaderFade 0.7s var(--ease) both;
}

.loader-name {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.4rem, 3.4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  animation: loaderFade 0.7s 0.12s var(--ease) both;
}

.loader-role {
  margin: 8px 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  animation: loaderFade 0.7s 0.22s var(--ease) both;
}

@keyframes loaderFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* —— Navigation —— */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  z-index: 105;
  background: linear-gradient(180deg, rgba(8, 11, 18, 0.9), transparent);
  backdrop-filter: blur(10px);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.nav.is-scrolled {
  background: rgba(8, 11, 18, 0.82);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid var(--line);
}

.brand {
  font: 700 1.25rem "Space Grotesk", sans-serif;
  letter-spacing: 0.08em;
  color: #fff;
  text-decoration: none;
  position: relative;
  z-index: 2;
}

.brand span { color: var(--accent); }

.nav-panel {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.nav-links {
  display: flex;
  gap: 1.7rem;
}

.nav-links a,
.nav-resume {
  color: #c8d0df;
  text-decoration: none;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
  padding: 6px 0;
}

.nav-links a:hover,
.nav-resume:hover { color: #fff; }

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent2);
  opacity: .24;
  transform: scaleX(1);
  transform-origin: center;
  transition: opacity 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: #fff;
}

.nav-links a:hover::after {
  opacity: .72;
}

.nav-links a.is-active::after {
  opacity: 1;
  box-shadow: 0 0 10px rgba(111, 231, 214, .78), 0 0 18px rgba(111, 231, 214, .28);
}

.nav-resume {
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 999px;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.nav-toggle-bar {
  display: block;
  width: 16px;
  height: 1.5px;
  margin: 5px auto;
  background: #fff;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* Anchor positioning: keep section tops visible beneath the fixed navigation. */
main > .section,
.project-card {
  scroll-margin-top: var(--anchor-offset);
}

@media (max-width: 900px) {
  :root { --anchor-offset: 84px; }
}

/* —— Layout —— */
main {
  position: relative;
  z-index: 2;
}

.section {
  min-height: 100vh;
  position: relative;
  padding: 130px 7vw 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  isolation: isolate;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--accent2);
  font-weight: 700;
  text-transform: uppercase;
  margin: 0;
}

/* —— Hero —— */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
  align-items: center;
  gap: 4vw;
  padding-top: 120px;
}

.hero-copy { max-width: 820px; }

.hero-title {
  margin: 18px 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.hero-line {
  display: block;
  font-size: clamp(2.35rem, 6.4vw, 5.4rem);
  color: #fff;
}

.hero-role {
  margin: 0 0 22px;
  font-size: clamp(0.82rem, 1.4vw, 1rem);
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--accent2);
  font-weight: 700;
}

.hero-sub {
  max-width: 620px;
  color: #aeb8ca;
  font-size: 1.05rem;
  line-height: 1.8;
  margin: 0;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 30px 0;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 20px;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}

.btn:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

.btn.primary {
  background: #fff;
  color: #0b0d13;
}

.hero-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: #7f8ba1;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

body.is-ready .hero-copy .eyebrow,
body.is-ready .hero-line,
body.is-ready .hero-role,
body.is-ready .hero-sub,
body.is-ready .hero-actions,
body.is-ready .hero-meta,
body.is-ready .hero-photo-wrap,
body.is-ready .scroll-cue {
  animation: heroRise 0.85s var(--ease) both;
}

body.is-ready .hero-copy .eyebrow { animation-delay: 0.05s; }
body.is-ready .hero-line:nth-child(1) { animation-delay: 0.12s; }
body.is-ready .hero-line:nth-child(2) { animation-delay: 0.2s; }
body.is-ready .hero-role { animation-delay: 0.28s; }
body.is-ready .hero-sub { animation-delay: 0.36s; }
body.is-ready .hero-actions { animation-delay: 0.44s; }
body.is-ready .hero-meta { animation-delay: 0.52s; }
body.is-ready .hero-photo-wrap { animation-delay: 0.18s; }
body.is-ready .scroll-cue { animation-delay: 0.7s; }

@keyframes heroRise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.hero-photo-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.photo-depth {
  position: relative;
  width: min(380px, 72vw);
  transform-style: preserve-3d;
  transition: none;
  will-change: transform;
  perspective: 1200px;
  contain: layout paint style;
}

.photo-flip {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  transform-style: preserve-3d;
  transition: transform 0.66s cubic-bezier(.16,.82,.22,1);
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.photo-depth.is-flipped .photo-flip {
  transform: translateZ(0) rotateY(180deg);
}

.photo-depth.is-flipping {
  pointer-events: none;
}

.photo-face {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}

.photo-face-front {
  transform: rotateY(0deg);
}

.photo-face-back {
  transform: rotateY(180deg);
}

.photo-card {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
  background: #121722;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.photo-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transform: translateZ(0);
}

.photo-card-back {
  position: relative;
  isolation: isolate;
}

.profile-video-bg,
.profile-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  background: #121722;
}

.profile-video-bg {
  z-index: 1;
  object-fit: cover;
  object-position: center;
  opacity: 1;
  filter: blur(24px) saturate(1.12);
  transform: scale(1.18);
}

.profile-video {
  z-index: 2;
  object-fit: contain;
  object-position: center;
  opacity: 1;
}

.photo-card-back::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.photo-plane {
  position: absolute;
  inset: 10% -8%;
  border-radius: 28px;
  pointer-events: none;
}

.photo-plane-back {
  z-index: 1;
  background: linear-gradient(145deg, rgba(184, 163, 255, 0.18), rgba(115, 216, 199, 0.08));
  transform: translate3d(-14px, 16px, -40px);
  filter: blur(1px);
}

.photo-plane-front {
  z-index: 3;
  inset: auto 8% 8% 8%;
  height: 28%;
  background: linear-gradient(transparent, rgba(8, 11, 18, 0.12));
  transform: translateZ(18px);
}

.photo-tag {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 4;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 0.65rem;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  width: max-content;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transform: translateZ(22px);
}

/* Hero photo orbit rings: both visible as animated ellipses. */
.orbit {
  position: absolute;
  border: 1px solid rgba(184, 163, 255, 0.28);
  border-radius: 50%;
  pointer-events: none;
  transform-origin: 50% 50%;
}

.orbit::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  top: -3.5px;
  left: 50%;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 14px rgba(115, 216, 199, 0.55);
}

.orbit-one {
  width: 120%;
  height: 65%;
  top: 18%;
  left: -10%;
  animation: hero-orbit-one-spin 18s linear infinite;
}

.orbit-two {
  width: 104%;
  height: 72%;
  top: 14%;
  left: -2%;
  animation: hero-orbit-two-spin 25s linear infinite;
}

.scroll-cue {
  position: absolute;
  bottom: 30px;
  left: 7vw;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #68738a;
  margin: 0;
}

.scroll-cue span {
  margin-left: 8px;
  color: var(--accent2);
}

.section-heading { max-width: 900px; margin-bottom: 50px; }

.section-heading h2 {
  font: 600 clamp(2.8rem, 6vw, 6rem) / 0.95 "Space Grotesk", sans-serif;
  letter-spacing: -0.05em;
  margin: 12px 0 20px;
}

h2 span {
  color: transparent;
  -webkit-text-stroke: 1px rgba(237, 242, 255, 0.55);
}

.section-heading > p:last-child {
  color: var(--muted);
  max-width: 650px;
  line-height: 1.7;
}

.about-grid,
.cert-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
}

.certificate-frame { align-self: start; }

.glass {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--line);
  border-radius: 28px;
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.panel {
  padding: 38px;
  font-size: 1.08rem;
  line-height: 1.9;
  color: #bdc6d6;
}

.facts { display: grid; gap: 12px; }

.facts div {
  padding: 24px;
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 0 18px 18px 0;
}

.facts b {
  display: block;
  font: 600 1.15rem "Space Grotesk", sans-serif;
  margin-bottom: 7px;
}

.facts span { color: #8894a8; font-size: 0.85rem; }

.skills { overflow: hidden; }

.skill-orbit {
  position: relative;
  width: 100%;
  max-width: 900px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  contain: layout style;
}

.skill-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(110px, 18vw, 170px);
  height: clamp(110px, 18vw, 170px);
  border: 1px solid rgba(184, 163, 255, 0.4);
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  font: 700 clamp(0.95rem, 1.6vw, 1.4rem) "Space Grotesk", sans-serif;
  background: rgba(184, 163, 255, 0.08);
  box-shadow: 0 0 80px rgba(184, 163, 255, 0.13);
  z-index: 2;
}

.skill-center small {
  font-size: clamp(0.55rem, 0.9vw, 0.7rem);
  color: var(--accent2);
  letter-spacing: 0.2em;
}

.skill-chip {
  position: absolute;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 17, 28, 0.72);
  backdrop-filter: blur(10px);
  font-size: clamp(0.7rem, 0.95vw, 0.82rem);
  transform: translate(-50%, -50%);
  white-space: nowrap;
  animation: chip-float 5s ease-in-out infinite;
  z-index: 1;
}

.c1 { left: 22%; top: 16%; }
.c2 { left: 50%; top: 8%;  animation-delay: 0.3s; }
.c3 { left: 80%; top: 18%; animation-delay: 0.8s; }
.c4 { left: 12%; top: 48%; animation-delay: 1.2s; }
.c5 { left: 90%; top: 50%; animation-delay: 1.7s; }
.c6 { left: 22%; top: 84%; animation-delay: 2.1s; }
.c7 { left: 50%; top: 92%; animation-delay: 2.5s; }
.c8 { left: 80%; top: 84%; animation-delay: 3s; }
.c9 { left: 68%; top: 34%; border-color: rgba(115, 216, 199, 0.4); animation-delay: 3.5s; }

.learning-card { max-width: 850px; padding: 42px; }

.learning-status {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--accent2);
  font-weight: 700;
  text-transform: uppercase;
}

.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 0 0 rgba(115, 216, 199, 0.5);
  animation: pulse 1.8s infinite;
  margin-right: 9px;
}

.learning-card h3 {
  font: 600 clamp(3rem, 6vw, 5.5rem) "Space Grotesk", sans-serif;
  margin: 20px 0 10px;
}

.learning-card > p {
  color: #aeb8ca;
  line-height: 1.8;
  max-width: 700px;
}

.learning-line {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  color: #778398;
  font-size: 0.8rem;
}

.learning-line b {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.learning-line.active { color: #fff; }
.learning-line.active b { color: var(--accent2); }

.ai-learning-roadmap {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.roadmap-label {
  margin: 0 0 14px;
  color: #8d99ad;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ai-skill-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-skill-list span {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  color: #c2ccdb;
  font-size: .78rem;
  line-height: 1.35;
}

.certificate-frame {
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #111;
}

.certificate-frame img { width: 100%; display: block; }

.cert-info { padding: 42px; }
.cert-info h3 { font: 600 2.3rem "Space Grotesk", sans-serif; margin: 15px 0 8px; }
.cert-info > p:not(.eyebrow) { color: #c0cad8; }
.cert-info dl { margin: 35px 0; }

.cert-info dl div {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.cert-info dt { color: #707c91; }
.cert-info dd { margin: 0; text-align: right; }

.text-link {
  border: 0;
  background: none;
  color: var(--accent2);
  padding: 0;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
}

.mentor-photo {
  position: relative;
  margin-top: 24px;
  max-width: 900px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.mentor-photo img {
  width: 100%;
  display: block;
  filter: saturate(0.8);
}

.mentor-photo div {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.mentor-photo span {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent2);
}

.mentor-photo b { font: 500 1.5rem "Space Grotesk", sans-serif; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 25px;
  overflow: hidden;
  transition: 0.4s;
  position: relative;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(184, 163, 255, 0.5);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.3);
}

.project-image {
  height: 280px;
  position: relative;
  overflow: hidden;
  background: #111;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.6s;
}

.project-card:hover .project-image img { transform: scale(1.04); }

.project-image span {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 10px;
  border-radius: 999px;
  font: 700 0.7rem "Space Grotesk", sans-serif;
}

.project-body { padding: 25px; }

.project-type {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--accent2);
  font-weight: 700;
}

.project-body h3 {
  font: 600 1.8rem "Space Grotesk", sans-serif;
  margin: 10px 0;
}

.project-body > p:not(.project-type) {
  color: #9ba7ba;
  line-height: 1.6;
  min-height: 50px;
}

.tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.tags b {
  font-size: 0.65rem;
  border: 1px solid var(--line);
  padding: 7px 9px;
  border-radius: 999px;
  color: #bfc8d8;
}

.project-body a {
  font-size: 0.75rem;
  color: #fff;
  text-decoration: none;
  margin-right: 18px;
}

.project-body a:hover { color: var(--accent2); }

.journey-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.journey-step {
  padding: 25px;
  border-top: 1px solid var(--line);
  min-height: 230px;
}

.journey-step span {
  font: 700 2rem "Space Grotesk", sans-serif;
  color: var(--accent);
}

.journey-step h3 { font: 600 1.5rem "Space Grotesk", sans-serif; }
.journey-step p { color: #8e99ac; line-height: 1.7; font-size: 0.85rem; }

.interests-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 38px;
}

.interest-card {
  min-height: 220px;
  padding: 30px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.14);
  text-align: center;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.interest-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.interest-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.interest-card-link:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 4px;
}

.interest-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--accent2);
  font-size: .82rem;
  font-weight: 600;
}

.interest-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 1.9rem;
}

.interest-card h3 {
  margin: 0 0 10px;
  font: 600 1.35rem "Space Grotesk", sans-serif;
}

.interest-card p {
  max-width: 320px;
  margin: 0 auto;
  color: #9ea9bc;
  line-height: 1.7;
  font-size: 0.87rem;
}

.contact { min-height: 85vh; }
.contact-box { max-width: 900px; }

.contact-box h2 {
  font: 600 clamp(3.5rem, 8vw, 8rem) / 0.9 "Space Grotesk", sans-serif;
  letter-spacing: -0.06em;
  margin: 20px 0;
}

.contact-box > p:not(.eyebrow) {
  color: #9da8bb;
  max-width: 600px;
  line-height: 1.8;
}

.contact-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

footer {
  position: absolute;
  bottom: 30px;
  left: 7vw;
  right: 7vw;
  display: flex;
  justify-content: space-between;
  color: #566176;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.blossom-scene {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.55;
}

.moon {
  position: absolute;
  width: 30vw;
  height: 30vw;
  max-width: 430px;
  max-height: 430px;
  right: -8vw;
  top: 10vh;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(220, 225, 255, 0.18), rgba(150, 160, 210, 0.03) 55%, transparent 70%);
  filter: blur(1px);
}

.tree {
  position: absolute;
  bottom: -4vh;
  right: -4vw;
  width: 45vw;
  height: 80vh;
  opacity: 0.55;
}

.tree::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 95%;
  right: 28%;
  bottom: 0;
  background: linear-gradient(90deg, #14151d, #2a2730, #101117);
  border-radius: 50%;
  transform: rotate(9deg);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
}

.tree::after {
  content: "";
  position: absolute;
  inset: 5% 0 15% 5%;
  background:
    radial-gradient(ellipse at 45% 30%, rgba(160, 118, 148, 0.18), transparent 45%),
    radial-gradient(ellipse at 60% 45%, rgba(184, 163, 255, 0.09), transparent 45%);
  filter: blur(12px);
}

.branch {
  position: absolute;
  height: 9px;
  width: 48%;
  background: #171820;
  border-radius: 100%;
  transform-origin: right center;
}

.b1 { right: 29%; top: 24%; transform: rotate(-36deg); }
.b2 { right: 30%; top: 38%; transform: rotate(22deg); }
.b3 { right: 25%; top: 51%; transform: rotate(-20deg); }
.b4 { right: 34%; top: 63%; transform: rotate(32deg); }
.b5 { right: 28%; top: 73%; transform: rotate(-13deg); }

.petal-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  overflow: hidden;
}

.petal {
  position: absolute;
  width: 10px;
  height: 14px;
  background: linear-gradient(145deg, var(--petal-start), var(--petal-end));
  border-radius: 75% 25% 70% 30%;
  opacity: 0.84;
  box-shadow: 0 2px 10px var(--petal-glow);
  animation: fall linear forwards;
}

.petal::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 65%;
  left: 52%;
  top: 17%;
  border-radius: 999px;
  background: var(--petal-highlight);
  opacity: .55;
  transform: rotate(18deg);
}

.greeting-modal,
.cert-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 4, 9, 0.76);
  backdrop-filter: blur(18px);
  z-index: 110;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}

.greeting-modal.open,
.cert-modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: min(520px, 90vw);
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(24, 30, 46, 0.95), rgba(8, 11, 18, 0.96));
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
  position: relative;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.4s var(--ease);
}

.greeting-modal.open .modal-card {
  transform: none;
}

.modal-card h2 {
  font: 600 2.5rem "Space Grotesk", sans-serif;
  margin: 12px 0;
}

.modal-card > p:not(.eyebrow) {
  color: #8f9aaf;
  line-height: 1.6;
}

.modal-card input {
  width: 100%;
  padding: 15px 16px;
  margin: 18px 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  outline: none;
  font: inherit;
}

.modal-card input:focus { border-color: var(--accent); }

.modal-card .btn {
  width: 100%;
  justify-content: center;
}

.modal-close {
  position: absolute;
  right: 18px;
  top: 14px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  width: 44px;
  height: 44px;
}

.greeting-result {
  margin-top: 18px;
  color: var(--accent2);
  font-weight: 700;
  min-height: 20px;
}

.cert-modal img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 30px 100px #000;
}

.cert-modal .modal-close {
  position: fixed;
  z-index: 2;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes hero-orbit-one-spin {
  from { transform: rotate(18deg); }
  to { transform: rotate(378deg); }
}
@keyframes hero-orbit-two-spin {
  from { transform: rotate(-12deg); }
  to { transform: rotate(-372deg); }
}
@keyframes float { 50% { transform: translateY(-12px); } }
@keyframes chip-float { 50% { transform: translate(-50%, calc(-50% - 12px)); } }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(115, 216, 199, 0); } }
@keyframes fall {
  0% { transform: translate3d(0, -10vh, 0) rotate(0deg); }
  100% { transform: translate3d(var(--drift), 110vh, 0) rotate(500deg); }
}


/* —— Phase 3 / Project experience —— */
.project-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0 26px;
  padding: 8px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.025);
  backdrop-filter: blur(14px);
}

.project-nav a {
  color: #9eabc0;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px 11px;
  font: 700 0.65rem "Space Grotesk", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}

.project-nav a span { color: #738096; margin-left: 4px; font-weight: 500; }
.project-nav a:hover,
.project-nav a.is-active {
  color: #fff;
  border-color: rgba(184,163,255,.28);
  background: rgba(184,163,255,.09);
  transform: translateY(-1px);
}
.project-nav a.is-active span { color: var(--accent2); }

.project-card {
  --mx: 50%;
  --my: 50%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(184,163,255,.10), transparent 32%),
    linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 18px 60px rgba(0,0,0,.18);
  transition: transform .45s var(--ease), border-color .35s var(--ease), box-shadow .45s var(--ease), background .35s var(--ease);
  will-change: transform;
}

.project-card:first-child { grid-column: 1 / -1; }
.project-card:nth-child(4) { grid-column: span 1; }
.project-card:nth-child(5) { grid-column: 1 / -1; }

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.09), transparent 24%, transparent 70%, rgba(115,216,199,.04));
  opacity: 0;
  transition: opacity .35s ease;
}
.project-card:hover::before,
.project-card:focus-within::before { opacity: 1; }

.project-image {
  height: 320px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: #0c111a;
}
.project-card:first-child .project-image,
.project-card:nth-child(5) .project-image { height: 390px; }

.project-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4,7,12,.02) 42%, rgba(4,7,12,.64) 100%);
  pointer-events: none;
}

.project-image img {
  transform: scale(1.001);
  transition: transform .75s var(--ease), filter .55s var(--ease);
}
.project-card:hover .project-image img,
.project-card:focus-within .project-image img { transform: scale(1.045); filter: saturate(1.05) contrast(1.02); }

.project-image-overlay {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.project-card:hover .project-image-overlay,
.project-card:focus-within .project-image-overlay { opacity: 1; transform: none; }
.project-image-overlay span {
  color: #d5dceb;
  font-size: .66rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.project-image-overlay strong {
  color: #fff;
  font: 600 .78rem "Space Grotesk", sans-serif;
}

.project-image span {
  z-index: 3;
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  background: rgba(5,8,14,.62);
}

.project-body { padding: 28px 28px 30px; }
.project-body h3 { max-width: 760px; }
.project-body > p:not(.project-type) { max-width: 760px; }

.project-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}
.project-actions a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: transform .25s var(--ease), border-color .25s, background .25s, color .25s;
}
.project-case-link {
  color: #0a0d13;
  background: #fff;
  border: 1px solid #fff;
}
.project-secondary-link {
  color: #c7d0df;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line);
}
.project-actions a:hover { transform: translateY(-2px); }
.project-secondary-link:hover { color: #fff; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.07); }

/* —— Case studies —— */
.case-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}
.case-main { position: relative; z-index: 2; }
.case-nav-links { display:flex; gap:1.3rem; }
.case-page .nav { min-height:68px; }
.case-hero {
  min-height: 76vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  padding: 150px 7vw 80px;
}
.case-kicker { color: var(--accent2); font-size: .7rem; letter-spacing: .2em; font-weight: 800; text-transform: uppercase; }
.case-hero h1 { font: 600 clamp(2.7rem, 6vw, 5.5rem)/.96 "Space Grotesk", sans-serif; letter-spacing: -.055em; margin: 18px 0 20px; max-width: 900px; }
.case-lede { color: #aeb8ca; font-size: clamp(1rem, 1.7vw, 1.2rem); line-height: 1.75; max-width: 720px; }
.case-hero-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:28px; }
.case-back-link {
  display:inline-flex;
  align-items:center;
  gap:7px;
  margin-top:16px;
  color:#aeb8ca;
  text-decoration:none;
  font-size:.72rem;
  font-weight:700;
  letter-spacing:.1em;
  text-transform:uppercase;
  transition:color .25s var(--ease), transform .25s var(--ease);
}
.case-back-link:hover,
.case-back-link:focus-visible {
  color:#fff;
  transform:translateX(-3px);
}
.case-meta-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  box-shadow: 0 30px 90px rgba(0,0,0,.3);
}
.case-meta-card img { width:100%; display:block; border-radius:18px; border:1px solid rgba(255,255,255,.12); }
.case-meta-label { margin:18px 0 7px; color:var(--accent2); font-size:.63rem; letter-spacing:.17em; text-transform:uppercase; font-weight:800; }
.case-tools { display:flex; flex-wrap:wrap; gap:7px; }
.case-tools span { border:1px solid var(--line); border-radius:999px; padding:7px 9px; color:#c6cedd; font-size:.64rem; }
.case-section { padding: 30px 7vw 90px; }
.case-grid { display:grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap:18px; }
.case-panel { grid-column: span 6; padding:30px; border:1px solid var(--line); border-radius:24px; background:rgba(255,255,255,.032); }
.case-panel.wide { grid-column: 1 / -1; }
.case-panel h2 { margin:0 0 12px; font:600 clamp(1.55rem, 3vw, 2.3rem) "Space Grotesk", sans-serif; letter-spacing:-.03em; }
.case-panel p { color:#a9b4c7; line-height:1.75; }
.case-list { margin:0; padding-left:1.1rem; color:#a9b4c7; }
.case-list li { margin:.65rem 0; padding-left:.25rem; }
.case-kpis { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; margin-top:18px; }
.case-kpi { padding:18px; border:1px solid var(--line); border-radius:18px; background:rgba(255,255,255,.025); }
.case-kpi strong { display:block; font:600 clamp(1.2rem, 2vw, 1.7rem) "Space Grotesk",sans-serif; }
.case-kpi span { display:block; margin-top:5px; color:#8793a8; font-size:.65rem; letter-spacing:.08em; text-transform:uppercase; }
.case-gallery { display:grid; grid-template-columns:1.4fr .6fr; gap:14px; margin-top:18px; align-items:start; }
.case-gallery-main { position:relative; overflow:hidden; border-radius:20px; border:1px solid var(--line); background:#0d121b; align-self:start; }
.case-gallery-main img { width:100%; height:auto; min-height:0; object-fit:contain; display:block; }
.case-gallery-thumbs { display:grid; grid-template-columns:1fr; gap:10px; align-self:start; }
.case-gallery-thumb { padding:0; border:1px solid var(--line); border-radius:14px; overflow:hidden; background:#0d121b; cursor:pointer; opacity:.62; transition:opacity .25s,border-color .25s,transform .25s; }
.case-gallery-thumb:hover,.case-gallery-thumb.is-active { opacity:1; border-color:rgba(184,163,255,.65); transform:translateX(-2px); }
.case-gallery-thumb img { width:100%; aspect-ratio:16/10; object-fit:cover; display:block; }
.case-footer { display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; align-items:center; padding:0 7vw 70px; }
.case-footer a { color:#cbd4e2; text-decoration:none; font-size:.75rem; letter-spacing:.1em; text-transform:uppercase; }
.case-footer a:hover { color:#fff; }
.case-nav-dropdown > summary { display:none; }
.case-nav-dropdown > .case-nav-links { display:flex; }

@media (max-width: 900px) {
  .case-page .nav { padding: 0 5vw; }
  .case-nav-links { gap: .85rem; }
  .case-nav-links a { font-size: .62rem; }
  .project-card:first-child, .project-card:nth-child(5) { grid-column: auto; }
  .project-image, .project-card:first-child .project-image, .project-card:nth-child(5) .project-image { height: 300px; }
  .case-hero { grid-template-columns:1fr; min-height:auto; }
  .case-panel { grid-column: 1 / -1; }
  .case-kpis { grid-template-columns:repeat(2,1fr); }
  .case-gallery { grid-template-columns:1fr; }
  .case-gallery-thumbs { grid-template-columns:repeat(4,1fr); }
}

@media (max-width: 900px) {
  .case-page .nav { align-items: center; }
  .case-page .case-nav-dropdown {
    position: relative;
    margin-left: auto;
  }
  .case-page .case-nav-dropdown > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: #c8d0df;
    font-size: .66rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    background: rgba(255,255,255,.04);
  }
  .case-page .case-nav-dropdown > summary::-webkit-details-marker { display:none; }
  .case-page .case-nav-dropdown > summary::after { content:'⌄'; margin-left:7px; font-size:.9rem; }
  .case-page .case-nav-dropdown[open] > summary::after { content:'⌃'; }
  .case-page .case-nav-links {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(220px, 72vw);
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 8px;
    background: rgba(7,9,16,.98);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(0,0,0,.34);
    z-index: 110;
  }
  .case-page .case-nav-links a {
    display: block;
    padding: 12px 10px;
    font-size: .72rem;
    letter-spacing: .1em;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .case-page .case-nav-links a:last-child { border-bottom: 0; }
}

@media (max-width: 600px) {
  .project-nav { width:100%; overflow-x:auto; flex-wrap:nowrap; scrollbar-width:none; }
  .project-nav::-webkit-scrollbar { display:none; }
  .project-nav a { flex:0 0 auto; }
  .project-image-overlay { opacity:1; transform:none; }
  .project-body { padding:23px 20px 24px; }
  .project-body h3 { font-size:1.5rem; }
  .project-actions a { flex:1 1 auto; justify-content:center; }
  .case-hero { padding:120px 5vw 60px; }
  .case-section { padding:20px 5vw 60px; }
  .case-panel { padding:22px; }
  .case-kpis { grid-template-columns:1fr 1fr; }
  .case-footer { padding:0 5vw 50px; }
  .case-gallery-main img { min-height:0; height:auto; }
}

@media (prefers-reduced-motion: reduce) {
  .project-nav a,
  .project-actions a,
  .project-image img,
  .project-card,
  .project-image-overlay { transition:none !important; }
  .project-card:hover .project-image img,
  .project-card:focus-within .project-image img { transform:none; filter:none; }
}

@media (max-width: 1024px) {
  .skill-orbit { max-width: 760px; }
  .skill-chip { padding: 10px 14px; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; }

  .nav-panel {
    position: fixed;
    top: calc(var(--nav-h) - 1px);
    right: 5vw;
    left: auto;
    width: min(330px, 90vw);
    max-height: min(72vh, 560px);
    overflow-y: auto;
    padding: 18px 20px 22px;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    background: rgba(7, 9, 16, 0.98);
    border: 1px solid var(--line);
    border-radius: 0 0 18px 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,.35);
    backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.35s var(--ease), visibility 0.35s, transform 0.35s var(--ease);
  }

  .nav.is-open .nav-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .nav-links {
    flex-direction: column;
    gap: 4px;
    width: 100%;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 12px 4px;
    font-size: 1rem;
    letter-spacing: 0.08em;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  .nav-links a:last-child { border-bottom: 0; }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 100px;
    min-height: auto;
    gap: 36px;
  }

  .hero-photo-wrap { order: -1; margin-top: 12px; }
  .photo-depth { width: min(260px, 70vw); }
  .about-grid,
  .cert-grid,
  .project-grid { grid-template-columns: 1fr; }
  .journey-track, .interests-grid { grid-template-columns: 1fr 1fr; }
  .skill-orbit { max-width: 620px; }
  .tree { width: 80vw; opacity: 0.35; }
}

@media (max-width: 768px) {
  .skill-orbit { max-width: 520px; }
  .skill-chip { padding: 9px 12px; }
  .ai-skill-list { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .section { padding: 110px 5vw 80px; }
  .hero-line { font-size: clamp(2.1rem, 11vw, 3.2rem); }
  .hero-photo-wrap { display: flex; }
  .photo-depth { width: min(210px, 62vw); }
  .photo-plane-back { display: none; }
  .orbit { opacity: 0.45; }
  .journey-track, .interests-grid { grid-template-columns: 1fr; }
  .skill-orbit { max-width: 100%; }
  .skill-chip { padding: 8px 11px; font-size: 0.62rem; }
  .c1 { left: 20%; top: 15%; }
  .c2 { left: 52%; top: 8%; }
  .c3 { left: 82%; top: 20%; }
  .c4 { left: 14%; top: 48%; }
  .c5 { left: 88%; top: 50%; }
  .c6 { left: 22%; top: 82%; }
  .c7 { left: 50%; top: 93%; }
  .c8 { left: 80%; top: 82%; }
  .c9 { left: 70%; top: 34%; }
  .contact-box h2 { font-size: 3.2rem; }
  footer { left: 5vw; right: 5vw; font-size: 0.55rem; }
  .nav { padding: 0 5vw; }
  .scroll-cue { left: 5vw; }
}

@media (max-width: 390px) {
  .skill-chip { padding: 6px 9px; font-size: 0.56rem; }
  .c4 { left: 16%; top: 48%; }
  .c5 { left: 86%; top: 50%; }
  .c1 { left: 22%; top: 15%; }
  .c3 { left: 80%; top: 20%; }
  .c6 { left: 24%; top: 82%; }
  .c8 { left: 78%; top: 82%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .cinematic-loader,
  .cinematic-loader.is-done {
    display: none;
  }

  body.is-loading { overflow: auto; }

  .orbit,
  .skill-chip,
  .pulse,
  .petal {
    animation: none !important;
  }

  .skill-chip {
    transform: translate(-50%, -50%) !important;
  }

  .reveal,
  .reveal.visible,
  body.is-ready .hero-copy .eyebrow,
  body.is-ready .hero-line,
  body.is-ready .hero-role,
  body.is-ready .hero-sub,
  body.is-ready .hero-actions,
  body.is-ready .hero-meta,
  body.is-ready .hero-photo-wrap,
  body.is-ready .scroll-cue,
  .btn,
  .project-card,
  .project-image img,
  .modal-card,
  .photo-depth {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1;
  }

  .greeting-modal:not(.open),
  .cert-modal:not(.open) {
    opacity: 0;
    visibility: hidden;
  }

  .btn:hover,
  .project-card:hover {
    transform: none;
  }
}


/* —— Phase 4: final polish —— */
.copy-email { cursor: pointer; }
.copy-email.is-copied { border-color: rgba(115,216,199,.7); color: #baf1e6; }

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}
.footer-links a {
  color: #aeb9cb;
  text-decoration: none;
  transition: color .2s ease;
}
.footer-links a:hover { color: #fff; }

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 115;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  background: rgba(10,14,23,.72);
  color: #edf2ff;
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 36px rgba(0,0,0,.24);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .25s var(--ease), visibility .25s, transform .25s var(--ease), border-color .25s ease;
}
.back-to-top span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.back-to-top:hover { border-color: rgba(184,163,255,.65); }

.external-link {
  white-space: nowrap;
}

@media (max-width: 600px) {
  .back-to-top { right: 14px; bottom: 14px; }
  .footer-links { gap: 11px; }
  footer { flex-wrap: wrap; }
}

@media print {
  .nav, .progress, .noise, .petal-layer, .blossom-scene,
  .back-to-top, .cinematic-loader, .project-nav, .hero-actions { display:none !important; }
  body { background:#fff !important; color:#111 !important; }
  body::before { display:none; }
  .section { min-height:auto; page-break-inside:avoid; }
}

.project-image.image-error::after {
  content: "Dashboard preview unavailable";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  color: #9ca7bb;
  background: linear-gradient(135deg, rgba(13,18,29,.96), rgba(8,11,18,.96));
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}


/* =========================================================
   FINAL LAYOUT / FLOW SYSTEM
   Content sections are content-height only. The hero keeps its
   cinematic viewport height; every following section flows
   directly into the next with no empty viewport-sized tails.
   ========================================================= */

/* Certificate: end exactly where its content ends. */
.certificate {
  min-height: auto;
  justify-content: flex-start;
  padding-bottom: 0;
}

/* Projects: always a deterministic 01 → 05 vertical list. */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.project-card,
.project-card:first-child,
.project-card:nth-child(4),
.project-card:nth-child(5) {
  grid-column: 1 / -1;
}

.project-card {
  display: grid;
  grid-template-columns: 72px minmax(300px, .95fr) minmax(0, 1.25fr);
  align-items: stretch;
  min-height: 360px;
}

.project-index {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 30px 10px;
  border-right: 1px solid var(--line);
  color: var(--accent2);
}

.project-index span {
  font: 700 1.35rem/1 "Space Grotesk", sans-serif;
  letter-spacing: .04em;
}

.project-index i {
  display: block;
  width: 1px;
  flex: 1;
  min-height: 90px;
  background: linear-gradient(to bottom, rgba(184,163,255,.7), rgba(184,163,255,.04));
}

.project-image,
.project-card:first-child .project-image,
.project-card:nth-child(5) .project-image {
  height: 100%;
  min-height: 360px;
  border-bottom: 0;
  border-right: 1px solid rgba(255,255,255,.08);
}

.project-image img {
  object-fit: contain;
}

.project-image > span {
  display: none;
}

.project-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 34px 36px;
}

.project-body > p:not(.project-type) {
  min-height: 0;
}

.project-actions {
  margin-top: auto;
  padding-top: 20px;
}

/* White case-study button stays readable on hover/focus. */
.project-body .project-case-link:hover,
.project-body .project-case-link:focus-visible {
  color: #0a0d13;
  background: #fff;
  border-color: #fff;
}

/* Every non-hero section is content-height only. */
main > .section:not(.hero) {
  min-height: auto;
  justify-content: flex-start;
  padding-top: 0;
  padding-bottom: 0;
}

/* No blank tail between consecutive sections. */
main > .section:not(.hero) + .section:not(.hero) {
  padding-top: 0;
}

/* Keep the first projects heading close to the certificate content. */
main > .section.projects {
  padding-top: 0;
}

/* Contact owns its footer in normal document flow, so it cannot create
   an artificial empty tail or overlap content. */
main > .section.contact {
  padding-bottom: 28px;
}

#contact footer {
  position: static;
  margin-top: 52px;
  width: auto;
}

/* Case-study pages: no artificial section-sized gaps. */
.case-hero {
  min-height: auto;
}

.case-section {
  padding-bottom: 48px;
}

.case-footer {
  padding-bottom: 36px;
}

@media (max-width: 900px) {
  main > .section:not(.hero) {
    padding-top: 0;
  }

  main > .section:not(.hero) + .section:not(.hero),
  main > .section.projects {
    padding-top: 0;
  }

  .project-card,
  .project-card:first-child,
  .project-card:nth-child(4),
  .project-card:nth-child(5) {
    grid-column: 1 / -1;
  }

  .project-card {
    grid-template-columns: 56px 1fr;
  }

  .project-image,
  .project-card:first-child .project-image,
  .project-card:nth-child(5) .project-image {
    grid-column: 2;
    min-height: 300px;
    height: 300px;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  .project-body {
    grid-column: 2;
  }

  .project-index {
    grid-row: 1 / span 2;
  }

  .case-section {
    padding-bottom: 36px;
  }
}

@media (max-width: 600px) {
  main > .section:not(.hero) {
    padding-top: 0;
  }

  main > .section:not(.hero) + .section:not(.hero),
  main > .section.projects {
    padding-top: 0;
  }

  .certificate {
    padding-bottom: 0;
  }

  .project-card {
    grid-template-columns: 48px 1fr;
    min-height: 0;
  }

  .project-index {
    padding: 22px 6px;
  }

  .project-image,
  .project-card:first-child .project-image,
  .project-card:nth-child(5) .project-image {
    min-height: 220px;
    height: 220px;
  }

  .project-body {
    padding: 22px 18px 24px;
  }

  #contact footer {
    margin-top: 38px;
  }

  .case-section {
    padding-bottom: 28px;
  }

  .case-footer {
    padding-bottom: 28px;
  }
}

@media print {
  #contact footer {
    position: static;
  }
}

/* =========================================================
   REQUESTED POLISH — SECTION SPACING / AI SPECIALIST / CTA
   ========================================================= */

/* Keep a consistent, readable 1 cm separation between major sections. */
main > .section + .section {
  margin-top: var(--section-gap);
}

/* AI Specialist skill subsections: title + practical use. */
.ai-skill-list {
  align-items: stretch;
}

.ai-skill-item {
  min-width: 0;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.025);
  transition: transform .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}

.ai-skill-item:hover {
  transform: translateY(-3px);
  border-color: rgba(184,163,255,.32);
  background: rgba(255,255,255,.045);
}

.ai-skill-item strong {
  display: block;
  color: #edf2ff;
  font: 600 .86rem/1.3 "Space Grotesk", sans-serif;
  margin-bottom: 7px;
}

.ai-skill-item span {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #8f9bb0;
  font-size: .72rem;
  line-height: 1.55;
}

/* Case-study CTA: force a readable label in every state. */
.project-actions .project-case-link,
.project-actions .project-case-link:link,
.project-actions .project-case-link:visited {
  color: #0a0d13 !important;
  -webkit-text-fill-color: #0a0d13 !important;
  opacity: 1 !important;
  visibility: visible !important;
  background: #fff;
  border: 1px solid #fff;
  font-family: inherit;
  line-height: 1.2;
  text-shadow: none !important;
  filter: none !important;
  position: relative;
  z-index: 1;
}

.project-actions .project-case-link .case-link-label,
.project-actions .project-case-link .case-link-arrow {
  color: #0a0d13 !important;
  -webkit-text-fill-color: #0a0d13 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.project-actions .project-case-link .case-link-label {
  display: inline-block;
}

.project-actions .project-case-link .case-link-arrow {
  display: inline-block;
  margin-left: 7px;
}

.project-actions .project-case-link:hover,
.project-actions .project-case-link:focus,
.project-actions .project-case-link:focus-visible,
.project-actions .project-case-link:active {
  color: #0a0d13 !important;
  -webkit-text-fill-color: #0a0d13 !important;
  opacity: 1 !important;
  visibility: visible !important;
  background: #f1f3f8;
  border-color: #f1f3f8;
}

.project-actions .project-case-link:hover .case-link-label,
.project-actions .project-case-link:hover .case-link-arrow,
.project-actions .project-case-link:focus .case-link-label,
.project-actions .project-case-link:focus .case-link-arrow,
.project-actions .project-case-link:focus-visible .case-link-label,
.project-actions .project-case-link:focus-visible .case-link-arrow,
.project-actions .project-case-link:active .case-link-label,
.project-actions .project-case-link:active .case-link-arrow {
  color: #0a0d13 !important;
  -webkit-text-fill-color: #0a0d13 !important;
}

@media (max-width: 600px) {
  .ai-skill-item {
    padding: 14px 15px;
  }

  .ai-skill-item strong {
    font-size: .82rem;
  }

  .ai-skill-item span {
    font-size: .7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-skill-item,
  .project-actions .project-case-link {
    transition: none !important;
  }
}

/* Icon-only social actions */
.icon-btn {
  width: 52px;
  min-width: 52px;
  height: 52px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: block;
}
.footer-social-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  color: rgba(255,255,255,.78);
  transition: transform .2s ease, color .2s ease, border-color .2s ease, background .2s ease;
}
.footer-social-icon svg { width: 18px; height: 18px; fill: currentColor; }
.footer-social-icon:hover, .footer-social-icon:focus-visible {
  color: #fff;
  border-color: rgba(255,255,255,.38);
  background: rgba(255,255,255,.08);
  transform: translateY(-2px);
}

/* =========================================================
   TOOLKIT SWITCH — DATA / AI SPECIALIST
   ========================================================= */
.skill-toolkit {
  position: relative;
  width: min(100%, 1060px);
  margin: 0 auto;
}
.skill-orbit {
  aspect-ratio: 1 / .72;
  min-height: 500px;
  max-width: 1000px;
}
.skill-ring {
  position: absolute;
  inset: 16% 22%;
  border: 1px solid rgba(184,163,255,.22);
  border-radius: 50%;
  pointer-events: none;
}
.skill-ring.ring-two {
  inset: 27% 33%;
  border-color: rgba(115,216,199,.15);
}
.skill-center {
  width: clamp(155px, 18vw, 190px);
  height: clamp(155px, 18vw, 190px);
  padding: 22px;
  gap: 10px;
  z-index: 4;
}
.skill-center-kicker {
  font-size: .56rem;
  letter-spacing: .22em;
  color: #8692a7;
}
.skill-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(6,10,18,.72);
}
.skill-switch-btn {
  min-width: 54px;
  border: 0;
  border-radius: 999px;
  padding: 8px 11px;
  color: #9ca8bb;
  background: transparent;
  font: 800 .6rem/1 "Space Grotesk", sans-serif;
  letter-spacing: .08em;
  cursor: pointer;
}
.skill-switch-btn:hover,
.skill-switch-btn:focus-visible { color: #fff; }
.skill-switch-btn.is-active {
  color: #081019;
  background: #fff;
}
.skill-center-mode {
  color: var(--accent2);
  font: 700 .7rem/1.2 "Space Grotesk", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.skill-chip-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.skill-chip {
  animation-delay: var(--chip-delay, 0s);
}
.skill-ai-summary {
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 5%;
  padding: 18px 20px;
  border: 1px solid rgba(115,216,199,.18);
  border-radius: 20px;
  background: rgba(10,15,24,.72);
  backdrop-filter: blur(10px);
  text-align: center;
}
.skill-ai-summary strong {
  display: block;
  color: #eef3ff;
  font: 600 .86rem/1.2 "Space Grotesk", sans-serif;
  margin-bottom: 6px;
}
.skill-ai-summary span {
  color: #8f9bb0;
  font-size: .72rem;
  line-height: 1.5;
}
.skillset-panel {
  margin: 18px auto 0;
  padding: 26px;
  max-width: 1000px;
}
.skillset-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.skillset-panel-head .eyebrow { margin: 0 0 7px; }
.skillset-panel-head h3 {
  margin: 0;
  max-width: 700px;
  font: 600 clamp(1.2rem, 2.5vw, 1.75rem)/1.15 "Space Grotesk", sans-serif;
}
.skillset-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(115,216,199,.2);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--accent2);
  font: 800 .58rem/1 "Space Grotesk", sans-serif;
  letter-spacing: .12em;
}
.skillset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.skillset-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.024);
  transition: transform .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.skillset-item:hover {
  transform: translateY(-2px);
  border-color: rgba(184,163,255,.3);
  background: rgba(255,255,255,.04);
}
.skillset-item-number {
  color: var(--accent2);
  font: 800 .68rem/1.2 "Space Grotesk", sans-serif;
  letter-spacing: .08em;
}
.skillset-item h4 {
  margin: 0 0 5px;
  color: #edf2ff;
  font: 600 .83rem/1.25 "Space Grotesk", sans-serif;
}
.skillset-item p {
  margin: 0;
  color: #8f9bb0;
  font-size: .71rem;
  line-height: 1.55;
}
.skillset-item { animation: skill-item-in .45s var(--ease) both; animation-delay: var(--skill-delay, 0ms); }
@keyframes skill-item-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Case-study identity sits beneath the action links and above Back to Projects. */
.case-signature {
  margin: 14px 0 0;
  color: #a9b4c7;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Copy-email feedback keeps the icon intact. */
.copy-email { position: relative; }
.copy-email[data-feedback]::after {
  content: attr(data-feedback);
  position: absolute;
  inset: 100% auto auto 50%;
  transform: translate(-50%, 8px);
  white-space: nowrap;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9,13,21,.94);
  color: #eef3ff;
  font-size: .58rem;
  pointer-events: none;
}

@media (max-width: 900px) {
  .skill-orbit { aspect-ratio: 1 / .82; min-height: 500px; }
  .skill-ai-summary { left: 12%; right: 12%; }
  .skillset-grid { grid-template-columns: 1fr; }
  .skillset-panel-head { flex-direction: column; }
}

@media (max-width: 600px) {
  .skill-orbit { aspect-ratio: 1 / 1; min-height: 470px; }
  .skill-ring { inset: 18% 16%; }
  .skill-ring.ring-two { inset: 30% 25%; }
  .skill-ai-summary { left: 8%; right: 8%; bottom: 3%; padding: 14px 15px; }
  .skillset-panel { padding: 20px; }
  .skillset-item { grid-template-columns: 28px 1fr; padding: 13px; }
  .case-signature { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .skillset-item { animation: none !important; }
}


/* =========================================================
   LATEST POLISH — HERO SPECIALTY + DUAL SKILL ORBITS
   ========================================================= */
.hero-specialty {
  margin: -10px 0 20px;
  color: var(--accent2);
  font-size: clamp(.72rem, 1.2vw, .9rem);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.skill-toolkit .skill-orbit {
  overflow: visible;
}

.skill-ring {
  transform-origin: 50% 50%;
  border-top-color: rgba(184,163,255,.78);
  box-shadow: 0 0 0 1px rgba(184,163,255,.02), 0 0 45px rgba(184,163,255,.05);
}

.skill-ring::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  top: -4px;
  left: 50%;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 16px rgba(115,216,199,.55);
}

.skill-ring.ring-one {
  animation: toolkit-ring-spin 18s linear infinite;
}

.skill-ring.ring-two {
  border-top-color: rgba(115,216,199,.62);
  animation: toolkit-ring-spin-reverse 25s linear infinite;
}

.skill-chip-layer {
  transform-origin: 50% 50%;
  animation: toolkit-orbit-spin 34s linear infinite;
  will-change: transform;
}

.skill-toolkit[data-mode="ai"] .skill-chip-layer {
  animation-duration: 42s;
}

.skill-toolkit:hover .skill-chip-layer,
.skill-toolkit:focus-within .skill-chip-layer {
  animation-play-state: paused;
}

.skill-chip {
  left: 50% !important;
  top: 50% !important;
  animation: none !important;
  transform:
    translate(-50%, -50%)
    rotate(var(--angle))
    translateY(calc(-1 * var(--orbit-radius)))
    rotate(calc(var(--angle) * -1));
  transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
}

.skill-chip-outer {
  --orbit-radius: clamp(150px, 29vw, 300px);
}

.skill-chip-inner {
  --orbit-radius: clamp(105px, 21vw, 215px);
}

.skill-toolkit[data-mode="data"] .skill-chip {
  border-color: rgba(184,163,255,.20);
}

.skill-toolkit[data-mode="ai"] .skill-chip {
  border-color: rgba(115,216,199,.22);
}

.skill-chip:hover {
  z-index: 5;
  border-color: rgba(255,255,255,.38);
  background: rgba(18,24,38,.9);
  box-shadow: 0 10px 28px rgba(0,0,0,.2);
}

@keyframes toolkit-orbit-spin {
  to { transform: rotate(360deg); }
}

@keyframes toolkit-ring-spin {
  to { transform: rotate(360deg); }
}

@keyframes toolkit-ring-spin-reverse {
  to { transform: rotate(-360deg); }
}

@media (max-width: 900px) {
  .skill-chip-outer { --orbit-radius: clamp(145px, 29vw, 230px); }
  .skill-chip-inner { --orbit-radius: clamp(105px, 21vw, 170px); }
}

@media (max-width: 600px) {
  .skill-chip {
    padding: 8px 10px;
    font-size: .58rem;
  }
  .skill-chip-outer { --orbit-radius: 130px; }
  .skill-chip-inner { --orbit-radius: 92px; }
  .hero-specialty {
    margin-top: -4px;
    font-size: .62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skill-chip-layer,
  .skill-ring.ring-one,
  .skill-ring.ring-two {
    animation: none !important;
  }
}


/* =========================================================
   FINAL TOOLKIT ORBIT FIX — TRUE CIRCLES + 360° SKILL MOTION
   ========================================================= */
.skill-toolkit .skill-orbit {
  position: relative;
  width: min(760px, 78vw);
  max-width: 760px;
  aspect-ratio: 1 / 1;
  height: auto;
  min-height: 0;
  margin: 0 auto;
  contain: layout paint;
  overflow: visible;
}

.skill-toolkit .skill-ring {
  width: 82%;
  height: 82%;
  inset: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.skill-toolkit .skill-ring.ring-two {
  width: 58%;
  height: 58%;
  inset: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.skill-toolkit .skill-chip-layer {
  position: absolute;
  inset: 0;
  transform: none !important;
  animation: none !important;
  will-change: contents;
  z-index: 3;
}

.skill-toolkit .skill-chip {
  position: absolute;
  left: 50% !important;
  top: 50% !important;
  margin: 0;
  animation: none !important;
  white-space: nowrap;
  will-change: transform;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.skill-toolkit .skill-chip-outer,
.skill-toolkit .skill-chip-inner {
  --orbit-radius: 0px;
}

.skill-toolkit .skill-ring.ring-one {
  animation: toolkit-ring-spin 22s linear infinite;
}

.skill-toolkit .skill-ring.ring-two {
  animation: toolkit-ring-spin-reverse 30s linear infinite;
}

.skill-toolkit:hover .skill-chip-layer,
.skill-toolkit:focus-within .skill-chip-layer {
  animation: none !important;
}

@media (max-width: 600px) {
  .skill-toolkit .skill-orbit {
    width: min(92vw, 480px);
  }

  .skill-toolkit .skill-chip {
    padding: 7px 9px;
    font-size: .57rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skill-toolkit .skill-ring.ring-one,
  .skill-toolkit .skill-ring.ring-two {
    animation: none !important;
  }
}

/* Only one identity signature on case-study heroes. */
.case-footer { display: none !important; }


/* =========================================================
   FOREGROUND PETAL LAYER
   Petals stay above page content while navigation/modals remain
   interactive above the effect. Normal mode is continuous.
   ========================================================= */
.petal-layer {
  z-index: 90;
  pointer-events: none;
  isolation: isolate;
}

.petal {
  will-change: transform, opacity;
  transform-origin: 50% 45%;
}


/* =========================================================
   FINAL TOOLKIT — STATIC CIRCULAR SKILLSETS
   ========================================================= */
.skill-toolkit .skill-chip-layer,
.skill-toolkit .skill-ring.ring-one,
.skill-toolkit .skill-ring.ring-two {
  animation: none !important;
}

.skill-toolkit .skill-chip-layer {
  transform: none !important;
  will-change: auto;
}

.skill-toolkit .skill-chip {
  animation: none !important;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

/* Keep both DATA and AI toolkits arranged in clean, readable circles. */
.skill-toolkit .skill-chip-outer { --orbit-radius: 0px; }
.skill-toolkit .skill-chip-inner { --orbit-radius: 0px; }

/* Footer is intentionally minimal: identity + copyright only. */
footer .footer-links { display: none !important; }

/* =========================================================
   TOOLKIT — FINAL STATIC CIRCULAR FLOW
   DATA: 6 skills on one readable ring.
   AI: 12 skills on two balanced rings (6 + 6).
   No rotation or floating animation is applied to the skill chips.
   ========================================================= */
.skill-toolkit .skill-chip-layer {
  animation: none !important;
  transform: none !important;
  will-change: auto;
}

.skill-toolkit .skill-chip {
  animation: none !important;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
  z-index: 3;
  max-width: 190px;
  text-align: center;
  line-height: 1.15;
}

/* JavaScript supplies the exact x/y position for each point on the ring. */
.skill-toolkit .skill-chip-outer,
.skill-toolkit .skill-chip-inner {
  --orbit-radius: 0px;
}

/* Keep the visual guide rings static and clean. */
.skill-toolkit .skill-ring.ring-one,
.skill-toolkit .skill-ring.ring-two {
  animation: none !important;
}

/* Data mode: all six tools form one circular flow. */
.skill-toolkit[data-mode="data"] .skill-chip-outer {
  --orbit-radius: clamp(185px, 27vw, 290px);
}

.skill-toolkit[data-mode="data"] .skill-chip-inner {
  --orbit-radius: clamp(185px, 27vw, 290px);
}

/* AI mode: six skills per ring, giving every label breathing room. */
.skill-toolkit[data-mode="ai"] .skill-chip-inner {
  --orbit-radius: clamp(135px, 19vw, 205px);
}

.skill-toolkit[data-mode="ai"] .skill-chip-outer {
  --orbit-radius: clamp(215px, 31vw, 320px);
}

.skill-toolkit[data-mode="data"] .skill-ring.ring-two {
  opacity: .35;
}

.skill-toolkit[data-mode="ai"] .skill-ring.ring-two {
  opacity: .72;
}

@media (max-width: 900px) {
  .skill-toolkit[data-mode="data"] .skill-chip-outer,
  .skill-toolkit[data-mode="data"] .skill-chip-inner {
    --orbit-radius: clamp(150px, 28vw, 235px);
  }

  .skill-toolkit[data-mode="ai"] .skill-chip-inner {
    --orbit-radius: clamp(105px, 20vw, 155px);
  }

  .skill-toolkit[data-mode="ai"] .skill-chip-outer {
    --orbit-radius: clamp(165px, 31vw, 245px);
  }

  .skill-toolkit .skill-chip {
    max-width: 155px;
    padding: 9px 11px;
    font-size: .62rem;
  }
}

@media (max-width: 600px) {
  .skill-toolkit[data-mode="data"] .skill-chip-outer,
  .skill-toolkit[data-mode="data"] .skill-chip-inner {
    --orbit-radius: 132px;
  }

  .skill-toolkit[data-mode="ai"] .skill-chip-inner {
    --orbit-radius: 88px;
  }

  .skill-toolkit[data-mode="ai"] .skill-chip-outer {
    --orbit-radius: 142px;
  }

  .skill-toolkit .skill-chip {
    max-width: 125px;
    padding: 7px 8px;
    font-size: .55rem;
  }
}

/* =========================================================
   FINAL TOOLKIT CIRCULAR FLOW — REFERENCE STYLE
   One clockwise sequence per mode; no out-of-orbit labels.
   ========================================================= */
.skill-toolkit .skill-orbit {
  width: min(920px, 94vw);
  aspect-ratio: 1 / 1;
  min-height: 660px;
  margin: 0 auto;
  overflow: visible;
}

.skill-toolkit .skill-ring.ring-one {
  width: 78%;
  height: 78%;
  inset: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-color: rgba(184,163,255,.34);
  opacity: 1;
  animation: none !important;
}

.skill-toolkit .skill-ring.ring-two {
  width: 58%;
  height: 58%;
  inset: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-color: rgba(115,216,199,.12);
  opacity: 1;
  animation: none !important;
}

.skill-toolkit .skill-ring::after {
  display: none;
}

.skill-toolkit .skill-chip-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  transform: none !important;
  animation: none !important;
  pointer-events: none;
}

.skill-toolkit .skill-chip {
  pointer-events: auto;
  left: 50% !important;
  top: 50% !important;
  max-width: 180px;
  min-width: 0;
  padding: 10px 14px;
  white-space: normal;
  text-align: center;
  line-height: 1.15;
  font-size: .67rem;
  z-index: 4;
  animation: none !important;
  transform-origin: center;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.skill-toolkit .skill-chip-outer {
  --orbit-radius: 0px;
}

.skill-toolkit .skill-flow-arrows {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
  color: rgba(115,216,199,.78);
}

.skill-toolkit .skill-flow-arrows path {
  vector-effect: non-scaling-stroke;
}

.skill-toolkit[data-mode="data"] .skill-chip {
  border-color: rgba(184,163,255,.28);
  background: rgba(11,16,27,.72);
}

.skill-toolkit[data-mode="ai"] .skill-chip {
  border-color: rgba(115,216,199,.28);
  background: rgba(11,16,27,.72);
}

.skill-toolkit .skill-chip:hover,
.skill-toolkit .skill-chip:focus-visible {
  border-color: rgba(255,255,255,.52);
  background: rgba(18,24,38,.94);
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
  outline: none;
}

@media (max-width: 900px) {
  .skill-toolkit .skill-orbit {
    width: min(760px, 94vw);
    min-height: 600px;
  }

  .skill-toolkit .skill-chip {
    max-width: 150px;
    padding: 9px 11px;
    font-size: .61rem;
  }
}

@media (max-width: 600px) {
  .skill-toolkit .skill-orbit {
    width: min(96vw, 520px);
    min-height: 520px;
  }

  .skill-toolkit .skill-chip {
    max-width: 112px;
    padding: 7px 8px;
    font-size: .52rem;
  }

  .skill-toolkit .skill-ring.ring-one { width: 76%; height: 76%; }
  .skill-toolkit .skill-ring.ring-two { width: 56%; height: 56%; }
}

/* Final clarity pass: one true process ring, with the reference-style
   clockwise arrows as the visual flow. */
.skill-toolkit .skill-ring.ring-two {
  display: none;
}

.skill-toolkit .skill-chip {
  max-width: 158px;
  min-width: 0;
  font-size: .62rem;
  padding: 9px 12px;
}

@media (min-width: 901px) {
  .skill-toolkit .skill-chip {
    max-width: 158px;
  }
}

@media (max-width: 900px) {
  .skill-toolkit .skill-chip {
    max-width: 138px;
    font-size: .59rem;
    padding: 8px 10px;
  }
}

@media (max-width: 600px) {
  .skill-toolkit .skill-chip {
    max-width: 108px;
    font-size: .51rem;
    padding: 7px 8px;
  }
}


/* =========================================================
   CURRENT UPDATE — MODE-SCALED STATIC TOOLKIT
   DATA = compact ring; AI = wider ring with readable spacing.
   ========================================================= */
.skill-toolkit[data-mode="data"] .skill-ring.ring-one {
  width: 58%;
  height: 58%;
}

.skill-toolkit[data-mode="ai"] .skill-ring.ring-one {
  width: 78%;
  height: 78%;
}

.skill-toolkit[data-mode="data"] .skill-chip {
  max-width: 150px;
}

.skill-toolkit[data-mode="ai"] .skill-chip {
  max-width: 158px;
}

@media (max-width: 900px) {
  .skill-toolkit[data-mode="data"] .skill-ring.ring-one {
    width: 56%;
    height: 56%;
  }

  .skill-toolkit[data-mode="ai"] .skill-ring.ring-one {
    width: 76%;
    height: 76%;
  }
}

@media (max-width: 600px) {
  .skill-toolkit[data-mode="data"] .skill-ring.ring-one {
    width: 52%;
    height: 52%;
  }

  .skill-toolkit[data-mode="ai"] .skill-ring.ring-one {
    width: 72%;
    height: 72%;
  }

  .skill-toolkit[data-mode="data"] .skill-chip {
    max-width: 112px;
  }

  .skill-toolkit[data-mode="ai"] .skill-chip {
    max-width: 118px;
  }
}

/* ================================================================
   Theme system — visual atmosphere only
   ================================================================ */
:root {
  --theme-surface: rgba(13,18,29,.62);
  --theme-surface-strong: rgba(13,18,29,.82);
  --theme-text-strong: #edf2ff;
  --theme-text: #c8d0df;
  --theme-shadow: rgba(0,0,0,.36);
  --theme-cloud: rgba(255,255,255,.78);
  --theme-sky-line: rgba(255,255,255,.28);
  --theme-overlay-a: rgba(96,72,180,.18);
  --theme-overlay-b: rgba(42,156,147,.12);
  --theme-overlay-c: rgba(26,111,255,.08);
}

body::before {
  background:
    radial-gradient(circle at 15% 18%, var(--theme-overlay-a), transparent 30%),
    radial-gradient(circle at 82% 66%, var(--theme-overlay-b), transparent 29%),
    radial-gradient(circle at 62% 10%, var(--theme-overlay-c), transparent 32%),
    var(--bg);
  transition: background 0.8s ease, filter 0.8s ease;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -9;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, transparent 42%, rgba(0,0,0,.08) 100%);
  opacity: .85;
  transition: background .8s ease, opacity .8s ease, filter .8s ease;
}

/* Theme palettes */
body[data-theme="midnight"] {
  --bg: #080b12;
  --bg-elevated: #10151f;
  --text: #edf2ff;
  --muted: #9ca7bb;
  --line: rgba(255,255,255,.12);
  --glass: rgba(13,18,29,.62);
  --accent: #b8a3ff;
  --accent2: #73d8c7;
  --petal: #f6b6cc;
  --petal-start: #ffd7e5;
  --petal-end: #e88fac;
  --petal-glow: rgba(246,182,204,.28);
  --petal-highlight: #fff6fa;
  --focus: #9be7d8;
  --theme-surface: rgba(13,18,29,.62);
  --theme-surface-strong: rgba(13,18,29,.86);
  --theme-text-strong: #edf2ff;
  --theme-text: #c8d0df;
  --theme-overlay-a: rgba(105,82,180,.20);
  --theme-overlay-b: rgba(44,156,147,.12);
  --theme-overlay-c: rgba(42,112,220,.08);
}

body[data-theme="aurora"] {
  --bg: #0b1630;
  --bg-elevated: #10244c;
  --text: #f4f8ff;
  --muted: #b7c5df;
  --line: rgba(255,255,255,.16);
  --glass: rgba(20,34,68,.56);
  --accent: #9d8cff;
  --accent2: #66e7ef;
  --petal: #f7b8d4;
  --petal-start: #ffd9ec;
  --petal-end: #c7b6ff;
  --petal-glow: rgba(171,146,255,.30);
  --petal-highlight: #ffffff;
  --focus: #a6fbff;
  --theme-surface: rgba(28,43,83,.52);
  --theme-surface-strong: rgba(21,38,79,.78);
  --theme-text-strong: #f8fbff;
  --theme-text: #d7e2f5;
  --theme-overlay-a: rgba(103,61,255,.35);
  --theme-overlay-b: rgba(44,217,255,.28);
  --theme-overlay-c: rgba(90,135,255,.20);
}

body[data-theme="emerald"] {
  --bg: #09211f;
  --bg-elevated: #12352f;
  --text: #effffb;
  --muted: #b5d5ce;
  --line: rgba(255,255,255,.16);
  --glass: rgba(17,57,51,.56);
  --accent: #79e3c1;
  --accent2: #55e0c1;
  --petal: #f5bdd0;
  --petal-start: #d9ffe9;
  --petal-end: #8edbb8;
  --petal-glow: rgba(94,231,180,.28);
  --petal-highlight: #f8fff9;
  --focus: #a8ffe3;
  --theme-surface: rgba(19,72,63,.52);
  --theme-surface-strong: rgba(17,61,54,.80);
  --theme-text-strong: #f5fffd;
  --theme-text: #d8eee8;
  --theme-overlay-a: rgba(13,161,128,.30);
  --theme-overlay-b: rgba(22,220,173,.22);
  --theme-overlay-c: rgba(95,206,255,.12);
}

body[data-theme="cosmic"] {
  --bg: #1a1230;
  --bg-elevated: #251a4c;
  --text: #f9f4ff;
  --muted: #cec5e5;
  --line: rgba(255,255,255,.16);
  --glass: rgba(37,28,72,.58);
  --accent: #c6a4ff;
  --accent2: #66d6ff;
  --petal: #ffbcd7;
  --petal-start: #ffd9ee;
  --petal-end: #b99aff;
  --petal-glow: rgba(193,142,255,.31);
  --petal-highlight: #ffffff;
  --focus: #d0baff;
  --theme-surface: rgba(50,35,93,.56);
  --theme-surface-strong: rgba(42,29,81,.80);
  --theme-text-strong: #fffaff;
  --theme-text: #e0d9ee;
  --theme-overlay-a: rgba(171,76,255,.32);
  --theme-overlay-b: rgba(67,140,255,.22);
  --theme-overlay-c: rgba(247,99,208,.16);
}

body[data-theme="light"] {
  --bg: #d9efff;
  --bg-elevated: #eef8ff;
  --text: #10213a;
  --muted: #4e6785;
  --line: rgba(16,33,58,.16);
  --glass: rgba(255,255,255,.56);
  --accent: #2767d8;
  --accent2: #1697d8;
  --petal: #ef74b1;
  --petal-start: #ffe2ef;
  --petal-end: #e56aa9;
  --petal-glow: rgba(229,106,169,.22);
  --petal-highlight: #ffffff;
  --focus: #1d73e8;
  --theme-surface: rgba(255,255,255,.55);
  --theme-surface-strong: rgba(255,255,255,.82);
  --theme-text-strong: #10213a;
  --theme-text: #324a68;
  --theme-overlay-a: rgba(58,147,255,.25);
  --theme-overlay-b: rgba(255,255,255,.66);
  --theme-overlay-c: rgba(126,204,255,.30);
}

body[data-theme="light"]::before {
  background:
    radial-gradient(ellipse at 18% 18%, rgba(255,255,255,.95) 0 10%, transparent 22%),
    radial-gradient(ellipse at 72% 20%, rgba(255,255,255,.86) 0 9%, transparent 21%),
    radial-gradient(ellipse at 48% 72%, rgba(255,255,255,.72) 0 11%, transparent 26%),
    linear-gradient(180deg, #74c8ff 0%, #9ddcff 38%, #d9f0ff 72%, #eef9ff 100%);
}
body[data-theme="light"]::after {
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.38), transparent 35%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.20));
  opacity: 1;
}

/* Stop the old scroll-scene hue cycling from altering the selected theme. */
body[data-scene]::before { filter: none !important; }

/* Navigation adapts to the selected atmosphere. */
.nav {
  background: linear-gradient(180deg, color-mix(in srgb, var(--theme-surface-strong) 95%, transparent), transparent);
}
.nav.is-scrolled { background: var(--theme-surface-strong); box-shadow: 0 10px 40px var(--theme-shadow); }
.brand, .nav-links a:hover, .nav-links a.is-active { color: var(--theme-text-strong); }
.nav-links a, .nav-resume { color: var(--theme-text); }
.nav-toggle { background: var(--theme-surface); }
.nav-toggle-bar { background: var(--theme-text-strong); }

/* Keep the project/card glass surfaces theme aware without changing their layout. */
.glass,
.project-card,
.project-nav,
.theme-menu,
.skillset-panel,
.learning-card,
.cert-info,
.case-panel,
.case-meta-card,
.interest-card { background: var(--theme-surface); }

/* Light mode readability overrides. */
body[data-theme="light"] .eyebrow { color: #0b73b6; }
body[data-theme="light"] .hero-title,
body[data-theme="light"] .hero-role,
body[data-theme="light"] .hero-sub,
body[data-theme="light"] .section-heading h2,
body[data-theme="light"] .contact-box h2,
body[data-theme="light"] .project-body h3,
body[data-theme="light"] .learning-card h3,
body[data-theme="light"] .cert-info h3,
body[data-theme="light"] .interest-card h3,
body[data-theme="light"] footer { color: var(--theme-text-strong); }
body[data-theme="light"] .section-heading h2 span,
body[data-theme="light"] .contact-box h2 span { color: #1e6fe5; }
body[data-theme="light"] .hero-title .hero-line { color: #10213a; }
body[data-theme="light"] .hero-role { color: #10213a; }
body[data-theme="light"] .hero-meta,
body[data-theme="light"] .scroll-cue,
body[data-theme="light"] .section-heading > p:last-child,
body[data-theme="light"] .project-body > p:not(.project-type),
body[data-theme="light"] .case-lede,
body[data-theme="light"] .case-panel p,
body[data-theme="light"] .case-panel li,
body[data-theme="light"] .cert-info p,
body[data-theme="light"] .learning-card p,
body[data-theme="light"] .interest-card p { color: var(--theme-text); }
body[data-theme="light"] .photo-tag { background: rgba(255,255,255,.82); color: #10213a; }
body[data-theme="light"] .mentor-photo div {
  background: linear-gradient(180deg, transparent 0%, rgba(6,22,39,.72) 42%, rgba(6,22,39,.9) 100%);
  color: #ffffff;
}
body[data-theme="light"] .mentor-photo b { color: #ffffff; }
body[data-theme="light"] .btn.ghost,
body[data-theme="light"] .project-secondary-link,
body[data-theme="light"] .case-back-link,
body[data-theme="light"] .text-link { color: #163153; border-color: rgba(16,33,58,.22); }
body[data-theme="light"] .btn.ghost:hover,
body[data-theme="light"] .project-secondary-link:hover { background: rgba(255,255,255,.52); color: #09213f; border-color: rgba(16,33,58,.36); }
body[data-theme="light"] .project-case-link { color: #10213a; background: rgba(255,255,255,.88); }
body[data-theme="light"] .project-case-link:hover,
body[data-theme="light"] .project-case-link:focus-visible { color: #10213a; background: #fff; }
body[data-theme="light"] .tags b,
body[data-theme="light"] .skill-chip,
body[data-theme="light"] .skillset-item,
body[data-theme="light"] .ai-skill-item { color: #17314f; border-color: rgba(16,33,58,.15); background: rgba(255,255,255,.44); }
body[data-theme="light"] .skill-center,
body[data-theme="light"] .skill-ring,
body[data-theme="light"] .interest-icon { border-color: rgba(16,62,108,.20); }
body[data-theme="light"] .project-image-overlay { background: linear-gradient(180deg, transparent 32%, rgba(4,28,56,.52) 100%); }
body[data-theme="light"] .blossom-scene { opacity: .26; }
body[data-theme="light"] .tree::before,
body[data-theme="light"] .branch { background: linear-gradient(90deg,#7b8fa5,#61798e,#4d647b); }
body[data-theme="light"] .moon { background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.72), rgba(220,239,255,.22) 55%, transparent 70%); }
body[data-theme="light"] .petal { opacity: .9; }
body[data-theme="light"] .noise { opacity: .28; }

/* Theme-aware cherry blossom treatment — the animation is shared, the palette adapts. */
body[data-theme="midnight"] .petal { filter: saturate(1.02); }
body[data-theme="aurora"] .petal { filter: saturate(1.06) brightness(1.03); }
body[data-theme="emerald"] .petal { filter: saturate(1.02) brightness(1.02); }
body[data-theme="cosmic"] .petal { filter: saturate(1.08) brightness(1.03); }
body[data-theme="light"] .petal { filter: saturate(1.02) brightness(1.04); }

/* Theme chooser */
.theme-control { position: relative; display: flex; align-items: center; }
.theme-trigger {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--theme-surface); color: var(--theme-text);
  padding: 9px 12px; font: 600 .68rem/1 Inter,system-ui,sans-serif;
  letter-spacing: .09em; text-transform: uppercase; cursor: pointer;
  backdrop-filter: blur(14px); transition: transform .2s var(--ease), border-color .2s, background .2s, color .2s;
}
.theme-trigger:hover, .theme-trigger[aria-expanded="true"] { color: var(--theme-text-strong); border-color: var(--accent2); background: var(--theme-surface-strong); }
.theme-trigger-icon { font-size: .95rem; line-height: 1; }
.theme-menu {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 150;
  width: min(320px, calc(100vw - 30px)); padding: 12px;
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 24px 70px var(--theme-shadow); backdrop-filter: blur(20px);
}
.theme-menu[hidden] { display: none; }
.theme-menu-title { margin: 4px 9px 10px; color: var(--muted); font-size: .65rem; letter-spacing: .15em; text-transform: uppercase; font-weight: 700; }
.theme-option {
  width: 100%; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center;
  padding: 10px 9px; border: 1px solid transparent; border-radius: 14px;
  background: transparent; color: var(--theme-text-strong); cursor: pointer; text-align: left;
}
.theme-option:hover, .theme-option:focus-visible, .theme-option.is-selected { background: rgba(255,255,255,.08); border-color: var(--line); }
.theme-option b { display: block; font-size: .78rem; font-weight: 700; }
.theme-option small { display: block; margin-top: 2px; font-size: .61rem; color: var(--muted); }
.theme-swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255,255,255,.28); box-shadow: inset 0 0 0 2px rgba(255,255,255,.08), 0 0 12px rgba(0,0,0,.12); }
.theme-swatch.midnight { background: linear-gradient(135deg,#080b12,#7c3aed,#00e5ff); }
.theme-swatch.aurora { background: linear-gradient(135deg,#e0f2ff,#60a5fa,#8b5cf6,#06b6d4); }
.theme-swatch.emerald { background: linear-gradient(135deg,#ecfdf5,#10b981,#06b6d4,#34d399); }
.theme-swatch.cosmic { background: linear-gradient(135deg,#f3e8ff,#a78bfa,#8b5cf6,#38bdf8); }
.theme-swatch.light { background: linear-gradient(180deg,#63b9ff,#dff4ff,#ffffff); }

/* Case pages: keep the selector from crowding the compact navigation. */
.case-theme-control { margin-left: .8rem; }
@media (max-width: 900px) {
  .nav-panel .theme-control { width: 100%; }
  .nav-panel .theme-menu { left: 0; right: auto; }
  .case-page .nav { gap: .6rem; }
  .case-theme-control { margin-left: auto; }
  .case-page .theme-trigger span:last-child { display: none; }
}

@media (max-width: 600px) {
  .theme-trigger { padding: 9px 10px; }
  .theme-menu { right: -5px; width: min(300px, calc(100vw - 20px)); }
}

/* ================================================================
   THEME READABILITY POLISH — keep every theme legible
   ================================================================ */

/* Use the selected theme text tokens consistently for primary content. */
body[data-theme="aurora"],
body[data-theme="emerald"],
body[data-theme="cosmic"],
body[data-theme="light"] {
  color: var(--theme-text-strong);
}

body[data-theme="aurora"] .section-heading h2,
body[data-theme="emerald"] .section-heading h2,
body[data-theme="cosmic"] .section-heading h2,
body[data-theme="light"] .section-heading h2,
body[data-theme="aurora"] .contact-box h2,
body[data-theme="emerald"] .contact-box h2,
body[data-theme="cosmic"] .contact-box h2,
body[data-theme="light"] .contact-box h2,
body[data-theme="aurora"] .hero-title,
body[data-theme="emerald"] .hero-title,
body[data-theme="cosmic"] .hero-title {
  color: var(--theme-text-strong);
  text-shadow: 0 2px 14px rgba(0,0,0,.18);
}

body[data-theme="aurora"] .hero-sub,
body[data-theme="emerald"] .hero-sub,
body[data-theme="cosmic"] .hero-sub,
body[data-theme="light"] .hero-sub,
body[data-theme="aurora"] .section-heading > p:last-child,
body[data-theme="emerald"] .section-heading > p:last-child,
body[data-theme="cosmic"] .section-heading > p:last-child,
body[data-theme="light"] .section-heading > p:last-child,
body[data-theme="aurora"] .project-body > p:not(.project-type),
body[data-theme="emerald"] .project-body > p:not(.project-type),
body[data-theme="cosmic"] .project-body > p:not(.project-type),
body[data-theme="light"] .project-body > p:not(.project-type),
body[data-theme="aurora"] .learning-card p,
body[data-theme="emerald"] .learning-card p,
body[data-theme="cosmic"] .learning-card p,
body[data-theme="light"] .learning-card p,
body[data-theme="aurora"] .cert-info p,
body[data-theme="emerald"] .cert-info p,
body[data-theme="cosmic"] .cert-info p,
body[data-theme="light"] .cert-info p {
  color: var(--theme-text);
  text-shadow: 0 1px 10px rgba(0,0,0,.12);
}

/* Light mode: deliberately darken text, chips, buttons and secondary content. */
body[data-theme="light"] .eyebrow,
body[data-theme="light"] .project-type,
body[data-theme="light"] .section-heading .eyebrow,
body[data-theme="light"] .learning-line.active b,
body[data-theme="light"] .case-kicker,
body[data-theme="light"] .case-meta-label,
body[data-theme="light"] .hero-specialty {
  color: #0b64a0;
}

body[data-theme="light"] .hero-title,
body[data-theme="light"] .hero-title .hero-line,
body[data-theme="light"] .hero-role,
body[data-theme="light"] .section-heading h2,
body[data-theme="light"] .contact-box h2,
body[data-theme="light"] .project-body h3,
body[data-theme="light"] .learning-card h3,
body[data-theme="light"] .cert-info h3,
body[data-theme="light"] .case-hero h1,
body[data-theme="light"] .case-panel h2,
body[data-theme="light"] .case-panel h3,
body[data-theme="light"] .case-meta-card strong,
body[data-theme="light"] .brand,
body[data-theme="light"] footer {
  color: #10213a !important;
  text-shadow: none;
}

body[data-theme="light"] .hero-sub,
body[data-theme="light"] .section-heading > p:last-child,
body[data-theme="light"] .project-body > p:not(.project-type),
body[data-theme="light"] .learning-card p,
body[data-theme="light"] .cert-info p,
body[data-theme="light"] .case-lede,
body[data-theme="light"] .case-panel p,
body[data-theme="light"] .case-panel li,
body[data-theme="light"] .case-list,
body[data-theme="light"] .hero-meta,
body[data-theme="light"] .facts span,
body[data-theme="light"] .journey-step p,
body[data-theme="light"] .contact-box p,
body[data-theme="light"] .footer-links a,
body[data-theme="light"] .scroll-cue {
  color: #294461 !important;
  text-shadow: none;
}

body[data-theme="light"] .hero-role { color: #174c7c !important; }
body[data-theme="light"] .hero-title .hero-line:nth-child(2) { color: #1d67cc !important; }
body[data-theme="light"] .section-heading h2 span,
body[data-theme="light"] .contact-box h2 span { color: #1d67cc !important; }

body[data-theme="light"] .btn.ghost,
body[data-theme="light"] .project-secondary-link,
body[data-theme="light"] .case-back-link,
body[data-theme="light"] .text-link,
body[data-theme="light"] .case-footer a {
  color: #163153 !important;
  border-color: rgba(16,33,58,.24) !important;
}

body[data-theme="light"] .btn.ghost:hover,
body[data-theme="light"] .project-secondary-link:hover,
body[data-theme="light"] .case-back-link:hover {
  color: #0c2a4a !important;
  background: rgba(255,255,255,.68) !important;
  border-color: rgba(16,33,58,.38) !important;
}

body[data-theme="light"] .project-case-link,
body[data-theme="light"] .case-hero-actions .btn:not(.ghost) {
  color: #ffffff !important;
  background: #176fe5 !important;
  border-color: #176fe5 !important;
}

body[data-theme="light"] .tags b,
body[data-theme="light"] .skill-chip,
body[data-theme="light"] .skillset-item,
body[data-theme="light"] .ai-skill-item,
body[data-theme="light"] .theme-option {
  color: #17314f !important;
}

body[data-theme="light"] .theme-menu,
body[data-theme="light"] .theme-trigger,
body[data-theme="light"] .glass,
body[data-theme="light"] .project-card,
body[data-theme="light"] .learning-card,
body[data-theme="light"] .cert-info,
body[data-theme="light"] .case-panel,
body[data-theme="light"] .case-meta-card {
  background: rgba(255,255,255,.74) !important;
  border-color: rgba(16,33,58,.15) !important;
  box-shadow: 0 18px 50px rgba(39,76,115,.13);
}

body[data-theme="light"] .theme-trigger,
body[data-theme="light"] .theme-trigger:hover,
body[data-theme="light"] .theme-trigger[aria-expanded="true"] {
  color: #163153 !important;
}

/* Bright dark themes: place a subtle text-safe veil behind copy without darkening the whole scene. */
body[data-theme="aurora"] .hero-copy,
body[data-theme="emerald"] .hero-copy,
body[data-theme="cosmic"] .hero-copy {
  text-shadow: 0 2px 12px rgba(0,0,0,.22);
}

body[data-theme="aurora"] .project-body,
body[data-theme="emerald"] .project-body,
body[data-theme="cosmic"] .project-body,
body[data-theme="aurora"] .learning-card,
body[data-theme="emerald"] .learning-card,
body[data-theme="cosmic"] .learning-card,
body[data-theme="aurora"] .cert-info,
body[data-theme="emerald"] .cert-info,
body[data-theme="cosmic"] .cert-info {
  backdrop-filter: blur(18px) saturate(120%);
}

/* Case-study readability for every theme. */
body[data-theme="light"] .case-tools span,
body[data-theme="light"] .case-kpi,
body[data-theme="light"] .project-nav a,
body[data-theme="light"] .project-nav a span {
  color: #294461 !important;
}

body[data-theme="light"] .case-tools span {
  border-color: rgba(16,33,58,.16) !important;
  background: rgba(255,255,255,.58);
}

/* Theme-aware atmospheric veil; opacity is deliberately low to preserve each scene. */
body[data-theme="light"]::before {
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04)),
    radial-gradient(ellipse at 18% 18%, rgba(255,255,255,.98) 0 10%, transparent 22%),
    radial-gradient(ellipse at 72% 20%, rgba(255,255,255,.90) 0 9%, transparent 21%),
    radial-gradient(ellipse at 48% 72%, rgba(255,255,255,.78) 0 11%, transparent 26%),
    linear-gradient(180deg, #66bbf7 0%, #9ddcff 38%, #dff3ff 72%, #f4fbff 100%);
}

@media (max-width: 900px) {
  body[data-theme="light"] .nav {
    background: rgba(255,255,255,.78);
    box-shadow: 0 8px 30px rgba(39,76,115,.12);
  }
  body[data-theme="light"] .nav-links a,
  body[data-theme="light"] .nav-resume { color: #163153 !important; }
}


/* ================================================================
   USER UPDATE — TOOLKIT SCALE + LIGHT THEME READABILITY
   Scope: toolkit sizing/readability and light-theme text contrast only.
   ================================================================ */

/* Make the toolkit feel like a primary visual section on desktop. */
.skill-toolkit {
  width: min(100%, 1180px);
}

.skill-toolkit .skill-orbit {
  width: min(1000px, 94vw);
  min-height: 720px;
}

.skill-toolkit .skill-center {
  width: clamp(175px, 19vw, 220px);
  height: clamp(175px, 19vw, 220px);
}

.skill-toolkit .skill-center-kicker {
  font-size: .64rem;
}

.skill-toolkit .skill-switch-btn {
  min-width: 64px;
  padding: 9px 13px;
  font-size: .68rem;
}

.skill-toolkit .skill-center-mode {
  font-size: .78rem;
}

.skill-toolkit .skill-chip {
  max-width: 190px;
  min-height: 42px;
  padding: 11px 15px;
  font-size: .76rem;
  font-weight: 700;
}

/* Keep the DATA ring compact but scale the whole toolkit up. */
.skill-toolkit[data-mode="data"] .skill-ring.ring-one {
  width: 56%;
  height: 56%;
}

/* Give the 12-item AI flow more breathing room. */
.skill-toolkit[data-mode="ai"] .skill-ring.ring-one {
  width: 82%;
  height: 82%;
}

/* Stronger, easier-to-see process arrows. */
.skill-toolkit .skill-flow-arrows {
  color: rgba(77, 178, 171, .9);
}

/* Light mode — true dark-on-light toolkit controls and labels. */
body[data-theme="light"] .skill-toolkit .skill-center {
  background: rgba(255,255,255,.9);
  border-color: rgba(15,64,110,.28);
  box-shadow: 0 18px 50px rgba(39,76,115,.14);
}

body[data-theme="light"] .skill-toolkit .skill-center-kicker {
  color: #48617b !important;
}

body[data-theme="light"] .skill-toolkit .skill-center-mode {
  color: #1769b0 !important;
}

body[data-theme="light"] .skill-toolkit .skill-switch {
  background: #eef6ff;
  border-color: rgba(16,55,92,.2);
}

body[data-theme="light"] .skill-toolkit .skill-switch-btn {
  color: #365470;
}

body[data-theme="light"] .skill-toolkit .skill-switch-btn:hover,
body[data-theme="light"] .skill-toolkit .skill-switch-btn:focus-visible {
  color: #0b3154;
}

body[data-theme="light"] .skill-toolkit .skill-switch-btn.is-active {
  background: #176fe5;
  color: #fff;
}

body[data-theme="light"] .skill-toolkit .skill-ring.ring-one {
  border-color: rgba(27, 96, 156, .42);
}

body[data-theme="light"] .skill-toolkit .skill-flow-arrows {
  color: #237f95;
}

body[data-theme="light"] .skill-toolkit .skill-chip {
  color: #102a45 !important;
  background: rgba(255,255,255,.92) !important;
  border-color: rgba(32,104,164,.30) !important;
  box-shadow: 0 8px 22px rgba(35,84,120,.10);
  text-shadow: none !important;
}

body[data-theme="light"] .skill-toolkit .skill-chip:hover,
body[data-theme="light"] .skill-toolkit .skill-chip:focus-visible {
  color: #09233d !important;
  background: #ffffff !important;
  border-color: rgba(23,111,229,.55) !important;
  box-shadow: 0 12px 28px rgba(35,84,120,.16);
}

/* Light-mode supporting copy: make every information block comfortably readable. */
body[data-theme="light"] .about-grid .panel p,
body[data-theme="light"] .facts b,
body[data-theme="light"] .facts span,
body[data-theme="light"] .journey-step h3,
body[data-theme="light"] .journey-step p,
body[data-theme="light"] .skillset-panel-head h3,
body[data-theme="light"] .skillset-item h4,
body[data-theme="light"] .skillset-item p {
  color: #173a5d !important;
  text-shadow: none !important;
}

body[data-theme="light"] .about-grid .panel,
body[data-theme="light"] .facts div,
body[data-theme="light"] .journey-step,
body[data-theme="light"] .skillset-panel {
  background: rgba(255,255,255,.84);
  border-color: rgba(16,55,92,.16);
}

body[data-theme="light"] .skillset-item {
  background: rgba(255,255,255,.76) !important;
}

body[data-theme="light"] .skillset-item-number {
  color: #1769b0 !important;
}

@media (max-width: 900px) {
  .skill-toolkit .skill-orbit {
    width: min(900px, 96vw);
    min-height: 650px;
  }

  .skill-toolkit .skill-chip {
    max-width: 175px;
    min-height: 40px;
    padding: 10px 13px;
    font-size: .70rem;
  }
}

@media (max-width: 600px) {
  .skill-toolkit .skill-orbit {
    width: min(96vw, 560px);
    min-height: 560px;
  }

  .skill-toolkit .skill-center {
    width: 150px;
    height: 150px;
  }

  .skill-toolkit .skill-center-kicker {
    font-size: .55rem;
  }

  .skill-toolkit .skill-switch-btn {
    min-width: 51px;
    padding: 8px 10px;
    font-size: .58rem;
  }

  .skill-toolkit .skill-center-mode {
    font-size: .65rem;
  }

  .skill-toolkit .skill-chip {
    max-width: 130px;
    min-height: 36px;
    padding: 8px 10px;
    font-size: .57rem;
  }
}


/* Case-study theme control + light-theme legibility hardening. */
.case-page[data-theme="light"],
body.case-page[data-theme="light"] {
  color: #10213a !important;
}
body[data-theme="light"] .ai-skill-item strong,
body[data-theme="light"] .ai-skill-item span,
body[data-theme="light"] .learning-line span,
body[data-theme="light"] .learning-line b {
  color: #173a5d !important;
  text-shadow: none !important;
}
body[data-theme="light"] .ai-skill-item strong,
body[data-theme="light"] .learning-line b {
  font-weight: 700;
}
body[data-theme="light"] .ai-skill-item,
body[data-theme="light"] .learning-line {
  background: rgba(255,255,255,.86) !important;
  border-color: rgba(16,55,92,.18) !important;
}
body[data-theme="light"] .case-theme-control .theme-trigger,
body[data-theme="light"] .case-theme-control .theme-trigger:hover,
body[data-theme="light"] .case-theme-control .theme-trigger[aria-expanded="true"] {
  color: #163153 !important;
  background: rgba(255,255,255,.82) !important;
  border-color: rgba(16,33,58,.22) !important;
}
body[data-theme="light"] .case-page .nav-links a,
body[data-theme="light"] .case-page .brand {
  color: #10213a !important;
}
body[data-theme="light"] .case-page .nav-links a:hover,
body[data-theme="light"] .case-page .nav-links a:focus-visible {
  color: #0b64a0 !important;
}
body[data-theme="light"] .case-page .case-meta-card p,
body[data-theme="light"] .case-page .case-meta-card li,
body[data-theme="light"] .case-page .case-meta-card .case-tools span,
body[data-theme="light"] .case-page .case-kpi span,
body[data-theme="light"] .case-page .case-panel p,
body[data-theme="light"] .case-page .case-panel li {
  color: #294461 !important;
}
body[data-theme="light"] .case-page .case-hero h1,
body[data-theme="light"] .case-page .case-panel h2,
body[data-theme="light"] .case-page .case-meta-card strong,
body[data-theme="light"] .case-page .case-kpi strong {
  color: #10213a !important;
}
body[data-theme="light"] .case-page .case-panel,
body[data-theme="light"] .case-page .case-meta-card,
body[data-theme="light"] .case-page .case-kpi {
  background: rgba(255,255,255,.86) !important;
  border-color: rgba(16,55,92,.16) !important;
}

/* ================================================================
   UNIVERSAL BACKGROUND — same structure across every theme
   ================================================================
   The old geometric blossom-tree silhouette is intentionally removed.
   Every theme now uses the same calm, low-detail atmospheric background;
   only the color treatment changes with the selected theme.
*/
.blossom-scene {
  display: none !important;
}

body::before {
  background:
    radial-gradient(ellipse at 18% 16%, rgba(255,255,255,.11) 0 8%, transparent 29%),
    radial-gradient(ellipse at 79% 72%, rgba(255,255,255,.08) 0 10%, transparent 30%),
    radial-gradient(circle at 54% 36%, var(--universal-glow-a), transparent 28%),
    radial-gradient(circle at 72% 18%, var(--universal-glow-b), transparent 24%),
    linear-gradient(125deg, var(--universal-base-a) 0%, var(--universal-base-b) 52%, var(--universal-base-c) 100%);
  transition: background .8s ease, opacity .8s ease;
}

body::after {
  background:
    radial-gradient(circle at 50% 44%, transparent 42%, rgba(7,15,26,.08) 100%),
    linear-gradient(135deg, rgba(255,255,255,.018), transparent 44%, rgba(255,255,255,.014));
  opacity: .82;
}

/* Same background geometry; theme palettes only alter its colors. */
body[data-theme="midnight"] {
  --universal-base-a: #0a101a;
  --universal-base-b: #121d2b;
  --universal-base-c: #0a1320;
  --universal-glow-a: rgba(124,58,237,.18);
  --universal-glow-b: rgba(0,229,255,.10);
}

body[data-theme="aurora"] {
  --universal-base-a: #132440;
  --universal-base-b: #1d3554;
  --universal-base-c: #12283f;
  --universal-glow-a: rgba(120,110,255,.22);
  --universal-glow-b: rgba(66,225,241,.18);
}

body[data-theme="emerald"] {
  --universal-base-a: #102b2a;
  --universal-base-b: #19413c;
  --universal-base-c: #102f31;
  --universal-glow-a: rgba(52,211,153,.18);
  --universal-glow-b: rgba(45,212,191,.15);
}

body[data-theme="cosmic"] {
  --universal-base-a: #211839;
  --universal-base-b: #332652;
  --universal-base-c: #1f2341;
  --universal-glow-a: rgba(167,139,250,.21);
  --universal-glow-b: rgba(96,165,250,.15);
}

body[data-theme="light"] {
  --universal-base-a: #f4f8fc;
  --universal-base-b: #dcecf8;
  --universal-base-c: #cbe3f3;
  --universal-glow-a: rgba(59,130,246,.12);
  --universal-glow-b: rgba(14,165,233,.10);
}

/* Remove the old light-mode background artwork so every theme shares
   the same universal background structure. */
body[data-theme="light"]::before {
  background:
    radial-gradient(ellipse at 18% 16%, rgba(255,255,255,.72) 0 8%, transparent 29%),
    radial-gradient(ellipse at 79% 72%, rgba(255,255,255,.48) 0 10%, transparent 30%),
    radial-gradient(circle at 54% 36%, var(--universal-glow-a), transparent 28%),
    radial-gradient(circle at 72% 18%, var(--universal-glow-b), transparent 24%),
    linear-gradient(125deg, var(--universal-base-a) 0%, var(--universal-base-b) 52%, var(--universal-base-c) 100%);
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    transition: none;
  }
}

/* HERO PHOTO — THEME-AWARE DUAL ELLIPSE ORBITS
   Deliberately stronger and larger so both rings remain visible in every theme. */
.hero-photo-wrap .orbit {
  z-index: 0;
  border-width: 2px;
  opacity: 1;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent2) 22%, transparent));
}

.hero-photo-wrap .orbit::after {
  width: 9px;
  height: 9px;
  top: -4.5px;
  margin-left: -4.5px;
  background: var(--accent2);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent2) 72%, transparent);
}

/* Both rings are intentionally larger than the portrait card. */
.hero-photo-wrap .orbit-one {
  width: 142%;
  height: 84%;
  top: 8%;
  left: -21%;
  animation: hero-orbit-one-spin 18s linear infinite;
}

.hero-photo-wrap .orbit-two {
  width: 126%;
  height: 76%;
  top: 12%;
  left: -13%;
  animation: hero-orbit-two-spin 25s linear infinite;
}

/* Theme-specific ring contrast: same geometry, palette follows the selected theme. */
body[data-theme="midnight"] .hero-photo-wrap .orbit {
  border-color: rgba(116, 177, 255, .62);
}
body[data-theme="midnight"] .hero-photo-wrap .orbit-two {
  border-color: rgba(115, 216, 199, .58);
}

body[data-theme="aurora"] .hero-photo-wrap .orbit {
  border-color: rgba(180, 221, 255, .74);
}
body[data-theme="aurora"] .hero-photo-wrap .orbit-two {
  border-color: rgba(109, 245, 239, .70);
}

body[data-theme="emerald"] .hero-photo-wrap .orbit {
  border-color: rgba(163, 246, 222, .72);
}
body[data-theme="emerald"] .hero-photo-wrap .orbit-two {
  border-color: rgba(81, 224, 188, .76);
}

body[data-theme="cosmic"] .hero-photo-wrap .orbit {
  border-color: rgba(211, 190, 255, .76);
}
body[data-theme="cosmic"] .hero-photo-wrap .orbit-two {
  border-color: rgba(102, 214, 255, .70);
}

body[data-theme="light"] .hero-photo-wrap .orbit {
  border-color: rgba(36, 91, 145, .62);
}
body[data-theme="light"] .hero-photo-wrap .orbit-two {
  border-color: rgba(22, 128, 167, .58);
}

@media (max-width: 600px) {
  .hero-photo-wrap .orbit-one {
    width: 148%;
    height: 86%;
    left: -24%;
  }

  .hero-photo-wrap .orbit-two {
    width: 132%;
    height: 78%;
    left: -16%;
  }

  .hero-photo-wrap .orbit::after {
    width: 8px;
    height: 8px;
    top: -4px;
    margin-left: -4px;
  }
}


/* ================================================================
   RESPONSIVE DEVICE PASS — compact navigation for medium screens
   Keeps the approved desktop layout intact above 1100px.
   ================================================================ */
@media (max-width: 1100px) {
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .nav-panel {
    position: fixed;
    inset: 0;
    padding: 100px 8vw 40px;
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
    background: rgba(7, 9, 16, 0.96);
    backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.35s var(--ease), visibility 0.35s, transform 0.35s var(--ease);
    overflow-y: auto;
  }

  .nav.is-open .nav-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .nav-links {
    flex-direction: column;
    gap: 4px;
    width: 100%;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 12px 4px;
    font-size: 1rem;
    letter-spacing: 0.08em;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  .nav-links a:last-child { border-bottom: 0; }

  .nav-panel .theme-control {
    width: 100%;
  }

  .nav-panel .theme-menu {
    left: 0;
    right: auto;
  }

  .nav-panel .nav-resume {
    align-self: flex-start;
  }

  .case-page .nav {
    gap: .6rem;
  }
}

/* Keep the hero orbit treatment inside the available medium-width frame. */
@media (max-width: 1100px) {
  .orbit-one {
    width: 100%;
    left: 0;
  }

  .orbit-two {
    width: 96%;
    left: 2%;
  }
}

/* Compact the toolkit visual rather than allowing the circular flow to clip. */
@media (max-width: 900px) {
  .skill-toolkit .skill-orbit {
    width: min(94vw, 620px);
    max-width: 620px;
    min-height: 0;
    aspect-ratio: 1 / 1;
  }

  .skill-toolkit .skill-chip {
    max-width: 160px;
  }
}

@media (max-width: 600px) {
  .skill-toolkit .skill-orbit {
    width: min(94vw, 520px);
    min-height: 0;
    aspect-ratio: 1 / 1;
  }

  .skill-toolkit .skill-center {
    width: 132px;
    height: 132px;
  }

  .skill-toolkit .skill-chip {
    max-width: 72px;
    min-height: 0;
    padding: 5px 6px;
    font-size: .46rem;
    line-height: 1.08;
  }
}

@media (max-width: 360px) {
  .skill-toolkit .skill-center {
    width: 118px;
    height: 118px;
  }

  .skill-toolkit .skill-chip {
    max-width: 66px;
    padding: 4px 5px;
    font-size: .43rem;
  }
}


/* Final responsive containment: keep transformed hero rings within the frame. */
@media (max-width: 900px) {
  .hero-photo-wrap { width: 100%; }
  .orbit-one { width: 82%; left: 9%; }
  .orbit-two { width: 78%; left: 11%; }
}

/* Mode-specific selectors need the same mobile cap because they carry higher
   specificity than the generic toolkit chip rule above. */
@media (max-width: 600px) {
  .skill-toolkit[data-mode="data"] .skill-chip,
  .skill-toolkit[data-mode="ai"] .skill-chip {
    max-width: 72px;
    min-height: 0;
    padding: 5px 6px;
    font-size: .46rem;
    line-height: 1.08;
  }

  .skill-toolkit[data-mode="ai"] .skill-chip { --orbit-label-radius: 0.38; }
}

@media (max-width: 360px) {
  .skill-toolkit[data-mode="data"] .skill-chip,
  .skill-toolkit[data-mode="ai"] .skill-chip {
    max-width: 66px;
    padding: 4px 5px;
    font-size: .43rem;
  }
}


/* Final responsive override: these high-specificity rules prevent the approved
   desktop ring scale from overflowing smaller viewports. */
@media (max-width: 1100px) {
  .hero-photo-wrap .orbit-one { width: 100% !important; left: 0 !important; }
  .hero-photo-wrap .orbit-two { width: 94% !important; left: 3% !important; }
}

@media (max-width: 900px) {
  .hero-photo-wrap .orbit-one { width: 92% !important; height: 70% !important; top: 15% !important; left: 4% !important; }
  .hero-photo-wrap .orbit-two { width: 86% !important; height: 64% !important; top: 18% !important; left: 7% !important; }
}

@media (max-width: 600px) {
  .skill-toolkit .skill-orbit {
    width: min(94vw, 520px) !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 1 / 1 !important;
  }

  .skill-toolkit[data-mode="data"] .skill-chip,
  .skill-toolkit[data-mode="ai"] .skill-chip {
    max-width: 72px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 5px 6px !important;
    font-size: .46rem !important;
    line-height: 1.08 !important;
  }
}

@media (max-width: 360px) {
  .skill-toolkit .skill-orbit {
    width: min(94vw, 520px) !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .skill-toolkit[data-mode="data"] .skill-chip,
  .skill-toolkit[data-mode="ai"] .skill-chip {
    max-width: 66px !important;
    padding: 4px 5px !important;
    font-size: .43rem !important;
  }
}


/* Final profile-card treatment: real photo front + video back with 3D flip. */
.photo-depth {
  overflow: visible;
  transform-style: preserve-3d;
  will-change: transform;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.photo-flip,
.photo-card {
  user-select: none;
  -webkit-user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  .photo-depth,
  .photo-flip,
  .profile-video-bg,
  .profile-video { transition: none !important; }
}

.interest-card {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(115,216,199,.10), transparent 34%),
    var(--glass);
}

.interest-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.08), transparent 30%);
  opacity: 0;
  transition: opacity .25s ease;
}

.interest-card:hover::after { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .interest-card { transition: none !important; }
  .interest-card::after { transition: none !important; }
}

/* Mobile-only theme dropdown: keep the chooser inside the navigation panel. */
@media (max-width: 600px) {
  .nav-panel .theme-control {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  .nav-panel .theme-trigger {
    width: 100%;
    justify-content: space-between;
    min-height: 44px;
  }

  .nav-panel .theme-menu {
    position: static;
    inset: auto;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
    padding: 8px;
    border-radius: 16px;
  }

  .nav-panel .theme-option {
    min-height: 46px;
  }

  .case-page .case-theme-control {
    position: relative;
    flex-direction: column;
    align-items: stretch;
  }

  .case-page .case-theme-control .theme-trigger {
    width: 44px;
    align-self: flex-end;
    justify-content: center;
  }

  .case-page .case-theme-control .theme-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    width: min(290px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
  }
}

/* ================================================================
   PHONE HEADER — two compact dropdown controls
   Main portfolio only. Desktop/tablet layout remains unchanged.
   ================================================================ */
.mobile-nav-actions { display: none; }

@media (max-width: 600px) {
  /* Keep the brand in the header and put Menu + Theme beside it. */
  .nav {
    min-height: 64px;
    padding: 8px 5vw;
    align-items: center;
  }

  .brand { flex: 0 0 auto; }

  .mobile-nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    position: relative;
    z-index: 220;
  }

  .mobile-nav-actions .nav-toggle,
  .mobile-theme-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-width: 76px;
    height: 40px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--theme-surface);
    color: var(--theme-text-strong);
    backdrop-filter: blur(14px);
    font: 700 .64rem/1 Inter,system-ui,sans-serif;
    letter-spacing: .12em;
    text-transform: uppercase;
    cursor: pointer;
  }

  .mobile-nav-actions .nav-toggle-label { display: inline; }
  .mobile-nav-actions .nav-toggle-bar { display: none; }

  .mobile-theme-control { position: relative; }
  .mobile-theme-trigger { min-width: 82px; }
  .mobile-theme-trigger[aria-expanded="true"],
  .mobile-nav-actions .nav-toggle[aria-expanded="true"] {
    border-color: var(--accent2);
    background: var(--theme-surface-strong);
  }

  /* Menu dropdown: directly below the two header controls, never over the brand. */
  .nav-panel {
    position: fixed;
    top: 64px;
    left: 5vw;
    right: 5vw;
    width: auto;
    max-height: min(70vh, 520px);
    padding: 10px 16px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    background: var(--theme-surface-strong);
    border: 1px solid var(--line);
    border-radius: 0 0 18px 18px;
    box-shadow: 0 24px 60px var(--theme-shadow);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    overflow-y: auto;
    z-index: 210;
  }

  .nav.is-open .nav-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .nav-panel .nav-links {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .nav-panel .nav-links a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 13px 4px;
    font-size: .82rem;
    letter-spacing: .11em;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  .nav-panel .nav-resume {
    align-self: flex-start;
    margin-top: 2px;
  }

  /* The desktop theme control stays in the panel; hide it on phones because
     the dedicated Theme control is already in the header. */
  .nav-panel > .theme-control { display: none; }

  /* Phone-only Theme dropdown, anchored to the Theme button. */
  .mobile-theme-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(300px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
    padding: 9px;
    border-radius: 16px;
    background: var(--theme-surface-strong);
    border: 1px solid var(--line);
    box-shadow: 0 24px 60px var(--theme-shadow);
    backdrop-filter: blur(20px);
    z-index: 260;
  }

  .mobile-theme-menu .theme-option { min-height: 46px; }
  .mobile-theme-menu .theme-menu-title { margin: 4px 9px 8px; }
}


/* FINAL MOBILE HEADER FIX — phone only. Keep Menu and Theme above all hero layers. */
@media (max-width: 600px) {
  .nav#siteNav {
    z-index: 1000;
    min-height: 64px;
    position: fixed;
    overflow: visible !important;
  }

  .nav#siteNav .mobile-nav-actions {
    position: relative;
    z-index: 1003;
    overflow: visible;
  }

  .nav#siteNav .mobile-nav-actions .nav-toggle,
  .nav#siteNav .mobile-theme-trigger {
    position: relative;
    z-index: 1004;
  }

  .nav#siteNav .nav-panel {
    position: fixed !important;
    top: 64px !important;
    left: 5vw !important;
    right: 5vw !important;
    width: auto !important;
    max-height: calc(100dvh - 82px) !important;
    min-height: 0 !important;
    display: block !important;
    padding: 12px 16px 18px !important;
    margin: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 1002 !important;
    box-sizing: border-box !important;
  }

  .nav#siteNav .nav-panel .nav-links {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    min-height: 0 !important;
    gap: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .nav#siteNav .nav-panel .nav-links a {
    display: flex !important;
    align-items: center !important;
    min-height: 46px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 13px 6px !important;
    color: var(--theme-text-strong) !important;
    opacity: 1 !important;
    visibility: visible !important;
    text-decoration: none !important;
  }

  .nav#siteNav .nav-panel .nav-links a::after {
    display: none !important;
  }

  .nav#siteNav .nav-panel .nav-resume {
    display: inline-flex !important;
    color: var(--theme-text-strong) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .nav#siteNav .mobile-theme-control {
    position: relative !important;
    z-index: 1005 !important;
    overflow: visible !important;
  }

  .nav#siteNav .mobile-theme-menu {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    width: min(300px, calc(100vw - 24px)) !important;
    max-height: calc(100dvh - 90px) !important;
    overflow-y: auto !important;
    z-index: 1006 !important;
  }

  .nav#siteNav .mobile-theme-menu[hidden] {
    display: none !important;
  }

  .nav#siteNav .mobile-theme-menu .theme-option {
    display: grid !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

/* FINAL PROFILE VIDEO FIX — one reliable tap/click on every device. */
.photo-depth { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.profile-video, .profile-video-bg { pointer-events: none; }
@media (max-width: 600px) {
  .photo-depth { cursor: pointer; }
}

/* FINAL OVERRIDE v2 — force a real mobile dropdown panel with measurable height. */
@media (max-width: 600px) {
  .nav#siteNav {
    height: 64px !important;
    min-height: 64px !important;
  }

  .nav#siteNav .nav-panel {
    top: 64px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 80px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 8px !important;
  }

  .nav#siteNav.is-open .nav-panel {
    height: auto !important;
    min-height: 0 !important;
  }
}

/* FINAL MOBILE MENU HEIGHT — prevent the dropdown from collapsing to a thin strip. */
@media (max-width: 600px) {
  .nav#siteNav .nav-panel,
  .nav#siteNav.is-open .nav-panel {
    height: min(430px, calc(100dvh - 82px)) !important;
    max-height: calc(100dvh - 82px) !important;
  }
}

/* Final mobile readability: make dropdown surfaces opaque enough that hero text never shows through. */
@media (max-width: 600px) {
  .nav#siteNav .nav-panel,
  .nav#siteNav .mobile-theme-menu {
    background: rgb(10 14 23 / 0.985) !important;
  }

  body[data-theme="light"] .nav#siteNav .nav-panel,
  body[data-theme="light"] .nav#siteNav .mobile-theme-menu {
    background: rgb(255 255 255 / 0.985) !important;
  }
}


/* ================================================================
   FINAL MOBILE MENU + PROFILE VIDEO HARDENING
   These rules intentionally sit last so older responsive rules cannot
   collapse or clip the controls on real phones.
   ================================================================ */
@media (max-width: 600px) {
  .nav#siteNav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    padding: 8px 5vw !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    z-index: 10000 !important;
  }

  .nav#siteNav .mobile-nav-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    position: relative !important;
    z-index: 10003 !important;
  }

  .nav#siteNav .mobile-nav-actions .nav-toggle,
  .nav#siteNav .mobile-nav-actions .mobile-theme-trigger {
    display: inline-flex !important;
    position: relative !important;
    flex: 0 0 auto !important;
    min-width: 76px !important;
    width: auto !important;
    height: 40px !important;
    z-index: 10004 !important;
  }

  .nav#siteNav .nav-panel#primaryNav {
    position: fixed !important;
    top: 64px !important;
    left: 5vw !important;
    right: 5vw !important;
    bottom: auto !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 78px) !important;
    margin: 0 !important;
    padding: 10px 16px 16px !important;
    display: block !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    background: rgb(8 12 20 / 0.985) !important;
    border: 1px solid var(--line) !important;
    border-top: 0 !important;
    border-radius: 0 0 18px 18px !important;
    box-shadow: 0 24px 60px rgb(0 0 0 / 0.55) !important;
    backdrop-filter: blur(20px) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-8px) !important;
    pointer-events: none !important;
    z-index: 10002 !important;
  }

  .nav#siteNav.is-open .nav-panel#primaryNav {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }

  .nav#siteNav .nav-panel .nav-links {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0 !important;
    margin: 0 !important;
  }

  .nav#siteNav .nav-panel .nav-links a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-height: 48px !important;
    padding: 13px 6px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    color: var(--theme-text-strong) !important;
    opacity: 1 !important;
    visibility: visible !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
    font-size: .82rem !important;
    line-height: 1.25 !important;
    letter-spacing: .11em !important;
    text-decoration: none !important;
  }

  .nav#siteNav .nav-panel .nav-links a::after {
    display: none !important;
  }

  .nav#siteNav .nav-panel .nav-resume {
    display: inline-flex !important;
    align-items: center !important;
    margin-top: 12px !important;
    color: var(--theme-text-strong) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .nav#siteNav .nav-panel > .theme-control { display: none !important; }

  .nav#siteNav .mobile-theme-control {
    position: relative !important;
    z-index: 10005 !important;
    overflow: visible !important;
  }

  .nav#siteNav .mobile-theme-menu {
    z-index: 10006 !important;
    max-height: calc(100dvh - 82px) !important;
    overflow-y: auto !important;
  }

  body[data-theme="light"] .nav#siteNav .nav-panel {
    background: rgb(255 255 255 / 0.985) !important;
  }
}

/* Use a single video element on the back face. A static blurred poster layer
   provides the depth effect without a second video that can fail independently. */
.photo-card-back::before {
  content: "";
  position: absolute;
  inset: -8%;
  z-index: 0;
  background: url("assets/profile.jpeg") center / cover no-repeat;
  filter: blur(24px) saturate(1.12);
  transform: scale(1.08);
  opacity: .9;
  pointer-events: none;
}
.photo-card-back .profile-video {
  z-index: 1;
}
.photo-card-back::after {
  z-index: 2;
}
.photo-depth { touch-action: manipulation; }

/* FINAL MENU GLASS MATCH — mobile Menu dropdown uses the same transparent/glass treatment as Theme. */
@media (max-width: 600px) {
  .nav#siteNav .nav-panel {
    width: min(300px, calc(100vw - 24px)) !important;
    left: auto !important;
    right: 5vw !important;
    padding: 12px !important;
    background: var(--theme-surface) !important;
    border: 1px solid var(--line) !important;
    border-radius: 20px !important;
    box-shadow: 0 24px 70px var(--theme-shadow) !important;
    backdrop-filter: blur(20px) saturate(125%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(125%) !important;
  }

  .nav#siteNav .nav-panel .nav-links {
    gap: 3px !important;
  }

  .nav#siteNav .nav-panel .nav-links a {
    min-height: 44px !important;
    padding: 11px 12px !important;
    border: 1px solid transparent !important;
    border-radius: 14px !important;
    background: transparent !important;
    color: var(--theme-text-strong) !important;
    font-size: .78rem !important;
    letter-spacing: .12em !important;
    transition: background .2s ease, border-color .2s ease, transform .2s ease, color .2s ease !important;
  }

  .nav#siteNav .nav-panel .nav-links a:hover,
  .nav#siteNav .nav-panel .nav-links a:focus-visible,
  .nav#siteNav .nav-panel .nav-links a.is-active {
    background: rgba(255,255,255,.08) !important;
    border-color: var(--line) !important;
    color: var(--theme-text-strong) !important;
    outline: none !important;
  }

  .nav#siteNav .nav-panel .nav-links a:active {
    transform: translateY(1px) !important;
  }

  .nav#siteNav .nav-panel .nav-resume {
    margin: 3px 0 0 !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    background: transparent !important;
  }
}


/* FINAL PROFILE TAG FLIP FIX — the role badge belongs to the photo face, not the outer flip wrapper. */
.photo-card-front .photo-tag {
  position: absolute;
  z-index: 4;
  pointer-events: none;
}
/* The video face has its own role badge; do not hide that badge with the front-face rule. */
.photo-face-front .photo-tag { display: inline-flex !important; }


/* FINAL VIDEO ROLE BADGE — keep the Data Analyst title visible while the profile video plays. */
.photo-card-back .photo-tag-video {
  position: absolute;
  z-index: 6 !important;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  pointer-events: none;
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  background: rgba(7, 12, 20, .78);
  border: 1px solid rgba(255,255,255,.14);
  color: var(--theme-text-strong, #fff);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 12px 30px rgba(0,0,0,.32);
  backdrop-filter: blur(12px) saturate(125%);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
}

@media (max-width: 600px) {
  .photo-card-back .photo-tag-video {
    bottom: 18px;
    min-height: 42px;
    padding: 0 18px;
    font-size: .68rem;
    letter-spacing: .13em;
  }
}
