:root {
  --bg: #faf9f6;
  --header-bg: #efece4;     /* Slightly deeper than the main page */
  --surface: #f2f0ea;
  --text: #1f2328;
  --muted: #5c636a;
  --accent: #0f5c5c;
  --accent-soft: rgba(15, 92, 92, 0.08);
  --border: #e5e2d9;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
  --bg: #15171a;
  --header-bg: #1e2228;     /* Slightly lighter than the main dark page */
  --surface: #1e2126;
  --text: #e6e8eb;
  --muted: #9aa1a9;
  --accent: #66c2bc;
  --accent-soft: rgba(102, 194, 188, 0.12);
  --border: #2a2e35;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 18.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--header-bg) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  padding: 1rem 0;
  margin-bottom: 2.75rem;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.88rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 7%, transparent);
}

.site-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 500;
}

/* Dark Mode Button */
.theme-toggle {
  background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--text) 24%, transparent);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

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

.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: inline; }
[data-theme="dark"] .icon-moon { display: none; }


/* Typography */
h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--text);
}

h1 {
  font-size: 1.85rem;
  margin-top: 0;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: 1.32rem;
  margin-top: 2.5rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.1rem;
  margin-top: 1.6rem;
  margin-bottom: 0.5rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

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

ul, ol { padding-left: 1.35rem; }
li { margin-bottom: 0.6rem; }

blockquote, .callout {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 0.96rem;
}

/* Profile Section */



/* Profile Photo (floated right with text wrapping around) */
.profile-photo {
  float: right;
  width: 200px;
  height: auto;
  margin: 0.25rem 15% 1rem 1.75rem;   /* top, right, bottom, left spacing */
  border-radius: 10px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* Keep section headings cleanly below the photo if your bio is short */
h2 {
  clear: both;
}




/* Pill Links (for PDF, arXiv, Notes) */
.pill {
  display: inline-block;
  font-family: "Inter", sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  margin-left: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  text-decoration: none;
  vertical-align: middle;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pill:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Collapsible Abstracts (<details>) */
details {
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

details summary {
  cursor: pointer;
  font-family: "Inter", sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  display: inline-block;
  user-select: none;
}

details summary:hover {
  color: var(--accent);
}

details p {
  margin: 0.6rem 0 0.4rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border-radius: 8px;
  color: var(--text);
}

/* Footer */
.site-footer {
  margin-top: 4.5rem;
  padding: 1.75rem 0 2.5rem;
  border-top: 1px solid var(--border);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.84rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

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

/* Back Link for Subpages */
.back-link {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.88rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

/* Photo Gallery */
.photo-gallery {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 2rem;
}

.photo-card {
  margin: 0;
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.photo-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  transition: opacity 0.2s ease;
}

.photo-card a:hover img {
  opacity: 0.94;
}

.photo-card figcaption {
  padding: 0.9rem 0.25rem 0.2rem;
}

.photo-meta {
  display: block;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.photo-card figcaption p {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--text);
}

/* Optional Side-by-Side Layout (photo left, comment right) */
.photo-card.photo-side {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: center;
}

.photo-card.photo-side figcaption {
  padding: 0.25rem 0.4rem 0.25rem 0;
}

/* Reading & Folktales Catalogue, 2026-11-29 */
.tale-list {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  margin-top: 1.5rem;
}

.tale-card {
  padding: 1.25rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.tale-card.tale-featured {
  border-left: 3.5px solid var(--accent);
}

.tale-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.tale-meta {
  display: block;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.tale-title {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.3;
}

.tale-orig {
  font-weight: 400;
  font-style: italic;
  font-size: 0.96rem;
  color: var(--muted);
  margin-left: 0.35rem;
}

.tale-header .pill {
  flex-shrink: 0;
  margin-left: 0;
  margin-top: 0.15rem;
}

.tale-card p {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.65;
}

/* folktales end */

/* Literary Epigraph / Quotation Box */
.epigraph-box {
  position: relative;
  margin: 1.6rem 0 2.25rem;
  padding: 1.6rem 2rem;
  background: color-mix(in srgb, var(--accent) 4%, var(--bg));
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 2px;
}

.epigraph-box::before {
  content: "“";
  position: absolute;
  top: -0.3rem;
  left: 1.1rem;
  font-family: "Newsreader", Georgia, serif;
  font-size: 3.4rem;
  line-height: 1;
  color: color-mix(in srgb, var(--accent) 26%, transparent);
  pointer-events: none;
  user-select: none;
}

.epigraph {
  margin: 0;
  padding: 0;
}

.epigraph + .epigraph {
  margin-top: 1.35rem;
  padding-top: 1.35rem;
  border-top: 1px dashed color-mix(in srgb, var(--accent) 25%, var(--border));
}

.epigraph blockquote {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--text);
}

.epigraph figcaption {
  margin-top: 0.45rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-align: right;
}

/* Useful Links Directory */
.link-directory {
  list-style: none;
  padding: 0;
  margin: 1rem 0 2rem;
}

.link-directory li {
  margin: 0;
  padding: 0.9rem 0.85rem;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}

.link-directory li:first-child {
  border-top: 1px solid var(--border);
}

.link-directory li:hover {
  background: var(--surface);
}

.link-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
}

.link-head a {
  font-weight: 600;
  font-size: 1.04rem;
}

.link-head a::after {
  content: " ↗";
  font-size: 0.78em;
  font-weight: 400;
  opacity: 0.65;
}

.link-domain {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.76rem;
  color: var(--muted);
}

.link-directory p {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
  line-height: 1.58;
  color: var(--text);
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding: 0 1rem; }
  ul, ol { padding-left: 1.15rem; }
  li { overflow-wrap: anywhere; }
  .profile-photo {
    float: right;
    width: 150px;
    margin: 0.25rem 0 0.75rem 0.85rem;
  }
  .photo-card { padding: 0.7rem; }
  .photo-card.photo-side { grid-template-columns: 1fr; gap: 0.75rem; }
  .tale-card { padding: 1rem 1.1rem; }
  .tale-header { flex-direction: column; gap: 0.45rem; }

  .epigraph-box { padding: 1.25rem 1.2rem; }
  .epigraph blockquote { font-size: 1.03rem; }

  .link-directory li { padding: 0.8rem 0.5rem; }
}
