/* ============================================================================
   styles.css — single stylesheet for the portfolio.
   Dark "blue-team" theme with a teal/cyan accent. CSS custom properties drive
   theming. Mobile-first, AA contrast, prefers-reduced-motion respected.
   ========================================================================== */

:root {
  /* Palette */
  --bg: #0b1220;
  --bg-alt: #0f1828;
  --surface: #121f33;
  --surface-2: #16263d;
  --border: #233754;
  --text: #e6edf6;
  --text-muted: #9fb2c9;
  --text-dim: #6f8299;
  --accent: #2dd4bf;          /* teal */
  --accent-strong: #14b8a6;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --signal: #38e07b;          /* signal-green for positive states */
  --danger: #f87171;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);

  /* Type */
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;

  /* Layout */
  --maxw: 1080px;
  --radius: 14px;
  --radius-sm: 9px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.4em; }

/* Visible focus everywhere */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.muted { color: var(--text-muted); font-weight: 400; }

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: #04211c; padding: 10px 16px;
  border-radius: 0 0 8px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ------------------------------- Buttons --------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.98rem; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #04211c; box-shadow: 0 6px 20px rgba(45, 212, 191, 0.28);
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(45, 212, 191, 0.42); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ------------------------------- Header ---------------------------------- */
/* ------------------------------ Preloader -------------------------------- */
/* Hidden by default; only shown when JS is present (so no-JS users never see
   a stuck overlay). app.js adds .hidden on window load to fade it out. */
.preloader { display: none; }
.js .preloader {
  position: fixed; inset: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: var(--bg);
  opacity: 1; visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.preloader-spinner { position: relative; width: 72px; height: 72px; display: grid; place-items: center; }
.preloader-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
.preloader-shield { color: var(--accent); animation: shieldPulse 1.8s ease-in-out infinite; }
@keyframes shieldPulse { 0%, 100% { opacity: 0.55; transform: scale(0.92); } 50% { opacity: 1; transform: scale(1); } }

.preloader-text {
  margin: 0; color: var(--text-muted); font-size: 0.9rem; letter-spacing: 1.5px;
  text-transform: uppercase; font-weight: 600;
}
.preloader-dots::after { content: ''; animation: dots 1.4s steps(4, end) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

@media (prefers-reduced-motion: reduce) {
  .preloader-ring, .preloader-shield, .preloader-dots::after { animation: none; }
  .preloader-dots::after { content: '…'; }
}

/* Scroll progress bar */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%; z-index: 200;
  background: linear-gradient(90deg, var(--accent), var(--signal));
  transition: width 0.1s linear;
}

/* Back-to-top floating button */
.back-to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 120;
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #04211c; border: none; box-shadow: 0 8px 24px rgba(45, 212, 191, 0.35);
  opacity: 0; transform: translateY(14px) scale(0.9); pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.2s ease;
}
.back-to-top.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.back-to-top:hover { box-shadow: 0 12px 30px rgba(45, 212, 191, 0.5); transform: translateY(-2px) scale(1.05); }
@media (max-width: 480px) { .back-to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; } }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 18, 32, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.site-header.scrolled {
  background: rgba(11, 18, 32, 0.9);
  border-bottom-color: var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-text { font-size: 1.02rem; letter-spacing: 0.2px; }

.nav { display: flex; align-items: center; }
.nav-toggle {
  display: none; background: none; border: none; color: var(--text);
  cursor: pointer; padding: 6px;
}
.nav-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  position: relative; display: inline-block; padding: 8px 12px; border-radius: 8px;
  color: var(--text-muted); font-size: 0.95rem; font-weight: 500;
  transition: color 0.18s ease, background 0.18s ease;
}
/* Animated underline that grows from the center on hover / active. */
.nav-list a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px;
  background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: center;
  transition: transform 0.25s cubic-bezier(0.22, 0.68, 0.18, 1);
}
.nav-list a:not(.nav-cta):hover::after,
.nav-list a.active:not(.nav-cta)::after { transform: scaleX(1); }
.nav-list a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-list a.active { color: var(--accent); }
.nav-cta { background: var(--accent-soft); color: var(--accent) !important; }
.nav-cta:hover { background: var(--accent); color: #04211c !important; }

/* --------------------------------- Hero ---------------------------------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(72px, 12vw, 150px) 0 clamp(56px, 8vw, 100px);
  background: var(--bg);
}

/* Animated aurora background */
.hero-aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-aurora .blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5;
  will-change: transform;
}
.blob-1 {
  width: 460px; height: 460px; top: -140px; right: -80px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.55), transparent 70%);
  animation: float1 18s ease-in-out infinite;
}
.blob-2 {
  width: 380px; height: 380px; bottom: -120px; left: -60px;
  background: radial-gradient(circle, rgba(56, 224, 123, 0.38), transparent 70%);
  animation: float2 22s ease-in-out infinite;
}
.blob-3 {
  width: 320px; height: 320px; top: 30%; left: 45%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3), transparent 70%);
  animation: float1 26s ease-in-out infinite reverse;
}
/* faint dotted grid overlay */
.hero-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(159, 178, 201, 0.10) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(circle at 50% 35%, #000 0%, transparent 75%);
  mask-image: radial-gradient(circle at 50% 35%, #000 0%, transparent 75%);
}
@keyframes float1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-30px, 40px) scale(1.08); } }
@keyframes float2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px, -30px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .hero-aurora .blob { animation: none; } }

.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr; gap: 44px; align-items: center; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 15px; font-size: 0.78rem; color: var(--text-muted); font-weight: 500;
  letter-spacing: 0.2px; margin: 0 0 22px;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--signal); flex: none;
  box-shadow: 0 0 0 0 rgba(56, 224, 123, 0.6); animation: pulse 2.4s infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(56,224,123,0.55); } 70% { box-shadow: 0 0 0 9px rgba(56,224,123,0); } 100% { box-shadow: 0 0 0 0 rgba(56,224,123,0); } }
@media (prefers-reduced-motion: reduce) { .status-dot { animation: none; } }

.hero-name { font-size: clamp(2.3rem, 6vw, 4rem); margin: 0 0 10px; letter-spacing: -1px; font-weight: 800; line-height: 1.05; }
.hero-name .grad {
  background: linear-gradient(120deg, var(--accent), var(--signal) 55%, #60a5fa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-title { font-size: clamp(1.05rem, 3vw, 1.45rem); color: var(--text); font-weight: 600; margin: 0 0 18px; min-height: 1.6em; }
.hero-title .dot { color: var(--accent); margin: 0 6px; }
/* Typing caret that blinks after the animated title */
.caret {
  display: inline-block; width: 2px; height: 1.05em; margin-left: 3px;
  background: var(--accent); vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }
.hero-hook { max-width: 600px; color: var(--text-muted); font-size: 1.06rem; margin: 0 0 30px; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }

.hero-links {
  display: flex; flex-wrap: wrap; gap: 12px 22px; list-style: none; margin: 0; padding: 0;
  font-size: 0.9rem;
}
.hero-links a, .hero-loc {
  display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted);
}
.hero-links a:hover { color: var(--accent); text-decoration: none; }
.hero-links svg { flex: none; }

/* Hero photo */
.hero-photo { position: relative; justify-self: center; }
.photo-frame {
  position: relative; width: clamp(220px, 60vw, 300px); aspect-ratio: 4 / 5;
  border-radius: 22px; padding: 4px;
  background: linear-gradient(135deg, var(--accent), rgba(96,165,250,0.6) 60%, transparent);
  box-shadow: var(--shadow);
}
.photo-frame img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 18px; display: block;
  position: relative; z-index: 1;
}
.photo-ring {
  position: absolute; inset: -10px; border-radius: 28px; z-index: 0;
  background: conic-gradient(from 0deg, transparent, var(--accent), transparent 40%);
  filter: blur(18px); opacity: 0.5; animation: spin 9s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .photo-ring { animation: none; } }
.photo-badge {
  position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 9px 16px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  box-shadow: var(--shadow);
}
.photo-badge svg { color: var(--accent); }

@media (min-width: 860px) {
  .hero-inner { grid-template-columns: 1.25fr 0.75fr; gap: 56px; }
  .hero-photo { justify-self: end; }
  .photo-frame { width: clamp(260px, 26vw, 320px); }
}

/* ------------------------------- Sections -------------------------------- */
.section { padding: clamp(56px, 9vw, 96px) 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: clamp(1.5rem, 4vw, 2rem); display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 28px;
}
.section-num {
  font-family: var(--mono); font-size: 0.95rem; color: var(--accent);
  font-weight: 600; opacity: 0.9;
}
.section-intro { color: var(--text-muted); max-width: 680px; margin: -10px 0 26px; }

/* Scroll reveal — only hide when JS is present (graceful no-JS fallback). */
.js .reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.22, 0.68, 0.18, 1),
              transform 0.7s cubic-bezier(0.22, 0.68, 0.18, 1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

/* Staggered child reveal: items animate in sequence once their .reveal
   container enters the viewport. transition-delay is set per item in JS. */
.js .stagger {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.22, 0.68, 0.18, 1),
              transform 0.6s cubic-bezier(0.22, 0.68, 0.18, 1);
}
.reveal.in .stagger { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .stagger { opacity: 1; transform: none; }
}

/* --------------------------------- About --------------------------------- */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
.about-lead { font-size: 1.12rem; color: var(--text); max-width: 720px; }
.about-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
  list-style: none; margin: 0; padding: 0;
}
.about-stats li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-num { display: block; font-size: 1.9rem; font-weight: 800; color: var(--accent); }
.stat-num small { font-size: 0.9rem; }
.stat-label { display: block; color: var(--text-muted); font-size: 0.88rem; margin-top: 4px; }

@media (min-width: 760px) {
  .about-grid { grid-template-columns: 1.3fr 1fr; align-items: start; }
  .about-stats { grid-template-columns: repeat(2, 1fr); }
}

/* --------------------------------- Skills -------------------------------- */
.skills-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 620px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 940px) { .skills-grid { grid-template-columns: repeat(3, 1fr); } }

.skill-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; transition: border-color 0.2s ease, transform 0.2s ease;
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.skill-card h3 { font-size: 1.05rem; color: var(--text); margin-bottom: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chips li {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
  padding: 5px 11px; border-radius: 999px; font-size: 0.82rem; font-weight: 500;
}
.chips-sm li { font-size: 0.76rem; padding: 4px 9px; }

/* ------------------------------ Timeline --------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline-item { position: relative; padding: 0 0 28px 30px; }
.timeline-item::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: -6px; width: 2px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.timeline-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.timeline-head h3 { font-size: 1.08rem; margin: 0; }
.timeline-date { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); }
.timeline-org { color: var(--text-muted); font-weight: 600; margin: 2px 0 8px; }
.timeline-body p { color: var(--text-muted); margin: 0; }

/* ------------------------------ Projects --------------------------------- */
.projects-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 620px) { .projects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 940px) { .projects-grid { grid-template-columns: repeat(3, 1fr); } }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; transition: border-color 0.2s ease, transform 0.2s ease;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.project-card h3 { font-size: 1.02rem; }
.project-card p { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 14px; }

/* ------------------------------- Reports --------------------------------- */
.reports-controls { display: flex; flex-direction: column; gap: 16px; margin-bottom: 30px; }
.search-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 14px; color: var(--text-dim); max-width: 460px;
}
.search-wrap input {
  flex: 1; background: none; border: none; color: var(--text); font-size: 0.95rem;
  padding: 12px 0; outline: none; font-family: inherit;
}
.search-wrap input::placeholder { color: var(--text-dim); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  padding: 7px 14px; border-radius: 999px; font-size: 0.84rem; font-weight: 500;
  cursor: pointer; font-family: inherit; transition: all 0.15s ease;
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn[aria-pressed="true"] { background: var(--accent); color: #04211c; border-color: var(--accent); }

.report-group { margin-bottom: 40px; }
.report-group-title {
  font-size: 1.18rem; padding-bottom: 10px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px;
}
.report-group-title::before {
  content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent);
}

.report-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .report-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .report-grid { grid-template-columns: repeat(3, 1fr); } }

.report-card {
  text-align: left; width: 100%; cursor: pointer; font-family: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  /* Entrance cascade — animation-delay is set per card in app.js. */
  animation: cardIn 0.5s cubic-bezier(0.22, 0.68, 0.18, 1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
/* Once the entrance animation finishes, drop it so the JS hover-tilt transform
   (set inline) is no longer overridden by the animation's fill state. */
.report-card.settled { animation: none; }
@media (prefers-reduced-motion: reduce) { .report-card { animation: none; } }
.report-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4); }
.report-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.badge {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.3px;
  background: var(--accent-soft); color: var(--accent);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.report-date { font-family: var(--mono); font-size: 0.78rem; color: var(--text-dim); }
.report-card h4 { font-size: 1.04rem; margin: 0; color: var(--text); }
.report-summary { color: var(--text-muted); font-size: 0.89rem; margin: 0; flex: 1; }
.report-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.report-tools span {
  font-size: 0.72rem; color: var(--text-dim); border: 1px solid var(--border);
  padding: 3px 8px; border-radius: 6px;
}

.reports-empty { color: var(--text-muted); text-align: center; padding: 30px 0; }

/* ---------------------------- Certifications ----------------------------- */
.cert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cert-list li {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 18px;
}
.cert-name { font-weight: 600; color: var(--text); }
.cert-date { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); }

/* ------------------------------ Education -------------------------------- */
.edu-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 32px;
}
.edu-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.edu-head h3 { font-size: 1.1rem; margin: 0; }
.edu-card p { color: var(--text-muted); }
.lang-title { font-size: 1.1rem; margin-bottom: 14px; }
.lang-chips li { background: var(--surface); }

/* ------------------------------- Contact --------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 820px) { .contact-grid { grid-template-columns: 0.85fr 1.15fr; } }

.contact-direct { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; }
.contact-direct li { display: flex; align-items: center; gap: 12px; color: var(--text-muted); }
.contact-direct svg { color: var(--accent); flex: none; }

.contact-form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px;
}
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-row label { font-size: 0.86rem; font-weight: 600; color: var(--text-muted); }
.req { color: var(--accent); }
.contact-form input,
.contact-form textarea {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: 11px 13px; font-size: 0.95rem; font-family: inherit;
  width: 100%; resize: vertical; transition: border-color 0.15s ease;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--accent); outline: none; }
.contact-form input[aria-invalid="true"],
.contact-form textarea[aria-invalid="true"] { border-color: var(--danger); }

/* Honeypot — visually hidden but reachable by bots, off-screen not display:none */
.hp-field {
  position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;
}

.form-status { margin: 14px 0 0; font-size: 0.9rem; min-height: 1.2em; }
.form-status.success { color: var(--signal); }
.form-status.error { color: var(--danger); }

/* Submit + spinner */
#contactSubmit { position: relative; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; display: none;
  border: 2px solid rgba(4, 33, 28, 0.35); border-top-color: #04211c;
  animation: spin 0.7s linear infinite;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-label { opacity: 0.7; }
.btn[disabled] { opacity: 0.7; cursor: not-allowed; transform: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------- Footer --------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 26px 0; }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
}
.site-footer p { margin: 0; color: var(--text-dim); font-size: 0.86rem; }
.footer-links { display: flex; gap: 14px; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

/* ========================= REPORT DETAIL MODAL ========================== */
.modal { position: fixed; inset: 0; z-index: 150; display: flex; align-items: flex-start; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(4, 9, 18, 0.72); backdrop-filter: blur(3px);
  animation: fadeIn 0.25s ease both;
}
.modal-dialog {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); width: min(880px, 100%); margin: 24px 16px;
  max-height: calc(100vh - 48px); overflow-y: auto; box-shadow: var(--shadow);
  animation: modalIn 0.34s cubic-bezier(0.22, 0.68, 0.18, 1) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(22px) scale(0.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal-dialog { animation: none; }
}
.modal-close {
  position: sticky; top: 0; float: right; margin: 10px 10px 0 0; z-index: 2;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-close:hover { border-color: var(--accent); color: var(--accent); }
.modal-content { padding: 26px clamp(20px, 4vw, 34px) 34px; }

.modal-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.modal-group { color: var(--text-muted); font-size: 0.86rem; font-weight: 600; }
.modal-content h2 { font-size: clamp(1.3rem, 4vw, 1.7rem); margin: 0 0 6px; padding-right: 40px; }
.modal-meta { color: var(--text-dim); font-family: var(--mono); font-size: 0.82rem; margin-bottom: 18px; }

.modal-section { margin-top: 26px; }
.modal-section h3 {
  font-size: 0.82rem; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--accent); margin-bottom: 12px;
}
.modal-summary { color: var(--text); font-size: 1rem; }

.modal-findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.modal-findings li { position: relative; padding-left: 26px; color: var(--text-muted); }
.modal-findings li::before {
  content: ""; position: absolute; left: 4px; top: 9px; width: 8px; height: 8px;
  border-radius: 2px; background: var(--signal);
}

/* Ordered "Report Contents" flow timeline — order MUST match the data array */
.flow { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.flow li {
  counter-increment: step; position: relative; padding: 0 0 18px 46px; color: var(--text);
}
.flow li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent);
  font-family: var(--mono); font-size: 0.86rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.flow li::after {
  content: ""; position: absolute; left: 14px; top: 30px; bottom: 2px; width: 2px;
  background: var(--border);
}
.flow li:last-child { padding-bottom: 0; }
.flow li:last-child::after { display: none; }

/* PDF area */
.pdf-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.pdf-actions .btn { padding: 9px 16px; font-size: 0.88rem; }
.pdf-frame-wrap {
  position: relative; width: 100%; aspect-ratio: 8.5 / 11; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.pdf-frame-wrap iframe { width: 100%; height: 100%; border: 0; }
.pdf-soon {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius-sm);
  padding: 48px 20px; color: var(--text-muted); text-align: center;
}
.pdf-soon svg { color: var(--text-dim); }

/* On small screens, hide the heavy iframe and rely on the Open/Download links */
@media (max-width: 560px) {
  .pdf-frame-wrap { display: none; }
  .pdf-mobile-note { display: block; color: var(--text-muted); font-size: 0.88rem; }
}
.pdf-mobile-note { display: none; }

/* ============================ RESPONSIVE NAV ============================= */
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav-list {
    position: absolute; top: 64px; right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-alt); border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px; display: none;
  }
  .nav-list.open { display: flex; }
  .nav-list li { width: 100%; }
  .nav-list a { display: block; padding: 12px 8px; border-radius: 8px; }
  .nav-cta { text-align: center; margin-top: 6px; }
}

/* ==========================================================================
   MODERN ANIMATIONS  (all disabled under prefers-reduced-motion at the end)
   ========================================================================== */

/* --- Cursor glow (created by JS, desktop only) --------------------------- */
.cursor-glow {
  position: fixed; top: 0; left: 0; width: 420px; height: 420px; border-radius: 50%;
  transform: translate3d(-50%, -50%, 0); pointer-events: none; z-index: 90;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.10), transparent 60%);
  opacity: 0; transition: opacity 0.4s ease; mix-blend-mode: screen; will-change: transform;
}
.cursor-glow.active { opacity: 1; }

/* --- Animated gradient on the hero name ---------------------------------- */
.hero-name .grad {
  background: linear-gradient(120deg, var(--accent), var(--signal) 45%, #60a5fa 70%, var(--accent));
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 7s linear infinite;
}
@keyframes gradShift { to { background-position: 220% center; } }

/* --- 3D tilt + cursor spotlight on cards --------------------------------- */
.skill-card, .project-card, .report-card {
  position: relative; overflow: hidden;
  transform-style: preserve-3d; will-change: transform;
  transition: border-color 0.2s ease, transform 0.3s cubic-bezier(0.22, 0.68, 0.18, 1), box-shadow 0.3s ease;
}
.skill-card::after, .project-card::after, .report-card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(45, 212, 191, 0.16), transparent 45%);
  opacity: 0; transition: opacity 0.3s ease; z-index: 1;
}
.skill-card.tilting::after, .project-card.tilting::after, .report-card.tilting::after { opacity: 1; }
/* keep card text above the spotlight overlay */
.skill-card > *, .project-card > *, .report-card > * { position: relative; z-index: 2; }
.skill-card.tilting, .project-card.tilting, .report-card.tilting {
  border-color: var(--accent); box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}

/* --- Hero photo 3D tilt --------------------------------------------------- */
.photo-frame { transition: transform 0.3s cubic-bezier(0.22, 0.68, 0.18, 1); will-change: transform; }

/* --- Section-title underline draw-in ------------------------------------- */
.section-title { position: relative; }
.section-title::after {
  content: ''; position: absolute; left: 0; bottom: -10px; height: 3px; width: 64px;
  background: linear-gradient(90deg, var(--accent), var(--signal)); border-radius: 3px;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.22, 0.68, 0.18, 1) 0.15s;
}
.reveal.in .section-title::after { transform: scaleX(1); }

/* --- Button shine sweep --------------------------------------------------- */
.btn { position: relative; overflow: hidden; }
.btn > * { position: relative; z-index: 1; }
.btn::after {
  content: ''; position: absolute; top: 0; left: -130%; width: 55%; height: 100%;
  transform: skewX(-22deg); pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transition: left 0.6s ease;
}
.btn:hover::after { left: 140%; }

/* --- Chip hover lift ------------------------------------------------------ */
.chips li { transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease; }
.chips li:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); }

/* --- Floating scroll-cue in the hero ------------------------------------- */
.scroll-cue {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-dim); font-size: 0.72rem; letter-spacing: 1.5px; text-transform: uppercase;
  z-index: 1; animation: floatCue 2.2s ease-in-out infinite;
}
.scroll-cue svg { color: var(--accent); }
@keyframes floatCue { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 7px); } }
@media (max-width: 859px) { .scroll-cue { display: none; } }

/* --- Respect reduced motion: kill all of the above ----------------------- */
@media (prefers-reduced-motion: reduce) {
  .cursor-glow { display: none; }
  .hero-name .grad { animation: none; }
  .skill-card, .project-card, .report-card, .photo-frame { transition: none; transform: none !important; }
  .skill-card::after, .project-card::after, .report-card::after { display: none; }
  .section-title::after { transition: none; transform: scaleX(1); }
  .btn::after { display: none; }
  .chips li:hover { transform: none; }
  .scroll-cue { animation: none; }
}
