/* Dr. Ramakotaiah Mogili — Academic portfolio */
:root {
  --navy: #0d1b2a;
  --navy-mid: #1b2838;
  --navy-soft: #243447;
  --white: #fafbfc;
  --cream: #f4f1ea;
  --gold: #c9a227;
  --gold-soft: #d4bc5c;
  --text: #2c3338;
  --text-muted: #5c656f;
  --border: rgba(13, 27, 42, 0.12);
  --shadow: 0 12px 40px rgba(13, 27, 42, 0.08);
  --radius: 12px;
  --header-h: 64px;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --step-400: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  --step-600: clamp(1.35rem, 1.15rem + 0.9vw, 1.75rem);
  --step-800: clamp(1.75rem, 1.45rem + 1.4vw, 2.35rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .section-reveal,
  .section-reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-400);
  line-height: 1.65;
  color: var(--text);
  background: var(--cream);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--navy);
  color: var(--white);
  padding: 0.75rem 1rem;
  z-index: 1000;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus {
  top: 1rem;
}

h1,
h2,
h3,
.section-header h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
}

h1 {
  font-size: var(--step-800);
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--step-600);
  margin: 0;
}

h3 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

a {
  color: var(--navy-mid);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--gold);
}

.container {
  width: min(1080px, 92vw);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 251, 252, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1080px, 92vw);
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0.5rem 0;
}

.logo {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.65rem;
  border: 2px solid var(--gold);
  border-radius: 4px;
}
.logo:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 6px;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  transition: transform 0.2s, opacity 0.2s;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
  justify-content: flex-end;
}

.site-nav a {
  display: block;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
  border-radius: 6px;
}
.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(201, 162, 39, 0.15);
  color: var(--navy);
}

@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease, visibility 0.25s;
  }

  .site-nav.is-open {
    max-height: min(70vh, 420px);
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav a {
    padding: 0.75rem 0.85rem;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }

  .site-header.is-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .site-header.is-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }
  .site-header.is-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* Hero */
.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(3.5rem, 10vw, 6rem);
  color: var(--white);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
      145deg,
      var(--navy) 0%,
      var(--navy-mid) 45%,
      #152536 100%
    );
  z-index: 0;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      ellipse 80% 60% at 100% 0%,
      rgba(201, 162, 39, 0.12),
      transparent 55%
    ),
    radial-gradient(
      ellipse 50% 40% at 0% 100%,
      rgba(255, 255, 255, 0.06),
      transparent 45%
    );
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-content {
  max-width: 36rem;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gold-soft);
  margin: 0 0 0.75rem;
}

.hero h1 {
  color: var(--white);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: var(--step-600);
  font-weight: 600;
  color: var(--gold-soft);
  margin: 0 0 0.75rem;
}

.hero-tagline {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 1.25rem;
  font-weight: 500;
}

.hero-contact {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.hero-contact li {
  margin-bottom: 0.5rem;
}

.hero-contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--white);
  text-decoration: none;
  font-size: 0.95rem;
}
.hero-contact a:hover {
  color: var(--gold-soft);
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  opacity: 0.9;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-soft);
  border-color: var(--gold-soft);
  color: var(--navy);
  transform: translateY(-1px);
}

.hero-photo-wrap {
  margin: 0;
}

.hero-photo {
  width: min(280px, 72vw);
  aspect-ratio: 4 / 5;
  background: var(--navy-soft);
  border: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    max-width: none;
  }

  .hero-contact a {
    justify-content: center;
  }

  .hero-photo-wrap {
    justify-self: center;
    order: -1;
  }

  .hero-photo {
    width: min(220px, 55vw);
  }
}

/* Sections */
.section {
  padding: clamp(3rem, 7vw, 4.5rem) 0;
}

main > section:nth-child(2n + 3) {
  background: var(--white);
}

.about,
.qualifications,
.experience,
.research,
.contributions,
.skills,
.memberships,
.contact {
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--navy);
  color: var(--gold);
  border-radius: 10px;
  flex-shrink: 0;
}

.section-icon svg {
  width: 24px;
  height: 24px;
}

.section-lead {
  color: var(--text-muted);
  max-width: 65ch;
  margin: -0.5rem 0 1.75rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: 0 2px 12px rgba(13, 27, 42, 0.04);
}

main > section:nth-child(2n + 3) .card {
  background: var(--cream);
}

.prose p {
  margin: 0 0 1rem;
}
.prose p:last-child {
  margin-bottom: 0;
}

/* Qualifications */
.qual-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .qual-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.qual-degree {
  display: block;
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.qual-meta {
  font-size: 0.88rem;
  color: var(--gold);
  font-weight: 600;
}

.qual-note {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.creds-line {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

/* Timeline — vertical line and dots share one horizontal axis */
.timeline {
  --tl-axis: 1.125rem;
  --tl-gutter: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--tl-gutter);
  border: none;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: var(--tl-axis);
  top: 0.85rem;
  bottom: 0.85rem;
  width: 3px;
  transform: translateX(-50%);
  background: var(--gold);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
  padding-left: 0;
  margin-left: 0;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item.card {
  padding: 1.65rem 1.9rem 1.8rem;
}

.timeline-marker {
  --marker-size: 14px;
  position: absolute;
  left: calc(var(--tl-axis) - var(--tl-gutter) - var(--marker-size) / 2);
  top: 2rem;
  width: var(--marker-size);
  height: var(--marker-size);
  background: var(--gold);
  border: 3px solid var(--cream);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--navy);
  box-sizing: border-box;
}

main > section:nth-child(2n + 3) .timeline-marker {
  border-color: var(--white);
}

.timeline-body time {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.timeline-role {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}

.timeline-org {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.timeline-body p:last-child {
  margin: 0;
  font-size: 0.92rem;
}

/* Research */
.research-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

@media (min-width: 720px) {
  .research-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.research-focus ul {
  margin: 0;
  padding-left: 1.2rem;
}

.research-focus li {
  margin-bottom: 0.35rem;
}

.stat-highlight {
  margin-top: 0;
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  display: block;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.subheading {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin: 0 0 1rem;
}

.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pub-item cite {
  font-style: normal;
  font-weight: 500;
  display: block;
  margin-bottom: 0.35rem;
}

.pub-venue {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Contributions */
.contrib-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 600px) {
  .contrib-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .contrib-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.contrib-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Skills */
.skills-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .skills-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.skill-pill {
  font-size: 0.92rem;
}

.skill-pill strong {
  color: var(--navy);
}

/* Memberships */
.mem-badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 560px) {
  .mem-badges {
    grid-template-columns: repeat(2, 1fr);
  }
}

.mem-badges li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

main > section:nth-child(2n + 3) .mem-badges li {
  background: var(--cream);
}

.badge {
  flex-shrink: 0;
  min-width: 3.25rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.5rem;
  background: var(--navy);
  color: var(--gold-soft);
  border-radius: 6px;
}

/* Contact */
.contact-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .contact-grid {
    grid-template-columns: 1fr 1.15fr;
    align-items: start;
  }
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-list li {
  margin-bottom: 1rem;
}

.contact-list li:last-child {
  margin-bottom: 0;
}

.contact-list strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.contact-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0.65rem 0 0.35rem;
}

.contact-form label:first-of-type {
  margin-top: 0;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: transparent;
}

.contact-form .btn {
  margin-top: 1rem;
  width: 100%;
}

.form-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.form-status {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: var(--navy-mid);
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.82);
  padding: 2.5rem 0;
  text-align: center;
}

.footer-inner {
  max-width: 48rem;
}

.footer-tagline {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  margin: 0 0 1rem;
  color: var(--white);
  line-height: 1.5;
}

.footer-copy {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

.site-footer a {
  color: var(--gold-soft);
}

/* Reveal animation */
.section-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero.section-reveal {
  opacity: 1;
  transform: none;
}

.hero .hero-content,
.hero .hero-photo-wrap {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease-out 0.1s, transform 0.7s ease-out 0.1s;
}

.hero.is-visible .hero-content,
.hero.is-visible .hero-photo-wrap {
  opacity: 1;
  transform: translateY(0);
}

.hero.is-visible .hero-photo-wrap {
  transition-delay: 0.25s;
}
