/* ============================================================
   Varghese Chacko — Portfolio
   Concept: AI-futuristic — deep space, violet/cyan gradient glow,
   glassmorphic cards, procedurally generated neural-mesh backdrop.
   ============================================================ */

:root {
  --bg: #05060c;
  --bg-alt: #090b16;
  --bg-card: rgba(255, 255, 255, 0.045);
  --bg-card-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.20);
  --text: #eef0fb;
  --text-muted: #a6acc4;
  --text-faint: #6c728c;
  --violet: #7c5cff;
  --cyan: #22d3ee;
  --gradient: linear-gradient(120deg, var(--violet), var(--cyan));
  --accent: #8f7bff;
  --accent-soft: rgba(124, 92, 255, 0.14);

  --font-display: "Sora", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --container: 1160px;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}

/* ---------- Generated background layers ---------- */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
  overflow: hidden;
}
.mesh-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.glow {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}
.glow-a {
  width: 560px; height: 560px;
  top: -160px; left: -120px;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.35), transparent 70%);
}
.glow-b {
  width: 620px; height: 620px;
  bottom: -220px; right: -160px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.28), transparent 70%);
}
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.015em;
  color: var(--text);
}

p { margin: 0 0 1em; color: var(--text-muted); }
p:last-child { margin-bottom: 0; }

.grad-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--gradient);
  color: #07080f;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset, 0 12px 28px rgba(124, 92, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 16px 34px rgba(124, 92, 255, 0.45); }
.btn-ghost {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--line-strong);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-1px); }
.btn-lg { padding: 17px 32px; font-size: 16px; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(5, 6, 12, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 14.5px;
  font-weight: 500;
}
.nav a { color: var(--text-muted); transition: color 0.15s ease; }
.nav a:hover { color: var(--text); }
.nav-cta {
  color: var(--text) !important;
  border: 1px solid var(--line-strong);
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--bg-card);
}
.nav-cta:hover { border-color: var(--cyan); color: var(--cyan) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  background: none; border: none; cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 168px 0 104px;
  overflow: hidden;
}
.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: center;
}
.hero-grid > * { min-width: 0; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--cyan);
  margin: 0 0 22px;
}
.eyebrow-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 12px rgba(124, 92, 255, 0.8);
}
.hero h1 {
  font-size: clamp(46px, 6.2vw, 78px);
  margin-bottom: 24px;
}
.hero-value {
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 44ch;
  margin-bottom: 36px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 52px;
}
.hero-stats {
  display: flex;
  gap: 44px;
  list-style: none;
  margin: 0; padding: 0;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}
.hero-stats li {
  font-size: 13px;
  color: var(--text-faint);
  max-width: 15ch;
}
.hero-stats span {
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text);
  font-weight: 700;
}

.hero-media { position: relative; z-index: 2; }
.frame {
  margin: 0;
  position: relative;
  padding: 3px;
  border-radius: var(--radius);
  background: var(--gradient);
}
.frame-inner {
  background: var(--bg);
  border-radius: calc(var(--radius) - 3px);
  overflow: hidden;
}
.frame img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 75% 35%;
  filter: grayscale(1) contrast(1.1) brightness(0.95);
  display: block;
}
.frame figcaption {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
  text-align: center;
  padding: 12px 8px;
  background: var(--bg);
}

/* ---------- Sections ---------- */
.section { padding: 108px 0; position: relative; z-index: 2; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); }

.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 64px;
}
.about-copy p { font-size: 17px; color: var(--text-muted); }
.about-copy strong { color: var(--text); font-weight: 600; }

/* ---------- Pillars ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.pillar {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.pillar:hover { border-color: var(--line-strong); background: var(--bg-card-strong); }
.pillar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.pillar-icon {
  display: block;
  width: 36px;
  height: 36px;
}
.pillar-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}
.pillar h3 { font-size: 18px; margin-bottom: 12px; }
.pillar p { font-size: 14.5px; }

/* ---------- Work ---------- */
.work-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.work-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  display: grid;
  grid-template-columns: 0.9fr 2.1fr;
  gap: 32px;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.work-item:hover { border-color: var(--line-strong); background: var(--bg-card-strong); transform: translateY(-2px); }
.work-meta h3 { font-size: 20px; margin-top: 10px; }
.work-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--cyan);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.2);
}
.work-item p { font-size: 15px; }
.work-tech {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
}
.work-tech li {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 999px;
}

/* ---------- Writing ---------- */
.writing-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 24px;
  align-items: start;
}
.book-card {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(10px);
}
.book-card img {
  width: 130px;
  flex-shrink: 0;
  aspect-ratio: 474 / 589;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  filter: saturate(0.75) contrast(1.02);
}
.book-info h3 { font-size: 21px; margin: 6px 0 12px; }
.book-info p { font-size: 14.5px; }
.book-links { display: flex; gap: 18px; margin-top: 14px; }
.book-links a { font-size: 14px; font-weight: 600; color: var(--cyan); }
.book-links a:hover { color: var(--violet); }

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.note-item {
  background: var(--bg-card);
  padding: 22px 26px;
  display: block;
  backdrop-filter: blur(10px);
  transition: background 0.2s ease;
}
a.note-item:hover { background: var(--bg-card-strong); }
.note-item h4 {
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.note-item h4 span { color: var(--cyan); }
.note-item p { font-size: 14px; margin: 0; }

/* ---------- Speaking & Recognition ---------- */
.speaking-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.speaking-card {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.speaking-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.speaking-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: grayscale(0.3) contrast(1.05);
}
.speaking-card figcaption { padding: 22px; }
.speaking-card h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 12px 0 8px;
}
.speaking-card p { font-size: 13.5px; margin: 0; }

/* ---------- Stats band ---------- */
.stats-band { padding: 64px 0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.stat {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 20px;
  backdrop-filter: blur(10px);
}
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
}
.stat-num {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label {
  display: block;
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 8px;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 48px;
}
.skill-group h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
}
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chips li {
  font-size: 13px;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--bg-card);
}

/* ---------- Contact ---------- */
.section-contact { padding-bottom: 130px; }
.contact-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 48px;
  align-items: end;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 64px;
  backdrop-filter: blur(14px);
  overflow: hidden;
}
.contact-grid::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 24px;
  padding: 1px;
  background: var(--gradient);
  opacity: 0.35;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.contact-grid h2 { font-size: clamp(28px, 3.6vw, 42px); margin: 8px 0 18px; }
.contact-sub { font-size: 16px; max-width: 46ch; margin-bottom: 30px; }
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 15px;
  font-weight: 500;
}
.contact-links a { display: flex; align-items: center; gap: 10px; color: var(--text); transition: color 0.15s ease; }
.contact-links a:hover { color: var(--cyan); }
.contact-links span { color: var(--violet); }
.social-icon { width: 18px; height: 18px; flex: none; }
.location {
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 13.5px;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; position: relative; z-index: 2; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--text-faint);
}
.footer-inner a { color: var(--text-faint); }
.footer-inner a:hover { color: var(--text); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.revealed { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { max-width: 380px; margin: 0 auto; }
  .speaking-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 150px 0 72px; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .work-item { grid-template-columns: 1fr; }
  .writing-grid { grid-template-columns: 1fr; }
  .book-card { flex-direction: column; }
  .book-card img { width: 110px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; padding: 44px; }
}

@media (max-width: 680px) {
  .container { padding: 0 20px; }
  .nav {
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 20px 20px;
    transform: translateY(-120%);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }
  .nav.open { transform: translateY(0); opacity: 1; }
  .nav a { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--line); }
  .nav-cta { margin-top: 12px; text-align: center; border-bottom: none !important; }
  .nav-toggle { display: flex; }
  .hero { padding: 130px 0 60px; }
  .section { padding: 72px 0; }
  .pillars { grid-template-columns: 1fr; }
  .speaking-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .work-item { padding: 28px; }
  .contact-grid { padding: 32px; }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}
