:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #222222;
  --muted: #555555;
  --line: #e3e3e3;
  --line-strong: #cccccc;
  --accent: #2d66c3;
  --accent-soft: #f4f7fb;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.05);
  --max-width: 980px;
}

html[data-theme="dark"] {
  --bg: #1c1c1d;
  --surface: #212529;
  --text: #e8e8e8;
  --muted: #b4b4b4;
  --line: #424246;
  --line-strong: #5a5a5f;
  --accent: #2698ba;
  --accent-soft: rgba(38, 152, 186, 0.12);
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html.transition-theme,
html.transition-theme *,
html.transition-theme *::before,
html.transition-theme *::after {
  transition:
    background-color 220ms ease,
    color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", sans-serif;
  font-weight: 300;
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

.inline-email {
  font-weight: 400;
  white-space: nowrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
}

.navbar,
.page,
.footer-inner {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  color: var(--text);
  font-family: "Roboto Slab", serif;
  font-size: 1.15rem;
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-links a,
.theme-toggle {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
  text-transform: lowercase;
}

.nav-links a.is-active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
}

.theme-toggle {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 1;
}

.theme-icon {
  display: none;
  font-size: 1rem;
}

.theme-icon-system {
  display: inline;
}

html[data-theme-setting="dark"] .theme-icon-system,
html[data-theme-setting="light"] .theme-icon-system {
  display: none;
}

html[data-theme-setting="dark"] .theme-icon-dark {
  display: inline;
}

html[data-theme-setting="light"] .theme-icon-light {
  display: inline;
}

#progress-bar {
  display: block;
  width: 100%;
  height: 2px;
  border: 0;
  background: transparent;
}

#progress-bar::-webkit-progress-bar {
  background: transparent;
}

#progress-bar::-webkit-progress-value {
  background: var(--accent);
}

#progress-bar::-moz-progress-bar {
  background: var(--accent);
}

.page {
  padding: 38px 0 56px;
}

.section {
  margin-bottom: 42px;
}

.page-header {
  margin-bottom: 18px;
}

.page-title,
.section-title,
.project-item h3,
.experience-card h3 {
  font-family: "Roboto Slab", serif;
}

.page-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.3rem, 6vw, 3rem);
  font-weight: 300;
  line-height: 1.1;
}

.title-strong {
  font-weight: 500;
}

.page-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 300;
}

.intro-content {
  overflow: hidden;
}

.profile-card {
  float: right;
  width: min(290px, 100%);
  margin: 4px 0 18px 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--accent-soft);
  box-shadow: var(--shadow);
}

.profile-block + .profile-block {
  margin-top: 14px;
}

.profile-label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.profile-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.intro-copy p {
  margin: 0 0 16px;
  font-size: 1rem;
}

.interest-list p {
  margin-bottom: 8px;
}

.interest-list ul {
  margin: 0;
  padding-left: 20px;
}

.interest-list li {
  margin-bottom: 10px;
}

.section-title {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 1.7rem;
  font-weight: 400;
  text-transform: lowercase;
}

.news-table-wrap {
  overflow-x: auto;
}

.news-table {
  width: 100%;
  border-collapse: collapse;
}

.news-table th,
.news-table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.98rem;
}

.news-table th {
  width: 22%;
  color: var(--text);
  font-weight: 400;
  text-align: left;
}

.project-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.project-item:first-child {
  border-top: 1px solid var(--line);
}

.project-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-top: 6px;
}

.project-index {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.project-index::after {
  content: "";
  display: inline-block;
  width: 48px;
  height: 1px;
  margin-left: 10px;
  background: var(--line-strong);
}

.project-category {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.project-body h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 400;
}

.project-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.project-body p {
  margin: 0 0 12px;
  font-weight: 300;
}

.project-notes {
  color: var(--text);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row span {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.84rem;
}

.experience-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.experience-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.experience-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 400;
}

.experience-card p {
  margin: 0 0 14px;
  font-weight: 300;
}

.site-footer {
  border-top: 1px solid var(--line);
}

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

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 520ms ease,
    transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .navbar {
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0 4px;
  }

  .nav-links.is-open {
    display: flex;
  }

  .profile-card {
    float: none;
    width: 100%;
    margin: 0 0 18px;
  }

  .project-item,
  .experience-grid {
    grid-template-columns: 1fr;
  }

  .project-item {
    gap: 12px;
  }

  .project-badge {
    gap: 6px;
    padding-top: 0;
  }

  .project-index::after {
    width: 34px;
  }

  .news-table th,
  .news-table td {
    display: block;
    width: 100%;
    padding: 8px 0;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
