/* rahulbalajee.com — Linear-inspired dark system, v2
   Canvas #08090a · text #f7f8f8/#d0d6e0/#8a8f98 · accent #5e6ad2/#7170ff
   Signature elements: dot-grid atmosphere, cursor-tracking glow borders,
   hero terminal, timeline rail, gradient display type. */

:root {
  --bg: #08090a;
  --bg-panel: #0f1011;
  --bg-elev: #191a1b;
  --text: #f7f8f8;
  --text-2: #d0d6e0;
  --text-3: #8a8f98;
  --text-4: #62666d;
  --brand: #5e6ad2;
  --accent: #7170ff;
  --accent-hover: #828fff;
  --green: #27a644;
  --green-soft: #4ade80;
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --surface: rgba(255, 255, 255, 0.02);
  --surface-2: rgba(255, 255, 255, 0.04);
  --surface-3: rgba(255, 255, 255, 0.05);
  --radius: 6px;
  --radius-card: 10px;
  --radius-panel: 14px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font);
  font-feature-settings: 'cv01', 'ss03';
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(113, 112, 255, 0.35); color: var(--text); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #26282c; border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #34363c; }

.mono { font-family: var(--mono); }

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand); color: #fff; padding: 8px 16px; border-radius: var(--radius);
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ============ Atmosphere ============ */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 20%, transparent 100%);
  pointer-events: none;
}
.bg-glow {
  position: fixed; inset: 0; z-index: -3;
  background:
    radial-gradient(ellipse 55% 40% at 68% -8%, rgba(94, 106, 210, 0.20), transparent 65%),
    radial-gradient(ellipse 40% 32% at 12% 4%, rgba(113, 112, 255, 0.10), transparent 65%);
  pointer-events: none;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: 510 15px/1 var(--font);
  padding: 11px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-primary {
  background: linear-gradient(180deg, #6a76e0, var(--brand));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(94, 106, 210, 0);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #7d88ee, #6a76e0);
  color: #fff;
  box-shadow: 0 2px 12px rgba(94, 106, 210, 0.45);
}
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-ghost {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.16);
}

/* ============ Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(13, 14, 18, 0.92), rgba(8, 9, 10, 0.78));
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
}
/* Gradient hairline under the nav — brightens once scrolled */
.nav::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(113, 112, 255, 0.28) 18%, rgba(126, 226, 168, 0.18) 50%,
    rgba(113, 112, 255, 0.28) 82%, transparent);
  opacity: 0.45;
  transition: opacity 0.25s ease;
}
.nav.scrolled::after { opacity: 1; }
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 24px;
  height: 68px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background:
    radial-gradient(120% 120% at 20% 15%, rgba(126, 226, 168, 0.35), transparent 42%),
    linear-gradient(135deg, #6d79e6, #4a52b4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 2px 10px rgba(94, 106, 210, 0.45);
  color: #fff; font: 590 13px/34px var(--font);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.brand:hover .brand-mark {
  transform: rotate(-4deg) scale(1.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 2px 16px rgba(113, 112, 255, 0.6);
}
.brand-name {
  display: flex; flex-direction: column; gap: 2px;
  font: 590 15px/1.1 var(--font); letter-spacing: -0.2px;
}
.brand-sub {
  font-size: 9.5px; font-weight: 500;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-4);
}
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  position: relative;
  font: 510 13.5px/1 var(--font);
  color: var(--text-3);
  letter-spacing: -0.1px;
  padding: 9px 13px;
  border-radius: 7px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a::after {
  content: '';
  position: absolute; left: 13px; right: 13px; bottom: 3px;
  height: 1.5px; border-radius: 1px;
  background: linear-gradient(90deg, var(--accent), #7ee2a8);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after { transform: scaleX(1); }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span {
  display: block; width: 18px; height: 1.5px;
  background: var(--text-2);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* ============ Hero ============ */
.hero { padding: 92px 0 72px; position: relative; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font: 510 12.5px/1 var(--font);
  color: var(--text-2);
  padding: 7px 14px 7px 10px;
  border: 1px solid rgba(39, 166, 68, 0.25);
  border-radius: 9999px;
  background: rgba(39, 166, 68, 0.07);
  margin-bottom: 26px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green-soft);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.9);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.hero-title {
  font: 590 clamp(44px, 5.4vw, 68px)/1.02 var(--font);
  letter-spacing: -2.1px;
  background: linear-gradient(180deg, #ffffff 20%, #b9bfcc 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 16px;
}
.hero-role {
  font: 510 21px/1.35 var(--font);
  letter-spacing: -0.3px;
  color: var(--accent-hover);
  margin-bottom: 18px;
}
.hero-pitch {
  max-width: 560px;
  font: 400 16px/1.68 var(--font);
  letter-spacing: -0.08px;
  color: var(--text-3);
  margin-bottom: 32px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.hero-location {
  display: flex; align-items: center; gap: 9px;
  font-size: 12px;
  color: var(--text-4);
  letter-spacing: 0;
}
.loc-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(113, 112, 255, 0.8);
  flex-shrink: 0;
}

/* ============ Terminal ============ */
.hero-term { min-width: 0; }
.terminal {
  background: #0b0c0e;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-panel);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 24px 60px -18px rgba(0, 0, 0, 0.8),
    0 0 80px -30px rgba(94, 106, 210, 0.35);
}
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--border-subtle);
}
.term-btn { width: 11px; height: 11px; border-radius: 50%; }
.tb-r { background: #ff5f57; }
.tb-y { background: #febc2e; }
.tb-g { background: #28c840; }
.term-title {
  margin-left: 8px;
  font-size: 11.5px;
  color: var(--text-4);
}
.term-body {
  padding: 16px 16px 18px;
  height: 348px;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-2);
}
.term-line { white-space: pre-wrap; word-break: break-all; min-height: 22px; }
.t-prompt { color: #7ee2a8; }
.t-path { color: var(--accent-hover); }
.t-dim { color: var(--text-4); }
.t-cmd { color: var(--text); }
.t-out { color: var(--text-3); }
.t-ok { color: var(--green-soft); }
.t-head { color: var(--text-4); }
.t-num { color: #f0b866; }
.cursor {
  display: inline-block;
  width: 7px; height: 15px;
  background: var(--accent-hover);
  vertical-align: -2px;
  margin-left: 1px;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============ Ticker ============ */
.ticker {
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.012);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  padding: 13px 0;
  font-size: 11.5px;
  letter-spacing: 0.4px;
  color: var(--text-4);
  animation: ticker 46s linear infinite;
  will-change: transform;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============ Stats ============ */
.stats { border-bottom: 1px solid var(--border-subtle); }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding-top: 42px; padding-bottom: 42px;
  gap: 28px;
}
.stat { position: relative; padding-left: 18px; }
.stat::before {
  content: '';
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 2px; border-radius: 1px;
  background: linear-gradient(180deg, var(--brand), transparent);
}
.stat-value {
  font: 590 38px/1.05 var(--font);
  letter-spacing: -1.1px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 13px; color: var(--text-4); margin-top: 7px; line-height: 1.45; }

/* ============ Sections ============ */
.section { padding: 104px 0 8px; }
.section-head {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 18px;
}
.section-kicker {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 12px; font-weight: 500;
  letter-spacing: 2px;
  color: var(--accent);
  white-space: nowrap;
}
.k-num { color: var(--text-4); font-size: 11px; }
.head-rule {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}
.section-title {
  font: 590 clamp(30px, 3.6vw, 42px)/1.08 var(--font);
  letter-spacing: -1.1px;
  color: var(--text);
  margin-bottom: 14px;
}
.section-sub {
  max-width: 560px;
  font-size: 15.5px; line-height: 1.6;
  color: var(--text-3);
  margin-bottom: 44px;
}
.section > .container > .section-title:last-of-type { margin-bottom: 44px; }

/* ============ Glow cards (cursor-tracking border highlight) ============ */
.glow-card {
  position: relative;
  --mx: 50%;
  --my: 50%;
}
.glow-card::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(260px circle at var(--mx) var(--my),
    rgba(130, 143, 255, 0.55), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.glow-card::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--mx) var(--my),
    rgba(113, 112, 255, 0.06), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.glow-card:hover::before, .glow-card:hover::after { opacity: 1; }

/* ============ Cards ============ */
.cards-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.card:hover { background: var(--surface-2); }
.card-title {
  font: 590 18px/1.3 var(--font);
  letter-spacing: -0.2px;
  color: var(--text);
  margin-bottom: 10px;
}
.card-desc { font-size: 14.5px; line-height: 1.62; color: var(--text-3); }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tag {
  font: 510 12px/1 var(--font);
  color: var(--text-2);
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9999px;
  background: var(--surface);
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.tag:hover { border-color: rgba(130, 143, 255, 0.5); color: var(--text); }

/* ============ Service cards: colored icons ============ */
.svc-head { display: flex; align-items: center; gap: 13px; margin-bottom: 12px; }
.svc-head .card-title { margin-bottom: 0; }
.svc-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.svc-icon svg { width: 19px; height: 19px; }
.card:hover .svc-icon { transform: scale(1.08); }

.svc-cluster .svc-icon {
  color: #9aa4ff;
  background: rgba(113, 112, 255, 0.10);
  border-color: rgba(113, 112, 255, 0.28);
}
.card.svc-cluster:hover .svc-icon { box-shadow: 0 0 18px rgba(113, 112, 255, 0.35); }

.svc-pipeline .svc-icon {
  color: #6ecff0;
  background: rgba(56, 189, 248, 0.09);
  border-color: rgba(56, 189, 248, 0.26);
}
.card.svc-pipeline:hover .svc-icon { box-shadow: 0 0 18px rgba(56, 189, 248, 0.32); }

.svc-pulse .svc-icon {
  color: #7ee2a8;
  background: rgba(74, 222, 128, 0.09);
  border-color: rgba(74, 222, 128, 0.26);
}
.card.svc-pulse:hover .svc-icon { box-shadow: 0 0 18px rgba(74, 222, 128, 0.30); }

.svc-code .svc-icon {
  color: #f0c674;
  background: rgba(240, 184, 102, 0.09);
  border-color: rgba(240, 184, 102, 0.26);
}
.card.svc-code:hover .svc-icon { box-shadow: 0 0 18px rgba(240, 184, 102, 0.30); }

/* ============ Experience: timeline rail ============ */
.timeline {
  position: relative;
  display: flex; flex-direction: column; gap: 20px;
  max-width: 860px;
  padding-left: 34px;
}
.timeline::before {
  content: '';
  position: absolute; left: 8px; top: 14px; bottom: 14px;
  width: 1px;
  background: linear-gradient(180deg,
    rgba(113, 112, 255, 0.55), rgba(94, 106, 210, 0.22) 55%, transparent);
}
.role {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 28px 30px;
  transition: background 0.2s ease;
}
.role:hover { background: var(--surface-2); }
.role-node {
  position: absolute; left: -30.5px; top: 31px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(113, 112, 255, 0.7);
}
.role-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  margin-bottom: 16px;
}
.role-title { font: 590 19px/1.3 var(--font); letter-spacing: -0.24px; color: var(--text); }
.role-company { font: 510 14px/1.5 var(--font); color: var(--accent-hover); margin-top: 2px; }
.role-period {
  font-size: 11.5px; color: var(--text-4); white-space: nowrap;
  padding: 5px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  background: var(--surface);
}
.role-bullets { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.role-bullets li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px; line-height: 1.62;
  color: var(--text-3);
}
.role-bullets li::before {
  content: '';
  position: absolute; left: 2px; top: 9px;
  width: 5px; height: 5px; border-radius: 1.5px;
  background: var(--brand);
  box-shadow: 0 0 6px rgba(94, 106, 210, 0.6);
}

/* ============ Projects ============ */
.projects-grid { grid-template-columns: repeat(3, 1fr); }
.project-card { display: flex; flex-direction: column; color: inherit; padding: 24px; }
.project-card:hover { color: inherit; transform: translateY(-3px); }
.project-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.project-card .card-title {
  font-family: var(--mono);
  font-size: 14px; font-weight: 500;
  margin-bottom: 0; letter-spacing: -0.1px;
}
.project-arrow {
  color: var(--text-4);
  font-size: 15px;
  transition: transform 0.2s ease, color 0.2s ease;
}
.project-card:hover .project-arrow {
  color: var(--accent-hover);
  transform: translate(2px, -2px);
}
.project-card .card-desc { font-size: 13.5px; flex-grow: 1; }
.project-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.lang-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}
.lang-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-4); }
.lang-Go { background: #00add8; box-shadow: 0 0 6px rgba(0, 173, 216, 0.55); }
.lang-Terraform { background: #a874ff; box-shadow: 0 0 6px rgba(168, 116, 255, 0.55); }
.lang-Python { background: #ffd343; box-shadow: 0 0 6px rgba(255, 211, 67, 0.45); }
.lang-TypeScript { background: #3178c6; box-shadow: 0 0 6px rgba(49, 120, 198, 0.55); }
.project-shows {
  font-size: 11.5px; color: var(--text-4);
  text-align: right;
  line-height: 1.4;
}

/* ============ Skills ============ */
.skills-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 32px; }
.skill-group {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.skill-group-name {
  font-size: 11px; font-weight: 500;
  letter-spacing: 1.6px;
  color: var(--text-4);
  text-transform: uppercase;
  margin-bottom: 13px;
}
.skill-group .tag-row { margin-top: 0; }

/* ============ Contact ============ */
.section-contact { padding-bottom: 40px; }

/* Gradient-border shell that makes the whole section pop */
.contact-shell {
  position: relative;
  border-radius: 20px;
  padding: 1px; /* gradient border thickness */
  background: linear-gradient(140deg,
    rgba(113, 112, 255, 0.45), rgba(113, 112, 255, 0.10) 30%,
    rgba(126, 226, 168, 0.10) 65%, rgba(126, 226, 168, 0.35));
}
.contact-inner {
  position: relative;
  border-radius: 19px;
  background:
    radial-gradient(70% 90% at 12% 0%, rgba(94, 106, 210, 0.16), transparent 55%),
    radial-gradient(55% 70% at 95% 100%, rgba(39, 166, 68, 0.08), transparent 60%),
    #0b0c0f;
  padding: 48px 44px 44px;
  overflow: hidden;
}
/* Soft aurora wash drifting across the panel */
.contact-aurora {
  position: absolute; inset: -40%;
  z-index: 0;
  background:
    radial-gradient(38% 30% at 30% 40%, rgba(113, 112, 255, 0.12), transparent 70%),
    radial-gradient(30% 26% at 70% 60%, rgba(126, 226, 168, 0.07), transparent 70%);
  animation: aurora 16s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes aurora {
  from { transform: translate3d(-4%, -3%, 0) rotate(0deg); }
  to { transform: translate3d(4%, 3%, 0) rotate(4deg); }
}
.contact-inner > * { position: relative; z-index: 1; }
.section-contact .section-head { margin-bottom: 22px; }
.avail-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10px; font-weight: 500;
  letter-spacing: 1.6px;
  color: var(--green-soft);
  padding: 6px 12px 6px 9px;
  border: 1px solid rgba(39, 166, 68, 0.3);
  border-radius: 9999px;
  background: rgba(39, 166, 68, 0.08);
  white-space: nowrap;
}
.grad-word {
  background: linear-gradient(90deg, #828fff, #7ee2a8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.contact-layout {
  display: grid; grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: start;
}
.contact-form {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 32px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 18px; }
.field label, .kind-field legend {
  display: block;
  font: 510 13px/1 var(--font);
  color: var(--text-2);
  margin-bottom: 8px;
}
.optional { color: var(--text-4); font-weight: 400; }
.field input[type="text"], .field input[type="email"], .field textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  padding: 11px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.22);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-4); }

.kind-field { border: none; }
.kind-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.kind-pill { cursor: pointer; }
.kind-pill input { position: absolute; opacity: 0; pointer-events: none; }
.kind-pill span {
  display: inline-block;
  font: 510 13px/1 var(--font);
  color: var(--text-3);
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--surface);
  transition: all 0.15s ease;
}
.kind-pill:hover span { border-color: rgba(130, 143, 255, 0.4); color: var(--text-2); }
.kind-pill input:checked + span {
  color: #fff;
  background: linear-gradient(180deg, #6a76e0, var(--brand));
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 10px rgba(94, 106, 210, 0.35);
}
.kind-pill input:focus-visible + span { box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.35); }

.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.form-foot { display: flex; align-items: center; gap: 16px; margin-top: 4px; flex-wrap: wrap; }
.form-status { font-size: 13.5px; color: var(--text-3); }
.form-status.ok { color: var(--green-soft); }
.form-status.err { color: #f87171; }

.contact-direct {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 28px;
}
.contact-direct-title {
  font: 590 16px/1.3 var(--font);
  color: var(--text);
  margin-bottom: 20px;
}
.contact-line {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 14px;
  margin-bottom: 14px;
}
.contact-label {
  font-size: 9.5px; letter-spacing: 1.4px;
  color: var(--text-4);
  width: 68px; flex-shrink: 0;
}
.copy-btn {
  font-size: 10.5px;
  color: var(--text-3);
  background: var(--surface-3);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-family: var(--mono);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.copy-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(130, 143, 255, 0.4);
}
.contact-note {
  margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px; line-height: 1.6;
  color: var(--text-4);
}

/* ============ Footer ============ */
.footer {
  margin-top: 96px;
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent);
  padding: 34px 0 46px;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
  flex-wrap: wrap;
}
.footer p { font-size: 13px; color: var(--text-4); }
.footer-edu { margin-top: 4px; font-size: 12px; }
.footer-built { font-size: 11px; letter-spacing: 0; }
.f-prompt { color: #7ee2a8; }
.f-arrow { color: var(--text-4); }
.f-ok { color: var(--green-soft); }

/* ============ Reveal animations (JS adds .js-anim to <html>) ============ */
.js-anim .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.js-anim .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-anim .reveal { opacity: 1; transform: none; transition: none; }
  .ticker-track { animation: none; }
  .status-dot { animation: none; }
  .cursor { animation: none; }
  .contact-aurora { animation: none; }
}

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-term { max-width: 640px; }
  .term-body { height: 300px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-layout { grid-template-columns: 1fr; }
  .skills-groups { grid-template-columns: 1fr; }
}

/* Nav collapses to the menu earlier than the content grids —
   the link row + CTA get cramped well before 640px. */
@media (max-width: 800px) {
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 24px; font-size: 15px; border-radius: 0; }
  .nav-links a::after { display: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 640px) {
  .section { padding: 68px 0 8px; }
  .hero { padding: 64px 0 52px; }
  .hero-title { letter-spacing: -1.4px; }
  .cards-grid, .projects-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .role-head { flex-direction: column; gap: 8px; }
  .contact-form { padding: 24px; }
  .contact-shell { border-radius: 16px; }
  .contact-inner { padding: 28px 20px 24px; border-radius: 15px; }
  .avail-chip { display: none; }
  .timeline { padding-left: 26px; }
  .role-node { left: -22.5px; }
  .timeline::before { left: 3px; }
  .term-body { height: 260px; font-size: 11.5px; }
  .footer-inner { flex-direction: column; }
  .brand-sub { display: none; }
  .nav-inner { height: 60px; }
}
