@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

html {
  font-family: 'Geist', Menlo, Monaco, Lucida Console, 'Courier New', Courier, monospace;
  background: #fff;
  letter-spacing: -0.025rem;
  color: #111;
}

body {
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

p {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  text-wrap: pretty;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

a {
  color: #777;
  text-decoration: none;
}

a:hover {
  color: #111;
}

.main-container {
  padding: 4rem 1rem;
  margin: auto;
  width: 100%;
  max-width: 700px;
  position: relative;
}

.language-picker {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.lang-link {
  color: #888;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.lang-link:hover {
  color: #111;
  background: #f0f0f0;
}

.lang-link.active {
  color: #111;
  font-weight: 700;
  text-decoration: underline;
}

.section {
  max-width: 700px;
  margin: 0 auto 48px;
}

.section-title {
  margin-bottom: 8px;
  font-weight: 700;
  line-height: 1.5;
  font-size: 1.5rem;
  color: #111;
}

/* Hero */
.hero-section {
  margin-bottom: 48px;
}

.hero-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hero-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 32px;
}

.hero-name {
  font-size: 2rem;
  font-weight: 700;
  color: #111;
}

.hero-label {
  color: #555;
  font-weight: 500;
  font-size: 1.1rem;
  text-wrap: balance;
}

.hero-location {
  color: #666;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  letter-spacing: -0.05rem;
}

.hero-location svg {
  color: #666;
}

.hero-print-footer {
  display: none;
  font-size: 0.75rem;
  color: #666;
}

.hero-social-footer {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.hero-social-footer a {
  color: #777;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #eee;
  padding: 4px;
  height: 32px;
  width: 32px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.hero-social-footer a:hover {
  background: #eee;
  border-color: #ddd;
  color: #111;
}

.hero-avatar-figure {
  margin: 0;
}

.hero-avatar-img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 128px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Experience & Education */
.experience-list, .education-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.experience-article, .education-article {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.experience-header, .education-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.experience-company a, .education-institution a {
  color: #111;
}

.experience-company a:hover, .education-institution a:hover {
  text-decoration: underline;
}

.experience-company, .education-institution {
  font-weight: 600;
  color: #111;
  font-size: 1.05rem;
}

.experience-position, .education-degree {
  font-weight: 400;
  color: #222;
  font-size: 0.95rem;
  margin-top: 2px;
}

.experience-time, .education-time {
  color: #666;
  font-size: 0.85rem;
  min-width: 102px;
  text-align: right;
}

.experience-highlights-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.highlight-badge {
  border-radius: 6px;
  background: #eee;
  color: #444;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
}

/* Ensure project header layout */
.project-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Align GitHub icon to the right of the title */
.project-github-link {
  margin-left: auto;
}

.project-article {
  border-radius: 8px;
  border: 1px solid #f2f2f2;
  gap: 16px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  height: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-article:hover {
  border-color: #e0e0e0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.project-header {
  flex: 1;
}

.project-title {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 1rem;
  font-weight: 600;
}

.project-title a {
  color: #111;
}

.project-title a:hover {
  text-decoration: underline;
}

.project-active-dot {
  color: rgb(0, 188, 47);
  animation: flicker 3s ease-in infinite;
  font-size: 1.2rem;
  line-height: 1;
}

/* Project GitHub (Codeberg) link as a button */
.project-github-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #777;
  background: #f5f5f5;
  border-radius: 4px;
  padding: 2px;
  transition: background 0.2s ease, color 0.2s ease;
}

.project-github-link:hover {
  color: #111;
  background: #e0e0e0;
}

.project-github-link svg {
  width: 1rem;
  height: 1rem;
}

.project-description {
  font-size: 0.75rem;
  line-height: 1.25rem;
  margin-bottom: 4px;
  color: #666;
}

.project-highlights-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.6rem;
}

.project-highlight-badge {
  border-radius: 6px;
  background: #eee;
  color: #444;
  font-size: 0.6rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
}

/* Skills */
.skills-list {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.skill-badge {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #1e293b;
  display: inline-flex;
  font-size: 0.85rem;
  font-weight: 500;
  gap: 8px;
  padding: 0.35rem 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-badge:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.06);
}

.skill-badge svg {
  display: inline-block;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Certificates */
.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-inline: -16px;
}

.certificate-article {
  border-radius: 8px;
  border: 1px solid #f2f2f2;
  gap: 8px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  height: 100%;
}

.certificate-name {
  margin: 0 0 4px 0;
  font-size: 0.95rem;
}

.certificate-name a {
  color: #111;
}

.certificate-name a:hover {
  text-decoration: underline;
}

.certificate-issuer {
  color: #333;
  font-size: 0.85rem;
  margin: 0;
}

.certificate-date {
  color: #666;
  font-size: 0.8rem;
  display: block;
  margin-top: 4px;
}

/* Languages */
.languages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-inline: -16px;
}

.language-article {
  border-radius: 8px;
  border: 1px solid #f2f2f2;
  gap: 10px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  height: 100%;
}

.language-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.language-name {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.language-fluency-label {
  color: #666;
  font-size: 0.8rem;
}

.language-bar {
  width: 100%;
  height: 10px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #e6e6e6;
}

.language-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #66bb6a);
  border-radius: 999px 0 0 999px;
  transition: width 0.4s ease;
}

/* Interests */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-inline: -16px;
}

.interest-article {
  border-radius: 12px;
  border: 1px solid #f2f2f2;
  gap: 12px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  min-height: 100px;
  background: #fff;
}

.interest-name {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
}

.interest-keywords-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.interest-keyword-badge {
  border-radius: 6px;
  background: #eee;
  color: #444;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
}

/* Keyboard Footer & Dialog */
.keyboard-footer {
  background: #fdfdfd;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  text-align: center;
  padding-block: 8px;
  font-size: 0.85rem;
  border-top: 1px solid #eee;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.05);
}

kbd {
  background: #eee;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-family: inherit;
  border: 1px solid #ddd;
}

.keyboard-trigger-btn {
  position: fixed;
  bottom: 15px;
  right: 15px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid #eee;
  box-shadow: 0 1px 1px #f2f2f2;
  display: none;
  align-items: center;
  justify-content: center;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 100;
}

.keyboard-trigger-btn:hover {
  transform: scale(1.05);
  border-color: #ddd;
}

.command-dialog {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 0;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.15);
  background: #fff;
}

.command-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

.command-dialog-inner {
  display: flex;
  flex-direction: column;
}

.command-input {
  width: 100%;
  padding: 16px;
  font-size: 1rem;
  border: none;
  border-bottom: 1px solid #eee;
  outline: none;
  font-family: inherit;
}

.command-results-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px 0;
}

.command-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.command-item:hover, .command-item.selected {
  background: #f5f5f5;
}

.command-item-title {
  font-weight: 500;
  color: #111;
}

.command-item-section {
  font-size: 0.75rem;
  color: #888;
  background: #eee;
  padding: 2px 6px;
  border-radius: 4px;
}

@keyframes flicker {
  0% { opacity: 1; }
  50% { opacity: 0.25; }
  100% { opacity: 1; }
}

@media (max-width: 700px) {
  .main-container {
    padding: 2rem 1.25rem;
  }

  .hero-container {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero-info {
    padding-right: 0;
    align-items: center;
  }

  .hero-social-footer {
    justify-content: center;
  }

  .projects-grid, .certificates-grid, .languages-grid, .interests-grid {
    margin-inline: 0;
  }

  .experience-header, .education-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .experience-time, .education-time {
    text-align: left;
    margin-top: 2px;
  }

  .keyboard-footer {
    display: none;
  }

  .keyboard-trigger-btn {
    display: flex;
  }
}

@media print {
  .no-print {
    display: none !important;
  }

  .print {
    display: block !important;
  }

  .hero-print-footer {
    display: block !important;
  }

  body {
    font-size: 11pt;
  }

  .main-container {
    padding: 0;
    max-width: 100%;
  }

  .section {
    margin-bottom: 24px;
    page-break-inside: avoid;
  }

  .project-article, .certificate-article, .language-article, .interest-article {
    border: 1px solid #ddd;
  }

  .language-fill {
    transition: none;
  }

  a {
    text-decoration: none;
    color: #000;
  }

  .project-active-dot {
    animation: none;
  }
}
