/* =========================================================
   TOKENS & THEMES
   ========================================================= */
:root {
  /* Dark Theme (Default) */
  --bg:          #0B0E14;
  --surface:     #121823;
  --surface-2:   #1A222E;
  --surface-3:   #222C3A;
  --accent:      #64FFDA;
  --accent-rgb:  100, 255, 218;
  --accent-2:    #FF6AC1;
  --accent-2-rgb:255, 106, 193;
  --ink-hi:      #E6EDF3;
  --ink-mid:     #8B98A9;
  --ink-dim:     #5C6877;
  --line:        #243041;
  --line-soft:   rgba(230, 237, 243, 0.07);

  --font-display:"Space Grotesk", sans-serif;
  --font-body:   "IBM Plex Sans", sans-serif;
  --font-mono:   "IBM Plex Mono", monospace;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-soft:   cubic-bezier(0.4, 0, 0.2, 1);

  --container-w: 1180px;
  --nav-h: 64px;
  --bottom-nav-h: 68px;
  
  --shadow-card: 0 28px 56px -24px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  /* Light Theme */
  --bg:          #F0F2F5;
  --surface:     #FFFFFF;
  --surface-2:   #F5F7F9;
  --surface-3:   #ECEEF1;
  --accent:      #00A884;
  --accent-rgb:  0, 168, 132;
  --accent-2:    #D63384;
  --accent-2-rgb:214, 51, 132;
  --ink-hi:      #0B0E14;
  --ink-mid:     #4A5568;
  --ink-dim:     #718096;
  --line:        #D1D9E0;
  --line-soft:   rgba(11, 14, 20, 0.08);

  --shadow-card: 0 20px 40px -20px rgba(0, 0, 0, 0.15);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  background: var(--bg);
  color: var(--ink-mid);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s ease, color 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.container { max-width: var(--container-w); margin: 0 auto; padding: 0 24px; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
::selection { background: var(--accent); color: var(--bg); }
img { max-width: 100%; display: block; }

/* =========================================================
   VIEW TRANSITION API (Theme Toggle Animation)
   ========================================================= */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* =========================================================
   BACKGROUND FX
   ========================================================= */
.bg-canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 998;
  opacity: 0.25; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}
[data-theme="light"] .grain { opacity: 0.1; mix-blend-mode: multiply; }

.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  z-index: 1100; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.1s linear;
}

.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.4; transition: opacity 0.4s; }
[data-theme="light"] .orb { opacity: 0.25; }

.orb-a {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.55), transparent 70%);
  top: -160px; right: -120px;
  animation: orb-1 22s ease-in-out infinite;
}
.orb-b {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(var(--accent-2-rgb), 0.32), transparent 70%);
  top: 38%; left: -160px;
  animation: orb-2 28s ease-in-out infinite;
}
.orb-c {
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.28), transparent 70%);
  bottom: -120px; right: 22%;
  animation: orb-3 32s ease-in-out infinite;
}
@keyframes orb-1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-70px, 90px) scale(1.1); } }
@keyframes orb-2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(90px, -70px) scale(1.15); } }
@keyframes orb-3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-60px, -60px) scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .orb { animation: none; } }

/* =========================================================
   SCROLLBAR
   ========================================================= */
html { scrollbar-color: var(--accent) var(--bg); scrollbar-width: thin; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* =========================================================
   TYPOGRAPHY
   ========================================================= */
h1, h2, h3 { font-family: var(--font-display); color: var(--ink-hi); margin: 0; letter-spacing: -0.01em; }

.section-head {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px;
}
.section-head-center { justify-content: center; }
.section-num {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 4px 10px; border-radius: 100px;
  letter-spacing: 0.04em;
}
.section-eyebrow {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-dim);
}
.section-title {
  font-size: clamp(1.85rem, 4.2vw, 2.8rem);
  font-weight: 600; line-height: 1.12;
  margin-bottom: 24px;
}
.section-intro {
  font-size: 1.05rem; color: var(--ink-mid);
  max-width: 560px; margin: 0 auto 40px;
}
.lead-text { font-size: 1.05rem; color: var(--ink-mid); margin-bottom: 20px; line-height: 1.7; }
.lead-text strong { color: var(--ink-hi); font-weight: 600; }
.accent { color: var(--accent); }

/* =========================================================
   TOP NAV (desktop)
   ========================================================= */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  background: rgba(11, 14, 20, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s, background 0.35s;
}
[data-theme="light"] .top-nav { background: rgba(240, 242, 245, 0.75); }
.top-nav.scrolled { border-bottom-color: var(--line-soft); background: rgba(11, 14, 20, 0.85); }
[data-theme="light"] .top-nav.scrolled { background: rgba(240, 242, 245, 0.9); }

.nav-inner {
  max-width: var(--container-w); margin: 0 auto;
  padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  color: var(--bg); background: var(--accent);
  letter-spacing: 0.02em;
  transition: transform 0.4s var(--ease-spring);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name {
  font-family: var(--font-display); font-weight: 600;
  color: var(--ink-hi); font-size: 16px;
}

.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-link {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--ink-mid); position: relative; padding: 4px 0;
  transition: color 0.25s;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0; height: 1.5px; background: var(--accent);
  transition: width 0.3s var(--ease-out);
}
.nav-link:hover, .nav-link.active { color: var(--ink-hi); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-cta {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  color: var(--bg); background: var(--accent);
  padding: 9px 18px; border-radius: 100px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: filter 0.25s, gap 0.25s;
}
.nav-cta:hover { filter: brightness(1.1); gap: 12px; }
.nav-cta i { font-size: 11px; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-hi); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: border-color 0.25s, color 0.25s, transform 0.3s var(--ease-spring);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(15deg); }

@media (max-width: 900px) {
  .top-nav { display: none; }
}

/* =========================================================
   MOBILE BOTTOM NAV
   ========================================================= */
.mobile-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 900;
  display: none;
  background: rgba(18, 24, 35, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--line-soft);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
}
[data-theme="light"] .mobile-nav { background: rgba(255, 255, 255, 0.92); }
.mobile-nav::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 36%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.mobile-tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 8px 2px;
  color: var(--ink-dim);
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.05em;
  border-radius: 12px;
  position: relative;
  transition: color 0.25s;
  background: transparent; border: none; cursor: pointer;
}
.mobile-tab i { font-size: 16px; transition: transform 0.3s var(--ease-spring); }
.mobile-tab.active { color: var(--accent); }
.mobile-tab.active i { transform: translateY(-2px) scale(1.08); }
.mobile-tab::before {
  content: ""; position: absolute; top: 2px; left: 50%;
  transform: translateX(-50%) scale(0);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
  transition: transform 0.3s var(--ease-spring);
}
.mobile-tab.active::before { transform: translateX(-50%) scale(1); }
.mobile-tab:active { background: var(--surface-2); }

@media (max-width: 900px) {
  .mobile-nav { display: flex; justify-content: space-around; }
  body { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) - 8px); }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: 120px 0 80px;
  display: flex; align-items: center;
  overflow: hidden;
}

.hero-container {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  align-items: center;
}
@media (min-width: 992px) {
  .hero-container { grid-template-columns: 1.3fr 0.9fr; gap: 64px; }
}

/* Hero title with word-by-word reveal */
.hero-title {
  font-size: clamp(2.5rem, 9vw, 4rem);
  font-weight: 700; line-height: 1.05; letter-spacing: -0.025em;
  margin-bottom: 24px;
  margin-top: 16px;
}
.hero-title .line {
  display: block; overflow: hidden; padding-bottom: 0.06em;
}
.hero-title .word {
  display: inline-block;
  transform: translateY(110%) rotate(4deg);
  opacity: 0;
  animation: word-up 0.95s var(--ease-out) forwards;
}
.hero-title .word.accent { color: var(--accent); }
.hero-title .line:nth-child(1) .word:nth-child(1) { animation-delay: 0.15s; }
.hero-title .line:nth-child(1) .word:nth-child(2) { animation-delay: 0.24s; }
.hero-title .line:nth-child(2) .word:nth-child(1) { animation-delay: 0.38s; }
.hero-title .line:nth-child(2) .word:nth-child(2) { animation-delay: 0.46s; }
.hero-title .line:nth-child(2) .word:nth-child(3) { animation-delay: 0.54s; }
@keyframes word-up {
  to { transform: translateY(0) rotate(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-title .word { transform: none; opacity: 1; animation: none; }
}

.hero-sub {
  font-size: clamp(1rem, 2.4vw, 1.12rem);
  color: var(--ink-mid); max-width: 540px; margin-bottom: 32px;
  line-height: 1.7;
}
.hero-sub strong { color: var(--ink-hi); font-weight: 600; }

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 36px; }

.btn-primary, .btn-ghost {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13.5px; font-weight: 500;
  padding: 14px 24px; border-radius: 100px;
  cursor: pointer; border: 1px solid transparent;
  transition: filter 0.3s, border-color 0.3s, background 0.3s, color 0.3s;
}
.btn-primary {
  background: var(--accent); color: var(--bg);
}
.btn-primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-22deg);
  transition: left 0.7s var(--ease-out);
}
.btn-primary:hover::after { left: 140%; }
.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost {
  border-color: var(--line); color: var(--ink-hi);
  background: var(--surface);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 576px) {
  .hero-cta { flex-direction: column; width: 100%; }
  .btn-primary, .btn-ghost { justify-content: center; width: 100%; padding: 16px 24px; }
}

.hero-meta { display: flex; flex-wrap: wrap; gap: 20px 26px; }
.meta {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim);
}
.meta i { color: var(--accent); font-size: 12px; }

/* =========================================================
   HERO PHOTO (Static Original Design)
   ========================================================= */
.hero-photo { position: relative; max-width: 360px; margin: 0 auto; width: 100%; }
.photo-stack { position: relative; }

.photo-frame {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.7);
  aspect-ratio: 4 / 5;
  z-index: 2;
  background: var(--surface);
}
[data-theme="light"] .photo-frame { box-shadow: 0 40px 80px -30px rgba(0,0,0,0.2); }

.photo-frame img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: center 18%;
  filter: grayscale(0.1) contrast(1.05);
}

.photo-frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(11, 14, 20, 0.7) 100%);
  pointer-events: none;
}
[data-theme="light"] .photo-frame::after { background: linear-gradient(180deg, transparent 50%, rgba(240, 242, 245, 0.7) 100%); }

.photo-deco {
  position: absolute;
  top: -16px; left: -16px; right: 30px; bottom: 30px;
  border: 1.5px solid var(--accent);
  border-radius: var(--r-lg);
  z-index: 1;
}

.photo-tag {
  position: absolute; left: 16px; bottom: 16px; z-index: 3;
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(11, 14, 20, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-soft);
  padding: 10px 14px;
  border-radius: 12px;
}
[data-theme="light"] .photo-tag { background: rgba(255, 255, 255, 0.8); }

.pt-name { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--ink-hi); }
.pt-role { font-family: var(--font-mono); font-size: 10.5px; color: var(--accent); letter-spacing: 0.04em; }
.pt-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-mid);
  margin-top: 4px;
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ADE80; box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
  animation: status-blink 2s ease-in-out infinite;
}
@keyframes status-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Scroll cue */
.scroll-cue {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
  color: var(--ink-dim);
  z-index: 3;
}
.scroll-line {
  width: 1px; height: 36px;
  background: linear-gradient(180deg, var(--accent), transparent);
  position: relative; overflow: hidden;
}
.scroll-line::after {
  content: ""; position: absolute; top: 0; left: 0;
  width: 100%; height: 30%;
  background: var(--ink-hi);
  animation: scroll-down 2s ease-in-out infinite;
}
@keyframes scroll-down {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(330%); }
}
@media (max-width: 768px) { .scroll-cue { display: none; } }

/* =========================================================
   SECTIONS
   ========================================================= */
.section { padding: 100px 0; position: relative; z-index: 1; }
.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

/* =========================================================
   ABOUT
   ========================================================= */
.about-row { margin-top: 8px; }
.about-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-top: 64px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
@media (min-width: 768px) {
  .about-stats { grid-template-columns: repeat(4, 1fr); }
}
.stat-block {
  background: var(--bg);
  padding: 26px 22px;
  display: flex; flex-direction: column; gap: 10px;
  transition: background 0.3s;
}
.section-alt .stat-block { background: var(--surface); }
.stat-block:hover { background: var(--surface-2); }
.stat-num {
  font-family: var(--font-display); font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 700; color: var(--accent); line-height: 1;
}
.stat-label { font-size: 12.5px; color: var(--ink-dim); line-height: 1.5; }

/* =========================================================
   TIMELINE
   ========================================================= */
.timeline { position: relative; margin-top: 56px; padding-left: 44px; }
.timeline-line {
  position: absolute; left: 17px; top: 8px; bottom: 8px; width: 1px;
  background: var(--line);
  transform-origin: top;
  animation: line-grow 1.5s var(--ease-out);
}
@keyframes line-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .timeline-line { animation: none; } }

.tl-item { position: relative; padding-bottom: 52px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-marker {
  position: absolute; left: -44px; top: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 13px;
  z-index: 2;
}
.section-alt .tl-marker { background: var(--bg); }
.tl-item:first-child .tl-marker {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}
.tl-item:first-child .tl-marker::before {
  content: ""; position: absolute; inset: -7px;
  border-radius: 50%; border: 1.5px solid rgba(var(--accent-rgb), 0.4);
  animation: marker-ring 2.6s ease-out infinite;
}
@keyframes marker-ring {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tl-item:first-child .tl-marker::before { animation: none; opacity: 0; }
}

.tl-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.tl-date { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; color: var(--ink-dim); }
.tl-tag {
  font-family: var(--font-mono); font-size: 10.5px;
  color: #4ADE80; background: rgba(74, 222, 128, 0.1);
  padding: 3px 10px; border-radius: 100px;
  display: inline-flex; align-items: center; gap: 6px;
}
.tag-pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.7);
  animation: status-blink 1.8s ease-in-out infinite;
}
.tl-role { font-size: clamp(1.05rem, 2.4vw, 1.25rem); font-weight: 600; margin-bottom: 10px; line-height: 1.3; }
.tl-desc { color: var(--ink-mid); max-width: 620px; margin-bottom: 16px; }
.tl-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tl-tags span {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-hi);
  border: 1px solid var(--line); padding: 5px 11px; border-radius: 100px;
  background: var(--surface-2);
  transition: border-color 0.25s, color 0.25s;
}
.tl-tags span:hover { border-color: var(--accent); color: var(--accent); }

.tl-links { margin-top: 16px; }

/* =========================================================
   CERT LINKS
   ========================================================= */
.cert-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent);
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 7px 14px;
  border-radius: 100px;
  transition: border-color 0.25s, background 0.25s, gap 0.25s, transform 0.25s;
}
.cert-link i { font-size: 11px; }
.cert-link:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  gap: 11px;
  transform: translateY(-1px);
}

/* =========================================================
   PROJECTS
   ========================================================= */
.projects-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 12px; margin-bottom: 40px;
}
.projects-hint {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-dim); display: inline-flex; align-items: center; gap: 8px;
  animation: hint-bob 2s ease-in-out infinite;
}
.projects-hint i { color: var(--accent); }
@keyframes hint-bob {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

.projects-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 992px) {
  .projects-track { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .projects-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding: 4px 20px 20px;
    margin: 0 -20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .projects-track::-webkit-scrollbar { display: none; }
  .projects-track > * {
    flex: 0 0 86%;
    scroll-snap-align: center;
  }
}

.proj-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: transform 0.45s var(--ease-out), border-color 0.3s, box-shadow 0.4s;
}
.section-alt .proj-card { background: var(--bg); }
.proj-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 28px 56px -24px rgba(var(--accent-rgb), 0.3);
}

@media (pointer: fine) {
  .proj-card::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(280px circle at var(--spot-x, 50%) var(--spot-y, 0%), rgba(var(--accent-rgb), 0.12), transparent 70%);
    opacity: 0; transition: opacity 0.4s;
  }
  .proj-card:hover::before { opacity: 1; }
  .proj-media, .proj-body { position: relative; z-index: 1; }
}

.proj-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--surface-2), var(--bg));
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.proj-media-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--ink-dim);
  transition: color 0.3s;
}
.proj-card:hover .proj-media-placeholder { color: var(--ink-mid); }
.proj-media-placeholder i {
  font-size: 32px; color: var(--accent); opacity: 0.7;
  transition: transform 0.4s var(--ease-spring);
}
.proj-card:hover .proj-media-placeholder i { transform: scale(1.15); }
.proj-media-placeholder span {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em;
}
.proj-video { width: 100%; height: 100%; object-fit: cover; display: block; border: none; }

.yt-facade {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background-size: cover; background-position: center;
  border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.yt-facade::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,14,20,0.15) 0%, rgba(11,14,20,0.55) 100%);
  transition: background 0.25s;
}
.yt-facade:hover::before { background: rgba(11,14,20,0.25); }
.yt-play-btn {
  position: relative; z-index: 1;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: transform 0.3s var(--ease-spring), filter 0.25s;
}
.yt-facade:hover .yt-play-btn { transform: scale(1.12); filter: brightness(1.06); }

.proj-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex-grow: 1; }
.proj-kicker {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent-2); margin-bottom: 10px;
}
.proj-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 10px; }
.proj-desc { color: var(--ink-mid); font-size: 14px; flex-grow: 1; margin-bottom: 18px; line-height: 1.6; }

.proj-stack { display: flex; gap: 6px; flex-wrap: wrap; }
.proj-stack span {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  padding: 4px 9px; border-radius: 6px;
}

.proj-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.proj-links a {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-hi);
  transition: color 0.25s, gap 0.25s;
}
.proj-links a i { color: var(--accent); font-size: 11px; }
.proj-links a:hover { color: var(--accent); gap: 10px; }

.proj-media-banner { width: 100%; height: 100%; object-fit: cover; display: block; }

/* =========================================================
   SKILLS
   ========================================================= */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  margin: 50px 0;
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  background: var(--bg);
}
.section-alt .marquee { background: rgba(11, 14, 20, 0.4); }
[data-theme="light"] .section-alt .marquee { background: rgba(255, 255, 255, 0.4); }
.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 36px;
  animation: marquee 35s linear infinite;
  padding-right: 36px;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 600;
  color: var(--ink-hi);
}
.marquee-track .sep {
  color: var(--accent); font-size: 1.2rem; font-weight: 400;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .marquee { overflow-x: auto; }
}

.skill-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 24px 22px;
  height: 100%;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.4s var(--ease-out);
}
.section-alt .skill-card { background: var(--surface); }
.skill-card:hover { border-color: var(--accent); transform: translateY(-4px); }

@media (pointer: fine) {
  .skill-card::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(220px circle at var(--spot-x, 50%) var(--spot-y, 0%), rgba(var(--accent-2-rgb), 0.1), transparent 70%);
    opacity: 0; transition: opacity 0.4s;
  }
  .skill-card:hover::before { opacity: 1; }
  .skill-title, .skill-list { position: relative; z-index: 1; }
}
.skill-title {
  font-size: 1rem; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; color: var(--ink-hi);
}
.skill-title i { color: var(--accent); font-size: 14px; }
.skill-list li {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-mid);
  padding: 8px 0; border-top: 1px solid var(--line-soft);
  transition: color 0.25s, padding-left 0.25s;
}
.skill-list li:first-child { border-top: none; }
.skill-list li:hover { color: var(--accent); padding-left: 6px; }

/* =========================================================
   CERTIFICATIONS
   ========================================================= */
.cert-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 30px 24px;
  text-align: center;
  height: 100%;
  background: var(--surface);
  transition: border-color 0.3s, transform 0.4s var(--ease-out);
}
.cert-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.cert-icon {
  width: 52px; height: 52px; margin: 0 auto 18px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 19px;
  position: relative;
  transition: transform 0.5s var(--ease-spring);
}
.cert-card:hover .cert-icon { transform: rotate(360deg); }
.cert-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.cert-card p { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-dim); margin-bottom: 0; }
.cert-card .cert-link { margin: 18px auto 0; }

/* =========================================================
   CONTACT
   ========================================================= */
.contact-section { text-align: center; padding: 110px 0 120px; }
.contact-inner { max-width: 680px; margin: 0 auto; }
.contact-title {
  font-size: clamp(2.5rem, 8vw, 4.2rem);
  font-weight: 700; line-height: 1.05; letter-spacing: -0.02em;
  margin: 16px 0 24px;
}
.contact-title .accent { color: var(--accent); }

.contact-links {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 44px; text-align: left;
}
.contact-link {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
}
.contact-link:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  transform: translateX(6px);
}
.cl-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 16px;
  transition: background 0.3s, transform 0.3s, color 0.3s;
}
.contact-link:hover .cl-icon { background: var(--accent); color: var(--bg); transform: scale(1.05); }
.cl-text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.cl-label {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim);
}
.cl-value {
  font-family: var(--font-body); font-size: 14.5px; color: var(--ink-hi);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cl-arrow { color: var(--ink-dim); font-size: 13px; transition: color 0.3s, transform 0.3s; }
.contact-link:hover .cl-arrow { color: var(--accent); transform: translateX(4px); }

@media (max-width: 576px) {
  .cl-value { font-size: 13px; }
  .contact-link { padding: 16px 18px; gap: 12px; }
  .cl-icon { width: 40px; height: 40px; font-size: 14px; }
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom, 0px));
  position: relative; z-index: 1;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-text { display: flex; flex-direction: column; gap: 2px; }
.ft-1 { font-family: var(--font-display); font-size: 13px; color: var(--ink-hi); font-weight: 600; }
.ft-2 { font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim); }
.footer-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim);
}
.ft-clock {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent);
}
.ft-clock i { font-size: 10px; }

@media (max-width: 768px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .footer-meta { align-items: flex-start; }
}

/* =========================================================
   BACK TO TOP
   ========================================================= */
.back-to-top {
  position: fixed; right: 24px; bottom: calc(24px + var(--bottom-nav-h)); z-index: 800;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s, filter 0.25s;
  box-shadow: 0 8px 24px -8px rgba(var(--accent-rgb), 0.5);
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { filter: brightness(1.1); transform: translateY(-2px); }

@media (min-width: 901px) {
  .back-to-top { bottom: 24px; }
}
@media (max-width: 576px) {
  .back-to-top { width: 46px; height: 46px; right: 18px; bottom: calc(18px + var(--bottom-nav-h)); }
}

/* =========================================================
   SCROLL REVEAL
   ========================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   MAGNETIC BUTTONS (desktop)
   ========================================================= */
.magnetic {
  --mx: 0px; --my: 0px;
  transform: translate(var(--mx), var(--my));
  transition: transform 0.4s var(--ease-out), filter 0.3s, border-color 0.3s, background 0.3s, color 0.3s;
}
@media (pointer: coarse) { .magnetic { --mx: 0 !important; --my: 0 !important; } }

/* =========================================================
   CERTIFICATE LIGHTBOX
   ========================================================= */
.cert-modal {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.cert-modal.open { opacity: 1; visibility: visible; }
.cert-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 5, 5, 0.88);
  backdrop-filter: blur(8px);
}
[data-theme="light"] .cert-modal-backdrop { background: rgba(0, 0, 0, 0.7); }
.cert-modal-dialog {
  position: relative;
  width: 100%; max-width: 880px; max-height: 88vh;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 50px 100px -30px rgba(0,0,0,0.8);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.4s var(--ease-spring);
}
.cert-modal.open .cert-modal-dialog { transform: translateY(0) scale(1); }
.cert-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.cert-modal-title {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: var(--ink-hi);
}
.cert-modal-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.cert-modal-download {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--accent);
  white-space: nowrap;
}
.cert-modal-download:hover { text-decoration: underline; }
.cert-modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-hi); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.25s, color 0.25s, transform 0.4s var(--ease-spring);
}
.cert-modal-close:hover { border-color: var(--accent); color: var(--accent); transform: rotate(90deg); }
.cert-modal-body {
  flex-grow: 1; overflow: auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); min-height: 300px;
}
.cert-modal-body img { width: 100%; height: auto; display: block; }
.cert-modal-body iframe { width: 100%; height: 76vh; border: none; display: block; }

@media (max-width: 576px) {
  .cert-modal { padding: 12px; }
  .cert-modal-dialog { max-height: 92vh; }
  .cert-modal-body iframe { height: 70vh; }
  .cert-modal-head { padding: 12px 14px; }
  .cert-modal-title { font-size: 13px; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 992px) {
  .section { padding: 80px 0; }
  .hero { padding: 100px 0 60px; min-height: auto; }
  .hero-photo { max-width: 280px; margin-top: 20px; }
}
@media (max-width: 768px) {
  .section { padding: 70px 0; }
  .timeline { padding-left: 34px; }
  .timeline-line { left: 13px; }
  .tl-marker { left: -34px; width: 28px; height: 28px; font-size: 11px; }
  .about-stats { margin-top: 44px; }
}
@media (max-width: 576px) {
  .container { padding: 0 20px; }
  .section-eyebrow { font-size: 11px; }
  .marquee { margin: 36px 0; padding: 18px 0; }
}

@media (hover: none) {
  .proj-card:hover { transform: none; }
  .proj-card:active { transform: scale(0.99); }
}
