/* ============================================================
   karthickrajan.com  —  styles
   ============================================================ */

:root {
  --bg: #0b0d12;
  --bg-alt: #10131b;
  --panel: #141823;
  --panel-2: #1a1f2c;
  --border: #232a3a;
  --text: #e7ebf3;
  --text-dim: #9aa3b8;
  --text-muted: #6b7388;
  --brand: #5b8def;
  --brand-2: #8b5cf6;
  --brand-3: #06b6d4;
  --accent: #34d399;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
  --shadow-lg: 0 30px 80px -20px rgba(0,0,0,0.6);
  --container: 1180px;
  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme='light'] {
  --bg: #ffffff;
  --bg-alt: #f6f8fc;
  --panel: #ffffff;
  --panel-2: #f1f4fa;
  --border: #e3e8f0;
  --text: #0f1422;
  --text-dim: #475068;
  --text-muted: #6b7388;
  --shadow: 0 10px 40px -15px rgba(15, 20, 34, 0.15);
  --shadow-lg: 0 30px 80px -25px rgba(15, 20, 34, 0.2);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(11, 13, 18, 0.7);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

html[data-theme='light'] .nav {
  background: rgba(255, 255, 255, 0.8);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px;
}
.brand-mark {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.brand-name .dot { color: var(--brand); }

.nav-links {
  display: flex; gap: 28px; list-style: none;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a {
  color: var(--text-dim);
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text); }

.theme-toggle {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 38px; height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--brand);
}

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

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 120px 28px 80px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 20% 30%, rgba(91, 141, 239, 0.18), transparent 60%),
    radial-gradient(ellipse 700px 500px at 80% 70%, rgba(139, 92, 246, 0.15), transparent 60%),
    radial-gradient(ellipse 500px 400px at 50% 100%, rgba(6, 182, 212, 0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

html[data-theme='light'] .hero-bg {
  background:
    radial-gradient(ellipse 800px 600px at 20% 30%, rgba(91, 141, 239, 0.12), transparent 60%),
    radial-gradient(ellipse 700px 500px at 80% 70%, rgba(139, 92, 246, 0.08), transparent 60%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 28px;
}
.hero-tag::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.hero h1 {
  font-size: clamp(40px, 7vw, 78px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
  max-width: 900px;
}
.gradient {
  background: linear-gradient(135deg, var(--brand), var(--brand-2) 50%, var(--brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-role {
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 22px;
}
.hero-role .sep { color: var(--text-muted); margin: 0 6px; }

.hero-summary {
  font-size: clamp(15px, 1.6vw, 17px);
  color: var(--text-dim);
  max-width: 720px;
  margin-bottom: 36px;
  line-height: 1.7;
}
.hero-summary strong { color: var(--text); font-weight: 600; }

.hero-cta {
  display: flex;
  gap: 12px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  box-shadow: 0 8px 24px -6px rgba(91, 141, 239, 0.5);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px -6px rgba(91, 141, 239, 0.6); }
.btn-ghost {
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
}
.dot-green {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.scroll-down {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  animation: bounce 2.5s infinite;
  z-index: 1;
}
@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 8px); }
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding: 110px 0;
  position: relative;
}
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 780px;
  margin-bottom: 60px;
}
.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--brand);
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}
.section-head h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* ============================================================
   About
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

.about-text p {
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 20px;
  line-height: 1.75;
}
.about-text strong { color: var(--text); font-weight: 600; }
.about-text em { color: var(--brand); font-style: normal; font-weight: 500; }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: all var(--transition);
}
.stat:hover { border-color: var(--brand); transform: translateY(-3px); }
.stat-num {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ============================================================
   Skills
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.skill-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: all var(--transition);
}
.skill-card:hover {
  border-color: var(--brand);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.skill-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(91, 141, 239, 0.15), rgba(139, 92, 246, 0.15));
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.skill-icon svg { width: 22px; height: 22px; }
.skill-card h3 {
  font-size: 16.5px;
  font-weight: 600;
  margin-bottom: 14px;
}
.pill-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill-list li {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
}

/* ============================================================
   Experience timeline
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 28px;
  max-width: 920px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--brand), var(--brand-2), transparent);
}

.tl-item {
  position: relative;
  margin-bottom: 44px;
}
.tl-item:last-child { margin-bottom: 0; }

.tl-marker {
  position: absolute;
  left: -28px;
  top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--brand);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--brand);
}

.tl-head {
  margin-bottom: 14px;
}
.tl-head h3 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 4px;
}
.tl-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}

.tl-points {
  list-style: none;
  padding-left: 0;
}
.tl-points li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.7;
}
.tl-points li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 11px;
  width: 8px; height: 2px;
  background: var(--brand);
  border-radius: 1px;
}
.tl-points strong { color: var(--text); font-weight: 600; }

/* ============================================================
   Projects
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: all var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: var(--brand);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.project-card.featured {
  background: linear-gradient(135deg, rgba(91, 141, 239, 0.08), rgba(139, 92, 246, 0.08)), var(--panel);
  border-color: rgba(91, 141, 239, 0.3);
  grid-column: span 2;
}
@media (max-width: 760px) {
  .project-card.featured { grid-column: span 1; }
}

.project-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brand);
  margin-bottom: 14px;
}

.project-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.project-card p {
  font-size: 14.5px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 20px;
  flex-grow: 1;
}
.project-card code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--panel-2);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text);
}

.tech-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tech-tags li {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 9px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
}

/* ============================================================
   Education
   ============================================================ */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 700px) {
  .edu-grid { grid-template-columns: 1fr; }
}

.edu-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  position: relative;
  transition: all var(--transition);
}
.edu-card:hover { border-color: var(--brand); transform: translateY(-3px); }

.edu-year {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 10px;
}
.edu-card h3 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 6px;
}
.edu-card p {
  color: var(--text-dim);
  font-size: 14.5px;
  margin-bottom: 14px;
}
.edu-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 100px;
}

/* ============================================================
   Certifications
   ============================================================ */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.cert-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: all var(--transition);
}
.cert-card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: var(--shadow); }
.cert-issuer {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brand);
  margin-bottom: 12px;
}
.cert-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.cert-card p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ============================================================
   Contact
   ============================================================ */
.contact-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 44px 40px;
  max-width: 760px;
}
.contact-lead {
  font-size: 17px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 32px;
}
.contact-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.contact-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
  padding: 16px 20px;
  background: var(--panel);
  transition: background var(--transition);
}
.contact-row:hover { background: var(--panel-2); }
.contact-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}
.contact-value {
  font-size: 15px;
  font-weight: 500;
}

@media (max-width: 600px) {
  .contact-card { padding: 32px 26px; }
  .contact-row { grid-template-columns: 1fr; gap: 4px; padding: 14px 18px; }
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  padding: 36px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: var(--text-muted);
  gap: 20px;
  flex-wrap: wrap;
}
.footer-meta { font-family: var(--font-mono); font-size: 12.5px; }

/* ============================================================
   Reveal-on-scroll
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
