/* ============================================================
   Sinthanai Selvan — Biostatistics / Epidemiology portfolio
   ============================================================ */

:root {
  --navy-900: #0a1a30;
  --navy-800: #10254a;
  --navy-700: #163464;
  --teal-500: #14a693;
  --teal-400: #35c9b4;
  --amber-400: #f2a65a;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #16202b;
  --muted: #5b6b7c;
  --border: #e4eaf1;
  --shadow: 0 8px 30px rgba(10, 26, 48, 0.08);
  --radius: 14px;
  --maxw: 1080px;
  --font-head: "Sora", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }

a { color: var(--teal-500); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--navy-900);
  line-height: 1.2;
  margin: 0 0 .5em;
}

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

/* ---------- Background motif: geospatial dot-grid ---------- */
.geo-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 2px 2px, rgba(255,255,255,0.10) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  pointer-events: none;
}

/* ---------- Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 26, 48, 0.96);
  backdrop-filter: blur(6px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.brand {
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--teal-400);
  box-shadow: 0 0 0 4px rgba(53,201,180,0.18);
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: #cfe0ef;
  font-size: .93rem;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  text-decoration: none;
}

.nav-links a.cta {
  color: var(--navy-900);
  background: var(--teal-400);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
}
.nav-links a.cta:hover { background: #4fd8c4; }

.nav-burger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--navy-700) 100%);
  color: #fff;
  overflow: hidden;
  padding: 72px 0 90px;
}

.hero .container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--teal-400);
  font-weight: 700;
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--teal-400);
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  margin-bottom: .35em;
}

.hero .role {
  font-size: 1.08rem;
  color: #d9e6f2;
  margin-bottom: 18px;
}

.hero .role strong { color: var(--teal-400); font-weight: 600; }

.hero p.lead {
  color: #b9cbdc;
  max-width: 54ch;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .93rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }

.btn-primary { background: var(--teal-400); color: var(--navy-900); }
.btn-primary:hover { background: #4fd8c4; }

.btn-ghost { border-color: rgba(255,255,255,0.35); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,0.06); }

.btn-outline { border-color: var(--border); color: var(--navy-900); background: #fff; }
.btn-outline:hover { border-color: var(--teal-500); color: var(--teal-500); }

.hero-photo-wrap {
  position: relative;
  justify-self: center;
}

.hero-photo-ring {
  position: absolute;
  inset: -14px;
  border: 1.5px dashed rgba(53, 201, 180, 0.45);
  border-radius: 24px;
}

.hero-photo {
  width: 280px;
  height: 350px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  position: relative;
  z-index: 1;
}

.hero-stats {
  display: flex;
  gap: 22px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.hero-stat .num {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}
.hero-stat .label {
  font-size: .78rem;
  color: #a8bdd0;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ---------- Section ---------- */
.section { padding: 76px 0; }
.section-alt { background: var(--surface); }

.section-head {
  max-width: 640px;
  margin: 0 auto 44px;
  text-align: center;
}

.section-head .tag {
  font-size: .78rem;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--teal-500);
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

.section-head h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.section-head p { color: var(--muted); }

/* ---------- Cards / grid ---------- */
.grid {
  display: grid;
  gap: 22px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

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

.expertise-card .icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: rgba(20,166,147,0.1);
  color: var(--teal-500);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 14px;
}

.expertise-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.expertise-card p { color: var(--muted); font-size: .92rem; margin: 0; }

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  padding-left: 28px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 40px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--teal-400);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--teal-400);
}

.timeline-item .period {
  font-size: .82rem;
  color: var(--teal-500);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.timeline-item h3 { font-size: 1.1rem; margin: 4px 0 2px; }
.timeline-item .org { color: var(--muted); font-size: .92rem; margin-bottom: 10px; }

.timeline-item ul { margin: 0; padding-left: 20px; color: var(--text); }
.timeline-item li { margin-bottom: 5px; font-size: .95rem; }

/* ---------- Education ---------- */
.edu-item {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.edu-item:last-child { border-bottom: none; }
.edu-item .yr {
  min-width: 110px;
  font-weight: 700;
  color: var(--navy-800);
  font-family: var(--font-head);
  font-size: .92rem;
}
.edu-item h3 { font-size: 1.02rem; margin-bottom: 2px; }
.edu-item p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- Skills / tags ---------- */
.tag-group { margin-bottom: 22px; }
.tag-group h4 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 12px;
}
.tags { display: flex; flex-wrap: wrap; gap: 9px; }
.tag {
  background: rgba(20,166,147,0.08);
  color: var(--navy-800);
  border: 1px solid rgba(20,166,147,0.25);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 500;
}

/* ---------- Publications ---------- */
.pub-item {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 14px;
}
.pub-item .journal { color: var(--teal-500); font-weight: 600; font-size: .88rem; }
.pub-item p { margin: 6px 0 0; font-size: .93rem; color: var(--text); }
.pub-item .doi { display: inline-block; margin-top: 8px; font-size: .85rem; }

/* ---------- Lists (workshops/conf) ---------- */
.simple-list { list-style: none; padding: 0; margin: 0; }
.simple-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
  display: flex;
  gap: 10px;
}
.simple-list li:last-child { border-bottom: none; }
.simple-list li::before { content: "▹"; color: var(--teal-500); font-weight: 700; }

/* ---------- Contact ---------- */
.contact-band {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #fff;
  text-align: center;
  padding: 64px 0;
}
.contact-band h2 { color: #fff; }
.contact-band p { color: #b9cbdc; max-width: 50ch; margin: 0 auto 26px; }
.contact-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-900);
  color: #92a6ba;
  padding: 26px 0;
  font-size: .85rem;
  text-align: center;
}
.site-footer a { color: #cfe0ef; }

.visitor-badge {
  display: block;
  margin: 10px auto 0;
  height: 20px;
  opacity: .9;
}

/* ---------- Resources page ---------- */
.resource-hero {
  background: linear-gradient(160deg, var(--navy-900), var(--navy-700));
  color: #fff;
  padding: 56px 0 64px;
  text-align: center;
}
.resource-hero h1 { color: #fff; }
.resource-hero p { color: #b9cbdc; max-width: 60ch; margin: 10px auto 0; }

.res-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.res-nav a {
  color: #d9e6f2;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 500;
}
.res-nav a:hover { background: rgba(255,255,255,0.08); text-decoration: none; }

.ppt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.ppt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ppt-card .file-icon {
  width: 40px; height: 40px;
  border-radius: 9px;
  background: rgba(242,166,90,0.15);
  color: var(--amber-400);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .8rem;
}
.ppt-card h3 { font-size: 1rem; margin-bottom: 2px; }
.ppt-card p { color: var(--muted); font-size: .88rem; margin: 0; flex-grow: 1; }

.empty-state {
  text-align: center;
  padding: 46px 24px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
}
.empty-state h3 { color: var(--navy-800); margin-bottom: 8px; }
.empty-state code {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .85rem;
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 26px;
}

.gallery-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.gallery-card .photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.gallery-card:hover img { transform: scale(1.04); }

.gallery-card .moment {
  padding: 20px 22px 22px;
}

.gallery-card h3 {
  font-size: 1.02rem;
  margin-bottom: 8px;
}

.gallery-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: .84rem;
  color: var(--muted);
  margin: 0;
}

.gallery-card .meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gallery-card .meta .ico {
  color: var(--teal-500);
}

/* ---------- Tool panels (calculators) ---------- */
.tool-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.tool-tab {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
}
.tool-tab.active {
  background: var(--navy-900);
  color: #fff;
  border-color: var(--navy-900);
}

.tool-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  display: none;
}
.tool-panel.active { display: block; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 6px;
}
.field .hint { font-size: .78rem; color: var(--muted); font-weight: 400; margin-left: 4px; }

.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: .93rem;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20,166,147,0.15);
}

.sub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.sub-tab {
  padding: 6px 14px;
  font-size: .82rem;
  font-weight: 600;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
}
.sub-tab.active { background: rgba(20,166,147,0.1); color: var(--teal-500); border-color: rgba(20,166,147,0.35); }

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.radio-group input[type="radio"] {
  accent-color: var(--teal-500);
  margin: 0;
}
.radio-group label:has(input:checked) {
  background: rgba(20,166,147,0.1);
  border-color: rgba(20,166,147,0.35);
  color: var(--teal-500);
}

.calc-mode { display: none; }
.calc-mode.active { display: block; }

.result-box {
  margin-top: 22px;
  padding: 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(20,166,147,0.08), rgba(53,201,180,0.05));
  border: 1px solid rgba(20,166,147,0.25);
}
.result-box .result-figure {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy-900);
}
.result-box .result-label {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--teal-500);
  font-weight: 700;
  margin-bottom: 4px;
}
.result-box .result-note {
  font-size: .85rem;
  color: var(--muted);
  margin-top: 10px;
}
.result-box.hidden { display: none; }

.stat-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.stat-tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.stat-tile .v { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; color: var(--navy-900); }
.stat-tile .k { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }

.formula-note {
  font-size: .82rem;
  color: var(--muted);
  background: var(--bg);
  border-left: 3px solid var(--teal-400);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin-top: 16px;
}

/* ---------- Data tables & inline charts (survival / time series) ---------- */
.table-wrap {
  overflow-x: auto;
  margin-top: 6px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  min-width: 420px;
}
.data-table th, .data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.data-table th {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .4px;
}
.data-table tbody tr:hover { background: var(--bg); }

.chart-wrap {
  margin-top: 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.chart-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-wrap .chart-caption {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
}

.disclaimer {
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
  margin-top: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-photo-wrap { order: -1; }
  .hero-actions, .hero-stats { justify-content: center; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }

  .nav-burger { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--navy-900);
    padding: 10px 24px 20px;
    gap: 4px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 10px 0; }
  .nav-links a.cta { display: inline-block; margin-top: 6px; }
}

@media (max-width: 560px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero-photo { width: 220px; height: 275px; }
  .section { padding: 56px 0; }
}
