/* ================================================================
   PORTFOLIO – MODERN THEME
   ================================================================ */

/* ── CSS Variables ─────────────────────────────────────────────── */
:root {
  --bg:        #0a0a0f;
  --bg-alt:    #0f0f1a;
  --surface:   #14141f;
  --surface-2: #1c1c2e;
  --border:    rgba(255,255,255,.07);
  --accent:    #22c55e;
  --accent-2:  #86efac;
  --text:      #e8e8f0;
  --text-muted:#94a3b8;
  --text-dim:  #64748b;
  --white:     #ffffff;
  --radius:    12px;
  --radius-lg: 20px;
  --shadow:    0 4px 30px rgba(0,0,0,.5);
  --transition: .3s cubic-bezier(.4,0,.2,1);
  --font:      'Inter', system-ui, sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --nav-h:     64px;
}

/* ── Reset / Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ── Canvas Background ─────────────────────────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Loader ────────────────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .5s, visibility .5s;
}
#loader.hidden { opacity: 0; visibility: hidden; }

.loader-ring {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 99px; }

/* ── Navbar ────────────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 5vw, 3rem);
  background: transparent;
  transition: background var(--transition), backdrop-filter var(--transition), box-shadow var(--transition);
}
#navbar.scrolled {
  background: rgba(10,10,15,.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--white);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-links a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--transition);
}
.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after { transform: scaleX(1); }

.btn-outline-sm {
  padding: .4rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 99px;
  color: var(--accent) !important;
  font-size: .85rem !important;
  transition: background var(--transition), color var(--transition) !important;
}
.btn-outline-sm:hover {
  background: var(--accent);
  color: var(--white) !important;
}
.btn-outline-sm::after { display: none !important; }

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-burger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Sound toggle group (keyboard + café together) ─────────────── */
.nav-sound-group {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
}

/* ── Sound toggle buttons ───────────────────────────────────────── */
.nav-sound-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  position: relative;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.nav-sound-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.nav-sound-btn.cafe-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0f;
}
/* ripple pulse on active café button only */
.nav-cafe-btn.cafe-on::after {
  content: '';
  position: absolute;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: cafe-pulse 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes cafe-pulse {
  0%   { transform: scale(1); opacity: .7; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  padding: .75rem 2rem;
  background: var(--accent);
  color: var(--white);
  border-radius: 99px;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .02em;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 0 24px rgba(34,197,94,.3);
}
.btn-primary:hover {
  background: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(34,197,94,.5);
}

.btn-ghost {
  display: inline-block;
  padding: .75rem 2rem;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 99px;
  font-weight: 500;
  font-size: .9rem;
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-outline {
  display: inline-block;
  padding: .65rem 1.6rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 99px;
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.btn-outline:hover { background: var(--accent); color: var(--white); }

/* ── Layout helpers ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 2.5rem);
}

.section {
  position: relative;
  z-index: 1;
  padding: clamp(5rem,10vw,8rem) 0;
}

.section-label {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--accent);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 3rem;
  color: var(--white);
}

.accent { color: var(--accent); }

/* ── Scroll animation base ─────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ── Hero ──────────────────────────────────────────────────────── */
#hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 0 clamp(1rem, 5vw, 3rem);
  overflow: hidden;
}

.hero-content {
  max-width: 780px;
  will-change: transform;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--accent);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: .75rem;
  opacity: 0;
  animation: fadeUp .6s .3s forwards;
}

.hero-name {
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--white);
  opacity: 0;
  animation: fadeUp .6s .45s forwards;
}

.hero-title {
  font-family: var(--mono);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--accent-2);
  min-height: 2rem;
  margin-top: 1rem;
  opacity: 0;
  animation: fadeUp .6s .6s forwards;
}

.hero-sub {
  font-size: clamp(.85rem, 1.5vw, 1rem);
  color: var(--text-muted);
  max-width: 540px;
  margin-top: .75rem;
  opacity: 0;
  animation: fadeUp .6s .75s forwards;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  opacity: 0;
  animation: fadeUp .6s .9s forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  opacity: .4;
  animation: fadeIn 1s 1.4s both;
}
.scroll-indicator span { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.scroll-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 1.8s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%,100% { transform: scaleY(1) translateY(0); opacity: .4; }
  50%      { transform: scaleY(.6) translateY(8px); opacity: 1; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: .4; } }

/* ── About ─────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 5rem;
  align-items: center;
}

.about-photo-wrap {
  position: relative;
  will-change: transform;
}

.about-photo-bg {
  position: absolute;
  inset: 12px -12px -12px 12px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: .3;
  z-index: 0;
}

.about-photo {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.about-photo-fallback {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -.02em;
}

.about-text h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 1.25rem;
}
.about-text p { color: var(--text-muted); font-size: 1rem; line-height: 1.8; margin-bottom: 1.5rem; }

.about-stats {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.stat { text-align: left; }
.stat-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { font-size: .78rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .1em; margin-top: .25rem; }

/* ── Skills ────────────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.skill-card:hover {
  border-color: var(--accent);
}

.skill-card-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.skill-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(34,197,94,.2), rgba(134,239,172,.2));
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.skill-icon svg {
  width: 20px; height: 20px;
  stroke: var(--accent);
}
.skill-category { font-weight: 600; color: var(--white); font-size: .95rem; }

.skill-list { display: flex; flex-direction: column; gap: .55rem; }

.skill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.skill-name { font-size: .85rem; color: var(--text-muted); }

/* Level badge */
.skill-level {
  font-size: .7rem;
  font-family: var(--mono);
  font-weight: 500;
  padding: .2rem .65rem;
  border-radius: 99px;
  white-space: nowrap;
  letter-spacing: .04em;
  border: 1px solid transparent;
}
.skill-level--basic {
  background: rgba(100,116,139,.15);
  color: #94a3b8;
  border-color: rgba(100,116,139,.25);
}
.skill-level--intermediate {
  background: rgba(134,239,172,.12);
  color: var(--accent-2);
  border-color: rgba(134,239,172,.3);
}
.skill-level--advanced {
  background: rgba(34,197,94,.15);
  color: #a5b4fc;
  border-color: rgba(34,197,94,.4);
  box-shadow: 0 0 8px rgba(34,197,94,.15);
}

/* ── GitHub Stats ───────────────────────────────────────────────── */
.gh-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.gh-cal-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .82rem;
  font-family: var(--mono);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: .35rem .9rem;
  border-radius: 99px;
  transition: color var(--transition), border-color var(--transition);
}
.gh-cal-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.gh-cal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Stats row: two cards side by side */
.gh-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.gh-stats-card {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
}

/* Contribution heatmap chart (inline SVG injected by JS) */
.gh-contrib-loading {
  display: block;
  text-align: center;
  padding: 2rem 0;
  color: var(--text-dim);
  font-size: .85rem;
  font-family: var(--mono);
}

/* <img> contribution chart */
.gh-contrib-img {
  display: block;
  width: 100%;
  height: auto;
}

/* ── GitHub profile quick stats ────────────────────────────────── */
.gh-profile-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.gh-stat-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: border-color var(--transition);
}
.gh-stat-item:hover { border-color: var(--accent); }
.gh-stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--accent-2);
  line-height: 1;
  margin-bottom: .4rem;
}
.gh-stat-label {
  font-size: .75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── GitHub contrib chart wrap ─────────────────────────────────── */
.gh-contrib-wrap {
  width: 100%;
  margin-bottom: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  overflow: hidden;
  box-sizing: border-box;
}

/* ── Most Used Languages ────────────────────────────────────────── */
.gh-lang-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
}

/* stacked bar at the top */
.lang-bar {
  display: flex;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  gap: 2px;
  margin-bottom: 1.25rem;
}
.lang-bar-seg {
  border-radius: 99px;
  transition: opacity var(--transition);
}
.lang-bar-seg:hover { opacity: .75; }

/* legend rows */
.lang-legend {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.lang-row {
  display: grid;
  grid-template-columns: 10px 110px 1fr 46px 64px;
  align-items: center;
  gap: .6rem;
}
.lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lang-name {
  font-size: .82rem;
  font-family: var(--mono);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lang-track {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.lang-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .8s ease;
}
.lang-pct {
  font-size: .78rem;
  font-family: var(--mono);
  color: var(--white);
  text-align: right;
}
.lang-count {
  font-size: .72rem;
  font-family: var(--mono);
  color: var(--text-dim);
  text-align: right;
}

/* ── GitHub repos header ────────────────────────────────────────── */
.gh-repos-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.gh-repos-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
}
.gh-repos-sort {
  font-size: .78rem;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* ── Repo cards grid ────────────────────────────────────────────── */
.gh-repos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.gh-repos-loading {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: .85rem;
  padding: 2rem 0;
  grid-column: 1 / -1;
}
.repo-card {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.repo-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(34,197,94,.15);
}
.repo-top {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.repo-icon { color: var(--text-dim); flex-shrink: 0; }
.repo-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--accent-2);
  font-family: var(--mono);
  word-break: break-all;
}
.repo-desc {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.repo-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: auto;
}
.repo-lang {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  color: var(--text-dim);
  font-family: var(--mono);
}
.repo-lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.repo-updated, .repo-stars {
  font-size: .72rem;
  color: var(--text-dim);
  font-family: var(--mono);
}
.repo-stars { color: var(--accent-2); }

/* ── Filter Bar ────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.filter-btn {
  padding: .4rem 1.1rem;
  border-radius: 99px;
  font-size: .82rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

/* ── Projects Grid ─────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 48px rgba(34,197,94,.2);
}
.project-card[data-visible="false"] { display: none; }

.project-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--surface-2);
}
.project-thumb-fallback {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

/* ── Project card iframe preview ───────────────────────────────── */
.proj-preview {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-shrink: 0;
}
.proj-screenshot {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform .4s ease;
}
.project-card:hover .proj-screenshot {
  transform: scale(1.04);
}
/* Fallback icon shown beneath while screenshot loads */
.proj-preview-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  color: var(--accent);
  opacity: .25;
}
.proj-preview-icon svg {
  width: 48px; height: 48px;
  stroke: var(--accent);
}
/* If screenshot errors, show icon fallback */
.proj-preview--error .proj-screenshot { display: none !important; }
.proj-preview--error .proj-preview-icon { z-index: 1; opacity: .5; }
/* Private badge shown instead of thumbnail */
.proj-private-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  color: var(--text-muted);
}
.proj-private-badge svg {
  opacity: .5;
}
.proj-private-badge span {
  font-size: .75rem;
  font-family: var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .6;
}

/* ── Modal iframe preview ──────────────────────────────────────── */
.modal-iframe-wrap {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface-2);
  margin-bottom: 0;
  flex-shrink: 0;
}
.modal-screenshot {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.modal-ss--error .modal-screenshot { display: none; }
.modal-preview-fallback {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  color: var(--text-muted);
}
.modal-preview-fallback svg { opacity: .4; }
.modal-preview-icon svg {
  width: 64px; height: 64px;
  stroke: var(--accent);
  opacity: .45;
}
.modal-preview-fallback p {
  font-size: .85rem;
  font-family: var(--mono);
  letter-spacing: .08em;
  opacity: .5;
}

.project-body { padding: 1.4rem; flex: 1; display: flex; flex-direction: column; }
.project-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.tag {
  font-size: .7rem;
  font-family: var(--mono);
  padding: .2rem .55rem;
  background: rgba(34,197,94,.15);
  color: var(--accent-2);
  border-radius: 4px;
  border: 1px solid rgba(34,197,94,.2);
}
.project-title { font-size: 1.05rem; font-weight: 700; color: var(--white); margin-bottom: .5rem; }
.project-desc { font-size: .88rem; color: var(--text-muted); line-height: 1.65; flex: 1; }
.project-arrow {
  margin-top: 1.25rem;
  color: var(--accent);
  font-size: .85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: gap var(--transition);
}
.project-card:hover .project-arrow { gap: .6rem; }

/* ── Timeline ──────────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: 3rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-2rem - 5px);
  top: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.timeline-date {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--accent);
  letter-spacing: .1em;
  margin-bottom: .5rem;
}
.timeline-role { font-size: 1.1rem; font-weight: 700; color: var(--white); margin-bottom: .25rem; }
.timeline-company {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.timeline-company .badge {
  font-size: .7rem;
  padding: .15rem .5rem;
  background: rgba(34,197,94,.15);
  border: 1px solid rgba(34,197,94,.25);
  border-radius: 4px;
  color: var(--accent-2);
}
.timeline-desc { font-size: .88rem; color: var(--text-dim); line-height: 1.75; max-width: 680px; }

/* ── Contact ───────────────────────────────────────────────────── */
.contact-inner { text-align: center; max-width: 700px; }
.contact-heading {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-bottom: 1rem;
}
.contact-sub { color: var(--text-muted); margin-bottom: 2.5rem; }

/* Facebook CTA button */
.contact-fb-btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: 1rem;
  padding: .85rem 2rem;
  margin-bottom: 3rem;
  background: #1877f2;
  border-color: #1877f2;
}
.contact-fb-btn:hover {
  background: #0d6efd;
  border-color: #0d6efd;
  box-shadow: 0 8px 24px rgba(24,119,242,.35);
}

.social-links {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
}
.social-links a {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}
.social-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
}
.social-links svg { width: 18px; height: 18px; fill: currentColor; }

/* ── Footer ────────────────────────────────────────────────────── */
footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 2rem;
  font-size: .8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90svh;
  overflow-y: auto;
  position: relative;
  animation: modalIn .3s cubic-bezier(.4,0,.2,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(20px); }
  to   { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  background: var(--surface-2);
  border-radius: 50%;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--white); }

.modal-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
#modalPreview {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
}
#modalPreview .modal-iframe-wrap {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-bottom: 0;
}
.modal-body { padding: 1.75rem; }
.modal-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .85rem; }
.modal-body h3 { font-size: 1.4rem; font-weight: 700; color: var(--white); margin-bottom: .75rem; }
.modal-body p { color: var(--text-muted); font-size: .9rem; line-height: 1.75; margin-bottom: 1.5rem; }
.modal-links { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Nav */
  .nav-links {
    display: none;
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    background: rgba(10,10,15,.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1.3rem; }
  .nav-burger { display: flex; }
  /* Sound group sits left of burger – push both to right */
  #navbar { gap: .5rem; }
  .nav-sound-group { margin-left: auto; }

  /* About */
  .about-grid { grid-template-columns: 1fr; gap: 3rem; }
  .about-photo-wrap { max-width: 260px; margin: 0 auto; }

  /* Layout */
  .form-row { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }

  /* GitHub Activity */
  .gh-cal-header { flex-direction: column; align-items: flex-start; }
  .gh-profile-stats { grid-template-columns: repeat(3, 1fr); }
  .gh-repos-grid { grid-template-columns: 1fr; }
  .gh-contrib-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .gh-contrib-wrap img { min-width: 720px; }

  /* Modal – full screen on mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    max-height: 92svh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  #modalPreview .modal-iframe-wrap {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  /* Social links – allow wrap & smaller */
  .social-links { flex-wrap: wrap; gap: .75rem; }
  .social-links a { width: 40px; height: 40px; }

  /* Contact section */
  .contact-inner { text-align: center; }
  .contact-heading { font-size: clamp(1.8rem, 6vw, 2.4rem); }
}

@media (max-width: 600px) {
  .skills-grid { grid-template-columns: 1fr; }
  .gh-profile-stats { grid-template-columns: repeat(2, 1fr); }
  .lang-row { grid-template-columns: 10px 90px 1fr 40px; }
  .lang-count { display: none; }

  /* Project cards */
  .proj-preview { height: 160px; }
  .filter-bar { gap: .35rem; }
  .filter-btn { padding: .35rem .85rem; font-size: .78rem; }
}

@media (max-width: 480px) {
  /* Hero */
  .hero-name { font-size: clamp(2.2rem, 10vw, 3rem); }
  .hero-sub { font-size: .82rem; }
  .hero-cta { flex-direction: column; align-items: flex-start; }
  .btn-primary, .btn-ghost { text-align: center; width: 100%; }

  /* About stats */
  .about-stats { gap: 1.25rem; }
  .about-stat-num { font-size: 1.8rem; }

  /* GitHub stats 2-col */
  .gh-profile-stats { grid-template-columns: repeat(2, 1fr); }
  .gh-stat-num { font-size: 1.5rem; }

  /* Modal body padding */
  .modal-body { padding: 1.25rem; }
  .modal-body h3 { font-size: 1.2rem; }

  /* Navbar sound btns – smaller */
  .nav-sound-btn { width: 30px; height: 30px; }
  .nav-cafe-btn.cafe-on::after { width: 30px; height: 30px; }

  /* Timeline */
  .timeline-entry { padding-left: 1.25rem; }
  .timeline-dot { left: -5px; }
}

/* ── Selection ─────────────────────────────────────────────────── */
::selection { background: rgba(34,197,94,.35); color: var(--white); }

/* ================================================================
   PARALLAX SYSTEM
   ================================================================ */

/* ── Scroll-parallax layers ───────────────────────────────────── */
[data-parallax-speed] {
  will-change: transform;
}

/* ── Tilt card (3-D perspective wrapper) ──────────────────────── */
[data-parallax-tilt] {
  will-change: transform;
  transform-style: preserve-3d;
}
[data-parallax-tilt]:hover {
  box-shadow: 0 24px 64px rgba(0,0,0,.55), 0 0 0 1px rgba(34,197,94,.2);
}

/* Glare overlay injected by JS */
.parallax-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .45s ease;
  z-index: 10;
  mix-blend-mode: overlay;
}

/* ── Floating idle animation ──────────────────────────────────── */
@keyframes parallax-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%       { transform: translateY(calc(var(--float-amp, 12px) * -1)) rotate(1deg); }
  66%       { transform: translateY(calc(var(--float-amp, 12px) * .5)) rotate(-0.5deg); }
}

.parallax-floating {
  animation: parallax-float var(--float-dur, 4s) ease-in-out var(--float-delay, 0s) infinite;
  will-change: transform;
}

/* ── Magnetic elements ────────────────────────────────────────── */
[data-parallax-magnetic] {
  will-change: transform;
  transition: transform .05s linear; /* smoothed in JS; CSS transition for snap-back */
}
[data-parallax-magnetic]:hover { cursor: pointer; }

/* ── Section depth entrance ───────────────────────────────────── */
/* Initial hidden state is set by JS (parallax.js) — not CSS.
   This keeps sections visible if JS hasn't run yet (no-JS fallback). */
.section.parallax-section-hidden {
  opacity: 0;
  transform: translateY(40px);
}
.section.parallax-section-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .9s cubic-bezier(.22,1,.36,1),
              transform .9s cubic-bezier(.22,1,.36,1);
}

/* ── Hero decorative orbs ─────────────────────────────────────── */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
  z-index: 0;
}
.hero-orb--1 {
  width: clamp(300px, 45vw, 600px);
  height: clamp(300px, 45vw, 600px);
  top: -15%;
  right: -10%;
  background: radial-gradient(circle, rgba(34,197,94,.12) 0%, transparent 70%);
  filter: blur(60px);
}
.hero-orb--2 {
  width: clamp(200px, 30vw, 420px);
  height: clamp(200px, 30vw, 420px);
  bottom: 10%;
  left: -5%;
  background: radial-gradient(circle, rgba(134,239,172,.07) 0%, transparent 65%);
  filter: blur(80px);
}
.hero-orb--3 {
  width: 6px; height: 6px;
  top: 28%;
  right: 22%;
  background: var(--accent);
  box-shadow: 0 0 16px 4px rgba(34,197,94,.6),
              0 0 40px 8px rgba(34,197,94,.25);
}

/* ── Follow cursor elements ───────────────────────────────────── */
[data-parallax-follow] {
  will-change: transform;
  pointer-events: none;
}

/* ── Reveal animation enhancements ───────────────────────────── */
/* Stagger cards inside sections that are already in view */
.parallax-section-in .reveal {
  transition-delay: var(--reveal-delay, 0ms);
}

/* ── prefers-reduced-motion: strip all parallax ──────────────── */
@media (prefers-reduced-motion: reduce) {
  [data-parallax-speed],
  [data-parallax-tilt],
  [data-parallax-float],
  [data-parallax-magnetic],
  [data-parallax-follow] {
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  .parallax-floating { animation: none !important; }
  .section.parallax-section-hidden,
  .section.parallax-section-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

