/* ============================================================
   PRANEET GOGOI — Portfolio Stylesheet
   ============================================================ */

/* ── DESIGN TOKENS ── */
:root {
  --bg:      #040608;
  --bg2:     #080c12;
  --surface: #0d1420;
  --border:  #1a2535;
  --accent:  #00f5d4;
  --accent2: #7b61ff;
  --accent3: #ff6b6b;
  --text:    #e8edf5;
  --muted:   #5a6a80;
  --glow:    0 0 30px rgba(0,245,212,0.2);
}

/* ── PRELOADER ── */
#preloader {
  position: fixed; inset: 0; z-index: 99999;
  background: #040608;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
#preloader.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
body.loading { overflow: hidden; }

.preloader-logo {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}

/* Spinning rings */
.preloader-ring {
  position: absolute; width: 140px; height: 140px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: var(--accent);
  border-right-color: rgba(0,245,212,0.15);
  animation: plRingSpin 1s linear infinite;
}
.preloader-ring-2 {
  position: absolute; width: 116px; height: 116px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-bottom-color: var(--accent2);
  border-left-color: rgba(123,97,255,0.15);
  animation: plRingSpin 1.5s linear infinite reverse;
}
@keyframes plRingSpin { to { transform: rotate(360deg); } }

/* SVG monogram */
.preloader-svg { width: 80px; height: 80px; position: relative; z-index: 2; }

.pl-letter {
  fill: none; stroke: var(--accent); stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 400; stroke-dashoffset: 400;
  animation: plDraw 1.1s cubic-bezier(.4,0,.2,1) forwards;
}
.pl-letter-2 {
  fill: none; stroke: var(--accent2); stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 400; stroke-dashoffset: 400;
  animation: plDraw 1.1s 0.25s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes plDraw { to { stroke-dashoffset: 0; } }

/* Glow fill after draw */
.pl-letter-fill {
  fill: rgba(0,245,212,0.06);
  opacity: 0;
  animation: plFill 0.4s 1s ease forwards;
}
.pl-letter-fill-2 {
  fill: rgba(123,97,255,0.06);
  opacity: 0;
  animation: plFill 0.4s 1.25s ease forwards;
}
@keyframes plFill { to { opacity: 1; } }

/* Pulse dot */
.preloader-dot {
  position: absolute; bottom: -18px; left: 50%;
  transform: translateX(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: plDot 0.9s ease-in-out infinite alternate;
}
@keyframes plDot {
  from { transform: translateX(-50%) scale(1);   opacity: 1; }
  to   { transform: translateX(-50%) scale(2.2); opacity: 0.3; }
}

/* Counter */
.preloader-counter {
  margin-top: 52px;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem; letter-spacing: 4px; color: var(--muted);
}
.preloader-counter span { color: var(--accent); font-weight: 700; }

/* Tagline */
.preloader-tagline {
  margin-top: 10px;
  font-family: 'Syne', sans-serif;
  font-size: 0.68rem; letter-spacing: 4px;
  color: var(--border); text-transform: uppercase;
  opacity: 0; animation: plFadeIn 0.6s 0.7s forwards;
}
@keyframes plFadeIn { to { opacity: 1; } }

/* Bottom progress bar */
.preloader-bar-wrap {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--border);
}
.preloader-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0%; transition: width 0.08s linear;
  box-shadow: 0 0 14px rgba(0,245,212,0.6);
}

/* Corner brackets decorating the preloader */
.preloader-bracket {
  position: absolute; width: 24px; height: 24px;
  border-color: rgba(0,245,212,0.2); border-style: solid;
}
.preloader-bracket.tl { top: 32px; left: 32px; border-width: 1px 0 0 1px; }
.preloader-bracket.tr { top: 32px; right: 32px; border-width: 1px 1px 0 0; }
.preloader-bracket.bl { bottom: 32px; left: 32px; border-width: 0 0 1px 1px; }
.preloader-bracket.br { bottom: 32px; right: 32px; border-width: 0 1px 1px 0; }

/* ── RESET & BASE ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Mono', monospace;
  overflow-x: hidden;
  cursor: none;
}

/* ── CUSTOM CURSOR ── */
.cursor {
  position: fixed; width: 12px; height: 12px;
  background: var(--accent); border-radius: 50%;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%,-50%);
  transition: transform 0.1s, width 0.2s, height 0.2s;
  mix-blend-mode: difference;
}
.cursor-ring {
  position: fixed; width: 40px; height: 40px;
  border: 1px solid var(--accent); border-radius: 50%;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%,-50%);
  transition: transform 0.15s ease, width 0.3s, height 0.3s, opacity 0.3s;
  opacity: 0.5;
}
body:hover .cursor-ring { opacity: 1; }

/* ── NOISE OVERLAY ── */
body::before {
  content: ''; position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 1; opacity: 0.4;
}

/* ── GRID BACKGROUND ── */
.grid-bg {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(0,245,212,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,245,212,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 60px;
  background: rgba(4,6,8,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.2rem;
  color: var(--accent); letter-spacing: 2px;
}
.nav-links { display: flex; gap: 40px; list-style: none; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 0.75rem;
  letter-spacing: 2px; text-transform: uppercase;
  transition: color 0.3s; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 1px; background: var(--accent); transition: width 0.3s;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--accent); }

/* ── SECTIONS ── */
section { position: relative; z-index: 2; }

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 120px 60px 60px;
  overflow: hidden;
}
.hero-inner { max-width: 1100px; width: 100%; position: relative; }

.hero-tag {
  font-size: 0.7rem; letter-spacing: 4px; color: var(--accent);
  text-transform: uppercase; margin-bottom: 20px;
  opacity: 0; animation: fadeUp 0.8s 0.2s forwards;
}
.hero-name {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: clamp(3rem, 7vw, 6rem); line-height: 0.95;
  letter-spacing: -2px; margin-bottom: 24px;
  opacity: 0; animation: fadeUp 0.8s 0.4s forwards;
}
.hero-name span { color: var(--accent); }
.hero-desc {
  font-size: 0.85rem; color: var(--muted); max-width: 480px;
  line-height: 1.8; margin-bottom: 40px;
  opacity: 0; animation: fadeUp 0.8s 0.6s forwards;
}
.hero-btns {
  display: flex; gap: 16px; flex-wrap: wrap;
  opacity: 0; animation: fadeUp 0.8s 0.8s forwards;
}
.btn {
  padding: 12px 28px; font-family: 'Space Mono', monospace;
  font-size: 0.75rem; letter-spacing: 2px; text-transform: uppercase;
  text-decoration: none; border-radius: 2px;
  transition: all 0.3s; cursor: none;
}
.btn-primary {
  background: var(--accent); color: var(--bg);
  border: 1px solid var(--accent);
}
.btn-primary:hover { background: transparent; color: var(--accent); box-shadow: var(--glow); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-stats {
  display: flex; gap: 48px; margin-top: 60px;
  opacity: 0; animation: fadeUp 0.8s 1s forwards;
}
.stat-num {
  font-family: 'Syne', sans-serif; font-size: 2.4rem; font-weight: 800;
  color: var(--accent); line-height: 1;
}
.stat-label {
  font-size: 0.65rem; color: var(--muted);
  letter-spacing: 2px; text-transform: uppercase; margin-top: 4px;
}

/* ── TERMINAL ── */
.character-container {
  position: absolute; right: -20px; top: 50%; transform: translateY(-50%);
  width: 420px;
}
.terminal-window {
  background: #0a0e16;
  border: 1px solid #1a2535;
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0,245,212,0.08),
    0 30px 80px rgba(0,0,0,0.6),
    0 0 60px rgba(0,245,212,0.06);
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  animation: termFloat 5s ease-in-out infinite;
}
@keyframes termFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-12px); }
}
.terminal-titlebar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: #0d1420;
  border-bottom: 1px solid #1a2535;
}
.terminal-dots { display: flex; gap: 6px; }
.tdot { width: 12px; height: 12px; border-radius: 50%; }
.tdot-red    { background: #ff5f57; }
.tdot-yellow { background: #febc2e; }
.tdot-green  { background: #28c840; }
.terminal-title {
  font-size: 0.65rem; color: #5a6a80; letter-spacing: 1px;
  flex: 1; text-align: center;
}
.terminal-body {
  padding: 16px 18px;
  min-height: 320px; max-height: 370px;
  overflow: hidden; line-height: 1.7;
  position: relative;
}
.terminal-prompt-line {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.t-prompt { color: #28c840; font-size: 0.68rem; white-space: nowrap; }
.t-cmd    { color: #e8edf5; }
.t-cursor {
  color: #00f5d4;
  animation: blink 1s step-end infinite;
  font-size: 0.8rem;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.t-line { margin: 1px 0; white-space: pre; }

/* Syntax highlighting */
.t-kw   { color: #7b61ff; }
.t-fn   { color: #00f5d4; }
.t-str  { color: #ffd700; }
.t-num  { color: #ff9e64; }
.t-cmt  { color: #3d5166; font-style: italic; }
.t-out  { color: #28c840; }
.t-err  { color: #ff6b6b; }
.t-cls  { color: #ff9e64; }
.t-punc { color: #5a6a80; }
.t-var  { color: #e8edf5; }
.t-op   { color: #7b61ff; }

/* ── MARQUEE ── */
.marquee-section {
  overflow: hidden; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0; background: var(--surface);
}
.marquee-track {
  display: flex; white-space: nowrap;
  animation: marquee 20s linear infinite;
}
.marquee-item {
  display: inline-flex; align-items: center; gap: 24px;
  font-size: 0.7rem; letter-spacing: 3px; text-transform: uppercase;
  color: var(--muted); padding: 0 40px;
}
.marquee-dot { color: var(--accent); font-size: 1rem; }
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── SECTION SHARED ── */
.section-label {
  font-size: 0.65rem; letter-spacing: 4px; color: var(--accent);
  text-transform: uppercase; margin-bottom: 16px;
}
.section-title {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.1; margin-bottom: 48px;
}

/* ── ABOUT ── */
#about { padding: 120px 60px; max-width: 1100px; margin: 0 auto; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.about-text p { color: var(--muted); line-height: 1.9; font-size: 0.85rem; margin-bottom: 16px; }
.about-char { display: flex; align-items: center; justify-content: center; position: relative; }
.about-char-svg {
  width: 280px; height: 280px;
  animation: float2 5s ease-in-out infinite;
  filter: drop-shadow(0 0 40px rgba(123,97,255,0.4));
}
@keyframes float2 {
  0%,100% { transform: translateY(0) rotate(-2deg); }
  50%     { transform: translateY(-15px) rotate(2deg); }
}
.orbit-ring {
  position: absolute; width: 320px; height: 320px;
  border: 1px dashed rgba(123,97,255,0.3); border-radius: 50%;
  animation: spin 20s linear infinite;
}
.orbit-ring::before {
  content: '◆'; position: absolute; top: -8px; left: 50%;
  transform: translateX(-50%); color: var(--accent2); font-size: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Progress bars */
.skill-bars { margin-top: 32px; }
.bar-item   { margin-bottom: 20px; }
.bar-label  {
  display: flex; justify-content: space-between;
  font-size: 0.7rem; margin-bottom: 8px; letter-spacing: 1px;
}
.bar-label span:last-child { color: var(--accent); }
.bar-track  { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.bar-fill   {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0; border-radius: 2px; transition: width 1.5s ease;
}

/* ── SKILLS ── */
#skills { padding: 120px 60px; background: var(--bg2); }
.skills-inner { max-width: 1100px; margin: 0 auto; }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px; margin-top: 48px;
}
.skill-card {
  background: var(--surface); border: 1px solid var(--border);
  padding: 28px; border-radius: 4px;
  transition: all 0.4s; position: relative; overflow: hidden;
}
.skill-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform: scaleX(0); transform-origin: left; transition: transform 0.4s;
}
.skill-card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: var(--glow); }
.skill-card:hover::before { transform: scaleX(1); }
.skill-cat { font-size: 0.65rem; letter-spacing: 3px; color: var(--accent); text-transform: uppercase; margin-bottom: 16px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.65rem; padding: 4px 10px; letter-spacing: 1px;
  border: 1px solid var(--border); color: var(--muted); border-radius: 2px;
  transition: all 0.2s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }

/* ── EXPERIENCE ── */
#experience { padding: 120px 60px; max-width: 1100px; margin: 0 auto; }
.timeline { position: relative; margin-top: 48px; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--accent2), transparent);
}
.timeline-item {
  padding: 0 0 64px 48px; position: relative;
  opacity: 0; transform: translateX(-20px); transition: all 0.6s;
}
.timeline-item.visible { opacity: 1; transform: translateX(0); }
.timeline-dot {
  position: absolute; left: -6px; top: 4px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent); transition: all 0.3s;
}
.timeline-item:hover .timeline-dot { background: var(--accent); box-shadow: var(--glow); }
.timeline-date  { font-size: 0.65rem; color: var(--accent); letter-spacing: 2px; margin-bottom: 8px; }
.timeline-role  { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.2rem; margin-bottom: 4px; }
.timeline-company { font-size: 0.75rem; color: var(--muted); margin-bottom: 16px; }
.timeline-list  { list-style: none; }
.timeline-list li {
  font-size: 0.8rem; color: var(--muted);
  padding: 6px 0 6px 16px; position: relative; line-height: 1.7;
}
.timeline-list li::before { content: '›'; position: absolute; left: 0; color: var(--accent); }

/* ── PROJECTS ── */
#projects { padding: 120px 60px; background: var(--bg2); }
.projects-inner { max-width: 1100px; margin: 0 auto; }
.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 48px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border);
  padding: 40px; border-radius: 4px; position: relative; overflow: hidden;
  transition: all 0.4s; opacity: 0; transform: translateY(30px);
}
.project-card.visible { opacity: 1; transform: translateY(0); }
.project-card::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(0,245,212,0.05) 0%, transparent 70%);
  opacity: 0; transition: opacity 0.4s;
}
.project-card:hover { transform: translateY(-8px); border-color: var(--accent); }
.project-card:hover::after { opacity: 1; }
.project-num {
  font-family: 'Syne', sans-serif; font-size: 3rem; font-weight: 800;
  color: var(--border); position: absolute; top: 24px; right: 28px; transition: color 0.4s;
}
.project-card:hover .project-num { color: rgba(0,245,212,0.15); }
.project-icon  { margin-bottom: 24px; font-size: 2rem; }
.project-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.3rem; margin-bottom: 12px; }
.project-desc  { font-size: 0.78rem; color: var(--muted); line-height: 1.8; margin-bottom: 24px; }
.project-tech  { display: flex; flex-wrap: wrap; gap: 8px; }
.tech-tag {
  font-size: 0.6rem; padding: 3px 8px;
  background: rgba(0,245,212,0.08); color: var(--accent);
  border: 1px solid rgba(0,245,212,0.2); border-radius: 2px; letter-spacing: 1px;
}

/* ── PUBLICATIONS ── */
#publications { padding: 120px 60px; max-width: 1200px; margin: 0 auto; }
.pub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-top: 48px;
}
.pub-card {
  background: var(--surface); border: 1px solid var(--border);
  padding: 32px; border-radius: 4px; position: relative; overflow: hidden;
  transition: all 0.4s; opacity: 0; transform: translateY(30px);
  display: flex; flex-direction: column;
}
.pub-card.visible { opacity: 1; transform: translateY(0); }
.pub-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.pub-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform: scaleX(0); transform-origin: left; transition: transform 0.4s;
}
.pub-card:hover::before { transform: scaleX(1); }

.pub-badge {
  display: inline-block; font-size: 0.58rem; letter-spacing: 2px;
  text-transform: uppercase; padding: 3px 8px;
  border: 1px solid; border-radius: 2px; margin-right: 10px;
  font-family: 'Space Mono', monospace;
}
.pub-badge.cyan        { color: var(--accent);  border-color: rgba(0,245,212,0.3);  background: rgba(0,245,212,0.06); }
.pub-badge.purple      { color: var(--accent2); border-color: rgba(123,97,255,0.3); background: rgba(123,97,255,0.06); }
.pub-badge.devto       { color: #ffffff;        border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.06); }
.pub-badge.medium-orange { color: #ffa500;      border-color: rgba(255,165,0,0.3);  background: rgba(255,165,0,0.06); }

.pub-date  { font-size: 0.62rem; color: var(--muted); }
.pub-meta  { display: flex; align-items: center; margin-bottom: 14px; }
.pub-title {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 1rem; line-height: 1.35; margin-bottom: 10px;
}
.pub-desc  {
  font-size: 0.75rem; color: var(--muted); line-height: 1.75;
  margin-bottom: 16px; flex: 1;
}
.pub-tags  { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.pub-tag   {
  font-size: 0.58rem; padding: 2px 7px; letter-spacing: 0.5px;
  border: 1px solid var(--border); color: var(--muted); border-radius: 2px;
}
.pub-link  {
  font-size: 0.65rem; letter-spacing: 2px; text-decoration: none;
  border-bottom: 1px solid; padding-bottom: 2px;
  transition: opacity 0.3s; margin-top: auto;
}
.pub-link:hover { opacity: 0.65; }
.devto-link    { color: #ffffff; border-color: rgba(255,255,255,0.25); }
.medium-link   { color: #ffa500; border-color: rgba(255,165,0,0.3); }

@media (max-width: 1024px) {
  .pub-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .pub-grid { grid-template-columns: 1fr; }
}

/* ── EDUCATION ── */
#education { padding: 120px 60px; max-width: 1100px; margin: 0 auto; }
.edu-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px; margin-top: 48px;
}
.edu-card {
  background: var(--surface); border: 1px solid var(--border);
  padding: 32px; border-radius: 4px;
  transition: all 0.4s; opacity: 0; transform: translateY(20px);
}
.edu-card.visible { opacity: 1; transform: translateY(0); }
.edu-card:hover { border-color: var(--accent2); transform: translateY(-6px); }
.edu-year   { font-size: 0.65rem; color: var(--accent); letter-spacing: 2px; margin-bottom: 12px; }
.edu-degree { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
.edu-inst   { font-size: 0.75rem; color: var(--muted); }
.edu-grade  {
  display: inline-block; margin-top: 16px; font-size: 0.65rem;
  padding: 4px 12px; background: rgba(0,245,212,0.08);
  color: var(--accent); border: 1px solid rgba(0,245,212,0.2);
}

/* ── CERTIFICATIONS ── */
#certs { padding: 0 60px 120px; max-width: 1100px; margin: 0 auto; }
.certs-grid { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 48px; }
.cert-card {
  flex: 1; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 28px; border-radius: 4px;
  display: flex; align-items: center; gap: 16px;
  transition: all 0.3s; opacity: 0; transform: scale(0.95);
}
.cert-card.visible { opacity: 1; transform: scale(1); }
.cert-card:hover { border-color: var(--accent2); transform: translateY(-4px); box-shadow: 0 0 30px rgba(123,97,255,0.15); }
.cert-icon   { font-size: 1.8rem; }
.cert-name   { font-size: 0.78rem; font-weight: 700; margin-bottom: 4px; }
.cert-issuer { font-size: 0.65rem; color: var(--muted); letter-spacing: 1px; }

/* ── CONTACT ── */
#contact {
  padding: 120px 60px; background: var(--bg2);
  text-align: center; position: relative; overflow: hidden;
}
.contact-inner   { max-width: 700px; margin: 0 auto; position: relative; z-index: 2; }
.contact-bg-char {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 500px; height: 500px; opacity: 0.04; pointer-events: none;
}
.contact-title {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 5rem); margin-bottom: 20px; line-height: 1;
}
.contact-desc   { color: var(--muted); font-size: 0.85rem; margin-bottom: 48px; line-height: 1.8; }
.contact-links  { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.contact-link {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 24px; border: 1px solid var(--border);
  color: var(--text); text-decoration: none; border-radius: 2px;
  font-size: 0.72rem; letter-spacing: 1px; transition: all 0.3s;
}
.contact-link:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--glow); }
.contact-link svg { width: 16px; height: 16px; }

/* ── SEND MESSAGE FORM ── */
#message { padding: 0 60px 120px; max-width: 800px; margin: 0 auto; position: relative; z-index: 2; }
.msg-form-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 48px; position: relative; overflow: hidden;
}
.msg-form-wrap::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
}
.msg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.msg-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.msg-row .msg-field { margin-bottom: 0; }
.msg-label { font-size: 0.65rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-family: 'Space Mono', monospace; }
.msg-input, .msg-textarea {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-family: 'Space Mono', monospace;
  font-size: 0.8rem; padding: 14px 16px; border-radius: 3px;
  outline: none; transition: border-color 0.3s, box-shadow 0.3s; width: 100%;
}
.msg-input:focus, .msg-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,245,212,0.08);
}
.msg-textarea { resize: vertical; min-height: 130px; line-height: 1.7; }
.msg-input::placeholder, .msg-textarea::placeholder { color: var(--muted); opacity: 0.6; }
.msg-honey { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
.msg-submit {
  width: 100%; padding: 16px; border: none; border-radius: 3px; cursor: pointer;
  font-family: 'Space Mono', monospace; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #040608; position: relative; overflow: hidden;
  transition: opacity 0.3s, transform 0.2s, box-shadow 0.3s;
}
.msg-submit:hover:not(:disabled) { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,245,212,0.3); }
.msg-submit:active  { transform: translateY(0); }
.msg-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.msg-status {
  margin-top: 16px; padding: 12px 16px; border-radius: 3px;
  font-size: 0.72rem; letter-spacing: 1px; text-align: center; display: none;
}
.msg-status.success { display: block; background: rgba(0,245,212,0.08); border: 1px solid rgba(0,245,212,0.3); color: var(--accent); }
.msg-status.error   { display: block; background: rgba(255,107,107,0.08); border: 1px solid rgba(255,107,107,0.3); color: var(--accent3); }
body.light .msg-input,
body.light .msg-textarea { background: #f8fafc; border-color: #c8d4e0; color: #0f1923; }
body.light .msg-input:focus,
body.light .msg-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,120,212,0.08); }
body.light .msg-form-wrap { background: #fff; border-color: #c8d4e0; }
body.light .msg-submit { color: #fff; }

/* ── FOOTER ── */
footer {
  padding: 28px 60px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.65rem; color: var(--muted); letter-spacing: 1px;
  position: relative; z-index: 2;
}
.footer-accent { color: var(--accent); }

/* ══════════════════════════════════════════════
   PERFORMANCE — reduce paint/reflow on mobile
══════════════════════════════════════════════ */
.grid-bg,
body::before { will-change: auto; }

/* Disable heavy effects on mobile to prevent lag */
@media (max-width: 768px) {
  /* Kill expensive fixed/animated backgrounds */
  .grid-bg            { display: none; }
  body::before        { display: none; }
  /* Disable glitch animation */
  .glitch::before,
  .glitch::after      { display: none; }
  /* Disable parallax float */
  .terminal-wrapper   { animation: none !important; transform: none !important; }
  /* Disable custom cursor (use native) */
  body                { cursor: auto !important; }
  .cursor,
  .cursor-ring        { display: none !important; }
  /* Trim orbit ring */
  .orbit-ring         { animation: none !important; }
  /* Reduce box shadows */
  .skill-card:hover,
  .project-card:hover { box-shadow: none; }
}

/* ══════════════════════════════════════════════
   RESPONSIVE LAYOUT
══════════════════════════════════════════════ */

/* ── 1280px ── */
@media (max-width: 1280px) {
  .character-container { width: 360px; right: -10px; }
}

/* ── 1024px: tablets landscape ── */
@media (max-width: 1024px) {
  .character-container { display: none; }
  .about-grid          { grid-template-columns: 1fr; }
  .projects-grid,
  .pub-grid,
  .pub-grid-6          { grid-template-columns: 1fr 1fr; }
  #hero, #about, #skills, #experience,
  #projects, #publications, #certs,
  #contact, #education, #message { padding-left: 40px; padding-right: 40px; }
  .msg-form-wrap { padding: 36px; }
}

/* ── 768px: tablets portrait ── */
@media (max-width: 768px) {
  nav { padding: 14px 20px; gap: 12px; }
  .nav-links { display: none; }
  .nav-logo  { font-size: 1rem; }
  .theme-toggle { width: 44px; height: 24px; }
  .theme-toggle-knob { width: 16px; height: 16px; }
  body.light .theme-toggle-knob { transform: translateX(20px); }

  #hero { padding: 100px 20px 60px; min-height: 100svh; }
  .hero-inner { text-align: center; }
  .hero-name  { font-size: clamp(2.4rem, 11vw, 4rem); letter-spacing: -1px; }
  .hero-btns  { justify-content: center; }
  .hero-stats { gap: 20px; justify-content: center; }
  .stat-num   { font-size: 1.8rem; }

  /* Terminal */
  .terminal-wrapper { width: 95vw; max-width: 100%; right: auto; left: 0; }
  .terminal-window  { font-size: 0.65rem; }

  /* All sections */
  #about, #skills, #experience,
  #projects, #publications, #education,
  #certs, #contact, #message { padding: 80px 20px; }
  #certs { padding-top: 0; }
  #message { padding-top: 0; }

  .section-title  { font-size: clamp(1.8rem, 8vw, 3rem); }

  /* Skills grid */
  .skills-grid    { grid-template-columns: 1fr 1fr; }

  /* Projects */
  .projects-grid  { grid-template-columns: 1fr; }
  .project-full   { grid-column: span 1; }

  /* Publications */
  .pub-grid,
  .pub-grid-6     { grid-template-columns: 1fr; }

  /* Timeline */
  .timeline-item  { padding-left: 28px; }

  /* Message form */
  .msg-row        { grid-template-columns: 1fr; }
  .msg-form-wrap  { padding: 28px 20px; }

  /* Contact links */
  .contact-links  { gap: 12px; }
  .contact-link   { padding: 12px 18px; font-size: 0.68rem; }

  /* Footer */
  footer { flex-direction: column; gap: 8px; text-align: center; padding: 24px 20px; }

  /* Cert cards */
  .certs-grid     { flex-direction: column; }
  .cert-card      { min-width: unset; }

  /* Edu cards */
  .edu-grid       { grid-template-columns: 1fr; }
}

/* ── 480px: small phones ── */
@media (max-width: 480px) {
  .hero-name { font-size: clamp(2rem, 13vw, 3rem); }
  .hero-stats { flex-direction: column; gap: 12px; align-items: center; }
  .contact-link { width: 100%; justify-content: center; }
  .contact-links { flex-direction: column; align-items: stretch; }
  .skills-grid { grid-template-columns: 1fr; }
  .hero-btns   { flex-direction: column; align-items: center; }
  .btn         { width: 100%; text-align: center; }
  .about-stats { flex-direction: column; }
  .msg-form-wrap { padding: 20px 16px; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scroll reveal */
.reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.7s, transform 0.7s;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Glitch */
.glitch { position: relative; }
.glitch::before,
.glitch::after {
  content: attr(data-text); position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  clip: rect(0,0,0,0);
}
.glitch::before { color: var(--accent2); animation: glitch1 3s infinite 1s; }
.glitch::after  { color: var(--accent3); animation: glitch2 3s infinite 1s; }
@keyframes glitch1 {
  0%,95%,100% { clip: rect(0,9999px,0,0); transform: none; }
  96% { clip: rect(20px,9999px,40px,0); transform: translateX(-3px); }
  97% { clip: rect(60px,9999px,80px,0); transform: translateX(3px); }
  98% { clip: rect(10px,9999px,30px,0); transform: translateX(-2px); }
}
@keyframes glitch2 {
  0%,95%,100% { clip: rect(0,9999px,0,0); transform: none; }
  96% { clip: rect(50px,9999px,70px,0); transform: translateX(3px); }
  97% { clip: rect(30px,9999px,50px,0); transform: translateX(-3px); }
  98% { clip: rect(70px,9999px,90px,0); transform: translateX(2px); }
}

/* ── THEME TOGGLE BUTTON ── */
.theme-toggle {
  position: relative;
  width: 52px; height: 28px;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  cursor: none;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle-track {
  position: absolute; inset: 3px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px; pointer-events: none;
}
.theme-toggle-track .icon-sun  { font-size: 10px; opacity: 0.4; transition: opacity 0.3s; }
.theme-toggle-track .icon-moon { font-size: 10px; opacity: 0.9; transition: opacity 0.3s; }
.theme-toggle-knob {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(0,245,212,0.5);
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1), background 0.3s, box-shadow 0.3s;
}
body.light .theme-toggle-knob  { transform: translateX(24px); background: #0078d4; box-shadow: 0 0 8px rgba(0,120,212,0.4); }
body.light .icon-sun  { opacity: 0.9 !important; }
body.light .icon-moon { opacity: 0.3 !important; }

/* ── LIGHT MODE TOKENS ── */
body.light {
  --bg:      #f0f4f8;
  --bg2:     #e4eaf2;
  --surface: #ffffff;
  --border:  #c8d4e0;
  --accent:  #0078d4;
  --accent2: #6244bb;
  --accent3: #e03e3e;
  --text:    #0f1923;
  --muted:   #5a6a7e;
  --glow:    0 0 30px rgba(0,120,212,0.15);
}
body.light #preloader      { background: #f0f4f8; }
body.light .preloader-counter { color: #5a6a7e; }
body.light .preloader-tagline { color: #c8d4e0; }
body.light .preloader-bar-wrap { background: #c8d4e0; }
body.light .preloader-bracket  { border-color: rgba(0,120,212,0.2); }

body.light nav { background: rgba(240,244,248,0.9); }
body.light .grid-bg {
  background-image:
    linear-gradient(rgba(0,120,212,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,120,212,0.05) 1px, transparent 1px);
}

/* Terminal in light mode */
body.light .terminal-window   { background: #fafcff; border-color: #c8d4e0; box-shadow: 0 8px 40px rgba(0,0,0,0.12); }
body.light .terminal-titlebar { background: #f0f4f8; border-color: #c8d4e0; }
body.light .terminal-title    { color: #8a9ab0; }
body.light .t-prompt { color: #1a9b1a; }
body.light .t-cmd, body.light .t-var { color: #0f1923; }
body.light .t-cursor { color: #0078d4; }
body.light .t-kw     { color: #6244bb; }
body.light .t-fn     { color: #0078d4; }
body.light .t-str    { color: #b5520f; }
body.light .t-num    { color: #c8590a; }
body.light .t-cmt    { color: #8a9ab0; font-style: italic; }
body.light .t-out    { color: #1a9b1a; }
body.light .t-err    { color: #e03e3e; }
body.light .t-punc   { color: #8a9ab0; }
body.light .t-op     { color: #6244bb; }
body.light .t-line   { color: #0f1923; }

/* Cards */
body.light .skill-card,
body.light .project-card,
body.light .cert-card,
body.light .edu-card { background: #ffffff; border-color: #c8d4e0; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
body.light .skill-card:hover,
body.light .project-card:hover { border-color: var(--accent); }

/* Tags */
body.light .tag      { border-color: #c8d4e0; color: #5a6a7e; }
body.light .tag:hover { border-color: var(--accent); color: var(--accent); }
body.light .tech-tag { background: rgba(0,120,212,0.07); border-color: rgba(0,120,212,0.2); color: var(--accent); }

/* Publication cards */
body.light .pub-card,
body.light .pub-card-6 { background: #ffffff; border-color: #c8d4e0; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
body.light .pub-card:hover,
body.light .pub-card-6:hover { border-color: var(--accent); }
body.light .pb-tag   { border-color: #c8d4e0; color: #5a6a7e; }
body.light .pb-cyan   { color: #0078d4; border-color: rgba(0,120,212,0.3);  background: rgba(0,120,212,0.06); }
body.light .pb-purple { color: #6244bb; border-color: rgba(98,68,187,0.3);  background: rgba(98,68,187,0.06); }
body.light .pb-white  { color: #444;    border-color: rgba(0,0,0,0.15);     background: rgba(0,0,0,0.04); }
body.light .pb-orange { color: #b55a00; border-color: rgba(181,90,0,0.3);   background: rgba(181,90,0,0.06); }
body.light .pb-cyan-link   { color: #0078d4; border-color: rgba(0,120,212,0.3); }
body.light .pb-purple-link { color: #6244bb; border-color: rgba(98,68,187,0.3); }
body.light .pb-white-link  { color: #444;    border-color: rgba(0,0,0,0.2); }
body.light .pb-orange-link { color: #b55a00; border-color: rgba(181,90,0,0.3); }

body.light .marquee-section  { background: #e4eaf2; }
body.light .btn-ghost        { border-color: #c8d4e0; color: #0f1923; }
body.light .btn-ghost:hover  { border-color: var(--accent); color: var(--accent); }
body.light .contact-link     { border-color: #c8d4e0; color: #0f1923; }
body.light .contact-link:hover { border-color: var(--accent); color: var(--accent); }
body.light footer            { border-color: #c8d4e0; }
body.light .orbit-ring       { border-color: rgba(98,68,187,0.2); }

/* Smooth global color transitions */
*, *::before, *::after {
  transition-property: background-color, border-color, color, box-shadow;
  transition-duration: 0.35s;
  transition-timing-function: ease;
}
/* Lock animation-specific transitions */
.bar-fill          { transition: width 1.5s ease !important; }
.reveal            { transition: opacity 0.7s, transform 0.7s !important; }
.timeline-item     { transition: opacity 0.6s, transform 0.6s !important; }
.project-card,
.pub-card,
.pub-card-6,
.skill-card,
.cert-card,
.edu-card          { transition: transform 0.4s, border-color 0.35s, box-shadow 0.4s, opacity 0.6s !important; }
.theme-toggle-knob { transition: transform 0.35s cubic-bezier(.4,0,.2,1), background 0.3s, box-shadow 0.3s !important; }
.preloader-bar     { transition: width 0.08s linear !important; }
.cursor            { transition: transform 0.1s, width 0.2s, height 0.2s !important; }

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
  .character-container { width: 360px; right: -10px; }
}
@media (max-width: 1024px) {
  .character-container { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .projects-grid, .pub-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  nav { padding: 16px 24px; }
  .nav-links { display: none; }
  #hero, #about, #skills, #experience,
  #projects, #certs, #contact, #education,
  #publications { padding: 80px 24px; }
  .hero-stats { gap: 24px; }
  footer { flex-direction: column; gap: 8px; text-align: center; }
}
