/* ==========================================================================
   Gowthaman Arumugam — profile site
   Design tokens + layout. Dark-first, light theme via [data-theme="light"].
   ========================================================================== */

:root {
  /* type */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* dark palette (default) */
  --bg: #0a0f1c;
  --bg-alt: #0e1526;
  --surface: #131c31;
  --surface-2: #182238;
  --border: rgba(148, 163, 199, 0.16);
  --text: #e6ebf5;
  --text-soft: #a9b4cc;
  --text-faint: #7c88a3;
  --accent: #5eead4;
  --accent-strong: #2dd4bf;
  --accent-ink: #062a26;
  --accent-2: #93c5fd;
  --shadow: 0 12px 40px rgba(2, 6, 18, 0.5);
  --nav-bg: rgba(10, 15, 28, 0.82);

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --bg: #fbfaf7;
  --bg-alt: #f3f1ea;
  --surface: #ffffff;
  --surface-2: #f7f5ef;
  --border: rgba(30, 41, 59, 0.12);
  --text: #16202e;
  --text-soft: #47536b;
  --text-faint: #6b7690;
  --accent: #0f766e;
  --accent-strong: #0d9488;
  --accent-ink: #ffffff;
  --accent-2: #1d4ed8;
  --shadow: 0 10px 32px rgba(23, 30, 46, 0.08);
  --nav-bg: rgba(251, 250, 247, 0.85);
}

/* ---------- reset & base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code { font-family: var(--font-mono); font-size: 0.86em; background: var(--surface-2); padding: 0.12em 0.4em; border-radius: 5px; border: 1px solid var(--border); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
.container.narrow { max-width: 860px; }
.center { text-align: center; }
.muted { color: var(--text-faint); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 18px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ---------- typography ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 6.5vw, 4.4rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); margin-bottom: 0.6em; }
h3 { font-size: 1.28rem; font-weight: 600; }

.kicker {
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 14px;
}
.eyebrow {
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.06em;
  color: var(--accent); margin-bottom: 22px;
}
.section-lede { max-width: 780px; color: var(--text-soft); font-size: 1.06rem; margin-bottom: 40px; }
.prose p { margin-bottom: 1.1em; color: var(--text-soft); font-size: 1.06rem; }
.prose strong, .section-lede strong { color: var(--text); }

/* ---------- nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}
.site-nav nav {
  max-width: var(--container); margin: 0 auto; padding: 14px clamp(20px, 4vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark {
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 600;
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); color: var(--accent);
}
.brand-name { font-size: 0.95rem; letter-spacing: 0.01em; }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2vw, 26px); list-style: none; }
.nav-links a { color: var(--text-soft); font-size: 0.92rem; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
#theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 9px;
  width: 34px; height: 34px; display: grid; place-items: center;
  color: var(--text-soft); cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
#theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
[data-theme="light"] .icon-moon { display: none; }
:root:not([data-theme="light"]) .icon-sun { display: none; }
html:not([data-theme]) .icon-sun { display: none; }

.nav-toggle { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-weight: 600; font-size: 0.94rem; border: 1px solid transparent;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent-strong); color: var(--accent-ink); box-shadow: 0 6px 22px rgba(45, 212, 191, 0.25); }
.btn-primary:hover { box-shadow: 0 10px 28px rgba(45, 212, 191, 0.35); }
.btn-ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }

/* ---------- hero ---------- */
.hero {
  padding: clamp(80px, 12vh, 140px) 0 clamp(60px, 9vh, 100px);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(52rem 30rem at 82% -12%, rgba(94, 234, 212, 0.09), transparent 60%),
    radial-gradient(40rem 26rem at -10% 110%, rgba(147, 197, 253, 0.07), transparent 60%);
}
[data-theme="light"] .hero::before {
  background:
    radial-gradient(52rem 30rem at 82% -12%, rgba(13, 148, 136, 0.08), transparent 60%),
    radial-gradient(40rem 26rem at -10% 110%, rgba(29, 78, 216, 0.05), transparent 60%);
}
.hero .container { position: relative; }
.hero-grid {
  display: grid; grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(36px, 6vw, 72px); align-items: center;
}
.hero-photo { margin: 0; justify-self: center; position: relative; }
.hero-photo img {
  display: block; width: min(290px, 100%); max-width: 100%; height: auto;
  border-radius: 22px; border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero-photo::before {
  content: ""; position: absolute; inset: -14px; z-index: -1;
  border-radius: 30px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 28%, transparent), transparent 55%);
  filter: blur(2px);
}
.hero-role {
  font-size: clamp(1.1rem, 2.4vw, 1.45rem); color: var(--text-soft);
  font-weight: 500; margin: 14px 0 22px;
}
.hero-lede { max-width: 720px; font-size: 1.1rem; color: var(--text-soft); }
.hero-lede strong { color: var(--text); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-cta.center { justify-content: center; }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin-top: clamp(48px, 7vh, 72px); padding-top: 36px;
  border-top: 1px solid var(--border);
}
.hero-stats dt {
  font-family: var(--font-display); font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  color: var(--accent); font-weight: 500;
}
.hero-stats dd { color: var(--text-faint); font-size: 0.9rem; margin-top: 6px; max-width: 24ch; }

/* ---------- sections ---------- */
.section { padding: clamp(70px, 10vh, 110px) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow);
}

/* ---------- pillars ---------- */
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 44px; }
.pillar-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.pillar-icon {
  flex: none; width: 50px; height: 50px; border-radius: 13px;
  display: grid; place-items: center; color: var(--accent);
  background: linear-gradient(140deg, var(--surface-2), transparent);
  border: 1px solid var(--border);
}
.pillar-sub { color: var(--text-faint); font-size: 0.92rem; margin-top: 4px; }
.pillar-list { list-style: none; display: grid; gap: 12px; }
.pillar-list li {
  padding-left: 22px; position: relative; color: var(--text-soft); font-size: 0.97rem;
}
.pillar-list li::before {
  content: "▸"; position: absolute; left: 0; color: var(--accent); font-size: 0.85em; top: 2px;
}
.pillar-list strong { color: var(--text); }
.pillar-metrics {
  margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border);
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent);
  line-height: 1.8;
}

/* ---------- research ---------- */
.research-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.research-card h3 { margin: 4px 0 4px; font-size: 1.35rem; }
.card-sub { color: var(--text-faint); font-size: 0.94rem; margin-bottom: 14px; font-weight: 500; }
.research-card > p:not(.card-sub) { color: var(--text-soft); font-size: 0.97rem; margin-bottom: 14px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.03em;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--text-faint); background: var(--surface-2);
}
.tag-teal { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.mini-list { list-style: none; display: grid; gap: 9px; margin-bottom: 18px; }
.mini-list li { padding-left: 20px; position: relative; font-size: 0.93rem; color: var(--text-soft); }
.mini-list li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.mini-list strong { color: var(--text); }
.card-links { display: flex; flex-wrap: wrap; gap: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.card-links a { font-weight: 600; font-size: 0.9rem; }

.community { margin-top: 46px; }
.community h3 { margin-bottom: 18px; }
.community-list { list-style: none; display: grid; gap: 12px; max-width: 900px; }
.community-list li { display: flex; gap: 14px; align-items: baseline; color: var(--text-soft); font-size: 0.97rem; }
.community-list .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }

.results-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  margin-top: 48px; padding: 30px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.results-strip dt { font-family: var(--font-display); font-size: 1.7rem; color: var(--accent); }
.results-strip dd { color: var(--text-faint); font-size: 0.87rem; margin-top: 6px; }

/* ---------- writing ---------- */
.writing-list { display: grid; gap: 18px; max-width: 920px; }
.writing-item { display: block; color: inherit; padding: 24px 28px; transition: transform 0.2s var(--ease), border-color 0.2s; }
.writing-item:hover { text-decoration: none; transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.writing-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.writing-item h3 { font-size: 1.12rem; margin-bottom: 8px; color: var(--text); }
.writing-item p { color: var(--text-soft); font-size: 0.94rem; margin-bottom: 10px; }
.writing-cta { font-weight: 600; font-size: 0.88rem; color: var(--accent); }
.writing-more { margin-top: 26px; color: var(--text-faint); font-size: 0.94rem; max-width: 920px; }

/* ---------- timeline ---------- */
.timeline { position: relative; margin-top: 46px; display: grid; gap: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px; background: linear-gradient(var(--accent), transparent);
  opacity: 0.35;
}
.tl-item { position: relative; padding-left: 42px; }
.tl-marker {
  position: absolute; left: 0; top: 30px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.tl-head { margin-bottom: 14px; }
.tl-org { color: var(--text-faint); font-size: 0.94rem; margin-top: 4px; }
.tl-date { font-family: var(--font-mono); font-size: 0.85em; color: var(--accent); }
.tl-body ul { list-style: none; display: grid; gap: 10px; }
.tl-body li { padding-left: 22px; position: relative; color: var(--text-soft); font-size: 0.97rem; }
.tl-body li::before { content: "▸"; position: absolute; left: 0; top: 2px; color: var(--accent); font-size: 0.85em; }
.tl-body strong { color: var(--text); }

/* ---------- skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 44px; }
.skill-group { padding: 22px; }
.skill-group h3 { font-family: var(--font-body); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  font-size: 0.83rem; color: var(--text-soft);
  padding: 5px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
}

/* ---------- education / contact / footer ---------- */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 40px; }
.edu-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.edu-card p { color: var(--text-soft); font-size: 0.94rem; }
.edu-card .muted { margin-top: 6px; font-size: 0.88rem; }

.contact { padding-bottom: clamp(90px, 12vh, 130px); }

.site-footer { border-top: 1px solid var(--border); padding: 30px 0; background: var(--bg-alt); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.88rem; color: var(--text-faint); }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .pillars, .research-grid, .edu-grid { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-photo { order: -1; justify-self: start; }
  .hero-photo img { width: min(220px, 55vw); border-radius: 18px; }
  .hero-photo::before { inset: -10px; border-radius: 24px; }
  .hero-stats, .results-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .brand-name { display: none; }
  .nav-toggle {
    display: flex; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px;
  }
  .nav-toggle span { width: 22px; height: 2px; background: var(--text); transition: transform 0.25s, opacity 0.25s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start;
    background: var(--nav-bg); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 18px clamp(20px, 4vw, 40px) 24px; gap: 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 24px; }
  .results-strip { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
}
