:root {
  --bg: #f7faf4;
  --text: #111111;
  --border: #dbe8d4;

  --accent: #8ee000;
  --accent-bright: #b6ff2e;
  --accent-dark: #4aa000;

  --shadow: 0 20px 45px rgba(24, 35, 18, 0.10);

  --font-main: "Roboto Flex", system-ui, sans-serif;
}

/* ===== DARK MODE ===== */

[data-theme="dark"] {
  --bg: #0f140d;
  --text: #ffffff;
  --border: #33452c;
}

/* ===== SCROLLBAR FIX ===== */

html {
  scrollbar-gutter: stable;
}

/* force scrollbar to always exist (prevents shifting) */
.cv-page {
  overflow-y: scroll;
}

/* ===== BASE ===== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
}

/* ===== HEADER ===== */

.site-header {
  width: 100%;
  max-width: 100vw;
  height: 72px;
  padding: 0 40px;

  display: flex;
  grid-template-columns: 180px minmax(0, 1fr) 110px;
  align-items: center;

  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

/* NAME (dark lime) */
.site-title,
.site-title:visited {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  white-space: nowrap;
}

/* NAV */
.site-nav {
  display: flex;
  align-items: center;
  gap: 12px;

  overflow-x: auto;
  white-space: nowrap;
  flex: 1;                  /* take available space */
  justify-content: center;  /* keep centered */
}

.site-nav a {
  text-decoration: none;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.site-nav a.active,
.site-nav a:hover {
  background: rgba(142, 224, 0, 0.15);
}

/* BUTTON */
.theme-toggle {
  justify-self: end;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

/* ===== MAIN ===== */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ===== HERO ===== */

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  align-items: center;
  gap: 70px;
}

.hero h1 {
  font-size: clamp(5rem, 12vw, 9rem);
  color: var(--accent-dark);
  line-height: 0.9;
  margin: 0;
}

.eyebrow {
  font-size: clamp(1rem, 1.8vw, 1.45rem);
  line-height: 1.35;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
}

.hero-text {
  font-size: 1.2rem;
  max-width: 600px;
}

/* ===== IMAGE ===== */

.hero-image {
  display: flex;
  justify-content: flex-end;
}

.hero-image img {
  width: 320px;
  height: 400px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* ===== ABOUT ===== */

.home-about {
  margin-top: 70px;
  width: 100%;
  max-width: none;
  border-top: 1px solid var(--border);
  padding-top: 36px;
}

.home-about h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.home-about p {
  line-height: 1.8;
  font-size: 1.08rem;
  max-width: 1000px;
}

/* ===== LINKS ===== */

a,
a:visited {
  color: var(--text);
}

.home-about a {
  text-decoration: underline;
  text-decoration-color: var(--accent-dark);
  text-underline-offset: 3px;
  font-weight: 500;
}

/* ===== BUTTONS ===== */

.button {
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  color: #102000;
}

.button.secondary {
  border: 1px solid var(--border);
}

/* ===== FOOTER ===== */

.site-footer {
  text-align: center;
  padding: 20px;
}

/* ===== CV PAGE ===== */

.cv-main {
  max-width: none;
  margin: 0;
  padding: 20px 0 60px;
  display: block;
}

.cv-header,
.cv-container {
  margin: 0 auto;
}

.cv-header {
  width: 75%;
  max-width: 900px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.cv-container {
  width: 75%;
  max-width: 900px;
  height: 85vh;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: white;
}

.cv-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.theme-toggle {
  justify-self: end;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

/* Research page css */

.research-entry {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.research-entry:last-child {
  border-bottom: none;
}

.research-entry h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.research-entry p {
  margin: 0;
  line-height: 1.75;
}

/* h1 highlighting lime, because i like it */

main h1 {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(142, 224, 0, 0.15);
}

.hero h1 {
  background: none;
  padding: 0;
}

/* Publication list spacing */
.publication-list li {
  margin-bottom: 16px;
}

/* Make footer smaller */
.site-footer {
  text-align: center;
  padding: 20px;
  font-size: 0.7rem;
}

.site-footer p {
  margin: 0;
}

/* ===== MOBILE ===== */

@media (max-width: 850px) {
  .site-header {
    width: 100%;
    height: 72px;
    padding: 0 40px;

    display: flex;              /* switch from grid → flex */
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    position: sticky;
    top: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
  }

  .site-nav {
    display: flex;
    align-items: center;
    gap: 12px;

    overflow-x: auto;
    white-space: nowrap;
    flex: 1;                  /* take available space */
    justify-content: center;  /* keep centered */
  }

  .theme-toggle {
    justify-self: start;
  }

  .hero-layout {
    grid-template-columns: 1fr;
  }

  .hero-image {
    order: -1;
    justify-content: flex-start;
  }

  .hero-image img {
    width: 220px;
    height: 280px;
  }

  .cv-container {
    width: 95%;
    height: 75vh;
  }
}