/* ====== Font Import ====== */
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&display=swap');

/* ====== Color System ====== */
:root {
  --bg: #f2f1ed;
  --text: #111111;
  --muted: #555;
  --accent: #2b3a55;  /* navy tone */
  --panel: #f7f7f7;
  --card: #ffffff;
  --border: #e4e1da;
}

body.dark {
  --bg: #171717;
  --text: #f1f1f1;
  --muted: #bdbdbd;
  --accent: #98b4ff;
  --panel: #232323;
  --card: #1e1e1e;
  --border: #2b2b2b;
}

/* ====== Global Serif + Small-Caps Typography ====== */
html { font-size: 18.5px; }
@media (min-width: 900px) {
  html { font-size: 19.5px; }
}

body,
button, input, select, textarea,
a, nav, .accordion, .panel,
h1, h2, h3, h4, h5, h6 {
  font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-caps: small-caps;
  text-transform: none;
  letter-spacing: 0.06em;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.9;
  margin: 0;
  transition: background .25s ease, color .25s ease;
}

/* ====== Layout ====== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ====== Header ====== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}

.site-title {
  margin: 0;
  font-size: 2.6rem;
  font-weight: 700;
  font-variant-caps: small-caps;
  letter-spacing: 0.12em;
}

.site-nav a {
  margin-left: 18px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.site-nav a:hover { border-bottom: 1px solid var(--text); }

/* ====== Header subtle shadow separation ====== */
.site-header {
  background-color: var(--bg);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* soft bottom shadow */
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Optional: smooth fade when scrolling */
@media (prefers-reduced-motion: no-preference) {
  .site-header {
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
  }
}


/* ====== Hero Section (Text Aligned, Photo Spaced) ====== */
.hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  align-items: flex-start;
  gap: 48px;                 /* more space between text and photo */
  padding: 40px 0 20px 0;
}

.hero-text {
  text-align: justify;       /* makes the paragraph edges aligned */
  text-justify: inter-word;
  hyphens: auto;
  margin-right: 10px;
}

.hero-photo {
  margin-top: 10px;
  text-align: center;        /* keeps image centered on small screens */
}

.hero-photo img {
  width: 100%;
  max-width: 360px;          /* limit width for elegance */
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-left: auto;
  margin-right: auto;
}

.caption {
  color: var(--muted);
  font-size: 12px;
  margin: 6px 0 0 0;
}

/* About section */
.section-narrow {
  max-width: 980px;       /* narrows the text block for elegance */
  margin: 50px auto 10px;
  padding: 0 6px;
}

#about p {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  font-size: 1.08rem;     /* a touch larger for readability */
  margin: 0.9rem 0 1.1rem;
  letter-spacing: 0.05em; /* consistent with site-wide small caps feel */
}

.about-title {
  text-align: right;      /* matches your screenshot */
  margin: 0 0 1.2rem 0;
  font-size: 1.7rem;
  letter-spacing: 0.07em;
}


/* ====== Headings ====== */
h1 {
  font-weight: 700;
  font-size: 2.3rem;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}
h2 {
  font-size: 1.6rem;
  margin-top: 2rem;
  font-weight: 700;
  letter-spacing: 0.07em;
}
h3 {
  font-size: 1.3rem;
  font-weight: 700;
}

/* ====== Paragraphs ====== */
p {
  margin: 0.8rem 0 1rem;
  letter-spacing: 0.05em;
  font-size: 1.02rem;
}

/* ===== Publications layout ===== */
.pubs {
  display: grid;
  grid-template-columns: 1fr 2fr;   /* left title, right list */
  gap: 40px;
  padding-top: 10px;
}

.pubs-title h2 {
  font-size: 1.8rem;
  margin: 0.2rem 0 0;
  letter-spacing: 0.07em;
}

.pubs-list {
  display: flex;
  flex-direction: column;
  gap: 28px;                        /* space between entries */
}

.pub {
  padding: 0 0 24px 0;
  border-bottom: 1px solid var(--border);
}

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

.pub-authors {
  margin: 0 0 6px 0;
  font-size: 1.05rem;
  font-weight: 700;                  /* small-caps already global */
}

.pub-authors .me {
  text-decoration: underline;        /* highlight your name */
}

.pub-title {
  font-size: 1.05rem;
  margin: 0 0 10px 0;
}

.pub-links a {
  display: inline-block;
  margin-right: 18px;
  color: var(--accent);
  text-decoration: underline;
}

/* responsive */
@media (max-width: 900px) {
  .pubs { grid-template-columns: 1fr; }
  .pubs-title h2 { text-align: left; margin-bottom: 6px; }
}

/* ===== Notes page ===== */
.notes h2 {
  font-size: 1.8rem;
  margin: 0 0 18px 0;
  letter-spacing: 0.07em;
}

.notes-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr;   /* similar balance to screenshot */
  gap: 40px 60px;                            /* row / column gaps */
  margin-top: 10px;
}

.notes-col h3 {
  margin: 8px 0 10px;
  font-size: 1.15rem;
  font-weight: 700;
}

.notes-col ul {
  list-style: disc;
  padding-left: 20px;                        /* indent bullets nicely */
  margin: 0;
}

.notes-col li {
  margin: 14px 0;
  line-height: 1.7;
}

.notes-col a {
  text-decoration: underline;                /* underline like your example */
  text-underline-offset: 3px;
  color: var(--accent);
}

/* Centered italic blurb */
.notes-blurb {
  text-align: center;
  margin: 36px auto 8px;
  font-style: italic;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

/* Responsive: stack columns on smaller screens */
@media (max-width: 1000px) {
  .notes-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .notes-grid { grid-template-columns: 1fr; }
}


/* ====== Accordion ====== */
.edu-row { margin: 10px 0 8px 0; }
.accordion {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
  letter-spacing: 0.05em;
}
.accordion:hover { background: var(--card); }

.accordion .logo-link img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.panel {
  display: none;
  padding: 14px 18px 8px 18px;
  border-left: 3px solid var(--accent);
  margin: 6px 0 16px 0;
  background: var(--panel);
  border-radius: 10px;
  font-size: 1rem;
}

/* ===== CV page ===== */
.cv-heading {
  font-size: 2.5rem;
  letter-spacing: 0.07em;
  margin: 28px 0 10px;
}

.cv-row + .cv-row { margin-top: 4px; }

/* Row button (accordion trigger) */
.cv-accordion {
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 22px 8px;
  display: grid;
  grid-template-columns: 2fr 1.5fr auto;  /* title | meta | right */
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background .2s ease;
}
.cv-accordion:hover { background: var(--panel); }

.cv-title {
  font-size: 1.6rem;         /* big line like your screenshot */
  font-weight: 700;
}

.cv-title {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: left;          /* ⬅ ensures single-line left alignment */
  white-space: normal;       /* prevents weird wrapping */
  display: block;            /* keep it block-level */
}


.cv-meta {
  color: var(--muted);
  font-size: 1.05rem;
}

/* right side: logo + chevron */
.cv-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}
.cv-logo {
  width: 75px; height: 75px; object-fit: contain;
  border-radius: 75%;
}
.chevron {
  font-size: 1.2rem;
  line-height: 1;
  transition: transform .2s ease;
}

/* opened state (JS will toggle .active) */
.cv-accordion.active .chevron { transform: rotate(180deg); }

/* Panel content */
/* ===== Professional Experience panel alignment ===== */
.cv-panel {
  padding: 14px 18px 18px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  text-align: left;              /* ← ensures all text is aligned */
  line-height: 1.7;
}

/* Paragraph styling inside panel */
.cv-panel p {
  margin: 0.5rem 0;              /* adds nice spacing */
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

/* Add blank line before location/dates */
.cv-panel p.location {
  margin-top: 1.2rem;            /* ← extra space before location */
  font-style: normal;
}
.cv-panel p.dates {
  margin-top: 0.4rem;            /* small separation below */
  font-weight: 500;
}

.cv-bullets {
  list-style: none;           /* ⬅ removes dots */
  margin: 0;
  padding: 0;
}
.cv-bullets li {
  margin: 6px 0;
  line-height: 1.7;
  text-align: justify;        /* optional: aligns lines neatly */
  text-justify: inter-word;
}

.cv-download {
  text-align: center;
  margin: 28px 0 6px;
}

/* Responsive */
@media (max-width: 900px) {
  .cv-accordion {
    grid-template-columns: 1fr auto; /* stack meta inside panel on small screens */
    padding: 18px 6px;
  }
  .cv-meta { display: none; }
}

/* ===== Two-column CV section ===== */
.cv-section {
  display: grid;
  grid-template-columns: 1fr 2fr;  /* title left, content right */
  gap: 50px;
  align-items: start;
  margin: 60px 0;
}

.cv-left {
  text-align: left;
  padding-right: 20px;
}

.cv-left h2 {
  font-size: 2.5rem;
  letter-spacing: 0.08em;
  line-height: 1.1;
  margin: 0;
}

.cv-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Adjust accordion design */
.cv-accordion {
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  padding: 18px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cv-accordion:hover { background: var(--panel); }

.cv-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: left;
  letter-spacing: 0.05em;
}

.cv-panel {
  padding: 10px 10px 18px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.cv-panel p {
  margin: 6px 0;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.cv-bullets {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
}
.cv-bullets li {
  margin: 4px 0;
}

/* Chevron */
.chevron {
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}
.cv-accordion.active .chevron {
  transform: rotate(180deg);
}

/* Responsive */
@media (max-width: 900px) {
  .cv-section {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .cv-left h2 {
    text-align: center;
  }
}


/* ===== Awards & Recognitions ===== */
.awards-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 12px;
}

.award {
  display: grid;
  grid-template-columns: 1fr 100px;  /* left = title, right = year */
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.award-title {
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  text-align: justify;
  text-justify: inter-word;
}

.award-year {
  font-size: 1.05rem;
  text-align: right;
  color: var(--text);
  font-weight: 500;
}

/* Responsive: stack on smaller screens */
@media (max-width: 700px) {
  .award {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }
  .award-year {
    text-align: left;
    color: var(--muted);
  }
}


/* ====== Logo Grid ====== */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 10px 0 40px 0;
}
.logo-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  text-decoration: none;
  color: var(--text);
  transition: transform .1s ease, background .2s ease, border-color .2s ease;
}
.logo-card:hover { transform: translateY(-2px); }
.logo-card img { width: 26px; height: 26px; object-fit: contain; }

/* ====== Footer ====== */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 24px;
}
.site-footer .container { padding: 20px 0; color: var(--muted); }

/* ===== Round theme toggle using image icons (clean) ===== */
.theme-toggle{
  position:fixed; right:22px; bottom:22px;
  width:46px; height:46px; border-radius:50%;
  border:2px solid var(--text);
  background: var(--bg);
  display:grid; place-items:center; cursor:pointer;
  box-shadow:0 6px 16px rgba(0,0,0,.15);
  transition: transform .12s ease, opacity .2s ease, border-color .2s ease, background-color .2s ease;
  overflow:hidden;
}
.theme-toggle:hover{ transform:translateY(-2px); opacity:.95; }
.theme-toggle:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; }

/* icons inside button */
.theme-toggle img.icon{
  width:24px; height:24px; object-fit:contain; display:block;
  transition: opacity .3s ease, transform .3s ease, filter .3s ease;
  filter: none;                       /* baseline: no filter */
}

/* Light mode – show sun, hide moon */
.theme-toggle .sun{ opacity:1; transform:scale(1); }
.theme-toggle .moon{ opacity:0; transform:scale(.7); position:absolute; }

/* Dark mode – show moon, hide sun */
body.dark .theme-toggle .sun{ opacity:0; transform:scale(.7); position:absolute; }
body.dark .theme-toggle .moon{ opacity:1; transform:scale(1); }

/* Make the SUN icon white when dark (in case it’s a black PNG) */
body.dark .theme-toggle .sun{
  filter: brightness(0) invert(1) contrast(1.05) !important;
}

/* optional tiny tint background in dark mode */
body.dark .theme-toggle{ background-color: rgba(255,255,255,0.05); }


/* ====== Links ====== */
a { color: var(--accent); }
a:hover { opacity: .9; }

/* ====== Footer Contact Icons (Clean Floating Style) ====== */
.footer-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;                 /* uniform spacing */
  padding: 28px 0;
  flex-wrap: wrap;
}

.footer-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;       /* ensures a uniform clickable box */
  height: 42px;
  flex-shrink: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  background: none;
}


.footer-icons a:hover {
  transform: translateY(-3px);
  opacity: 0.8;
}

/* Icons */
.footer-icons img {
  max-height: 42px;              /* same visual height */
  width: auto;               /* preserves aspect ratio */
  object-fit: contain;
  display: block;
  vertical-align: middle;
  margin: auto;
  filter: invert(0%) brightness(100%);  /* black icons for light mode */
  transition: filter 0.3s ease;
}


/* In dark mode → make icons white */
body.dark .footer-icons img {
  filter: invert(100%) brightness(100%);
}

body.dark .theme-toggle .moon {
  filter: brightness(0) invert(1) drop-shadow(0 0 2px rgba(255,255,255,0.6));
}



/* ====== Responsive ====== */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .hero-text {
    text-align: left;    /* easier to read on mobile */
  }
  .hero-photo img {
    max-width: 320px;
  }
}

/* ===== CV two-column layout: more room on the right ===== */
.cv-section{
  /* title column ~320px, content takes the rest */
  grid-template-columns: 320px minmax(0,1fr);
  gap: 64px;                 /* more space between left title and content */
}

/* ===== Right alignment fix for Professional Experience ===== */

/* Make the right column expand fully and align items to the right edge */
.cv-section .cv-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;   /* ⬅ ensures all accordions align right */
  width: 100%;
}

/* Accordion should itself fill the available width, right-aligned */
.cv-accordion {
  width: 90%;              /* ⬅ controls how far from right edge */
  max-width: 1000px;       /* prevent it from being too wide on big screens */
  text-align: left;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Institution titles */
.cv-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Panels now align perfectly with titles */
.cv-panel {
  width: 90%;
  max-width: 1000px;
  margin: 6px 0 26px 0;
  padding: 18px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  line-height: 1.75;
  text-align: left;
}

/* Chevron placement */
.chevron {
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}
.cv-accordion.active .chevron {
  transform: rotate(180deg);
}

/* === CV: align the whole right column to the page's right edge === */
.cv-section {
  /* left title column, big flexible right column */
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 60px;
}

/* Right column should NOT center its children */
.cv-section .cv-right {
  display: flex;
  flex-direction: column;
  align-items: stretch;      /* <-- no centering; take full width */
  width: 100%;
}

/* Each row fills the whole right column width */
.cv-section .cv-right > .cv-row { width: 100%; }

/* Button + panel should span the full width (no 90% boxes) */
.cv-accordion,
.cv-panel {
  width: 100%;
  max-width: none;
}

/* Tidy accordion button */
.cv-accordion {
  border: none;                      /* remove default button border */
  border-top: 1px solid var(--border);
  padding: 20px 0;
  display: grid;
  grid-template-columns: 1fr auto;   /* title | chevron */
  align-items: center;
  background: transparent;
  text-align: left;
}

/* Title on ONE line; if it overflows, show an ellipsis */
.cv-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .05em;
  white-space: nowrap;               /* <-- one line */
  overflow: hidden;
  text-overflow: ellipsis;           /* … if too long */
}

/* Panel breathing room */
.cv-panel {
  margin: 6px 0 24px 0;
  padding: 16px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  line-height: 1.75;
  text-align: left;
}

/* Mobile: stack cleanly */
@media (max-width: 900px) {
  .cv-section { grid-template-columns: 1fr; gap: 22px; }
}

/* ===== Smaller left section title (Professional Experience) ===== */
.cv-left h2 {
  font-size: 2.5rem;        /* smaller, elegant size */
  letter-spacing: 0.06em;   /* keep the small-caps spacing */
  line-height: 1.2;
  margin: 0 0 1rem 0;
  text-align: left;
  font-weight: 700;
}

/* ===== Skills & Interests Section (Refined) ===== */
.cv-section {
  display: grid;
  grid-template-columns: 1fr 2.2fr;
  align-items: flex-start;
  gap: 60px;
  margin: 60px auto;
  max-width: 1200px;
}

.cv-left h2 {
  margin: 0;
  font-size: 2.5rem;              /* smaller, matches "Professional Experience" */
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.07em;
}

.skills {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 6px;
  line-height: 1.8;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.skill-item p {
  margin: 0;
  font-variant-caps: small-caps;
}

.skill-item strong {
  font-weight: 700;
  letter-spacing: 0.05em;
}

.skills hr {
  border: none;
  border-top: 1px solid var(--text);
  opacity: 0.5;
  margin: 10px 0;
}

/* Responsive balance */
@media (max-width: 900px) {
  .cv-section {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .cv-left h2 {
    text-align: left;
  }
}

/* ===== Unified CV Section Titles ===== */
.cv-left h2,
.education h2,
.experience h2,
.awards-list h2,
.skills h2 {
  font-size: 2.5rem;             /* uniform size */
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.07em;
  margin: 0;
  text-transform: none;
  font-variant-caps: small-caps;
}



