/* Pratik Yadav — Software Developer Portfolio */
:root {
  --bg: #07080a;
  --bg-elevated: #0f1116;
  --bg-card: #13161c;
  --bg-glass: rgba(19, 22, 28, 0.72);
  --text: #f0f1f3;
  --text-dim: #8b93a1;
  --text-faint: #525866;
  --accent: #6ee7b7;
  --accent-2: #38bdf8;
  --accent-warm: #fbbf24;
  --accent-soft: #6ee7b7;
  --accent-rgb: 110, 231, 183;
  --accent-2-rgb: 56, 189, 248;
  --accent-warm-rgb: 251, 191, 36;
  --line: #1e222b;
  --line-soft: #161920;
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1180px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --display: 'Syne', var(--sans);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 72px;
  --glow: 0 0 80px rgba(110, 231, 183, 0.12);
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  --card-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(7, 8, 10, 0.88);
  --nav-overlay: rgba(7, 8, 10, 0.97);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --page-x: max(12px, calc(10px + var(--safe-l)));
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--safe-t) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-width: 280px;
}

main {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

::selection { background: rgba(var(--accent-rgb), 0.35); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: max(var(--page-x), clamp(12px, 4vw, 40px));
  padding-right: max(var(--page-x), clamp(12px, 4vw, 40px));
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; }

.mono { font-family: var(--mono); }
.display { font-family: var(--display); }

/* ── Cursor glow (desktop only) ── */
.cursor-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.04) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  opacity: 0;
}

.cursor-trail {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}

@media (hover: hover) and (pointer: fine) {
  .cursor-glow { opacity: 1; }
}

/* ── Grain overlay ── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Header ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: calc(var(--header-h) + var(--safe-t));
  padding-top: var(--safe-t);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  transition: background 0.35s var(--ease), backdrop-filter 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s ease;
}

/* Transparent Sticky/Fixed Navbar */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(7, 8, 10, 0.55); /* Translucent dark overlay */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Ensure topbar doesn't override transparency */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 max(var(--page-x), clamp(12px, 4vw, 40px));
  gap: 12px;
  min-width: 0;
  background: transparent;
}

.logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(0.78rem, 2.8vw, 0.95rem);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-bracket { color: var(--accent); }
.logo-dim { color: var(--text-faint); }

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.nav-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
  position: relative;
}

.nav-link:hover { color: var(--text); background: var(--bg-card); }
.nav-link.active { color: var(--accent); }

.nav-indicator {
  position: absolute;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  transition: transform 0.45s var(--ease), width 0.45s var(--ease);
  left: 0;
  width: 0;
}

.nav-cta {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: #041510;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.15);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  z-index: 110;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.nav-mobile {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: var(--nav-overlay);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
}

.nav-mobile.open { opacity: 1; pointer-events: auto; }

.nav-mobile .nav-link {
  font-size: 1.1rem;
  padding: 14px 24px;
  opacity: 0;
  transform: translateY(16px);
}

.nav-mobile.open .nav-link {
  animation: mobileNavIn 0.5s var(--ease) forwards;
}

.nav-mobile.open .nav-link:nth-child(1) { animation-delay: 0.05s; }
.nav-mobile.open .nav-link:nth-child(2) { animation-delay: 0.1s; }
.nav-mobile.open .nav-link:nth-child(3) { animation-delay: 0.15s; }
.nav-mobile.open .nav-link:nth-child(4) { animation-delay: 0.2s; }
.nav-mobile.open .nav-link:nth-child(5) { animation-delay: 0.25s; }

@keyframes mobileNavIn {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .nav-desktop, .nav-cta { display: none; }
  .menu-toggle { display: flex; }
}

@media (min-width: 901px) {
  .nav-mobile { display: none; }
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + var(--safe-t) + 24px) 0 max(40px, var(--safe-b));
  position: relative;
  overflow: hidden;
}

.hero-mesh {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(var(--accent-rgb), 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(var(--accent-2-rgb), 0.03) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 60% 80%, rgba(var(--accent-warm-rgb), 0.025) 0%, transparent 50%);
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 75%);
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  width: 100%;
  min-width: 0;
}

.hero-content {
  max-width: 620px;
  min-width: 0;
  width: 100%;
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
  opacity: 0;
}

.profile-handle { color: var(--text-dim); }
.profile-dot { opacity: 0.5; }
.profile-location { color: var(--text-dim); }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 16px;
  padding: 6px 14px 6px 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.06);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: 0 0 4px rgba(var(--accent-rgb), 0.2);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}

.hero-role {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  color: var(--text-dim);
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  opacity: 0;
}

.hero-title .line { display: block; overflow: hidden; }
.hero-title .char { display: inline-block; opacity: 0; }
.hero-title .gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-warm) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-bio {
  font-size: clamp(1rem, 2vw, 1.14rem);
  color: var(--text-dim);
  line-height: 1.75;
  margin: 0 0 28px;
  max-width: 540px;
}

.hero-bio strong { color: var(--text); font-weight: 600; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 32px;
}

.btn {
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.25s var(--ease), border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1), rgba(var(--accent-2-rgb), 0.1));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn:hover::before { opacity: 1; }
.btn:hover { transform: translateY(-3px); border-color: rgba(var(--accent-rgb), 0.35); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #34d399);
  color: #041510;
  border-color: transparent;
  font-weight: 600;
}

.btn-primary:hover {
  box-shadow: 0 12px 32px rgba(var(--accent-rgb), 0.3);
}

.btn:active,
.nav-cta:active {
  transform: scale(0.97);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  margin-bottom: 24px;
}

.experience-includes {
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
}

.experience-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.experience-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exp-chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-card);
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s var(--ease), box-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.exp-chip:hover,
.exp-chip.is-active {
  border-color: rgba(var(--accent-rgb), 0.3);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

.stat-item { opacity: 0; }

.stat-value {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Terminal widget */
.hero-terminal {
  background: var(--bg-glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--glow), 0 24px 64px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(30px) scale(0.97);
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-left: 8px;
}

.terminal-body {
  padding: 24px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.9;
  min-height: 220px;
}

.terminal-line { opacity: 0; }
.terminal-prompt { color: var(--accent); }
.terminal-key { color: var(--accent-2); }
.terminal-str { color: var(--accent-warm); }
.terminal-comment { color: var(--text-faint); }
.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 960px) {
  .hero-layout { grid-template-columns: 1fr; gap: 24px; }
  .hero-terminal { order: -1; max-width: 100%; width: 100%; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .skills-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-stats { gap: 12px; }
}

/* ── Sections shared ── */
section {
  padding: clamp(48px, 6vw, 72px) 0;
  position: relative;
}

.section-divider {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 max(var(--page-x), clamp(12px, 4vw, 40px));
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent);
  opacity: 0.6;
}

.section-alt { background: var(--bg-elevated); }

.section-header {
  margin-bottom: clamp(24px, 4vw, 36px);
  max-width: 640px;
}

.section-index {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.65;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
}

/* ── Projects ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  perspective: 1400px;
  width: 100%;
  min-width: 0;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 2.5vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
  opacity: 0;
  transform: translateY(24px);
  transform-style: preserve-3d;
  will-change: transform;
  height: 100%;
  box-shadow: var(--card-shadow);
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.project-card.is-active,
.project-card:active {
  transform: translateY(-2px) scale(0.985);
  border-color: rgba(var(--accent-rgb), 0.22);
  box-shadow: var(--card-shadow-hover);
}

@media (hover: hover) and (pointer: fine) {
  .project-card:hover {
    border-color: rgba(var(--accent-rgb), 0.28);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-4px);
  }

  .project-card:hover::before { opacity: 1; }
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.04), rgba(var(--accent-2-rgb), 0.04));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.project-card .card-inner-tilt { pointer-events: none; }

.project-card.is-tilting {
  transition: border-color 0.3s ease, box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}

.project-card.featured {
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(var(--accent-rgb), 0.04) 100%);
}

.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.project-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1rem, 4vw, 1.25rem);
  line-height: 1.25;
  word-break: break-word;
}

.project-badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.project-badge.live {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.08);
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin: 0;
  position: relative;
  z-index: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-elevated);
}

.project-link {
  font-family: var(--mono);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--accent);
  position: relative;
  z-index: 1;
  transition: gap 0.25s ease;
  margin-top: auto;
}

.project-link:hover { gap: 12px; }
.project-link.disabled { color: var(--text-faint); pointer-events: none; }

@media (max-width: 820px) {
  .projects-grid { grid-template-columns: 1fr; }
}

/* ── Skills ── */
.skills-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 56px);
  align-items: start;
  min-width: 0;
  width: 100%;
}

.code-block {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 28px);
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.5vw, 0.85rem);
  line-height: 2;
  overflow-x: auto;
  box-shadow: var(--card-shadow);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  -webkit-overflow-scrolling: touch;
}

.code-block .k { color: var(--accent-2); }
.code-block .s { color: var(--accent-warm); }
.code-block .p { color: var(--text-faint); }
.code-block .bracket { color: var(--text-dim); }

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.skill-chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--text-dim);
  opacity: 0;
  transform: scale(0.8);
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease, transform 0.25s var(--ease), box-shadow 0.25s ease;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.skill-chip:hover,
.skill-chip.is-active {
  border-color: rgba(var(--accent-rgb), 0.35);
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.bars-wrap { display: flex; flex-direction: column; gap: 22px; }

.bar-row { opacity: 0; transform: translateX(-16px); }

.bar-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.bar-header b { color: var(--text); font-weight: 500; }
.bar-header span { color: var(--text-faint); }

.bar-track {
  height: 6px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  position: relative;
}

.bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (max-width: 860px) {
  .skills-layout { grid-template-columns: 1fr; }
}

/* ── Experience ── */
.timeline {
  position: relative;
  max-width: 760px;
  padding-left: 32px;
}

.timeline-line {
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
  transform-origin: top;
  transform: scaleY(0);
}

.timeline-line.active { transform: scaleY(1); transition: transform 1.4s var(--ease); }

.tl-item {
  position: relative;
  padding: 16px 16px 16px 0;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateX(-20px);
  border-radius: var(--radius-sm);
  transition: background 0.3s ease, transform 0.3s var(--ease), padding 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.tl-item:last-child { margin-bottom: 0; padding-bottom: 16px; }

@media (hover: hover) and (pointer: fine) {
  .tl-item:hover {
    background: rgba(var(--accent-rgb), 0.04);
    transform: translateX(4px);
    padding-left: 8px;
  }
}

.tl-item.is-active {
  background: rgba(var(--accent-rgb), 0.06);
  transform: translateX(4px);
  padding-left: 8px;
}

.tl-marker {
  position: absolute;
  left: -32px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.3);
}

.tl-date {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.tl-role {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.tl-org {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.tl-desc {
  font-size: 0.94rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin: 0;
}

/* ── Contact ── */
.contact-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 5vw, 56px);
  min-width: 0;
  width: 100%;
}

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 36px);
}

.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.field input,
.field textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.field textarea { min-height: 130px; }

.form-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.form-note {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  margin: 12px 0 0;
}

.form-status {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  min-height: 1.2em;
}

.contact-links { display: flex; flex-direction: column; gap: 12px; }

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  transition: transform 0.3s var(--ease), border-color 0.25s ease, box-shadow 0.3s var(--ease), background 0.25s ease;
  opacity: 0;
  transform: translateY(16px);
  box-shadow: var(--card-shadow);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.contact-card:hover,
.contact-card.is-active {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb), 0.28);
  box-shadow: var(--card-shadow-hover);
  background: rgba(var(--accent-rgb), 0.04);
}

.contact-card:active {
  transform: scale(0.98);
}

.contact-card .label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.contact-card .label small {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.contact-card .arrow {
  font-family: var(--mono);
  color: var(--accent);
  transition: transform 0.25s ease;
}

.contact-card:hover .arrow { transform: translate(3px, -3px); }

@media (max-width: 860px) {
  .contact-layout { grid-template-columns: 1fr; }
}

/* ── Footer ── */
.site-footer {
  padding: 28px max(var(--page-x), clamp(12px, 4vw, 40px)) calc(28px + var(--safe-b));
  text-align: center;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-faint);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* ── Scroll progress ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 200;
  transition: width 0.1s linear;
}

/* ── SEO (visually hidden, crawlable) ── */
.sr-keywords {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Tablet tweaks ── */
@media (min-width: 481px) and (max-width: 1024px) {
  .hero { padding-top: calc(var(--header-h) + 24px); }
  section { padding: 56px 0; }
}

/* ── Large desktop ── */
@media (min-width: 1440px) {
  :root { --maxw: 1280px; }
}

/* ═══ Enhanced animations & layout (Kokonut / Manus-inspired) ═══ */

.hero-orbs {
  position: absolute;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.28;
  will-change: transform;
}

.orb-a {
  width: min(420px, 55vw);
  height: min(420px, 55vw);
  top: 8%;
  left: -5%;
  background: rgba(var(--accent-rgb), 0.14);
}

.orb-b {
  width: min(360px, 45vw);
  height: min(360px, 45vw);
  top: 20%;
  right: -8%;
  background: rgba(var(--accent-2-rgb), 0.12);
}

.orb-c {
  width: min(280px, 38vw);
  height: min(280px, 38vw);
  bottom: 10%;
  left: 35%;
  background: rgba(var(--accent-warm-rgb), 0.08);
}

.hero-particles {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.32;
  pointer-events: none;
}

.section-title .word {
  display: inline-block;
  overflow: hidden;
}

.section-title .word-inner {
  display: inline-block;
  transform: translateY(110%);
}

.projects-grid.bento {
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2vw, 18px);
  align-items: stretch;
}

.projects-grid.bento .project-card.featured {
  grid-column: span 1;
  grid-row: span 1;
}

@media (min-width: 581px) and (max-width: 960px) {
  .projects-grid.bento { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 580px) {
  .projects-grid.bento { grid-template-columns: 1fr; }
}

.glow-border {
  position: relative;
  isolation: isolate;
}

.glow-border::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius) + 1px);
  padding: 1px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.35), rgba(var(--accent-2-rgb), 0.2));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.glow-border:hover::after,
.glow-border:focus-within::after,
.glow-border.is-active::after {
  opacity: 0.75;
}

.card-shine {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent-rgb), 0.12), transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}

.project-card:hover .card-shine { opacity: 1; }

.project-top,
.project-desc,
.project-tags,
.project-link {
  position: relative;
  z-index: 1;
}

.marquee-track {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(28px, 4vw, 40px);
  mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
  max-width: 100vw;
}

.marquee-inner {
  display: flex;
  gap: clamp(32px, 6vw, 64px);
  width: max-content;
  padding: 14px 0;
  animation: marquee 28s linear infinite;
}

.marquee-inner span {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.marquee-track:hover .marquee-inner {
  animation-play-state: paused;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

.skill-viz {
  margin-bottom: 28px;
  padding: 16px 18px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.spark-line {
  stroke: var(--accent);
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
}

.spark-area {
  fill: url(#sparkGrad);
  opacity: 0;
}

.spark-chart defs { display: block; }

.bars-wrap .spark-chart + .bar-row { margin-top: 0; }

.code-block {
  position: relative;
}

.code-block::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: var(--radius) 0 0 var(--radius);
  opacity: 0.6;
}

.tl-marker {
  transition: transform 0.35s var(--ease), box-shadow 0.35s ease;
}

.tl-item.in-view .tl-marker {
  transform: scale(1.12);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.25);
}

.contact-form .field input,
.contact-form .field textarea {
  transform: translateZ(0);
}

.contact-form .field.is-focused label {
  color: var(--accent);
}

.thank-you-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 48px) clamp(20px, 4vw, 40px) clamp(16px, 3vw, 24px);
  text-align: center;
}

.thank-you {
  font-family: var(--display);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  color: var(--text-dim);
  margin: 0;
  letter-spacing: -0.01em;
}

.thank-you::before {
  content: '✦';
  display: block;
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 10px;
  opacity: 0.7;
}

@media (max-width: 960px) {
  .hero-layout { gap: 28px; }
  .hero-terminal { width: 100%; max-width: none; }
  .skills-layout { gap: 28px; }
  .contact-layout { gap: 24px; }
  .profile-meta { flex-wrap: wrap; }
}

.footer-line {
  margin: 0;
  background: linear-gradient(90deg, var(--text-dim), var(--accent), var(--text-dim));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: footerShine 8s linear infinite;
}

.footer-sub {
  margin: 0;
  font-size: 0.68rem;
  color: var(--text-faint);
}

@keyframes footerShine {
  to { background-position: 200% center; }
}

/* Touch / mobile polish */
@media (max-width: 480px) {
  .nav-link { min-height: 44px; display: inline-flex; align-items: center; }
  .marquee-inner { animation-duration: 36s; }
  .hero-particles { display: none; }
  .cursor-glow { display: none; }
  .cursor-trail { display: none; }
  .hero-orbs { opacity: 0.5; }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .hero-layout { grid-template-columns: 1fr; }
  .hero-terminal { max-width: 100%; }
}

@media (hover: none) {
  .glow-border::after { opacity: 0; }
  .glow-border.is-active::after { opacity: 0.6; }
}

/* ── Full-device responsive (iPhone → budget phones) ── */
@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .hero { min-height: auto; padding-bottom: max(36px, var(--safe-b)); }
  .hero-title { font-size: clamp(2rem, 11vw, 2.75rem); }
  .hero-bio { font-size: 0.95rem; margin-bottom: 22px; }
  .hero-role { font-size: 1rem; margin-bottom: 14px; }
  .section-title { font-size: clamp(1.45rem, 6.5vw, 1.85rem); }
  .section-header { margin-bottom: 18px; }
  .section-desc { font-size: 0.92rem; }
  section { padding: clamp(36px, 8vw, 52px) 0; }
  .timeline { padding-left: 22px; max-width: 100%; }
  .tl-marker { left: -22px; width: 11px; height: 11px; }
  .tl-desc { font-size: 0.88rem; }
  .contact-card { padding: 14px 16px; }
  .contact-card .label small { font-size: 0.6rem; line-height: 1.4; }
  .code-block { font-size: 0.68rem; padding: 14px; line-height: 1.75; }
  .terminal-body { min-height: 160px; padding: 16px; font-size: 0.72rem; }
  .terminal-title { font-size: 0.65rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55vw; }
  .field input, .field textarea { font-size: 16px; padding: 12px 14px; max-width: 100%; }
  .btn { padding: 12px 18px; font-size: 0.78rem; width: 100%; justify-content: center; min-height: 44px; }
  .hero-actions { flex-direction: column; gap: 10px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-label { font-size: 0.62rem; }
  .marquee-inner span { font-size: 0.65rem; }
  .thank-you-wrap { padding-left: max(var(--page-x), 12px); padding-right: max(var(--page-x), 12px); }
  .project-card { min-width: 0; }
  .project-badge { white-space: normal; text-align: center; max-width: 100%; }
  .nav-cta { display: none; }
  .menu-toggle { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
}

@media (max-width: 360px) {
  :root { --header-h: 56px; --page-x: max(10px, var(--safe-l)); }
  .logo-bracket { display: none; }
  .hero-eyebrow { font-size: 0.72rem; padding: 5px 10px 5px 8px; }
  .hero-title { font-size: 1.85rem; }
  .profile-meta { font-size: 0.7rem; gap: 6px; }
  .project-card { padding: 14px; gap: 10px; }
  .project-desc { font-size: 0.84rem; }
  .project-badge { font-size: 0.6rem; padding: 3px 8px; }
  .tag { font-size: 0.62rem; }
  .nav-mobile .nav-link { font-size: 1rem; padding: 12px 20px; }
  .section-index { font-size: 0.68rem; }
  .bar-header { font-size: 0.72rem; flex-wrap: wrap; gap: 4px; }
  .contact-form { padding: 18px; }
  .form-footer { flex-direction: column; align-items: stretch; }
  .form-footer .btn { width: 100%; }
}

@media (max-width: 320px) {
  :root { --header-h: 52px; }
  .hero-title { font-size: 1.65rem; }
  .hero-role { font-size: 0.92rem; }
  .stat-value { font-size: 1.1rem; }
  .experience-logos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .exp-chip { text-align: center; font-size: 0.62rem; padding: 5px 6px; }
  .menu-toggle span { width: 18px; }
  .footer-line, .footer-sub { font-size: 0.62rem; }
  .thank-you { font-size: 1rem; }
}

@media (max-width: 280px) {
  .hero-stats { grid-template-columns: 1fr; }
  .logo-dim { display: none; }
  .hero-eyebrow { max-width: 100%; white-space: normal; text-align: center; justify-content: center; }
  .profile-meta { justify-content: center; }
  .experience-logos { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */

/* Prevent overall page horizontal overflow */
html, body {
  width: 100%;
  overflow-x: hidden;
}

/* Ensure all elements scale within the mobile screen width */
* {
  max-width: 100%;
}

/* Mobile adjustments (screens 768px wide and below) */
@media (max-width: 768px) {

  /* Reduce container padding so card content isn't squeezed */
  .inner-content {
    padding: 12px 16px;
    font-size: 14px;
    word-break: break-word; /* Prevents long text/links from overflowing */
  }

  /* Make grid/flex layouts stack vertically instead of side-by-side */
  .skills-container,
  .projects-grid,
  .contact-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 16px;
  }

  /* Force cards to fit full mobile width safely */
  .project-card,
  .contact-card,
  .star-border-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* Allow text inside contact card labels to wrap gracefully */
  .contact-card .label small {
    display: block;
    word-break: break-all;
  }
}


/* 1. Prevent screen overflow from StarBorder 300% width gradients */
html, body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  position: relative;
}

/* 2. Universal Box Sizing & Fluid Widths */
*, *::before, *::after {
  box-sizing: border-box !important;
  max-width: 100% !important;
}

/* 3. Targeted Fixes for Small Mobile Screens (390px and below) */
@media screen and (max-width: 480px) {

  /* Ensure main sections don't push outside the screen */
  main, section, container, .container, .wrapper {
    width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    overflow-x: hidden;
  }

  /* Force StarBorder & Portfolio Cards to fit within the screen */
  .star-border-container,
  .hero-terminal,
  .project-card,
  .contact-card,
  .skill-card,
  .skills-container {
    width: 100% !important;
    min-width: 0 !important; /* Overrides default flex min-width */
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Reduce internal padding so text doesn't overflow or crop */
  .inner-content,
  .project-card,
  .contact-card,
  .hero-terminal {
    padding: 12px 14px !important;
  }

  /* Force grid containers (Skills, Projects, Contacts) to stack in 1 column */
  .skills-grid,
  .projects-grid,
  .contact-grid,
  .skills-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
  }

  /* Fix individual skill chips / tags if they use flex/inline-block */
  .skill-tag,
  .skill-item,
  .tech-stack span {
    white-space: normal !important; /* Allows multi-line wrap instead of cutting off */
    word-break: break-word !important;
    font-size: 13px !important;
  }

  /* Text overflow safety */
  p, h1, h2, h3, h4, span, a, small {
    word-wrap: break-word !important;
    word-break: break-word !important;
  }
}