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

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1a1f36;
  --text-muted: #5a6278;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(26, 31, 54, 0.08);
  --radius: 16px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

/* Hero */
.hero {
  position: relative;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
  padding: 3rem 1.5rem 4rem;
}

.top-bar {
  position: fixed;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.top-bar > * {
  pointer-events: auto;
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.top-action-link.active {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.65);
}

.top-nav-item {
  position: relative;
}

.top-nav-item.has-submenu > .top-action-link::after {
  content: "▾";
  margin-left: 0.35rem;
  font-size: 0.75rem;
}

.top-submenu {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 170px;
  list-style: none;
  padding: 0.35rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.top-submenu a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}

.top-submenu a:hover,
.top-submenu a.active {
  color: var(--accent);
  background: var(--accent-light);
}

.top-nav-item.has-submenu:hover .top-submenu,
.top-nav-item.has-submenu.open .top-submenu {
  display: block;
}

.lang-switch {
  display: flex;
  gap: 0.5rem;
}

.top-action-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: background 0.2s, border-color 0.2s;
}

.top-action-link:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.55);
}

.lang-btn {
  width: 1.65rem;
  height: 1.15rem;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.lang-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.lang-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light), 0 4px 14px rgba(37, 99, 235, 0.35);
}

.flag-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.profile-image-wrapper {
  flex-shrink: 0;
}

.profile-image {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 32%;
  border: 4px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.greeting {
  font-size: 1rem;
  opacity: 0.85;
  margin-bottom: 0.25rem;
}

.hero-text h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.role {
  font-size: 1.25rem;
  font-weight: 500;
  opacity: 0.95;
}

.location {
  margin-top: 0.75rem;
  opacity: 0.8;
  font-size: 0.95rem;
}

/* Main layout */
main {
  max-width: 800px;
  margin: -2rem auto 3rem;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text);
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent-light);
}

.card p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.card p:last-child {
  margin-bottom: 0;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.skill-group h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

/* Accordion – Werdegang */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.accordion-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}

.accordion-item.active {
  border-color: var(--accent);
  background: var(--surface);
}

.accordion-header {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.75rem 1rem;
  width: 100%;
  padding: 1rem 1.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  text-align: left;
}

.accordion-header:hover {
  background: rgba(37, 99, 235, 0.04);
}

.accordion-period {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.accordion-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.accordion-role {
  font-weight: 600;
  color: var(--text);
}

.accordion-project {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.accordion-company {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}

.accordion-arrow {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
}

.accordion-item.active .accordion-arrow {
  transform: rotate(90deg);
  color: var(--accent);
}

.accordion-panel {
  display: none;
  overflow: hidden;
}

.accordion-body {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.accordion-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.accordion-body h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

.accordion-body h4:first-of-type {
  margin-top: 0;
}

.accordion-body .tags {
  margin-top: 0.25rem;
}

/* Two column */
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.info-list {
  list-style: none;
}

.info-list li {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.info-list li strong {
  color: var(--text);
}

.languages li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.languages li:last-child {
  border-bottom: none;
}

.languages .level {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

/* Contact */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: var(--bg);
  transition: background 0.2s, color 0.2s;
}

.contact-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.contact-icon {
  font-size: 1.25rem;
}

/* Project cards */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.project-card.current {
  border-color: var(--accent);
  background: var(--accent-light);
}

.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.project-card-period {
  font-weight: 600;
  color: var(--accent);
}

.project-card-company {
  color: var(--text-muted);
}

.project-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.project-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
  flex-grow: 1;
}

.project-card-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.25rem;
}

.timeline-item h3 a,
.project-title-link {
  color: inherit;
  text-decoration: none;
}

.timeline-item h3 a:hover,
.project-title-link:hover {
  color: var(--accent);
}

/* Project detail pages */
.page-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
  padding: 2rem 1.5rem 3rem;
}

.page-header-inner {
  max-width: 800px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: #fff;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.page-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.95rem;
  opacity: 0.9;
}

.detail-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.detail-list {
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.detail-list li {
  margin-bottom: 0.5rem;
}

.detail-list li:last-child {
  margin-bottom: 0;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.pdf-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.pdf-download-btn::before {
  content: "↓";
  font-size: 1.1rem;
  font-weight: 700;
}

.pdf-download-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  color: #fff;
}

/* Blog page */
.blog-header {
  position: relative;
  padding-top: 3rem;
}

.blog-subtitle {
  font-size: 1rem;
  opacity: 0.9;
  margin: 0;
}

.blog-layout {
  max-width: 1100px;
  margin: -2rem auto 2rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.blog-tree {
  padding: 1.25rem;
  position: sticky;
  top: 1rem;
}

.blog-back {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.blog-back:hover {
  text-decoration: underline;
}

.blog-tree-root {
  list-style: none;
}

.blog-tree-root > li {
  margin-bottom: 0.35rem;
}

.blog-tree-heading {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, color 0.2s;
}

.blog-tree-heading::before {
  content: "›";
  margin-right: 0.45rem;
  font-size: 1rem;
  transition: transform 0.25s ease;
}

.blog-tree-group.open > .blog-tree-heading::before {
  transform: rotate(90deg);
}

.blog-tree-heading:hover {
  background: var(--bg);
  color: var(--text);
}

.blog-tree-items {
  display: none;
  list-style: none;
  margin: 0.25rem 0 0.5rem 0.75rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
}

.blog-tree-link {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.blog-tree-link:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.blog-tree-link.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

.blog-tree-empty {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.blog-content h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent-light);
}

.blog-content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.blog-content p:last-child {
  margin-bottom: 0;
}

.blog-content-hint {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--bg);
  border: 1px dashed var(--border);
  font-size: 0.9rem;
}

.blog-article-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.blog-article-lead {
  font-size: 1.05rem;
  color: var(--text) !important;
  font-weight: 500;
}

.blog-article h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 1.25rem 0 0.5rem;
}

.blog-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.blog-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.blog-list:empty {
  display: none;
}

.blog-list:not(:empty) + .blog-empty {
  display: none;
}

.blog-list-item {
  margin: 0;
}

.blog-list-link {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.blog-list-link:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.blog-list-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.blog-list-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.blog-list-teaser {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.blog-empty {
  text-align: center;
}

.blog-empty p {
  color: var(--text-muted);
  margin: 0;
}

/* Responsive */

@media (max-width: 800px) {
  .blog-layout {
    grid-template-columns: 1fr;
    margin-top: -1.5rem;
  }

  .blog-tree {
    position: static;
  }
}

@media (max-width: 600px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-text h1 {
    font-size: 2rem;
  }

  .profile-image {
    width: 140px;
    height: 140px;
  }

  .card {
    padding: 1.5rem;
  }

  .accordion-header {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 0.35rem 0.75rem;
  }

  .accordion-period {
    grid-column: 1;
    grid-row: 1;
  }

  .accordion-info {
    grid-column: 1;
    grid-row: 2;
  }

  .accordion-company {
    grid-column: 1;
    grid-row: 3;
    text-align: left;
  }

  .accordion-arrow {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: center;
  }
}
