/* ==========================================================================
   NALAIN MUHAMMAD — PORTFOLIO
   Design concept: "Schema" — a portfolio rendered as a technical blueprint /
   database schema, echoing a data scientist & systems builder's own craft.
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
ul { list-style: none; }

/* ---------- Design tokens ---------- */
:root {
  /* -- Color: "blueprint" system (DARK — default) -- */
  --ink: #0A0D12;
  --ink-raised: #12161F;
  --ink-raised-2: #171C27;
  --line: #232A38;
  --line-soft: rgba(35, 42, 56, 0.6);
  --paper: #EDEFF3;
  --paper-dim: #8B93A3;
  --paper-faint: #565E70;
  --signal: #E8A33D;      /* primary-key gold */
  --signal-dim: rgba(232, 163, 61, 0.14);
  --wire: #4FA6D8;        /* foreign-key blue */
  --wire-dim: rgba(79, 166, 216, 0.14);
  --good: #5FBE8D;

  /* -- Type -- */
  --f-display: 'Space Grotesk', sans-serif;
  --f-body: 'Inter', sans-serif;
  --f-mono: 'IBM Plex Mono', monospace;

  /* -- Layout -- */
  --container-w: 1200px;
  --nav-h: 76px;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;

  /* -- Motion -- */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.2s;
  --t-med: 0.4s;
  --t-slow: 0.8s;
}

/* ---------- LIGHT THEME ---------- */
[data-theme="light"] {
  --ink: #F5F6FA;
  --ink-raised: #FFFFFF;
  --ink-raised-2: #EEF0F4;
  --line: #D5D9E2;
  --line-soft: rgba(213, 217, 226, 0.6);
  --paper: #1A1D24;
  --paper-dim: #5A6070;
  --paper-faint: #8B93A3;
  --signal: #D4922E;
  --signal-dim: rgba(212, 146, 46, 0.14);
  --wire: #2E7BAD;
  --wire-dim: rgba(46, 123, 173, 0.14);
  --good: #3E9A6E;
}

/* ---------- Base ---------- */
body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

.mono { font-family: var(--f-mono); }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.01em;
}

::selection { background: var(--signal); color: var(--ink); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--wire); }

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 32px;
}

.section { padding: 128px 0; position: relative; scroll-margin-top: var(--nav-h); }
@media (max-width: 720px) { .section { padding: 88px 0; } }

/* ---------- Focus / accessibility ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--signal); color: var(--ink); padding: 12px 20px;
  font-family: var(--f-mono); font-weight: 600;
}
.skip-link:focus { left: 16px; top: 16px; }

/* ---------- Corner registration ticks (blueprint motif) ---------- */
.corner-ticks { position: absolute; inset: 20px; pointer-events: none; z-index: 1; }
.corner-ticks span { position: absolute; width: 18px; height: 18px; opacity: 0.5; }
.corner-ticks span::before, .corner-ticks span::after { content: ''; position: absolute; background: var(--line); }
.corner-ticks span::before { width: 100%; height: 1px; top: 0; }
.corner-ticks span::after { width: 1px; height: 100%; left: 0; }
.corner-ticks span:nth-child(1) { top: 0; left: 0; }
.corner-ticks span:nth-child(2) { top: 0; right: 0; }
.corner-ticks span:nth-child(3) { bottom: 0; left: 0; }
.corner-ticks span:nth-child(4) { bottom: 0; right: 0; }
@media (max-width: 720px) { .corner-ticks { display: none; } }

/* ---------- Scroll progress ---------- */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--signal), var(--wire));
  z-index: 1000;
  transition: background 0.4s ease;
}

/* ---------- Custom cursor (crosshair — on-theme with the blueprint) ---------- */
.cursor-dot, .cursor-cross {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 999;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s ease, width 0.2s var(--ease), height 0.2s var(--ease);
}
.cursor-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--signal); }
.cursor-cross { background: var(--wire); opacity: 0.45; }
.cursor-cross--h { width: 18px; height: 1px; }
.cursor-cross--v { width: 1px; height: 18px; }
.cursor-active .cursor-cross { width: 30px; height: 1px; }
.cursor-cross--v.cursor-active { width: 1px; height: 30px; }
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-cross { display: none; }
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  height: var(--nav-h);
  display: flex; align-items: center;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.navbar.scrolled {
  background: rgba(10, 13, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
[data-theme="light"] .navbar.scrolled {
  background: rgba(245, 246, 250, 0.85);
}
.navbar-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1.5px solid var(--signal); border-radius: var(--radius-s);
  font-family: var(--f-mono); font-weight: 700; font-size: 0.8rem; color: var(--signal);
}
.brand-name { font-family: var(--f-mono); font-size: 0.9rem; color: var(--paper-dim); }
@media (max-width: 560px) { .brand-name { display: none; } }

.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-link {
  font-size: 0.9rem; color: var(--paper-dim); position: relative; padding: 6px 0;
  transition: color var(--t-fast);
}
.nav-link::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 1.5px;
  background: var(--signal); transition: width var(--t-med) var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--paper); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
@media (max-width: 900px) { .nav-links { display: none; } }

.nav-actions { display: flex; align-items: center; gap: 16px; }
.menu-toggle { display: none; padding: 6px; }
@media (max-width: 900px) { .menu-toggle { display: block; } }
.icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.theme-toggle:hover {
  border-color: var(--signal);
  transform: rotate(15deg);
}
.theme-icon { position: absolute; transition: opacity 0.3s ease, transform 0.3s ease; }
.theme-icon--sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.theme-icon--moon { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="light"] .theme-icon--sun { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="light"] .theme-icon--moon { opacity: 0; transform: rotate(90deg) scale(0.5); }

/* ---------- Mobile menu ---------- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 450;
  background: var(--ink);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--nav-h) + 24px) 32px 40px;
  transform: translateY(-100%);
  transition: transform var(--t-med) var(--ease), visibility var(--t-med);
  visibility: hidden;
}
.mobile-menu.open { transform: translateY(0); visibility: visible; }
.mobile-menu-links { display: flex; flex-direction: column; gap: 6px; }
.mobile-link {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--f-display); font-size: 1.9rem; font-weight: 600;
  padding: 14px 0; border-bottom: 1px solid var(--line-soft);
  color: var(--paper);
}
.mobile-link .mono { color: var(--signal); font-size: 0.9rem; }
.mobile-menu-footer { display: flex; gap: 20px; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: var(--radius-s);
  font-size: 0.95rem; font-weight: 600; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--signal); color: var(--ink); }
.btn-primary:hover { transform: translateY(-2px); background: #f0b25c; box-shadow: 0 8px 25px rgba(232, 163, 61, 0.3); }
.btn-ghost { border: 1.5px solid var(--line); color: var(--paper); }
.btn-ghost:hover { border-color: var(--wire); color: var(--wire); transform: translateY(-2px); }
.btn-sm { padding: 10px 18px; font-size: 0.85rem; }
@media (max-width: 560px) { .btn-sm { display: none; } }

.btn-icon-text {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--paper-dim); font-size: 0.85rem;
  padding: 14px 8px; transition: color var(--t-fast);
}
.btn-icon-text:hover { color: var(--signal); }

.text-link { display: inline-flex; align-items: center; gap: 8px; color: var(--signal); font-size: 0.9rem; font-weight: 600; }
.text-link .icon { width: 15px; height: 15px; transition: transform var(--t-fast) var(--ease); }
.text-link:hover .icon { transform: translateX(4px); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  padding-top: var(--nav-h);
  overflow: hidden;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 75%);
}

.hero-inner {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center;
  position: relative; z-index: 2; padding: 60px 32px;
}
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 460px; margin: 0 auto; }
}

.hero-title { font-size: clamp(2.6rem, 2rem + 3.4vw, 4.6rem); font-weight: 700; margin-bottom: 22px; }
.hero-title-hi { display: block; font-size: 0.36em; font-weight: 500; color: var(--paper-dim); margin-bottom: 6px; }

.hero-role { display: flex; align-items: baseline; gap: 10px; font-size: 1.15rem; margin-bottom: 26px; flex-wrap: wrap; }
.role-prompt { color: var(--wire); }
.role-text { color: var(--signal); font-weight: 500; }
.role-caret { color: var(--signal); animation: caret-blink 1s step-end infinite; }
@keyframes caret-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.hero-desc { max-width: 52ch; color: var(--paper-dim); font-size: 1.05rem; margin-bottom: 36px; }

.hero-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }

.scroll-indicator {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 0.75rem; color: var(--paper-faint); z-index: 2;
  animation: bob 2.4s ease-in-out infinite;
}
.scroll-indicator .icon { width: 14px; height: 14px; }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }
@media (max-width: 720px) { .scroll-indicator { display: none; } }

/* ---------- Hero profile picture ---------- */
.hero-profile-pic {
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 3px solid var(--signal);
  padding: 3px;
  margin-bottom: 28px;
  position: relative;
  box-shadow: 0 0 0 8px var(--signal-dim), 0 8px 30px rgba(232, 163, 61, 0.2);
  animation: profile-glow 3s ease-in-out infinite alternate;
}
@keyframes profile-glow {
  0% { box-shadow: 0 0 0 8px var(--signal-dim), 0 8px 30px rgba(232, 163, 61, 0.2); }
  100% { box-shadow: 0 0 0 12px var(--signal-dim), 0 12px 40px rgba(232, 163, 61, 0.35); }
}
.profile-img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
@media (max-width: 720px) {
  .hero-profile-pic { width: 100px; height: 100px; margin-bottom: 22px; }
}

/* ---------- Hero schema diagram (signature element) ---------- */
.schema-svg { width: 100%; height: auto; overflow: visible; }
.schema-lines { stroke: var(--wire); stroke-width: 1.5; fill: none; }
.schema-node rect:not(.node-title-bg):not(.node-field) {
  fill: var(--ink-raised); stroke: var(--line); stroke-width: 1.4;
}
.schema-node--hub rect:not(.node-title-bg):not(.node-field) { stroke: var(--signal); stroke-width: 1.8; }
.schema-node--accent rect:not(.node-title-bg):not(.node-field) { stroke: var(--wire); stroke-width: 1.6; }
.node-title-bg { fill: var(--ink-raised-2); }
.node-title-bg--accent { fill: var(--wire-dim); }
.node-title { fill: var(--paper); font-size: 11px; font-weight: 600; }
.schema-node--hub .node-title { fill: var(--signal); }
.node-field { fill: var(--line); }
.schema-origin { fill: var(--signal); }

/* Clickable schema nodes */
.schema-link { cursor: pointer; }
.schema-node--clickable { transition: transform 0.3s var(--ease); transform-box: fill-box; transform-origin: center; }
.schema-link:hover .schema-node--clickable { transform: scale(1.08); }
.schema-link:hover .schema-node--clickable rect:not(.node-title-bg):not(.node-field) { stroke: var(--signal); stroke-width: 2; }

.schema-node {
  opacity: 0; transform: scale(0.9); transform-box: fill-box; transform-origin: center;
  animation: node-in 0.6s var(--ease) forwards;
  animation-delay: calc(var(--d) * 0.12s + 0.3s);
}
@keyframes node-in { to { opacity: 1; transform: scale(1); } }

.schema-line {
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  animation: line-draw 0.9s var(--ease) forwards;
  animation-delay: 0.1s;
  opacity: 0.7;
}
@keyframes line-draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .schema-node, .schema-line { animation: none !important; opacity: 1 !important; transform: none !important; stroke-dashoffset: 0 !important; }
}

/* ==========================================================================
   SECTION HEADER PATTERN
   ========================================================================== */
.section-header { max-width: 640px; margin-bottom: 64px; }
.section-title { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.75rem); margin-bottom: 14px; }
.section-desc { color: var(--paper-dim); font-size: 1.05rem; max-width: 56ch; }

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 72px; align-items: start; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; gap: 48px; } }
.about-text p { color: var(--paper-dim); margin-bottom: 20px; font-size: 1.02rem; }
.about-text strong { color: var(--paper); font-weight: 600; }

.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.stat-card { background: var(--ink-raised); padding: 28px 22px; transition: background 0.3s ease, transform 0.3s ease; }
.stat-card:hover { background: var(--ink-raised-2); }
.stat-number { font-size: 2.4rem; font-weight: 600; color: var(--signal); line-height: 1; margin-bottom: 10px; }
.stat-label { font-size: 0.85rem; color: var(--paper-dim); }

/* ==========================================================================
   SKILLS — HEXAGONAL HONEYCOMB LAYOUT
   ========================================================================== */
.skill-groups { display: flex; flex-direction: column; gap: 52px; }
.skill-group-title { color: var(--wire); font-size: 0.85rem; margin-bottom: 24px; text-transform: lowercase; }

.hex-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: flex-start;
}

.hex-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.3s var(--ease);
}
.hex-item:hover { transform: translateY(-6px); }

.hex-shape {
  width: 80px;
  height: 90px;
  display: grid;
  place-items: center;
  background: var(--ink-raised);
  border: 1.5px solid var(--line);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

/* Outer glow wrapper for hex */
.hex-item:hover .hex-shape {
  background: var(--ink-raised-2);
  border-color: var(--signal);
}

.hex-item::before {
  content: '';
  position: absolute;
  width: 88px;
  height: 98px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: transparent;
  transition: background 0.3s ease;
  z-index: -1;
}
.hex-item:hover::before {
  background: var(--signal-dim);
}

.hex-shape i {
  font-size: 32px;
  line-height: 1;
}

.hex-shape .icon {
  color: var(--paper-dim);
  transition: color 0.3s ease;
}
.hex-item:hover .hex-shape .icon { color: var(--signal); }

.hex-label {
  font-size: 0.78rem;
  color: var(--paper-dim);
  font-family: var(--f-mono);
  text-align: center;
  transition: color 0.3s ease;
}
.hex-item:hover .hex-label { color: var(--paper); }

@media (max-width: 560px) {
  .hex-shape { width: 64px; height: 72px; }
  .hex-shape i { font-size: 24px; }
  .hex-grid { gap: 14px; }
}

/* ==========================================================================
   TIMELINE (Experience)
   ========================================================================== */
.timeline { position: relative; padding-left: 40px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline-item { position: relative; margin-bottom: 40px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute; left: -40px; top: 26px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--ink); border: 2px solid var(--wire);
}
.timeline-dot--current { border-color: var(--signal); box-shadow: 0 0 0 4px var(--signal-dim); }
.timeline-card {
  background: var(--ink-raised); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 28px 30px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.timeline-card:hover {
  border-color: var(--wire);
  transform: translateX(4px);
  box-shadow: -4px 0 20px rgba(79, 166, 216, 0.08);
}
.timeline-top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.timeline-icon { color: var(--wire); flex-shrink: 0; margin-top: 3px; }
.timeline-role { font-size: 1.15rem; font-weight: 600; margin-bottom: 2px; }
.timeline-org { color: var(--paper-dim); font-size: 0.92rem; }
.timeline-date { color: var(--paper-faint); font-size: 0.82rem; margin-bottom: 14px; }
.timeline-desc { color: var(--paper-dim); margin-bottom: 16px; }
.timeline-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  margin-left: auto; flex-shrink: 0; font-size: 0.72rem; padding: 5px 11px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--paper-dim);
}
.badge--live { border-color: var(--good); color: var(--good); }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; padding: 6px 12px; border-radius: 999px;
  background: var(--ink-raised-2); color: var(--paper-dim); border: 1px solid var(--line-soft);
}
.icon-sm { width: 13px; height: 13px; }

/* ==========================================================================
   PROJECTS
   ========================================================================== */
.project-list { display: flex; flex-direction: column; gap: 32px; }
.project-card {
  display: grid; grid-template-columns: 300px 1fr;
  border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden;
  background: var(--ink-raised);
  transition: border-color var(--t-med), transform var(--t-fast), box-shadow 0.3s ease;
  transform-style: preserve-3d;
}
.project-card:hover {
  border-color: var(--wire);
  box-shadow: 0 12px 40px rgba(79, 166, 216, 0.08);
}
@media (max-width: 860px) { .project-card { grid-template-columns: 1fr; } }

.project-visual {
  position: relative; padding: 24px;
  background: linear-gradient(155deg, var(--ink-raised-2), var(--ink));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 200px;
  overflow: hidden;
}
@media (max-width: 860px) { .project-visual { border-right: none; border-bottom: 1px solid var(--line); min-height: 140px; } }

/* Project image placeholder */
.project-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg,
      rgba(79, 166, 216, 0.08) 0%,
      rgba(232, 163, 61, 0.08) 50%,
      rgba(95, 190, 141, 0.08) 100%
    );
  overflow: hidden;
}
.project-img-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 40%, rgba(79, 166, 216, 0.12), transparent 60%),
    radial-gradient(circle at 70% 60%, rgba(232, 163, 61, 0.12), transparent 60%);
  animation: project-gradient-shift 8s ease-in-out infinite alternate;
}
@keyframes project-gradient-shift {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}
.project-img-label {
  position: relative;
  z-index: 2;
  font-size: 0.72rem;
  color: var(--paper-faint);
  opacity: 0.6;
  padding: 6px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-s);
}
.project-screenshot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 3;
}

.project-path { position: relative; font-size: 0.78rem; color: var(--paper-faint); word-break: break-all; z-index: 4; }
.project-visual .badge { position: relative; align-self: flex-start; margin-left: 0; margin-top: 10px; background: var(--ink); z-index: 4; }
.icon-xl { width: 46px; height: 46px; }

.project-body { padding: 32px 36px; }
.project-header { margin-bottom: 22px; }
.project-title { font-size: 1.4rem; margin-bottom: 8px; }
.project-meta { color: var(--paper-faint); font-size: 0.8rem; }

.project-case { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.case-block { display: grid; grid-template-columns: 110px 1fr; gap: 18px; }
@media (max-width: 620px) { .case-block { grid-template-columns: 1fr; gap: 4px; } }
.case-label { color: var(--wire); font-size: 0.78rem; padding-top: 2px; }
.case-block p { color: var(--paper-dim); font-size: 0.95rem; }

.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.project-links { display: flex; flex-wrap: wrap; gap: 12px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 10px 16px; font-size: 0.85rem; color: var(--paper);
  transition: border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.link-btn:hover {
  border-color: var(--signal); color: var(--signal);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--signal-dim);
}

/* ==========================================================================
   CERTIFICATIONS
   ========================================================================== */
.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 860px) { .cert-grid { grid-template-columns: 1fr; } }
.cert-card {
  border: 1px solid var(--line); border-radius: var(--radius-m); padding: 28px;
  background: var(--ink-raised); transition: transform var(--t-fast), border-color var(--t-fast), box-shadow 0.3s ease;
}
.cert-card:hover {
  transform: translateY(-4px);
  border-color: var(--signal);
  box-shadow: 0 12px 30px var(--signal-dim);
}
.cert-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.cert-top .icon { color: var(--signal); }
.cert-date { font-size: 0.75rem; color: var(--paper-dim); }
.cert-title { font-size: 1.05rem; margin-bottom: 8px; line-height: 1.3; }
.cert-issuer { color: var(--paper-dim); font-size: 0.9rem; margin-bottom: 14px; }
.cert-id { font-size: 0.75rem; color: var(--paper-dim); padding-top: 14px; border-top: 1px solid var(--line-soft); }

/* ==========================================================================
   SERVICES
   ========================================================================== */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
@media (max-width: 860px) { .services-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .services-grid { grid-template-columns: 1fr; } }
.service-card {
  background: var(--ink-raised); padding: 34px 28px;
  transition: background var(--t-fast), transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
  background: var(--ink-raised-2);
  transform: translateY(-2px);
}
.service-card .icon-lg { color: var(--wire); margin-bottom: 20px; transition: color 0.3s ease, transform 0.3s ease; }
.service-card:hover .icon-lg { color: var(--signal); transform: scale(1.15); }
.service-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.service-card p { color: var(--paper-dim); font-size: 0.9rem; }
.icon-lg { width: 26px; height: 26px; }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact { background: var(--ink-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; gap: 48px; } }

.info-list { display: flex; flex-direction: column; gap: 4px; margin-top: 32px; }
.info-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--line-soft); color: var(--paper-dim);
  font-size: 0.95rem; transition: color var(--t-fast), padding-left 0.3s ease;
}
.info-item .icon { color: var(--wire); flex-shrink: 0; }
a.info-item:hover { color: var(--paper); padding-left: 6px; }

.contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 0.78rem; color: var(--paper-dim); }
.form-group input, .form-group textarea {
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 13px 16px; color: var(--paper); font-size: 0.95rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--paper-faint); }
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--signal); outline: none;
  box-shadow: 0 0 0 3px var(--signal-dim);
}
.form-group textarea { resize: vertical; min-height: 110px; }
.contact-form .btn { align-self: flex-start; margin-top: 4px; }
.form-status { min-height: 1.2em; color: var(--good); font-size: 0.85rem; }
.form-status.is-error { color: #e2685f; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer { padding: 56px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-name { font-family: var(--f-display); font-weight: 600; }
.footer-tag { font-size: 0.78rem; color: var(--paper-faint); }
.footer-social { display: flex; gap: 18px; }
.footer-social a { color: var(--paper-dim); transition: color var(--t-fast), transform 0.3s ease; }
.footer-social a:hover { color: var(--signal); transform: translateY(-3px); }
.footer-copy { font-size: 0.78rem; color: var(--paper-faint); }
@media (max-width: 720px) { .footer-inner { flex-direction: column; text-align: center; } }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; bottom: 28px; right: 28px; z-index: 400;
  width: 46px; height: 46px; border-radius: var(--radius-m);
  background: var(--ink-raised); border: 1.5px solid var(--signal);
  display: grid; place-items: center; color: var(--signal);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity var(--t-fast), transform var(--t-fast) var(--ease), background var(--t-fast), visibility var(--t-fast), box-shadow 0.3s ease;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top.visible:hover {
  background: var(--ink-raised-2);
  box-shadow: 0 8px 25px var(--signal-dim);
  transform: translateY(-3px);
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10, 13, 18, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity var(--t-fast) var(--ease), visibility var(--t-fast);
  padding: 20px;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-content {
  background: var(--ink-raised); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 30px; position: relative; max-width: 600px; width: 100%;
  transform: translateY(20px) scale(0.95);
  transition: transform var(--t-med) var(--ease);
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.modal-overlay.open .modal-content { transform: translateY(0) scale(1); }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; color: var(--paper-dim);
  transition: background var(--t-fast), color var(--t-fast);
}
.modal-close:hover { background: var(--line); color: var(--paper); }
.modal-img { max-width: 100%; max-height: 60vh; border-radius: var(--radius-s); object-fit: contain; }
.cert-card--clickable { cursor: pointer; }

/* ==========================================================================
   SCROLL REVEAL — ENHANCED ANIMATIONS
   ========================================================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation for grid children */
.anim-stagger {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  transition-delay: calc(var(--i, 0) * 0.08s);
}
.in-view .anim-stagger,
.anim-stagger.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Slide from left */
.anim-slide-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.anim-slide-left.in-view { opacity: 1; transform: translateX(0); }

/* Slide from right */
.anim-slide-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.anim-slide-right.in-view { opacity: 1; transform: translateX(0); }

/* Scale up */
.anim-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.anim-scale.in-view { opacity: 1; transform: scale(1); }

/* Shimmer effect for cards on hover */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(232, 163, 61, 0.04) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.service-card { position: relative; overflow: hidden; }
.service-card:hover::before {
  opacity: 1;
  animation: shimmer 2s ease infinite;
}

/* Glow pulse for badge--live */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(95, 190, 141, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(95, 190, 141, 0); }
}
.badge--live { animation: glow-pulse 2.4s ease-in-out infinite; }

/* Section divider lines */
.section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--signal), transparent);
  opacity: 0.5;
}
.contact::after { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal], .anim-stagger, .anim-slide-left, .anim-slide-right, .anim-scale {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ==========================================================================
   ENHANCED ENTRANCE ANIMATIONS
   ========================================================================== */

/* ---- Hero title word-by-word cascade ---- */
@keyframes hero-text-rise {
  0% { opacity: 0; transform: translateY(40px) rotateX(10deg); filter: blur(6px); }
  100% { opacity: 1; transform: translateY(0) rotateX(0deg); filter: blur(0); }
}
.hero-copy.in-view .hero-title-hi {
  animation: hero-text-rise 0.7s var(--ease) forwards;
}
.hero-copy.in-view .hero-title {
  animation: hero-text-rise 0.8s var(--ease) 0.15s both;
}
.hero-copy.in-view .hero-role {
  animation: hero-text-rise 0.7s var(--ease) 0.35s both;
}
.hero-copy.in-view .hero-desc {
  animation: hero-text-rise 0.7s var(--ease) 0.5s both;
}
.hero-copy.in-view .hero-cta {
  animation: hero-text-rise 0.7s var(--ease) 0.65s both;
}
.hero-copy.in-view .hero-profile-pic {
  animation: profile-pop 0.8s var(--ease) 0.1s both, profile-glow 3s ease-in-out 0.9s infinite alternate;
}
@keyframes profile-pop {
  0% { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  60% { transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ---- Section titles slide in with underline wipe ---- */
@keyframes title-slide-in {
  0% { opacity: 0; transform: translateX(-50px); }
  100% { opacity: 1; transform: translateX(0); }
}
.section-header.in-view .section-title {
  animation: title-slide-in 0.7s var(--ease) forwards;
}
.section-header.in-view .section-desc {
  animation: hero-text-rise 0.6s var(--ease) 0.2s both;
}

/* ---- Stat cards bounce in ---- */
@keyframes stat-bounce {
  0% { opacity: 0; transform: translateY(30px) scale(0.9); }
  60% { transform: translateY(-5px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.about-stats.in-view .stat-card {
  animation: stat-bounce 0.5s var(--ease) both;
}
.about-stats.in-view .stat-card:nth-child(1) { animation-delay: 0s; }
.about-stats.in-view .stat-card:nth-child(2) { animation-delay: 0.1s; }
.about-stats.in-view .stat-card:nth-child(3) { animation-delay: 0.2s; }
.about-stats.in-view .stat-card:nth-child(4) { animation-delay: 0.3s; }

/* ---- Hex skills pop in with rotation ---- */
@keyframes hex-pop {
  0% { opacity: 0; transform: translateY(20px) scale(0.7) rotate(-15deg); }
  70% { transform: translateY(-3px) scale(1.05) rotate(2deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
}
.skill-group.in-view .hex-item {
  animation: hex-pop 0.5s var(--ease) both;
}
.skill-group.in-view .hex-item:nth-child(1) { animation-delay: 0.05s; }
.skill-group.in-view .hex-item:nth-child(2) { animation-delay: 0.1s; }
.skill-group.in-view .hex-item:nth-child(3) { animation-delay: 0.15s; }
.skill-group.in-view .hex-item:nth-child(4) { animation-delay: 0.2s; }
.skill-group.in-view .hex-item:nth-child(5) { animation-delay: 0.25s; }
.skill-group.in-view .hex-item:nth-child(6) { animation-delay: 0.3s; }

/* ---- Timeline cards slide in from left ---- */
@keyframes timeline-slide {
  0% { opacity: 0; transform: translateX(-60px); }
  100% { opacity: 1; transform: translateX(0); }
}
.timeline-item.in-view .timeline-card {
  animation: timeline-slide 0.6s var(--ease) both;
}
.timeline-item.in-view .timeline-dot {
  animation: stat-bounce 0.4s var(--ease) 0.1s both;
}

/* ---- Project cards dramatic entrance ---- */
@keyframes project-reveal {
  0% { opacity: 0; transform: translateY(60px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.project-card.in-view {
  animation: project-reveal 0.8s var(--ease) both;
}
.project-card.in-view:nth-child(1) { animation-delay: 0s; }
.project-card.in-view:nth-child(2) { animation-delay: 0.15s; }
.project-card.in-view:nth-child(3) { animation-delay: 0.3s; }

/* ---- Certification cards fan in ---- */
@keyframes cert-fan {
  0% { opacity: 0; transform: translateY(30px) rotateZ(-3deg); }
  100% { opacity: 1; transform: translateY(0) rotateZ(0deg); }
}
.cert-card.in-view {
  animation: cert-fan 0.5s var(--ease) both;
}
.cert-card.in-view:nth-child(1) { animation-delay: 0.05s; }
.cert-card.in-view:nth-child(2) { animation-delay: 0.15s; }
.cert-card.in-view:nth-child(3) { animation-delay: 0.25s; }

/* ---- Service cards cascade ---- */
@keyframes service-cascade {
  0% { opacity: 0; transform: translateY(30px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.service-card.in-view {
  animation: service-cascade 0.5s var(--ease) both;
}
.service-card:nth-child(1) { animation-delay: 0s; }
.service-card:nth-child(2) { animation-delay: 0.06s; }
.service-card:nth-child(3) { animation-delay: 0.12s; }
.service-card:nth-child(4) { animation-delay: 0.18s; }
.service-card:nth-child(5) { animation-delay: 0.24s; }
.service-card:nth-child(6) { animation-delay: 0.3s; }

/* ---- Contact info items stagger ---- */
@keyframes info-slide {
  0% { opacity: 0; transform: translateX(-30px); }
  100% { opacity: 1; transform: translateX(0); }
}
.contact-info.in-view .info-item {
  animation: info-slide 0.5s var(--ease) both;
}
.contact-info.in-view .info-item:nth-child(1) { animation-delay: 0.1s; }
.contact-info.in-view .info-item:nth-child(2) { animation-delay: 0.2s; }
.contact-info.in-view .info-item:nth-child(3) { animation-delay: 0.3s; }
.contact-info.in-view .info-item:nth-child(4) { animation-delay: 0.4s; }

/* ---- Form fields appear ---- */
@keyframes form-appear {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
.contact-form.in-view .form-row,
.contact-form.in-view .form-group,
.contact-form.in-view .btn {
  animation: form-appear 0.5s var(--ease) both;
}
.contact-form.in-view .form-row { animation-delay: 0.1s; }
.contact-form.in-view .form-group:nth-child(2) { animation-delay: 0.2s; }
.contact-form.in-view .form-group:nth-child(3) { animation-delay: 0.3s; }
.contact-form.in-view .btn { animation-delay: 0.4s; }

/* ---- Footer fade up ---- */
@keyframes footer-up {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
.footer-inner { animation: footer-up 0.7s var(--ease) both; }

/* ---- Floating subtle pulse for hover states ---- */
@keyframes float-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ==========================================================================
   RESPONSIVE TYPE TWEAKS
   ========================================================================== */
@media (max-width: 560px) {
  .container { padding: 0 20px; }
  .hero-inner { padding: 40px 20px; }
  .project-body { padding: 26px 22px; }
  .contact-form, .about-stats { width: 100%; }
}
