/* =========================================================
   Akhil A. Naik — Portfolio
   Modern stylesheet with light/dark theming via CSS vars.
   ========================================================= */

:root {
  /* Light theme (default) */
  --bg: #FAFAF7;
  --bg-elev: #FFFFFF;
  --bg-soft: #F1F1EC;
  --surface: #FFFFFF;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #0E1116;
  --text-muted: #5A6470;
  --text-subtle: #8B95A5;
  --accent: #5B47E0;
  --accent-2: #0EA5B7;
  --accent-soft: rgba(91, 71, 224, 0.10);
  --accent-gradient: linear-gradient(135deg, #5B47E0 0%, #0EA5B7 100%);
  --hero-glow-1: rgba(91, 71, 224, 0.35);
  --hero-glow-2: rgba(14, 165, 183, 0.28);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10), 0 4px 12px rgba(15, 23, 42, 0.06);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --header-bg: rgba(250, 250, 247, 0.78);
}

html[data-theme="dark"] {
  --bg: #0A0E14;
  --bg-elev: #11161E;
  --bg-soft: #141A24;
  --surface: #131922;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #E7ECF3;
  --text-muted: #98A3B3;
  --text-subtle: #6D798C;
  --accent: #8B7BFF;
  --accent-2: #3DD9EF;
  --accent-soft: rgba(139, 123, 255, 0.14);
  --accent-gradient: linear-gradient(135deg, #8B7BFF 0%, #3DD9EF 100%);
  --hero-glow-1: rgba(139, 123, 255, 0.40);
  --hero-glow-2: rgba(61, 217, 239, 0.30);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30), 0 1px 3px rgba(0, 0, 0, 0.20);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.30), 0 2px 6px rgba(0, 0, 0, 0.20);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.40), 0 6px 16px rgba(0, 0, 0, 0.20);
  --header-bg: rgba(10, 14, 20, 0.78);
}

/* ===== Reset / base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-2); }
h1, h2, h3, h4 { font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif; font-weight: 700; line-height: 1.2; color: var(--text); letter-spacing: -0.015em; margin: 0 0 0.6rem; }
h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1rem; color: var(--text-muted); }
::selection { background: var(--accent-soft); color: var(--text); }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ===== Header / Nav ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 700; font-size: 1.05rem; color: var(--text);
  display: inline-flex; align-items: center; gap: 8px;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent-gradient);
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.nav-links { display: flex; gap: 4px; align-items: center; list-style: none; padding: 0; margin: 0; }
.nav-links a {
  color: var(--text-muted); font-size: 0.92rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-soft); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer; margin-left: 8px;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}
.theme-toggle:hover { background: var(--accent-soft); transform: translateY(-1px); border-color: var(--border-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-toggle { display: none; }

/* ===== Hero ===== */
.hero {
  position: relative; padding: 96px 0 80px;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: ''; position: absolute; pointer-events: none; filter: blur(60px);
  border-radius: 50%; opacity: 0.85; z-index: 0;
}
.hero::before {
  width: 480px; height: 480px;
  top: -160px; left: -120px;
  background: radial-gradient(circle, var(--hero-glow-1) 0%, transparent 70%);
}
.hero::after {
  width: 520px; height: 520px;
  bottom: -200px; right: -160px;
  background: radial-gradient(circle, var(--hero-glow-2) 0%, transparent 70%);
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.3fr 1fr;
  gap: 56px; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--border);
  letter-spacing: 0.02em; margin-bottom: 20px;
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #10B981; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.hero h1 .grad { background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-roles {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--text-muted); font-weight: 500;
  margin-top: 4px; min-height: 1.8em;
}
.hero-roles .typed {
  background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 600;
}
.hero-roles .cursor {
  display: inline-block; width: 2px; height: 1.1em; background: var(--accent);
  vertical-align: text-bottom; margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-lede {
  margin: 22px 0 32px; font-size: 1.05rem; max-width: 56ch;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 32px; margin-top: 40px;
  padding-top: 28px; border-top: 1px solid var(--border);
}
.hero-stats .stat { display: flex; flex-direction: column; }
.hero-stats .num {
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.5rem;
  font-weight: 700; color: var(--text);
}
.hero-stats .label { font-size: 0.82rem; color: var(--text-subtle); }

.hero-portrait {
  position: relative; justify-self: center;
  width: 100%; max-width: 320px; aspect-ratio: 1;
}
.hero-portrait::before {
  content: ''; position: absolute; inset: -14px;
  background: var(--accent-gradient); border-radius: 28px;
  opacity: 0.25; filter: blur(20px); z-index: 0;
}
.hero-portrait img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 22px;
  border: 4px solid var(--bg-elev);
  box-shadow: var(--shadow-lg);
}
.hero-portrait .badge {
  position: absolute; z-index: 2;
  background: var(--bg-elev); border: 1px solid var(--border);
  padding: 10px 14px; border-radius: 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 600;
  box-shadow: var(--shadow-md);
}
.hero-portrait .badge.b1 { top: 18px; left: -22px; }
.hero-portrait .badge.b2 { bottom: 18px; right: -22px; }
.hero-portrait .badge svg { width: 16px; height: 16px; color: var(--accent); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px;
  font-size: 0.94rem; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer; transition: all 0.2s ease;
  font-family: inherit;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--accent-gradient); color: white;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { color: white; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-ghost {
  background: var(--bg-elev); color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }

/* ===== Sections ===== */
.section { padding: 88px 0; position: relative; }
.section-alt { background: var(--bg-elev); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 48px; text-align: center; }
.section-head .kicker {
  display: inline-block; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.section-head h2 .grad { background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-head .lede { color: var(--text-muted); max-width: 60ch; margin: 10px auto 0; }

/* ===== Skills ===== */
.skills-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.skill-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.skill-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.skill-card .ic {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  margin-bottom: 14px;
}
.skill-card .ic svg { width: 22px; height: 22px; }
.skill-card h3 { margin-bottom: 12px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tag-list li {
  font-size: 0.82rem; font-weight: 500; color: var(--text-muted);
  padding: 5px 10px; border-radius: 8px;
  background: var(--bg-soft); border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.tag-list li:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ===== Filters ===== */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; align-items: center;
  margin: 0 auto 36px; max-width: 920px;
}
.filter {
  font-family: inherit; cursor: pointer;
  font-size: 0.84rem; font-weight: 600;
  padding: 8px 14px; border-radius: 999px;
  background: var(--bg-elev); color: var(--text-muted);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.2s ease;
}
.filter:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.filter.active {
  background: var(--accent-gradient); color: white;
  border-color: transparent; box-shadow: var(--shadow-sm);
}
.filter .count {
  font-size: 0.72rem; font-weight: 700;
  background: var(--bg-soft); color: var(--text-subtle);
  padding: 2px 7px; border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.filter.active .count { background: rgba(255, 255, 255, 0.25); color: white; }
.filter-status {
  text-align: center; color: var(--text-subtle);
  font-size: 0.85rem; margin: -16px 0 24px;
}

/* ===== Projects (homepage cards) ===== */
.project-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.project-card.is-hidden { display: none; }
.project-card .thumb.placeholder {
  background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
}
.project-card .thumb.placeholder svg {
  width: 56px; height: 56px; color: rgba(255, 255, 255, 0.92);
}
.project-card .thumb.placeholder::after { display: none; }
.project-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  color: inherit;
}
.project-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-lg);
  border-color: var(--accent); color: inherit;
}
.project-card .thumb {
  position: relative; aspect-ratio: 16/9; overflow: hidden;
  background: var(--bg-soft);
}
.project-card .thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.project-card:hover .thumb img { transform: scale(1.05); }
.project-card .thumb::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.45) 100%);
}
.project-card .thumb .badge {
  position: absolute; bottom: 14px; left: 14px; z-index: 2;
  background: rgba(255,255,255,0.95); color: #0E1116;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 5px 10px; border-radius: 999px; text-transform: uppercase;
}
.project-card .body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-card h3 { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-card h3 .arrow {
  display: inline-flex; width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-soft); color: var(--text-muted);
  align-items: center; justify-content: center;
  transition: all 0.25s ease;
}
.project-card:hover h3 .arrow { background: var(--accent); color: white; transform: rotate(-45deg); }
.project-card .desc { color: var(--text-muted); font-size: 0.93rem; margin: 0; }
.project-card .meta {
  margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px;
}
.project-card .meta span {
  font-size: 0.74rem; font-weight: 600; color: var(--accent);
  padding: 3px 9px; border-radius: 6px;
  background: var(--accent-soft);
}

/* ===== Blogs ===== */
.blog-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.blog-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  display: flex; flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  color: inherit;
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); color: inherit; }
.blog-card .kicker {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-2);
  margin-bottom: 10px;
}
.blog-card h3 { margin-bottom: 12px; }
.blog-card p { font-size: 0.93rem; margin-bottom: 18px; }
.blog-card .read {
  margin-top: auto; font-size: 0.88rem; font-weight: 600; color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
.blog-card:hover .read { gap: 10px; }

/* ===== Education cards ===== */
.edu-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.edu-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.edu-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.edu-card .grade {
  position: absolute; top: 18px; right: 18px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  padding: 5px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.edu-card .ic { font-size: 1.6rem; margin-bottom: 6px; display: block; }
.edu-card h3 { margin-bottom: 4px; font-size: 1.05rem; }
.edu-card .uni { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* ===== Publications ===== */
.pub-list { display: grid; gap: 18px; max-width: 880px; margin: 0 auto; }
.pub-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 26px;
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.pub-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.pub-card .status {
  position: absolute; top: 18px; right: 18px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}
.pub-card .status.published {
  background: rgba(16, 185, 129, 0.12); color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.30);
}
.pub-card .status.review {
  background: rgba(245, 158, 11, 0.12); color: #D97706;
  border: 1px solid rgba(245, 158, 11, 0.30);
}
html[data-theme="dark"] .pub-card .status.review { color: #FBBF24; }
.pub-card h3 { font-size: 1.05rem; margin: 0 0 10px; padding-right: 110px; line-height: 1.4; }
.pub-card .authors { color: var(--text-muted); font-size: 0.88rem; margin: 0 0 8px; }
.pub-card .authors strong { color: var(--text); font-weight: 700; }
.pub-card .journal { color: var(--text); font-style: italic; margin: 0 0 8px; font-size: 0.92rem; }
.pub-card .doi {
  color: var(--accent); font-size: 0.85rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
}
.pub-card .doi svg { width: 14px; height: 14px; }
.pub-card .doi:hover { color: var(--accent-2); }

/* ===== Awards ===== */
.awards-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.award-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex; align-items: flex-start; gap: 16px;
}
.award-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.award-card .ic {
  font-size: 1.6rem; flex-shrink: 0;
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--accent-soft);
  display: inline-flex; align-items: center; justify-content: center;
}
.award-card h3 { font-size: 1rem; margin: 0 0 4px; line-height: 1.3; }
.award-card p { margin: 0; color: var(--text-muted); font-size: 0.88rem; }

/* ===== Timeline ===== */
.timeline {
  position: relative; padding-left: 36px; max-width: 820px; margin: 0 auto;
}
.timeline::before {
  content: ''; position: absolute; left: 12px; top: 8px; bottom: 8px;
  width: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0.35;
}
.tl-item { position: relative; padding: 0 0 36px 24px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -29px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.tl-item .when {
  display: inline-block; font-size: 0.78rem; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 8px;
}
.tl-item h3 {
  margin-bottom: 4px; font-size: 1.08rem;
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.tl-item .role-tag {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--border);
}
.tl-item .role-tag.alt {
  background: rgba(14, 165, 183, 0.12); color: var(--accent-2);
  border-color: rgba(14, 165, 183, 0.30);
}
.tl-item .when.multi { line-height: 1.5; }
.tl-item .org { color: var(--text-muted); margin: 0 0 6px; font-weight: 500; }
.tl-item .loc { color: var(--text-subtle); font-size: 0.85rem; margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-item .hint {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; color: var(--text-subtle);
  opacity: 0.65; transition: opacity 0.2s ease;
}
.tl-item .hint svg { width: 12px; height: 12px; transition: transform 0.3s ease; }
.tl-item:hover .hint, .tl-item.is-open .hint { opacity: 0; }

.tl-item .tl-desc {
  margin-top: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.65;
  background: var(--bg-elev);
  border-radius: 12px;
  border: 1px solid transparent;
  transition: max-height 0.45s ease, opacity 0.3s ease, margin-top 0.3s ease, padding 0.3s ease, border-color 0.3s ease;
  padding: 0 16px;
}
.tl-item:hover .tl-desc, .tl-item.is-open .tl-desc {
  max-height: 360px;
  opacity: 1;
  margin-top: 12px;
  padding: 14px 16px;
  border-color: var(--border);
}
.tl-item { cursor: pointer; }

/* ===== Contact ===== */
.contact-wrap {
  display: grid; gap: 36px;
  grid-template-columns: 1.1fr 1fr;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-md);
}
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.field input, .field textarea {
  font-family: inherit; font-size: 0.94rem;
  padding: 12px 14px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.contact-info { display: flex; flex-direction: column; gap: 18px; }
.contact-info h3 { font-size: 1.1rem; margin-bottom: 4px; }
.contact-info p { margin: 0; }
.contact-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
}
.contact-item .ic {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.contact-item .ic svg { width: 18px; height: 18px; }
.contact-item .label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-subtle); margin: 0 0 2px; font-weight: 600; }
.contact-item .val { color: var(--text); font-weight: 500; margin: 0; word-break: break-word; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.socials a {
  width: 42px; height: 42px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.socials a:hover { color: white; background: var(--accent-gradient); border-color: transparent; transform: translateY(-2px); }
.socials a svg { width: 18px; height: 18px; }

/* ===== Footer ===== */
.site-footer {
  padding: 32px 0; text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-subtle); font-size: 0.88rem;
}

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ===== Project category page (sub-page) styles ===== */
.subpage-hero { padding: 80px 0 40px; position: relative; overflow: hidden; }
.subpage-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 20%, var(--hero-glow-1) 0%, transparent 45%),
              radial-gradient(circle at 80% 80%, var(--hero-glow-2) 0%, transparent 50%);
  opacity: 0.5; filter: blur(40px);
}
.subpage-hero .inner { position: relative; z-index: 1; }
.crumbs { font-size: 0.85rem; color: var(--text-subtle); margin-bottom: 12px; }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--accent); }
.subpage-hero h1 { margin-bottom: 12px; }
.subpage-hero .lede { color: var(--text-muted); max-width: 64ch; font-size: 1.05rem; }

.proj-list { display: grid; gap: 22px; padding: 24px 0 88px; }
.proj-item {
  display: grid; grid-template-columns: 220px 1fr; gap: 28px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.proj-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.proj-item .thumb {
  position: relative; aspect-ratio: 4/3;
  border-radius: 10px; overflow: hidden;
  background: var(--bg-soft);
}
.proj-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.proj-item .content { display: flex; flex-direction: column; gap: 10px; }
.proj-item h3 { margin-bottom: 0; }
.proj-item .desc { color: var(--text-muted); font-size: 0.96rem; margin: 0; }
.proj-item .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.proj-item .tags span {
  font-size: 0.74rem; font-weight: 600; color: var(--accent);
  padding: 4px 10px; border-radius: 6px;
  background: var(--accent-soft);
}
.proj-item .actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }

/* ===== Project detail page ===== */
.detail-hero { padding: 72px 0 32px; }
.detail-hero h1 { margin-bottom: 14px; max-width: 18ch; }
.detail-hero .lede { color: var(--text-muted); font-size: 1.05rem; max-width: 64ch; margin: 0 0 24px; }
.detail-hero .detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.detail-banner {
  margin: 24px 0 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  aspect-ratio: 21/8;
  background: var(--bg-soft);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.detail-banner img { width: 100%; height: 100%; object-fit: cover; }
.detail-banner.placeholder {
  background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.95);
}
.detail-banner.placeholder svg { width: 72px; height: 72px; }

.detail-grid {
  display: grid; gap: 24px;
  grid-template-columns: 1fr;
  margin-bottom: 48px;
}

.detail-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  box-shadow: var(--shadow-sm);
}
.detail-card h2 {
  font-size: 1.05rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent);
  font-weight: 700; margin: 0 0 14px;
}
.detail-card h2:not(:first-child) { margin-top: 28px; }
.detail-card p { font-size: 1rem; line-height: 1.75; color: var(--text); }
.detail-card p + p { margin-top: 12px; }

.note-callout {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 20px; border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}
.note-callout .ic {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: var(--bg-elev); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.note-callout .ic svg { width: 16px; height: 16px; }
.note-callout p { margin: 0; color: var(--text); font-size: 0.95rem; }
.note-callout p strong { color: var(--accent); }

.skill-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-chips span {
  font-size: 0.84rem; font-weight: 500; color: var(--text-muted);
  padding: 6px 12px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.skill-chips span:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.pdf-frame {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  box-shadow: var(--shadow-md);
  margin-bottom: 64px;
}
.pdf-frame .pdf-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.pdf-frame .pdf-bar .left { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.pdf-frame .pdf-bar .left svg { width: 18px; height: 18px; color: var(--accent); }
.pdf-frame .pdf-bar a {
  font-size: 0.85rem; font-weight: 600; color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
.pdf-frame embed { display: block; width: 100%; height: 1024px; background: white; }

/* ===== Mobile ===== */
@media (max-width: 880px) {
  .hero { padding: 60px 0 50px; }
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-portrait { max-width: 240px; order: -1; }
  .hero-portrait .badge.b1 { left: 0; }
  .hero-portrait .badge.b2 { right: 0; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 36px; }
  .contact-wrap { grid-template-columns: 1fr; padding: 28px; }
  .contact-row { grid-template-columns: 1fr; }
  .proj-item { grid-template-columns: 1fr; }
  .proj-item .thumb { aspect-ratio: 16/9; max-height: 200px; }
  .detail-banner { aspect-ratio: 16/9; }
  .detail-card { padding: 22px; }
  .pdf-frame embed { height: 600px; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-elev); flex-direction: column; padding: 12px; border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--bg-soft); color: var(--text);
    border: 1px solid var(--border); cursor: pointer; margin-left: 4px;
  }
  .nav-toggle svg { width: 18px; height: 18px; }
}

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