/* ---------------------------------------------------------------
   Jalim Singh — personal site
   Design tokens
----------------------------------------------------------------- */
:root {
  --ink: #12181c;
  --ink-soft: #2b343a;
  --slate: #55636b;
  --paper: #edf1ef;
  --paper-raised: #ffffff;
  --line: #d2d9d5;
  --teal: #1f6f6b;
  --teal-deep: #14514e;
  --amber: #b5762a;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --max: 780px;
  --max-wide: 1080px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1.1em; }

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

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

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

/* ---------------- Nav ---------------- */
header.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(237, 241, 239, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

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

.nav-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
  font-weight: 600;
}

.nav-links {
  display: flex;
  gap: 28px;
  font-size: 0.95rem;
}

.nav-links a {
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  border-color: var(--teal);
  color: var(--teal-deep);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  width: 38px;
  height: 34px;
  font-size: 1.1rem;
  color: var(--ink);
}

@media (max-width: 640px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 4px 24px 14px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: block; }
}

/* ---------------- Hero ---------------- */
.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 800px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero { padding: 48px 0 40px; }
}

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.1rem);
  letter-spacing: -0.01em;
}

.hero .role {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--teal-deep);
  margin-bottom: 22px;
  letter-spacing: 0.01em;
}

.hero .statement {
  font-size: 1.08rem;
  color: var(--slate);
  max-width: 46ch;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin-top: 22px;
  font-size: 0.95rem;
}

.hero-links a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.hero-links a:hover { border-color: var(--teal); color: var(--teal-deep); }

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-portrait {
  width: 220px;
  max-width: 60%;
  aspect-ratio: 1;
  height: auto;
  object-fit: cover;
  border-radius: 50%;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  box-shadow: 0 0 0 6px var(--paper), 0 10px 30px rgba(20, 81, 78, 0.12);
}

.hero-graphic { width: 100%; max-width: 340px; height: auto; display: block; }

@media (max-width: 800px) {
  .hero-visual { order: -1; align-items: flex-start; }
  .hero-graphic { display: none; }
  .hero-portrait { width: 140px; }
}

/* ---------------- Sections ---------------- */
main { padding-bottom: 80px; }

.section {
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}

.section:last-child { border-bottom: none; }

.section h2 {
  font-size: 1.55rem;
  margin-bottom: 18px;
}

.section .figure {
  margin: 24px 0;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  padding: 6px;
}

.section .figure img { width: 100%; }

.section .figure figcaption {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--slate);
  padding: 10px 6px 4px;
}

.pub-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.pub-list li {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
  color: var(--ink-soft);
}

.pub-list a {
  border-bottom: 1px solid var(--line);
}

.pub-list a:hover { border-color: var(--teal); color: var(--teal-deep); }

/* ---------------- Page header (non-home pages) ---------------- */
.page-head {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.5rem);
}

.page-head .sub {
  color: var(--slate);
  font-size: 1.02rem;
  max-width: 56ch;
}

/* ---------------- Interests / lists ---------------- */
.plain-list {
  padding-left: 1.15em;
  margin: 0 0 1.1em;
}

.plain-list li { margin-bottom: 6px; }

.cv-download {
  display: inline-block;
  margin-top: 6px;
  padding: 10px 18px;
  border: 1px solid var(--teal);
  color: var(--teal-deep);
  font-size: 0.92rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.cv-download:hover { background: var(--teal); color: #fff; }

/* ---------------- Contact ---------------- */
.contact-card {
  border: 1px solid var(--line);
  background: var(--paper-raised);
  padding: 32px;
  margin-top: 8px;
}

.contact-card .label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--slate);
  margin-bottom: 4px;
}

.contact-card .value {
  margin-bottom: 20px;
  font-size: 1.02rem;
}

.contact-card .value:last-child { margin-bottom: 0; }

/* ---------------- Footer ---------------- */
footer {
  padding: 28px 0 48px;
  font-size: 0.85rem;
  color: var(--slate);
}

footer a { border-bottom: 1px solid var(--line); }
footer a:hover { border-color: var(--teal); color: var(--teal-deep); }
