/* ==========================================================================
   Sajag Swami: personal site
   Plain CSS, no build step. Fonts are self-hosted (see /fonts).
   Light editorial aesthetic inspired by fine typographic monographs.
   ========================================================================== */

@font-face {
  font-family: "Newsreader Variable";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(fonts/newsreader-latin-wght-normal.woff2) format("woff2");
}

@font-face {
  font-family: "Newsreader Variable";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url(fonts/newsreader-latin-wght-italic.woff2) format("woff2");
}

@font-face {
  font-family: "Hanken Grotesk Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/hanken-grotesk-latin-wght-normal.woff2) format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;

  /* Warm parchment & stone neutrals */
  --bg: #f1f1ee;
  --surface: #f8f8f6;
  --surface-hover: #ffffff;
  --ink: #1b1c1e;
  --ink-2: #45484e;
  --ink-3: #62656b;
  --line: #dcdcd5;
  --line-strong: #c2c2b8;
  --link: #244b68;
  --link-hover: #0f2c42;
  --dog: #b5771f;
  --dog-light: #dcae6f;
  --dog-tint: rgba(181, 119, 31, 0.08);

  --serif: "Newsreader Variable", "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk Variable", "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(18px, 5vw, 44px);
  --wrap: min(100% - 2 * var(--gutter), 64rem);
  --reading: 40rem;
  --nav-h: 84px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-card: 0 4px 16px -4px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 10px 24px -6px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.68;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

@media (min-width: 721px) {
  body {
    font-size: 1.1875rem;
  }
}

:lang(hi) {
  font-family: "Kohinoor Devanagari", "Noto Sans Devanagari", "Mangal", var(--sans);
}

:lang(ja) {
  font-family: var(--sans), "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

::selection {
  background: color-mix(in srgb, var(--dog) 25%, transparent);
  color: var(--ink);
}

img,
video {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--dog);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 580;
  letter-spacing: -0.018em;
  text-wrap: balance;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.35rem, 5.2vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.028em;
}

h2 {
  font-size: clamp(1.5rem, 2.8vw, 1.95rem);
  line-height: 1.22;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.32;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

ul, ol {
  margin: 0 0 1em;
  padding-left: 1.35em;
}

li {
  margin: 0.35em 0;
}

strong {
  font-weight: 640;
}

blockquote {
  margin: 1.6em 0 1.8em;
  padding: 0.2em 0 0.2em 1.25em;
  max-width: var(--reading);
  border-left: 3px solid var(--dog);
  color: var(--ink-2);
  font-style: italic;
  font-size: 1.08em;
  line-height: 1.55;
  background: var(--dog-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px;
}

blockquote p {
  margin: 0;
}

blockquote cite {
  display: block;
  margin-top: 0.5em;
  font: normal 0.8rem/1.4 var(--sans);
  color: var(--ink-3);
  font-style: normal;
}

.skip {
  position: absolute;
  left: 14px;
  top: -80px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  font: 500 0.9rem var(--sans);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: top 0.2s ease;
}

.skip:focus {
  top: 14px;
}

/* ---------- Header and the dog ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s ease;
}

.navbar {
  width: var(--wrap);
  min-height: var(--nav-h);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
}

.dog-link {
  display: block;
  line-height: 0;
  border-radius: var(--radius-lg);
  margin: 6px 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}

.dog-link:hover {
  transform: scale(1.03);
}

.dog {
  display: block;
  height: calc(var(--nav-h) - 18px);
  width: auto;
  aspect-ratio: 104 / 112;
  overflow: visible;
}

.dog-shadow {
  fill: var(--ink);
  opacity: 0.1;
}

.dog-ear-l,
.dog-ear-r,
.dog-tail {
  will-change: transform;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 28px;
  font: 500 0.92rem/1.2 var(--sans);
}

.nav-links a {
  padding: 8px 0;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--dog);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--ink);
  font: 500 0.88rem var(--sans);
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.nav-toggle:hover {
  background: #ffffff;
  border-color: var(--dog);
}

.nav-toggle:active {
  transform: scale(0.97);
}

@media (max-width: 720px) {
  :root {
    --nav-h: 68px;
  }

  .js .nav-toggle {
    display: inline-flex;
  }

  .js .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 16px;
    background: color-mix(in srgb, var(--bg) 98%, transparent);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line-strong);
    box-shadow: 0 18px 32px -16px rgba(0, 0, 0, 0.15);
    font-size: 1.05rem;
    animation: menuFadeIn 0.18s ease-out forwards;
  }

  @keyframes menuFadeIn {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

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

  .js .nav-links a {
    padding: 13px 4px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .js .nav-links a:last-child {
    border-bottom: 0;
  }

  .js .nav-links a[aria-current="page"] {
    border-bottom-color: var(--line);
    color: var(--dog);
    font-weight: 600;
  }

  .nav-links {
    width: 100%;
    padding-bottom: 10px;
  }
}

/* ---------- Layout ---------- */
main {
  width: var(--wrap);
  margin: 0 auto;
  padding: clamp(36px, 6vw, 76px) 0 0;
}

.section {
  margin-top: clamp(48px, 8vw, 88px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.section > h2 {
  margin-bottom: 1.1em;
}

main > .section:first-child,
.page-header + .section {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.page-header {
  margin-bottom: clamp(32px, 5.5vw, 56px);
}

.page-header h1 {
  margin-bottom: 0.35em;
}

.page-intro {
  max-width: var(--reading);
  margin: 0;
  color: var(--ink-2);
  font-size: 1.1em;
  line-height: 1.6;
}

.page-header .entry-links {
  margin-top: 18px;
}

/* Breadcrumb nav on subpages */
.breadcrumb-nav {
  margin-bottom: 24px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

.back-link:hover {
  color: var(--dog);
  transform: translateX(-3px);
  text-decoration: none;
}

.back-link svg {
  flex-shrink: 0;
}

/* ---------- Home Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: clamp(24px, 4.5vw, 52px);
  align-items: start;
}

.profile-dp {
  display: block;
  width: 176px;
  height: 176px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-dp:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
}

.names {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin: 0.7em 0 1.1em;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink-3);
}

.names span + span {
  padding-left: 16px;
  border-left: 1px solid var(--line-strong);
}

.hero-role {
  margin: 0 0 1.4em;
  font: 500 1rem/1.55 var(--sans);
  color: var(--ink-2);
}

.hero-role strong {
  color: var(--ink);
}

.hero-copy {
  max-width: var(--reading);
  font-size: 1.08em;
  line-height: 1.7;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 28px;
  font: 500 0.9rem var(--sans);
}

.quick-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  color: var(--ink-2);
  text-decoration: none;
  box-shadow: var(--shadow-subtle);
  transition: all 0.15s ease;
}

.quick-links a:hover {
  color: var(--ink);
  background: var(--surface-hover);
  border-color: var(--dog);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
}

/* Interest Cards */
.interest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.interest-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px 22px;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.interest-item:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.interest-item h3 {
  margin-bottom: 0.5em;
  font-family: var(--sans);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.interest-item p {
  color: var(--ink-2);
  font-size: 0.96em;
  line-height: 1.55;
  margin: 0;
}

/* Professional Note */
.professional-note {
  max-width: var(--reading);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--dog);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 26px 30px;
  box-shadow: var(--shadow-subtle);
}

.professional-note h2 {
  margin-bottom: 0.6em;
}

.professional-note p {
  font-size: 1.05rem;
  line-height: 1.62;
  color: var(--ink-2);
}

.professional-note .question {
  margin-top: 1.2em;
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.25;
  color: var(--ink);
  font-style: italic;
}

/* Contact List */
.contact-list {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 0 32px;
  margin: 0;
  max-width: 40rem;
  font-family: var(--sans);
  font-size: 0.98rem;
}

.contact-list dt,
.contact-list dd {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  margin: 0;
  display: flex;
  align-items: center;
}

.contact-list dt {
  color: var(--ink-3);
  font-weight: 500;
}

.contact-list dd {
  overflow-wrap: anywhere;
}

.contact-list dt:first-of-type,
.contact-list dt:first-of-type + dd {
  border-top: 0;
}

/* ---------- Entries: Projects, Lab Log, Publications ---------- */
.project-list,
.log-list,
.pub-list {
  display: grid;
  gap: 0;
}

.project,
.log-entry,
.pub-entry {
  padding: clamp(40px, 6vw, 64px) 0;
  border-top: 1px solid var(--line);
}

.project:first-child,
.log-entry:first-child,
.pub-entry:first-child {
  border-top: 0;
  padding-top: 0;
}

.project-title-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1.1em;
}

.project-title-row h2,
.log-entry h2,
.pub-entry h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  letter-spacing: -0.02em;
}

.pub-entry h2 {
  margin-bottom: 0.55em;
  max-width: 36rem;
}

.circa {
  margin-left: 0.5em;
  font: 450 0.55em var(--sans);
  letter-spacing: 0.01em;
  color: var(--ink-3);
  white-space: nowrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  font: 450 0.82rem/1.4 var(--sans);
  color: var(--ink-2);
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
}

.project-copy,
.log-copy,
.pub-copy {
  max-width: var(--reading);
  font-size: 1.06em;
  line-height: 1.68;
}

.project-media {
  margin: 30px 0 0;
  max-width: 48rem;
}

.project-media img,
.project-media video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-media img:hover {
  border-color: var(--dog);
  box-shadow: var(--shadow-hover);
}

.project-media video {
  background: #000;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 30px 0 0;
  max-width: 48rem;
}

.media-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: none;
}

.media-grid img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.media-grid img:hover {
  border-color: var(--dog);
  box-shadow: var(--shadow-hover);
}

.caption {
  margin-top: 10px;
  max-width: 42rem;
  font: 400 0.86rem/1.55 var(--sans);
  color: var(--ink-3);
}

.note {
  color: var(--ink-2);
  font: 400 0.92rem/1.5 var(--sans);
}

/* Action Links on Projects & Pubs */
.project-links,
.entry-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 24px;
  font: 500 0.9rem/1.4 var(--sans);
}

.project-links a,
.entry-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  text-decoration: none;
  box-shadow: var(--shadow-subtle);
  transition: all 0.15s ease;
}

.project-links a:hover,
.entry-links a:hover {
  background: #ffffff;
  border-color: var(--dog);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.08);
}

.entry-links strong {
  display: block;
  width: 100%;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  font-size: 0.92rem;
}

/* Zetamac chart container */
.chart-wrap {
  margin: 32px 0 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-subtle);
}

.chart-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.chart-heading h3 {
  margin: 0 0 2px;
  font-size: 1.25rem;
}

.chart-heading span,
.chart-stats,
.chart-caption {
  color: var(--ink-3);
  font: 400 0.85rem/1.5 var(--sans);
}

.chart-stats {
  white-space: nowrap;
  font-weight: 500;
}

.zeta-chart {
  margin: 0;
}

.zeta-chart img {
  border: 0;
  box-shadow: none;
  border-radius: var(--radius-sm);
}

.chart-caption {
  margin-top: 12px;
  max-width: 46rem;
}

/* ---------- Personal Page ---------- */
.personal-muses {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 28px;
}

.muse {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px 22px;
  font-size: 0.97em;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.muse:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.muse a:has(img) {
  display: inline-block;
  line-height: 0;
  margin-bottom: 18px;
}

.muse img {
  display: block;
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.muse:hover img {
  border-color: var(--dog);
  transform: scale(1.03);
}

.muse h2,
.muse h3 {
  margin-bottom: 0.45em;
  font-size: 1.35rem;
}

.muse .quote {
  margin: 0 0 1.1em;
  color: var(--ink-2);
  font-style: italic;
  font-size: 0.98em;
  line-height: 1.5;
}

.hobby-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.hobby {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hobby:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.hobby h2,
.hobby h3 {
  margin-bottom: 0.45em;
  font-size: 1.25rem;
  font-family: var(--sans);
  font-weight: 600;
}

.hobby p {
  color: var(--ink-2);
  font-size: 0.98em;
  line-height: 1.6;
  margin: 0;
}

/* ---------- Insho Technical Page Specs & Tables ---------- */
.project-detail {
  padding-bottom: 40px;
}

.code-block-card {
  margin: 24px 0;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-subtle);
}

.diagram {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink);
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 26px 0;
}

.spec-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
  box-shadow: var(--shadow-subtle);
}

.spec-card h4 {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spec-card p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink);
  line-height: 1.45;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-subtle);
}

.gesture-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.92rem;
  text-align: left;
}

.gesture-table th,
.gesture-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.gesture-table th {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  font-weight: 600;
  color: var(--ink);
}

.gesture-table tr:last-child td {
  border-bottom: 0;
}

.feature-list {
  padding-left: 1.3em;
  line-height: 1.7;
}

.feature-list li {
  margin: 0.5em 0;
}

/* ---------- Footer ---------- */
.footer {
  width: var(--wrap);
  margin: clamp(64px, 10vw, 110px) auto 0;
  padding: 24px 0 calc(42px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  font: 400 0.86rem/1.6 var(--sans);
  color: var(--ink-3);
}

/* ---------- 404 ---------- */
.lost {
  padding: clamp(24px, 8vh, 80px) 0 0;
  text-align: center;
}

.lost .dog {
  height: clamp(150px, 34vw, 250px);
  margin: 0 auto 28px;
}

.lost h1 {
  margin-bottom: 0.4em;
}

.lost p {
  margin-inline: auto;
  max-width: 30rem;
  color: var(--ink-2);
}

.nav-home {
  display: inline-block;
  padding: 10px 0;
  font: 600 1rem/1.2 var(--sans);
  color: var(--ink);
}

.dog-link:has(.nav-home) {
  line-height: 1.2;
}

.log-entry > .tags {
  margin: 6px 0 1.1em;
}

.dog-link:focus:not(:focus-visible) {
  outline: none;
}

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .profile-dp {
    width: 124px;
    height: 124px;
    border-radius: var(--radius-md);
  }

  .interest-grid,
  .personal-muses,
  .hobby-grid,
  .media-grid,
  .media-grid.three {
    grid-template-columns: 1fr;
  }

  .interest-grid {
    gap: 18px;
  }

  .chart-heading {
    display: block;
  }

  .chart-stats {
    display: block;
    margin-top: 6px;
    white-space: normal;
  }

  .contact-list {
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 0 18px;
  }

  .professional-note {
    padding: 20px 22px;
  }

  .professional-note .question {
    font-size: 1.3rem;
  }

  .muse {
    padding: 20px 18px;
  }

  .hobby {
    padding: 20px 18px;
  }
}

@media (max-width: 480px) {
  .contact-list {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .contact-list dt {
    padding-bottom: 2px;
    border-bottom: 0;
  }

  .contact-list dd {
    padding-top: 2px;
    padding-bottom: 12px;
    border-top: 0;
  }

  .quick-links {
    gap: 8px 10px;
  }

  .quick-links a {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- Print ---------- */
@media print {
  :root {
    --bg: #fff;
    --ink: #000;
    --ink-2: #222;
    --ink-3: #444;
    --line: #ccc;
    --link: #000;
  }

  .site-header,
  .skip {
    display: none;
  }

  body {
    font-size: 11pt;
  }

  a {
    text-decoration: underline;
  }

  .project,
  .log-entry,
  .pub-entry,
  .muse,
  .hobby {
    break-inside: avoid;
  }
}

/* ==========================================================================
   Memorial: मोती (Moti)
   ========================================================================== */
body[data-page="moti"] {
  min-height: 100vh;
  position: relative;
  color: #f3f3ee;
}

body[data-page="moti"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: #17181a;
  background-image:
    linear-gradient(to bottom,
      rgba(23, 24, 26, 0.0) 0%,
      rgba(23, 24, 26, 0.15) 18%,
      rgba(23, 24, 26, 0.72) 38%,
      rgba(23, 24, 26, 0.93) 62%,
      #17181a 100%
    ),
    url("images/moti_bg.jpg");
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
}

body[data-page="moti"] .site-header {
  background: rgba(18, 19, 21, 0.65);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-page="moti"] .nav-links a {
  color: #d6d6d0;
}

body[data-page="moti"] .nav-links a:hover {
  color: #ffffff;
}

body[data-page="moti"] .nav-toggle {
  color: #d6d6d0;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(25, 27, 30, 0.7);
}

body[data-page="moti"] main {
  width: min(100% - 2 * var(--gutter), var(--reading));
  margin: 0 auto;
  padding: clamp(140px, 28vh, 300px) 0 60px;
}

.memoriam-container {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

body[data-page="moti"] .footer {
  color: #a8a8a2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  padding: 30px 0 36px;
  text-align: center;
}

.memoriam-header {
  margin-bottom: clamp(22px, 3.5vw, 30px);
}

.back-home-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: #d6d6d0;
  text-decoration: none;
  margin-bottom: 22px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.back-home-link:hover {
  color: #ffffff;
  transform: translateX(-3px);
  text-decoration: none;
}

.back-home-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.memoriam-title {
  font-family: var(--serif);
  font-size: clamp(2.3rem, 5vw, 3.3rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.hindi-name {
  font-family: "Kohinoor Devanagari", "Noto Sans Devanagari", "Mangal", var(--sans);
  color: inherit;
}

.memoriam-title .hindi-name {
  color: inherit;
  font-family: "Kohinoor Devanagari", "Noto Sans Devanagari", "Mangal", var(--sans);
  font-weight: 600;
}

.memoriam-circa {
  font-family: var(--sans);
  font-size: 1.05rem;
  color: #d6d6ce;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.memoriam-photo-caption {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: #a8a89f;
  margin: 6px 0 0;
  font-style: italic;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Narrative Story */
.memoriam-story {
  font-size: 1.14rem;
  line-height: 1.76;
  color: #f0f0eb;
  margin: 28px 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.memoriam-story p {
  margin: 0 0 1.35em;
}

.memoriam-story strong {
  color: inherit;
}

/* Mascot Callout */
.memoriam-mascot-box {
  margin: 36px 0 10px;
  padding: 20px 22px;
  background: rgba(22, 23, 26, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 18px;
  align-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

@media (max-width: 540px) {
  .memoriam-mascot-box {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
  }
}

.memoriam-mascot-avatar {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.memoriam-mascot-avatar svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.memoriam-mascot-body h3 {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
}

.memoriam-mascot-body p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #d2d2cb;
}
/* ---------- Projects year gutter ---------- */
.project-list {
  --year-gutter: clamp(4.5rem, 9vw, 7rem);
}

.project-list > .project {
  position: relative;
  margin-left: var(--year-gutter);
}

.project-year {
  position: absolute;
  left: calc(-1 * var(--year-gutter));
  top: 0.45rem;
  width: calc(var(--year-gutter) - 1rem);
  color: var(--ink-3);
  font: 500 0.8rem/1.2 var(--sans);
  letter-spacing: 0.02em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .project-list {
    --year-gutter: 0rem;
  }

  .project-list > .project {
    margin-left: 0;
  }

  .project-year {
    position: static;
    width: auto;
    margin-bottom: 0.35rem;
    text-align: left;
    font-size: 0.75rem;
  }
}
