:root {
  --bg: #ffffff;
  --text: #1f2937;
  --muted: #4b5563;
  --accent: #163a63;
  --line: #d1d5db;
  --max-width: 815px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 56px;
}

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

a:hover {
  text-decoration: underline;
}

/* ===== Header / Navigation ===== */

.topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.language-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.language-switch a,
.language-switch button {
  display: inline-block;
  background: #ffffff;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.language-switch a:hover,
.language-switch button:hover {
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
}

.language-switch a.active,
.language-switch button.active {
  background: var(--accent);
  color: #ffffff;
}

.back-link {
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: inline-block;
}

/* ===== Header blocks ===== */

header {
  margin-bottom: 44px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.header-text {
  flex: 1;
  min-width: 250px;
}

.site-title,
h1 {
  color: var(--accent);
  margin: 0 0 10px 0;
}

.site-title {
  font-size: 2.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.site-subtitle {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 20px 0;
}

.intro {
  font-weight: 500;
}

/* ===== Contact ===== */

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

.contact li {
  margin: 6px 0;
  color: var(--muted);
}

.linkedin-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.linkedin-link:hover {
  text-decoration: underline;
}

.portrait {
  flex-shrink: 0;
  width: 140px;
  border-radius: 10px;
}

/* ===== General content ===== */

section {
  margin-bottom: 40px;
}

h2 {
  font-size: 1.2rem;
  color: var(--accent);
  margin: 0 0 12px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

p {
  margin: 0 0 14px 0;
}

ul {
  margin: 0;
  padding-left: 24px;
}

li {
  margin: 8px 0;
}

/* ===== Reference / project pages ===== */

.project {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.project-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.project-meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.project-description {
  margin: 0;
}

.project-image {
  width: 100%;
  max-width: 700px;
  height: auto;
  display: block;
  margin: 12px auto 4px auto;
}

.project-image.large {
  max-width: 815px;
}

.project-image.small {
  max-width: 500px;
}

.project:last-of-type {
  border-bottom: none;
}

.image-caption {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 3px;
  margin-bottom: 20px;
}

/* ===== New thumb-friendly page navigation buttons ===== */

.page-links {
  margin-top: 20px;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-button:hover {
  background: #eef3f8;
  border-color: var(--accent);
  text-decoration: none;
}

.nav-button.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* ===== Footer CTA buttons ===== */

footer {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.footer-cta {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.footer-cta .cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
  color: var(--accent);
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.footer-cta .cta:hover {
  background-color: var(--accent);
  color: #ffffff;
  text-decoration: none;
}

.footer-cta .cta-separator {
  color: var(--muted);
}

/* ===== Utility ===== */

.hidden-lang {
  display: none !important;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ===== Responsive ===== */

@media (min-width: 768px) {
  .project-title {
    font-size: 1.4rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 24px 16px 44px;
  }

  .topbar {
    justify-content: flex-start;
  }

  .site-title {
    font-size: 2rem;
    line-height: 1.15;
  }

  .site-subtitle {
    font-size: 1.05rem;
    line-height: 1.45;
  }

  h2 {
    font-size: 1.1rem;
  }

  .page-links {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-button {
    width: 100%;
  }

  .footer-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-cta .cta {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
  }

  .footer-cta .cta-separator {
    display: none;
  }
}