/* Swarajh Mehta — multi-page personal site
   Palette: navy + cream + coral
*/

:root {
  --bg:        #14253A;
  --bg-card:   #1A2E47;
  --text:      #F5EFE0;
  --muted:     #8DA0B8;
  --accent:    #E7785A;
  --divider:   #1F3550;

  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 64rem;
  --gap:       1.5rem;
  --gap-lg:    3.5rem;
  --gap-xl:    5rem;

  --radius: 6px;
  --header-h: 4rem;
}

* { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
}

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

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover { color: var(--accent); }

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

/* ───── Header / nav ───── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  background: rgba(20, 37, 58, 0.85);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--divider);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .logo {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.125rem;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.02em;
}

.site-header .logo:hover { color: var(--accent); }

.site-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2rem;
  font-size: 0.95rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover { color: var(--text); }

.site-nav a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* ───── Page intro ───── */

.page-intro {
  padding: var(--gap-xl) 0 var(--gap-lg);
  border-bottom: 1px solid var(--divider);
}

.page-intro h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.25rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.page-intro p {
  margin: 0;
  color: var(--muted);
  font-style: italic;
  font-size: 1.05rem;
  max-width: 36rem;
}

/* ───── Hero (home) ───── */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 3rem;
  padding: var(--gap-xl) 0 var(--gap-lg);
}

.hero-text h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.75rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.015em;
}

.hero-text .tagline {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-style: italic;
  font-size: 1.1rem;
}

.hero-text .bio {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.75;
  max-width: 34rem;
}

.hero-photo img {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ───── Section heading ───── */

.section {
  padding: var(--gap-lg) 0;
  border-bottom: 1px solid var(--divider);
}

.section:last-of-type { border-bottom: none; }

.section h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.5rem;
}

/* ───── Highlights ───── */

.highlight-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.highlight {
  display: grid;
  grid-template-columns: auto 8rem 1fr;
  align-items: baseline;
  gap: 1rem;
}

.highlight .star {
  color: var(--accent);
  font-size: 0.9rem;
  line-height: 1;
}

.highlight .label {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.highlight .body { margin: 0; }

/* ───── Interests row ───── */

.interest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.interest-card {
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.interest-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.interest-card .interest-thumb {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.interest-card .interest-thumb.thumb-top {
  object-position: center 10%;
}

.interest-card .interest-text {
  padding: 1.1rem 1.25rem 1.35rem;
}

.interest-card h4 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
  color: var(--text);
}

.interest-card p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ───── Contact ───── */

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  font-size: 1rem;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
}

.contact-list i { color: var(--accent); }

.contact-list a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.contact-list a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ───── Project cards (alternating) ───── */

.projects-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap-lg);
  padding: var(--gap-lg) 0;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr);
  align-items: center;
  gap: 2.5rem;
}

.project-card.reverse {
  direction: rtl;
}

.project-card.reverse > * {
  direction: ltr;
}

.project-image {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--divider);
  aspect-ratio: 4 / 3;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.project-content h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.005em;
}

.project-content p {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.7;
}

.project-content p em {
  color: var(--accent);
  font-style: normal;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.project-tech span {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: 999px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.project-links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.project-links a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 1px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.project-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.project-links i {
  margin-right: 0.4rem;
  color: var(--muted);
}

.project-links a:hover i { color: var(--accent); }

/* ───── Experience timeline ───── */

.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--gap-lg);
  padding: var(--gap-lg) 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 2.5rem;
  padding-bottom: var(--gap-lg);
  border-bottom: 1px solid var(--divider);
}

.timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline-period {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  padding-top: 0.25rem;
}

.timeline-body h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 0 0 0.2rem;
  letter-spacing: -0.005em;
}

.timeline-body h4 {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 1rem;
  margin: 0 0 0.85rem;
  color: var(--muted);
}

.timeline-body p {
  margin: 0 0 0.85rem;
  line-height: 1.7;
}

.timeline-body p em {
  color: var(--accent);
  font-style: normal;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.timeline-tags span {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 2px 8px;
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: 999px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.timeline-body.has-portrait {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

.timeline-body.has-portrait .timeline-media.portrait {
  margin-top: 0.25rem;
}

.timeline-media {
  margin-top: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--divider);
  background: var(--bg-card);
  display: inline-block;
  max-width: 100%;
}

.timeline-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
}

.timeline-media.portrait {
  max-width: 300px;
}

.timeline-media.portrait img {
  max-height: 480px;
}

.timeline-media .caption {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.5rem 1rem;
  font-style: italic;
  border-top: 1px solid var(--divider);
}

.timeline-media a {
  display: block;
  text-decoration: none;
  cursor: zoom-in;
}

/* CSS-only lightbox (uses :target) */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

.lightbox:target {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  font-size: 2.25rem;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease;
}

.lightbox-close:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.15);
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
}

/* ───── Footer ───── */

.site-footer {
  border-top: 1px solid var(--divider);
  padding: 2rem 0 2.5rem;
  margin-top: var(--gap-lg);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

/* ───── Responsive ───── */

@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    text-align: left;
    padding: var(--gap-lg) 0;
  }

  .hero-text h1 { font-size: 2rem; }

  .hero-photo {
    order: -1;
  }

  .hero-photo img {
    width: 140px;
    height: 140px;
  }

  .interest-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card,
  .project-card.reverse {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    direction: ltr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .timeline-body.has-portrait {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

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

  .highlight .label {
    grid-column: 2;
    grid-row: 1;
  }

  .highlight .body {
    grid-column: 2;
    grid-row: 2;
    margin-top: 0.1rem;
  }

  .site-nav { gap: 1.25rem; }

  .page-intro { padding: var(--gap-lg) 0 var(--gap); }

  .page-intro h1 { font-size: 1.85rem; }
}

@media (max-width: 480px) {
  .hero-text h1 { font-size: 1.75rem; }
  .interest-grid { grid-template-columns: 1fr; }
  .site-header .container { padding: 0 1rem; }
  .site-nav { gap: 1rem; font-size: 0.9rem; }
}

::selection {
  background: var(--accent);
  color: var(--bg);
}
