:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --text: #1f2937;
  --subtext: #4b5563;
  --accent: #2d6cdf;
  --accent-soft: #dfeafc;
  --border: #dbe3f0;
  --shadow: rgba(31, 41, 55, 0.1);
  --hero-bg: linear-gradient(135deg, #ffffff 0%, #edf4ff 100%);
  --button-bg: #ffffff;
  --button-border: #dbe3f0;
}

body.dark-mode {
  --bg: #000000;
  --panel: #111111;
  --text: #ffffff;
  --subtext: #e5e7eb;
  --accent: #8ab4ff;
  --accent-soft: #1b1f2a;
  --border: #2b2b2b;
  --shadow: rgba(0, 0, 0, 0.7);
  --hero-bg: linear-gradient(135deg, #111111 0%, #000000 100%);
  --button-bg: #111111;
  --button-border: #333333;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg);
  background-image: url("./bakimege.jpg");
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode {
  background-color: #000000;
  background-image: url("./bakimege.jpg");
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  color: var(--text);
}

.page-shell {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 16px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 25px rgba(31, 41, 55, 0.08);
}

body.dark-mode .topbar {
  background: rgba(17, 17, 17, 0.8);
  border-color: #2b2b2b;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.45);
}

.banner-wrap {
  width: calc(100% / 6);
  min-width: 150px;
  max-width: 230px;
}

.banner-link {
  display: block;
  width: 100%;
}

.banner-image {
  display: block;
  width: 100%;
  height: auto;
  min-height: 54px;
  max-height: 90px;
  border-radius: 14px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
}

.topnav {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.hero,
.academic-card,
.card {
  scroll-margin-top: 130px;
}

.topnav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.topnav a:hover {
  background: rgba(45, 108, 223, 0.08);
}

.theme-toggle {
  position: relative;
  z-index: 30;
  width: 36px;
  height: 36px;
  border: 1px solid var(--button-border);
  border-radius: 50%;
  background: var(--button-bg);
  color: var(--text);
  box-shadow: 0 8px 18px var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
  flex: 0 0 36px;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-icon {
  font-size: 1.2rem;
}

.hero {
  background: var(--hero-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 16px 40px var(--shadow);
  padding: 48px 40px;
}


.profile-block {
  display: flex;
  align-items: center;
  gap: 28px;
}

.profile-image {
  width: 172px;
  height: 172px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--border);
  box-shadow: 0 10px 25px rgba(31, 41, 55, 0.15);
  background: #e7edf9;
}

.hero-text {
  flex: 1;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.1;
}

.subtitle {
  margin-top: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--subtext);
}

.summary {
  margin-top: 20px;
  max-width: 700px;
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--subtext);
}

.contact-row {
  margin-top: 28px;
}

.contact-row a,
.card a {
  color: var(--accent);
}

.contact-row a {
  display: inline-block;
  padding: 10px 18px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
}

.academic-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 24px;
  box-shadow: 0 10px 25px rgba(31, 41, 55, 0.05);
  margin-top: 24px;
  margin-bottom: 28px;
}

body.dark-mode .academic-card,
body.dark-mode .card,
body.dark-mode .hero {
  background: rgba(17, 17, 17, 0.95);
  border-color: #2b2b2b;
}

.academic-card h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.academic-card p {
  margin: 0;
  line-height: 1.8;
  color: var(--subtext);
}

.content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 10px 25px rgba(31, 41, 55, 0.05);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.2rem;
}

.card ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.9;
  color: var(--subtext);
}

.card p {
  margin: 0;
  line-height: 1.8;
  color: var(--subtext);
}

.card-description {
  margin-top: 14px;
  font-size: 0.96rem;
  color: var(--subtext);
}

.hobby-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 20px;
  align-items: start;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.hobby-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.hobby-item strong {
  color: var(--text);
}

.hobby-item p {
  margin: 0;
}

.hobby-item .card-description {
  margin-top: 10px;
}

.quote-source {
  display: block;
  margin-left: 8.5em;
}

@media (max-width: 640px) {
  .page-shell {
    padding-top: 24px;
  }

  .theme-toggle {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .hero {
    padding: 32px 22px;
  }

  .profile-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-image {
    width: 140px;
    height: 140px;
  }

  .card {
    padding: 22px 18px;
  }

  .hobby-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .quote-source {
    margin-left: 0;
  }
}
