/* 
   Design tokens
    */
:root {
  /* Color: dark theme (default) */
  --bg: #0a0c0f;
  --bg-elevated: #0e1116;
  --surface: #12161c;
  --surface-2: #171c23;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e7ecef;
  --muted: #8b96a3;
  --muted-2: #626d78;

  --teal: #4fd1c5;
  --teal-dim: rgba(79, 209, 197, 0.14);
  --gold: #e8b84b;
  --gold-dim: rgba(232, 184, 75, 0.14);
  --danger: #e4685d;
  --success: #6fcf97;

  --grad-text: linear-gradient(100deg, var(--teal) 0%, var(--gold) 100%);

  /* Typography */
  --font-display: "Syne", "Segoe UI", sans-serif;
  --font-body: "DM Sans", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  /* Layout */
  --container-w: 1180px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --nav-h: 76px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.18s;
  --dur-med: 0.4s;
}

/* 
   Light theme override
    */
body.light-theme {
  --bg: #f6f7f9;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --border: rgba(10, 12, 15, 0.08);
  --border-strong: rgba(10, 12, 15, 0.16);
  --text: #12161c;
  --muted: #525b66;
  --muted-2: #7b8390;

  --teal-dim: rgba(20, 150, 140, 0.12);
  --gold-dim: rgba(180, 130, 20, 0.14);
}

/* 
   Reset & base
    */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background var(--dur-med) var(--ease), color var(--dur-med) var(--ease);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.mono {
  font-family: var(--font-mono);
}

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--teal);
  color: #05201d;
  padding: 12px 18px;
  z-index: 1000;
  border-radius: 0 0 8px 0;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

/* 
   Glass utility
    */
.glass {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* 
   Scroll progress bar
    */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--grad-text);
  z-index: 1100;
  transition: width 0.1s linear;
}

/* 
   Section rhythm
    */
.section {
  padding: 110px 0;
  position: relative;
}

.section-alt {
  background: var(--bg-elevated);
}

.eyebrow {
  color: var(--teal);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  display: inline-block;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.section-sub {
  max-width: 640px;
  margin-bottom: 44px;
}

.section-sub-quote {
  max-width: 720px;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 50px;
  border-left: 3px solid var(--gold);
  padding-left: 20px;
}

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 
   NAVIGATION
    */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--dur-med) var(--ease), border-color var(--dur-med) var(--ease);
}

.site-header.scrolled {
  background: rgba(10, 12, 15, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

body.light-theme .site-header.scrolled {
  background: rgba(246, 247, 249, 0.82);
}

.navbar {
  max-width: var(--container-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.nav-logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--teal-dim);
  color: var(--teal);
  font-size: 0.75rem;
  border: 1px solid var(--border-strong);
}

.nav-logo-text .dot {
  color: var(--gold);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--muted);
  transition: color var(--dur-fast), background var(--dur-fast);
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-link.active {
  color: var(--teal);
  background: var(--teal-dim);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: border-color var(--dur-fast), transform var(--dur-fast);
}

.theme-toggle:hover {
  border-color: var(--teal);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.theme-toggle .icon-moon {
  display: none;
}

body.light-theme .theme-toggle .icon-sun {
  display: none;
}

body.light-theme .theme-toggle .icon-moon {
  display: block;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  align-items: center;
  justify-content: center;
}

.hamburger span {
  width: 18px;
  height: 2px;
  background: var(--text);
  transition: transform var(--dur-fast), opacity var(--dur-fast);
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 
   HERO
    */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: var(--nav-h);
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 10%, transparent 75%);
  opacity: 0.6;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  width: 100%;
}

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(480px circle at var(--glow-x, 50%) var(--glow-y, 30%), rgba(79, 209, 197, 0.10), transparent 60%);
  transition: background 0.2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .hero-glow {
    display: none;
  }
}

.hero-text {
  max-width: 620px;
}

/* ---------- Hero photo ---------- */
.hero-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  justify-self: center;
}

.hero-photo-ring {
  position: relative;
  width: min(320px, 70vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  padding: 6px;
  background: conic-gradient(from 180deg, var(--teal), var(--gold), var(--teal));
}

.hero-photo-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--bg);
  z-index: 0;
}

.hero-photo {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  padding: 8px;
  filter: saturate(1.03);
}

.hero-photo-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--muted);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(111, 207, 151, 0.2);
  flex-shrink: 0;
}

.inline-link {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--dur-fast);
}

.inline-link:hover {
  text-decoration-color: currentColor;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.hero-role {
  color: var(--muted);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  min-height: 1.5em;
  margin-bottom: 4px;
}

.hero-role::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--teal);
  margin-left: 4px;
  vertical-align: -0.15em;
  animation: blink 1s step-end infinite;
}

@media (prefers-reduced-motion: reduce) {
  .hero-role::after {
    animation: none;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.signal-trace {
  width: 100%;
  max-width: 560px;
  height: 46px;
  margin: 18px 0 22px;
  display: block;
}

.signal-trace polyline {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw-signal 2.2s var(--ease) forwards 0.3s;
}

@keyframes draw-signal {
  to {
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .signal-trace polyline {
    stroke-dashoffset: 0;
    animation: none;
  }
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}

.hero-sub {
  max-width: 560px;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 34px;
}

.hero-socials {
  display: flex;
  gap: 14px;
}

.social-link {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  transition: border-color var(--dur-fast), transform var(--dur-fast), color var(--dur-fast);
  color: var(--muted);
}

.social-link svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.social-link:hover {
  border-color: var(--teal);
  color: var(--teal);
  transform: translateY(-2px);
}

.social-link--disabled {
  opacity: 0.35;
  pointer-events: none;
}

.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border-radius: 20px;
  border: 2px solid var(--border-strong);
  background: transparent;
  display: none;
}

@media (min-width: 768px) {
  .scroll-cue {
    display: block;
  }
}

.scroll-cue span {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--teal);
  animation: cue-bounce 1.8s ease-in-out infinite;
}

@keyframes cue-bounce {
  0%,
  100% {
    top: 6px;
    opacity: 1;
  }
  50% {
    top: 18px;
    opacity: 0.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue span {
    animation: none;
  }
}

/* 
   BUTTONS
    */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast), border-color var(--dur-fast), background var(--dur-fast);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--grad-text);
  color: #05201d;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s var(--ease);
}

.btn-primary:hover::after {
  left: 130%;
}

.btn-primary:hover {
  box-shadow: 0 8px 24px -8px var(--teal);
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary::after {
    display: none;
  }
}

.btn-outline {
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.btn-ghost {
  color: var(--muted);
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-2);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

/* 
   ABOUT
    */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 46px;
  align-items: start;
}

.about-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 26px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-item span:last-child {
  color: var(--text);
  font-weight: 600;
}

.meta-label {
  color: var(--gold);
  font-size: 0.78rem;
}

.about-card {
  padding: 28px;
}

.about-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.about-card-row:last-child {
  border-bottom: none;
}

.about-card-row .label {
  color: var(--muted-2);
  font-size: 0.82rem;
}

.status-pill {
  color: var(--teal);
  background: var(--teal-dim);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* 
   SKILLS
    */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.skill-card {
  padding: 26px 24px;
}

.skill-card h3 {
  font-size: 1.05rem;
  margin-bottom: 18px;
  color: var(--text);
}

.skill-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.92rem;
  transition: padding-left var(--dur-fast);
}

.skill-list li:hover {
  padding-left: 4px;
}

.skill-list li:last-child {
  border-bottom: none;
}

.skill-dots {
  display: inline-flex;
  gap: 4px;
  margin-right: 8px;
  vertical-align: middle;
}

.skill-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
}

.skill-dots span.filled {
  background: var(--teal);
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.tag-intermediate {
  color: var(--teal);
  background: var(--teal-dim);
}

.tag-familiar {
  color: #7fb0e0;
  background: rgba(127, 176, 224, 0.14);
}

.tag-learning {
  color: var(--gold);
  background: var(--gold-dim);
}

.tag-exploring {
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.tag-status {
  color: var(--gold);
  background: var(--gold-dim);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-research {
  color: var(--teal);
  background: var(--teal-dim);
}

/* 
   PROJECTS
    */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.filter-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  transition: all var(--dur-fast);
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-btn.active {
  background: var(--grad-text);
  color: #05201d;
  border-color: transparent;
  font-weight: 700;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--dur-med) var(--ease), border-color var(--dur-fast), box-shadow var(--dur-med) var(--ease);
}

.project-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad-text);
  opacity: 0;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: opacity var(--dur-med);
  pointer-events: none;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: transparent;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
}

.project-card:hover::before {
  opacity: 0.6;
}

.project-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.project-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-web {
  background: var(--teal-dim);
  color: var(--teal);
}

.icon-ai {
  background: var(--gold-dim);
  color: var(--gold);
}

.icon-database {
  background: rgba(127, 176, 224, 0.14);
  color: #7fb0e0;
}

.icon-desktop {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.icon-games {
  background: rgba(228, 104, 93, 0.12);
  color: #e4685d;
}

.project-card.filtered-out {
  display: none;
}

.project-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.project-card-head h3 {
  font-size: 1.12rem;
  color: var(--text);
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.badge {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.project-features {
  margin-bottom: 20px;
  flex-grow: 1;
}

.project-features li {
  position: relative;
  padding-left: 18px;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.project-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

.project-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.filter-empty {
  text-align: center;
  padding: 40px 0;
}

/* 
   RESEARCH & INTERESTS
    */
.interest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 70px;
}

.interest-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.92rem;
  transition: border-color var(--dur-fast), transform var(--dur-fast);
}

.interest-card:hover {
  border-color: var(--teal);
  transform: translateY(-3px);
}

.interest-icon {
  color: var(--gold);
  font-size: 1rem;
}

.research-journey {
  border-top: 1px solid var(--border);
  padding-top: 50px;
}

.journey-title {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  margin-bottom: 10px;
}

.journey-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.journey-steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.step-index {
  color: var(--teal);
  font-size: 0.85rem;
  opacity: 0.8;
}

/* 
   EDUCATION TIMELINE
    */
.timeline {
  position: relative;
  padding-left: 30px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 30px;
}

.timeline-dot {
  position: absolute;
  left: -37px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-dim);
}

.timeline-content {
  padding: 26px;
}

.timeline-content h3 {
  font-size: 1.2rem;
  margin: 10px 0 6px;
}

.timeline-org {
  color: var(--text);
  font-weight: 500;
}

.timeline-meta {
  font-size: 0.82rem;
  color: var(--muted-2);
}

/* 
   CERTIFICATIONS
    */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.cert-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cert-card h3 {
  font-size: 1rem;
  color: var(--text);
}

/* 
   GITHUB
    */
.github-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  padding: 40px;
}

.github-panel-info {
  flex: 1 1 320px;
}

.github-user {
  color: var(--teal);
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.github-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.github-stats {
  flex: 1 1 240px;
  border-left: 1px solid var(--border);
  padding-left: 34px;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.github-stats .about-card-row {
  width: 100%;
  min-width: 180px;
}

@media (max-width: 700px) {
  .github-stats {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 20px;
  }
}

.heatmap-card {
  margin-top: 24px;
  padding: 32px;
  position: relative;
}

.heatmap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.heatmap-head h3 {
  font-size: 1.05rem;
  color: var(--text);
}

.heatmap-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.heatmap-loading {
  margin: 0;
  font-size: 0.85rem;
  padding: 20px 0;
}

.heatmap-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 11px);
  gap: 3px;
  min-width: 720px;
  width: max-content;
  padding-top: 18px;
  position: relative;
}

.heatmap-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: default;
  transition: outline-color var(--dur-fast);
}

.heatmap-cell[data-level="1"] {
  background: rgba(79, 209, 197, 0.28);
  border-color: transparent;
}

.heatmap-cell[data-level="2"] {
  background: rgba(79, 209, 197, 0.52);
  border-color: transparent;
}

.heatmap-cell[data-level="3"] {
  background: rgba(79, 209, 197, 0.76);
  border-color: transparent;
}

.heatmap-cell[data-level="4"] {
  background: var(--teal);
  border-color: transparent;
}

.heatmap-cell:hover {
  outline: 1.5px solid var(--text);
  outline-offset: 1px;
}

.heatmap-month-label {
  position: absolute;
  top: 0;
  font-size: 0.72rem;
  color: var(--muted-2);
  white-space: nowrap;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--muted-2);
}

.legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.legend-swatch[data-level="1"] {
  background: rgba(79, 209, 197, 0.28);
  border-color: transparent;
}

.legend-swatch[data-level="2"] {
  background: rgba(79, 209, 197, 0.52);
  border-color: transparent;
}

.legend-swatch[data-level="3"] {
  background: rgba(79, 209, 197, 0.76);
  border-color: transparent;
}

.legend-swatch[data-level="4"] {
  background: var(--teal);
  border-color: transparent;
}

.heatmap-tooltip {
  position: fixed;
  z-index: 1300;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  pointer-events: none;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  transform: translate(-50%, -120%);
}

.heatmap-tooltip[hidden] {
  display: none;
}

.heatmap-fallback {
  margin: 14px 0 0;
  font-size: 0.85rem;
}

/* 
   CONTACT
    */
.contact-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 46px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.contact-info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-info-item .label {
  color: var(--gold);
  font-size: 0.78rem;
}

.contact-info-item a:hover {
  color: var(--teal);
}

.contact-form {
  padding: 34px;
}

.form-row {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row label {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 500;
}

.form-row input,
.form-row textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color var(--dur-fast);
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--teal);
}

.form-row.invalid input,
.form-row.invalid textarea {
  border-color: var(--danger);
}

.form-error {
  color: var(--danger);
  font-size: 0.78rem;
  min-height: 1em;
}

.form-status {
  margin: 16px 0 0;
  font-size: 0.9rem;
  min-height: 1.2em;
}

.form-status.success {
  color: var(--success);
}

.form-status.error {
  color: var(--danger);
}

/* 
   FOOTER
    */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 50px 0 24px;
  background: var(--bg-elevated);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.footer-brand p {
  margin: 6px 0 0;
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a:hover,
.footer-socials a:hover {
  color: var(--teal);
}

.footer-socials {
  display: flex;
  gap: 18px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 20px;
  font-size: 0.82rem;
  color: var(--muted-2);
}

.footer-bottom p {
  margin: 0;
}

/* 
   BACK TO TOP
    */
.back-to-top {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--grad-text);
  color: #05201d;
  border: none;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--dur-fast), transform var(--dur-fast), visibility var(--dur-fast);
  z-index: 900;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 
   MODAL
    */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 8, 0.7);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 1200;
  padding: 24px;
}

/* The [hidden] attribute must always win over the display:grid rule above,
   otherwise the browser's default "hidden { display:none }" (a user-agent
   style) loses to this author style and the overlay shows on page load. */
.modal-overlay[hidden] {
  display: none;
}

.modal {
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 34px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.2rem;
  display: grid;
  place-items: center;
}

.modal h3 {
  margin-bottom: 14px;
  padding-right: 40px;
}

.modal p {
  margin-bottom: 10px;
}

/* 
   SCROLL REVEAL
    */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/*
   RESPONSIVE
    */
@media (max-width: 1024px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text {
    max-width: 100%;
    order: 2;
  }

  .hero-photo-wrap {
    order: 1;
  }

  .signal-trace,
  .hero-sub {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions,
  .hero-socials {
    justify-content: center;
  }
}

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-elevated);
    padding: 20px;
    gap: 4px;
    transform: translateX(100%);
    transition: transform var(--dur-med) var(--ease);
    overflow-y: auto;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-link {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
  }

  .hamburger {
    display: flex;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 80px 0;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .github-panel {
    padding: 26px;
  }

  .contact-form {
    padding: 24px;
  }
}