/* ==========================================================================
   Harsh Modi - personal site
   Hand-written stylesheet. No framework dependency.
   ========================================================================== */

:root {
  --color-bg: #fbfaf7;
  --color-bg-alt: #f2f0e9;
  --color-surface: #ffffff;
  --color-border: #e4e1d6;
  --color-text: #1c1c1a;
  --color-text-muted: #5c5c56;
  --color-text-faint: #8a897f;

  --color-accent: #1f4d43;
  --color-accent-dark: #163a32;
  --color-accent-light: #3f7a6b;
  --color-accent-soft: #e9f1ee;

  --font-heading: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container-width: 1080px;
  --radius: 6px;
  --shadow-sm: 0 1px 3px rgba(28, 28, 26, 0.06);
  --shadow-md: 0 6px 24px rgba(28, 28, 26, 0.08);

  --nav-height: 72px;
}

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

html {
  scroll-behavior: smooth;
}

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

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

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-dark);
  text-decoration: underline;
}

ul {
  padding-left: 1.2em;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.5em;
  color: var(--color-text);
}

h1 { font-size: clamp(2.2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p {
  margin: 0 0 1em;
}

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

.section {
  padding: 72px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

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

.section-header .eyebrow {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 10px;
}

.section-header p {
  color: var(--color-text-muted);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-outline:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---- Header / Nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}

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

.nav-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-text);
}

.nav-brand:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--color-accent);
  text-decoration: none;
  background: var(--color-accent-soft);
}

.nav-links a.active {
  color: var(--color-accent-dark);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  margin: 0 auto;
}

/* ---- Hero ---- */
.hero {
  padding: 76px 0 56px;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 48px;
}

.hero-photo {
  flex: 0 0 220px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--color-surface);
  box-shadow: var(--shadow-md);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-text .eyebrow {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.hero-text h1 {
  margin-bottom: 6px;
}

.hero-role {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.hero-bio {
  max-width: 640px;
  color: var(--color-text-muted);
}

/* ---- Social icons ---- */
.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 1.05rem;
}

.social-icon:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  text-decoration: none;
}

/* ---- Cards ---- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-body {
  padding: 24px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  align-items: start;
}

.card-body ul {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin: 12px 0 0;
  padding-left: 1.2em;
}

.card-body ul li {
  margin-bottom: 6px;
}

.card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f0f0d;
}

.card-media iframe,
.card-media video,
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

.card h3 {
  margin-bottom: 8px;
}

.card .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

/* ---- Highlights teaser (home) ---- */
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.highlight-card {
  padding: 24px;
}

.highlight-card h3 {
  font-size: 1.05rem;
}

.highlight-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* ---- Timeline (CV page) ---- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
}

.timeline-date {
  background: var(--color-accent);
  color: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.timeline-date .period {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 4px;
}

.timeline-date .label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
}

.timeline-content {
  padding: 24px;
}

.timeline-content h4 {
  margin-bottom: 4px;
}

.timeline-content .org {
  color: var(--color-text-muted);
  margin-bottom: 10px;
  display: block;
}

.timeline-content ul {
  margin: 10px 0 0;
  color: var(--color-text-muted);
}

.timeline-content li {
  margin-bottom: 6px;
}

/* ---- Publications list ---- */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pub-item {
  display: grid;
  grid-template-columns: 140px 1fr;
}

.pub-venue {
  background: var(--color-accent);
  color: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pub-venue .name {
  font-weight: 600;
  font-size: 0.95rem;
}

.pub-venue .year {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-top: 2px;
}

.pub-body {
  padding: 20px 24px;
}

.pub-links {
  margin-top: 8px;
  font-size: 0.9rem;
}

.pub-links a {
  margin-right: 16px;
  font-weight: 600;
}

/* ---- Skill tags ---- */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--color-surface);
  color: var(--color-text);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
}

.contact-info dt {
  font-weight: 600;
  margin-top: 16px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
}

.contact-info dd {
  margin: 4px 0 0;
  color: var(--color-text);
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 40px 0;
  text-align: center;
  color: var(--color-text-faint);
  font-size: 0.9rem;
}

.site-footer .social-row {
  justify-content: center;
  margin-bottom: 16px;
}

.site-footer .footer-name {
  font-family: var(--font-heading);
  color: var(--color-text);
  font-weight: 600;
  margin-bottom: 6px;
}

/* ---- Page header (non-home pages) ---- */
.page-hero {
  padding: 56px 0 16px;
}

.page-hero .eyebrow {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 10px;
}

.page-hero p {
  color: var(--color-text-muted);
  max-width: 640px;
}

/* ---- Scroll fade-in ---- */
[data-fade] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-fade].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .hero-inner {
    flex-direction: column;
    text-align: center;
  }

  .hero-bio {
    margin: 0 auto;
  }

  .social-row {
    justify-content: center;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .highlight-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item,
  .pub-item {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 24px 20px;
    display: none;
  }

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

  .nav-links a {
    padding: 12px 10px;
  }

  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 520px) {
  .section {
    padding: 48px 0;
  }

  .hero {
    padding: 48px 0 32px;
  }

  .hero-photo {
    width: 160px;
    height: 160px;
    flex-basis: 160px;
  }
}
