:root {
  --bg: #f7f3ea;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --text: #1f2933;
  --muted: #5f6b7a;
  --line: #e4d8c6;
  --accent: #7c4a1e;
  --accent-dark: #4b2e17;
  --accent-soft: #efe2d0;
  --ink: #0f172a;
  --shadow: 0 18px 45px rgba(38, 30, 20, 0.08);
}

/* Base */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124, 74, 30, 0.13), transparent 34rem),
    linear-gradient(180deg, #fbf7ef 0%, var(--bg) 48%, #fffdf8 100%);
  line-height: 1.65;
}

a {
  color: inherit;
}

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

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

/* Header / Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(228, 216, 198, 0.86);
}

.nav-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-name {
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-size: 1.1rem;
}

.brand-subtitle {
  font-size: 0.76rem;
  color: var(--muted);
}

.simple-nav {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.simple-nav a {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.55rem 0.78rem;
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--accent-dark);
  transition: background 160ms ease, transform 160ms ease;
}

.simple-nav a:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* Backward compatibility for older pages using section-nav */
.section-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 40px;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(228, 216, 198, 0.86);
}

.section-nav > a {
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-size: 1.1rem;
  text-decoration: none;
}

.section-nav nav {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.section-nav nav a {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.55rem 0.78rem;
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--accent-dark);
  transition: background 160ms ease, transform 160ms ease;
}

.section-nav nav a:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* Hero */
.hero,
.page-hero {
  padding: 4.8rem 0 3rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #dec7a9;
  border-radius: 999px;
  padding: 0.42rem 0.7rem;
}

h1,
h2,
h3 {
  color: var(--ink);
}

h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(2.7rem, 6vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  margin: 1.1rem 0 1rem;
}

.hero-lede,
.page-hero p {
  font-size: clamp(1.05rem, 2vw, 1.26rem);
  color: var(--muted);
  max-width: 820px;
  margin: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.7rem;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.78rem 1rem;
  font-weight: 800;
  font-size: 0.92rem;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button.primary {
  color: #ffffff;
  background: var(--ink);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.button.secondary {
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.button:hover {
  transform: translateY(-2px);
}

/* Sections */
.section {
  padding: 3rem 0;
}

.page-main {
  min-height: 70vh;
}

.section-header {
  display: grid;
  grid-template-columns: 0.45fr 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 2rem;
}

.section-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 850;
  color: var(--accent);
}

.section-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
  margin: 0;
  letter-spacing: -0.035em;
}

.section-copy {
  margin: 0;
  color: var(--muted);
  font-size: 1.03rem;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.three-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.35rem;
  box-shadow: 0 12px 32px rgba(38, 30, 20, 0.05);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: #c7af8f;
  box-shadow: 0 18px 44px rgba(38, 30, 20, 0.09);
}

.card h2,
.card h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.35;
  color: var(--ink);
}

.card .meta {
  margin: 0.35rem 0 0;
  color: #9a7a55;
  font-size: 0.83rem;
  font-weight: 800;
}

.card p {
  color: var(--muted);
  margin: 0.85rem 0 0;
}

.card a {
  color: var(--accent-dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(124, 74, 30, 0.35);
}

.card .button {
  border-bottom: none;
  margin-top: 1rem;
}

.card .button.primary {
  color: #ffffff;
}

.card .button.secondary {
  color: var(--ink);
}

.card ul {
  color: var(--muted);
  margin: 1rem 0 1.2rem;
  padding-left: 1.2rem;
}

.card ul li {
  margin-bottom: 0.35rem;
}

/* Academic note list pages */
.note-list {
  display: grid;
  gap: 1rem;
}

.note-card {
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.25rem;
  box-shadow: 0 12px 32px rgba(38, 30, 20, 0.05);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.note-card:hover {
  transform: translateY(-2px);
  border-color: #c7af8f;
  box-shadow: 0 18px 44px rgba(38, 30, 20, 0.08);
}

.note-card h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--ink);
}

.note-card .meta {
  margin: 0.35rem 0 0;
  color: #9a7a55;
  font-size: 0.83rem;
  font-weight: 800;
}

.note-card p {
  color: var(--muted);
}

.note-card a {
  display: inline-block;
  margin-top: 0.4rem;
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid rgba(124, 74, 30, 0.35);
}

.disabled-link {
  display: inline-block;
  margin-top: 0.4rem;
  color: #9a7a55;
  font-weight: 800;
}

/* Individual note/article pages */
.note-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
  align-items: start;
}

.article {
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(1.4rem, 4vw, 2.3rem);
  box-shadow: 0 12px 32px rgba(38, 30, 20, 0.05);
}

.article h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.8rem;
  margin: 2rem 0 0.6rem;
}

.article h2:first-child {
  margin-top: 0;
}

.article p,
.article li {
  color: var(--muted);
}

.article code {
  background: var(--accent-soft);
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
}

.article a {
  color: var(--accent-dark);
  font-weight: 750;
  text-decoration: none;
  border-bottom: 1px solid rgba(124, 74, 30, 0.35);
}

.sidebar {
  position: sticky;
  top: 96px;
  background: #fffaf1;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.25rem;
  box-shadow: 0 12px 32px rgba(38, 30, 20, 0.05);
}

.sidebar h2 {
  margin: 0 0 0.55rem;
  font-size: 1.1rem;
}

.sidebar p {
  color: var(--muted);
  font-size: 0.94rem;
}

.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  background: #f1e2ca;
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 850;
  margin-bottom: 0.75rem;
}

/* Travel map */
.map-panel {
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 1.25rem;
  box-shadow: 0 12px 32px rgba(38, 30, 20, 0.05);
}

.map-wrap {
  width: 100%;
  overflow-x: auto;
}

.india-map {
  width: min(100%, 820px);
  height: auto;
  display: block;
  margin: 0 auto;
}

.state {
  fill: #e8ddcf;
  stroke: #fffaf1;
  stroke-width: 2;
  transition: fill 160ms ease, transform 160ms ease, opacity 160ms ease;
  cursor: default;
}

.state.visited {
  fill: #b87833;
  cursor: pointer;
}

.state.draft {
  fill: #d7a667;
  cursor: pointer;
}

.state.planned {
  fill: #cebda7;
}

.state:hover {
  opacity: 0.88;
}

.map-label {
  font-size: 13px;
  font-weight: 800;
  fill: #2f2417;
  pointer-events: none;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.legend i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid #fffaf1;
}

/* Footer */
footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
  background: rgba(255, 253, 248, 0.65);
  margin-top: 3rem;
}

/* Responsive */
@media (max-width: 1000px) {
  .three-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .section-header,
  .cards,
  .note-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: 0;
  }

  .section-nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem 28px;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 28px, 1120px);
  }

  .brand-subtitle {
    display: none;
  }

  .simple-nav {
    gap: 0.35rem;
  }

  .simple-nav a,
  .section-nav nav a {
    font-size: 0.8rem;
    padding: 0.48rem 0.62rem;
  }

  h1 {
    font-size: 3.1rem;
  }

  .hero,
  .page-hero {
    padding: 3.8rem 0 2.4rem;
  }
}
/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.55rem 0.72rem;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: var(--accent-soft);
  border-color: #c9b79e;
}

.small-theme-toggle {
  box-shadow: none;
}

/* Dark mode variables */
html[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #151821;
  --surface-strong: #1b1f2a;
  --text: #e5e7eb;
  --muted: #a8b0bf;
  --line: #2b3140;
  --accent: #d4a373;
  --accent-dark: #f1c89a;
  --accent-soft: #2a2119;
  --ink: #f8fafc;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

/* Dark mode base */
html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(212, 163, 115, 0.13), transparent 34rem),
    linear-gradient(180deg, #0f1117 0%, #111827 48%, #151821 100%);
}

/* Dark mode surfaces */
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .section-nav,
html[data-theme="dark"] footer {
  background: rgba(21, 24, 33, 0.9);
  border-color: var(--line);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .note-card,
html[data-theme="dark"] .article,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .map-panel {
  background: rgba(21, 24, 33, 0.92);
  border-color: var(--line);
}

/* Dark mode navigation */
html[data-theme="dark"] .simple-nav a,
html[data-theme="dark"] .section-nav nav a,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .button.secondary {
  background: rgba(27, 31, 42, 0.95);
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme="dark"] .simple-nav a:hover,
html[data-theme="dark"] .section-nav nav a:hover,
html[data-theme="dark"] .theme-toggle:hover {
  background: var(--accent-soft);
}

/* Dark mode primary button */
html[data-theme="dark"] .button.primary {
  background: #f8fafc;
  color: #0f172a;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

/* Dark mode text accents */
html[data-theme="dark"] .section-kicker,
html[data-theme="dark"] .card .meta,
html[data-theme="dark"] .note-card .meta,
html[data-theme="dark"] .status-pill,
html[data-theme="dark"] .disabled-link {
  color: #d4a373;
}

/* Dark mode links */
html[data-theme="dark"] .card a,
html[data-theme="dark"] .note-card a,
html[data-theme="dark"] .article a {
  color: #f1c89a;
  border-bottom-color: rgba(241, 200, 154, 0.45);
}

/* Dark mode code blocks and pills */
html[data-theme="dark"] .article code,
html[data-theme="dark"] .status-pill,
html[data-theme="dark"] .eyebrow {
  background: var(--accent-soft);
  border-color: #4a3828;
}

/* Dark mode travel map */
html[data-theme="dark"] .state {
  fill: #2b3140;
  stroke: #151821;
}

html[data-theme="dark"] .state.visited {
  fill: #b87833;
}

html[data-theme="dark"] .state.draft {
  fill: #d7a667;
}

html[data-theme="dark"] .state.planned {
  fill: #4a5568;
}

html[data-theme="dark"] .map-label {
  fill: #f8fafc;
}

html[data-theme="dark"] .legend i {
  border-color: #151821;
}

/* Mobile theme button */
@media (max-width: 560px) {
  .theme-toggle .theme-text {
    display: none;
  }

  .theme-toggle {
    padding: 0.48rem 0.62rem;
  }
}
