/* Jay Patel — modern portfolio */
:root {
  --bg-deep: #070a12;
  --bg-surface: #0f1419;
  --bg-elevated: #151b24;
  --header-bg: rgba(7, 10, 18, 0.75);
  --hero-gradient: linear-gradient(135deg, #fff 0%, #a5f3fc 50%, var(--accent) 100%);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaed;
  --text-muted: #9aa0a6;
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.15);
  --accent-glow: rgba(34, 211, 238, 0.35);
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 72px;
  --max: 1120px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-deep: #f4f7fb;
  --bg-surface: #ffffff;
  --bg-elevated: #eef3f9;
  --border: rgba(15, 23, 42, 0.12);
  --text: #111827;
  --text-muted: #4b5563;
  --accent: #0ea5e9;
  --accent-dim: rgba(14, 165, 233, 0.12);
  --accent-glow: rgba(14, 165, 233, 0.25);
  /* lighter header and a darker hero gradient so the heading remains visible on white */
  --header-bg: rgba(255, 255, 255, 0.85);
  --hero-gradient: linear-gradient(135deg, #0f1724 0%, #7dd3fc 50%, var(--accent) 100%);
}

/* Light theme - variant 2: warmer palette (preferred) */
[data-theme="light"][data-light-variant="2"] {
  --accent: #ff7a59; /* coral */
  --accent-dim: rgba(255, 122, 89, 0.12);
  --accent-glow: rgba(255, 122, 89, 0.20);
  --hero-gradient: linear-gradient(135deg, #0b1220 0%, #ffb78a 45%, var(--accent) 100%);
}

/* Light theme - variant 3: cool teal */
[data-theme="light"][data-light-variant="3"] {
  --accent: #06b6d4; /* teal */
  --accent-dim: rgba(6, 182, 212, 0.10);
  --accent-glow: rgba(6, 182, 212, 0.22);
  --hero-gradient: linear-gradient(135deg, #08101a 0%, #7ee7ff 45%, var(--accent) 100%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 200;
  width: auto;
  height: auto;
  overflow: visible;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--accent);
  color: #042f2e;
  border-radius: var(--radius-sm);
  outline: 2px solid #fff;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease), opacity 0.2s var(--ease);
}

a:hover {
  color: #67e8f9;
}

.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(34, 211, 238, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(99, 102, 241, 0.06), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(34, 211, 238, 0.05), transparent),
    var(--bg-deep);
}

/* light theme: make mesh warmer/softer for a pleasant white background */
[data-theme="light"] .bg-mesh {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(14, 165, 233, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(255, 122, 89, 0.04), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(34, 211, 238, 0.03), transparent),
    var(--bg-deep);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 20%, transparent 100%);
  pointer-events: none;
}

/* SVG blobs container (stronger animated background) */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  opacity: 0.12;
  transform-origin: center;
  filter: blur(28px) saturate(120%);
}

@keyframes blob-move {
  0% { transform: translate3d(-4%, -2%, 0) scale(1); }
  50% { transform: translate3d(6%, 4%, 0) scale(1.06); }
  100% { transform: translate3d(-4%, -2%, 0) scale(1); }
}

.bg-blobs svg { width: 120%; height: 120%; animation: blob-move 36s ease-in-out infinite; }

/* lazy-image blur-up */
.img-lazy {
  display: block;
  width: 100%;
  height: auto;
  filter: blur(8px) saturate(80%);
  transform: scale(1.02);
  transition: filter 480ms ease, transform 480ms ease, opacity 360ms ease;
  opacity: 0.98;
}
.img-lazy.loaded {
  filter: none;
  transform: none;
  opacity: 1;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  /* use theme-aware header background */
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

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

/* typed brand styles */
/* brand typing removed - brand is static */

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-desktop a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  margin-left: auto;
  margin-right: 0.5rem;
}

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  padding: 1rem;
  background: rgba(15, 20, 25, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  gap: 0.25rem;
  z-index: 99;
}

.nav-mobile.open {
  display: flex;
}

.nav-mobile a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}

.nav-mobile a:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

main {
  /* give extra breathing room so first section doesn't touch the fixed header */
  padding-top: calc(var(--header-h) + 12px);
}

.section {
  padding: 5rem 1.5rem;
  max-width: var(--max);
  margin: 0 auto;
}

.section-head {
  margin-bottom: 2.5rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--text);
}

.section-lead {
  margin: 0.75rem 0 0;
  max-width: 52ch;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 1.5rem 5rem;
  max-width: var(--max);
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
  width: fit-content;
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0 0 1rem;
  /* theme-aware gradient for good contrast in both dark and light modes */
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* typed text cursor and accessible typing styles */
.typed::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.05em;
  background: var(--accent);
  margin-left: 0.45rem;
  vertical-align: middle;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.typed {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
}

.hero-sub {
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  color: var(--text-muted);
  max-width: 42ch;
  margin: 0 0 1.5rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.35rem 0.65rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #0891b2, var(--accent));
  color: #042f2e;
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn-primary:hover {
  color: #042f2e;
  box-shadow: 0 0 32px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.social-row {
  display: flex;
  gap: 1rem;
}

.social-row a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.social-row a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.stat-row {
  margin: 0 0 1.75rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  max-width: 640px;
}

/* project card micro-interactions */
.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 1.25rem;
  border-radius: 12px;
  transition: transform 160ms var(--ease), box-shadow 200ms var(--ease), border-color 160ms var(--ease);
}
.project-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 8px 30px rgba(2,6,23,0.25), 0 2px 6px rgba(0,0,0,0.06);
  border-color: var(--accent);
}

/* subtle animated background movement for the mesh */
.bg-mesh {
  animation: mesh-drift 24s linear infinite;
  background-size: 120% 140%;
}

@keyframes mesh-drift {
  0% { background-position: 10% 10%; }
  50% { background-position: 90% 70%; }
  100% { background-position: 10% 10%; }
}

/* improve contrast when typed text appears (light theme) */
.typed { color: var(--accent); }

.stat-card {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
}

.stat-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1rem;
}

.projects-toolbar {
  margin-bottom: 1.25rem;
}

.project-search {
  width: min(100%, 520px);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.8rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
}

.chip.active,
.chip:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.project-card.is-hidden {
  display: none;
}

.project-empty {
  margin-top: 1rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.to-top-btn {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: all 0.25s var(--ease);
}

.to-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), box-shadow 240ms var(--ease);
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 12px 36px rgba(2,6,23,0.18), 0 4px 10px rgba(0,0,0,0.06);
}

/* left accent bar that grows on hover */
.project-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), rgba(255,255,255,0.06));
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 260ms var(--ease);
  /* allow clicks through decorative pseudo-element */
  pointer-events: none;
}
.project-card:hover::before { transform: scaleY(1); }

/* subtle overlay on hover */
.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.02));
  opacity: 0;
  transition: opacity 260ms var(--ease);
  /* decorative overlay should not block interactions */
  pointer-events: none;
}
.project-card:hover::after { opacity: 1; }

.project-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.project-card h3 { display: flex; align-items: center; gap: 0.6rem; transition: transform 180ms var(--ease); }
.project-icon { color: var(--accent); font-size: 1.05rem; width: 1.3rem; text-align: center; }
.project-card:hover h3 { transform: translateY(-3px); }

.project-card p { margin: 0 0 0.9rem; }

.project-card p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
}

/* project thumbnail */
.project-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.9rem;
  display: block;
}

@media screen and (max-width: 640px) {
  .project-thumb { height: 220px; }
}


.project-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.project-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

.timeline {
  position: relative;
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 2.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.timeline-item h3 {
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
}

.timeline-item h4 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.timeline-item ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  list-style: disc;
}

.timeline-item li {
  margin-bottom: 0.35rem;
}

.course-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.course-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  transition: border-color 0.2s;
}

.course-card:hover {
  border-color: rgba(34, 211, 238, 0.25);
}

.course-card h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.course-card h3::before {
  content: "▹";
  color: var(--accent);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.course-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.course-card a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.course-card .cert-link {
  margin-top: 0.5rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

thead {
  background: var(--bg-elevated);
}

th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-align: left;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

td:first-child {
  color: var(--text);
  font-weight: 500;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: rgba(34, 211, 238, 0.04);
}

.interest-block {
  margin-bottom: 2rem;
}

.interest-block:last-child {
  margin-bottom: 0;
}

.interest-block h4 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.interest-block ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.interest-block li {
  margin-bottom: 0.4rem;
}

.footer-cta {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-deep) 100%);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 1.5rem;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.footer-cta h2 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.footer-cta p {
  margin: 0;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: right;
}

.footer-links span,
.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links a {
  color: var(--accent);
}

.footer-bar {
  text-align: center;
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .nav-desktop {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .theme-toggle {
    margin-left: 0;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-links {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .stat-row {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}
