/* ── Navbar ────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s, border-color 0.2s;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 32px;
  max-width: 1120px;
  margin: 0 auto;
}

.nav-brand {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.nav-brand .prompt { color: var(--accent); margin-right: 2px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  font-size: 12px;
  color: var(--muted);
}

.nav-links a {
  padding: 4px 0;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--text); }

.nav-links a.active {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Theme toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.theme-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Mobile nav */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
}

@media (max-width: 640px) {
  .nav-inner { padding: 0 16px; height: 48px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    gap: 12px;
    z-index: 99;
  }
}

/* ── Section label ─────────────────────────────────────── */

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 16px;
}

.section-label::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.section-label .label-id {
  margin-left: auto;
  color: var(--faint);
  letter-spacing: 0.08em;
}

/* ── Cards ─────────────────────────────────────────────── */

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

.card-flat {
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 20px;
}

/* ── Buttons ───────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: 12px;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-2);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn.primary:hover {
  filter: brightness(1.1);
}

/* ── Pill / status badge ───────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 10px;
  color: var(--muted);
}

.pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3FB950;
  box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.18);
}

/* ── Tags ──────────────────────────────────────────────── */

.tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── Terminal ──────────────────────────────────────────── */

.terminal {
  background: #0D1117;
  border: 1px solid #30363D;
  border-radius: 10px;
  overflow: hidden;
  color: #E6EDF3;
  font-family: 'JetBrains Mono', monospace;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #161B22;
  border-bottom: 1px solid #30363D;
}

.terminal-dots { display: flex; gap: 6px; }

.terminal-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red   { background: #FF5F57; }
.dot-yellow{ background: #FEBC2E; }
.dot-green { background: #28C840; }

.terminal-title {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: #8B949E;
}

.terminal-body {
  padding: 22px 20px;
  font-size: 13px;
  line-height: 1.7;
  min-height: 100px;
}

.term-prompt { color: var(--accent); margin-right: 8px; }
.term-cmd    { color: #E6EDF3; }
.term-pkg    { color: var(--accent); }
.term-comment{ color: #8B949E; }

.term-cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--accent);
  vertical-align: -3px;
  margin-left: 1px;
  animation: blink 1s steps(2) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ── KPI cards ─────────────────────────────────────────── */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
}

.kpi-num {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.kpi-num .unit { font-size: 14px; color: var(--muted); }

.kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 6px;
}

.kpi-spark {
  display: block;
  margin-top: 10px;
  width: 100%;
  height: 24px;
}

/* ── Project grid ──────────────────────────────────────── */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

@media (max-width: 900px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .projects-grid { grid-template-columns: 1fr; }
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.project-thumb {
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  overflow: hidden;
}

.project-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

.project-footer .detail-link { color: var(--accent); }

/* ── Modal ─────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px;
  overflow-y: auto;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  width: 100%;
  max-width: 880px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  transform: translateY(16px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 24px;
  letter-spacing: -0.02em;
}

.modal-subtitle {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.modal-hero {
  aspect-ratio: 16 / 7;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 24px;
  overflow: hidden;
}

.modal-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
}

@media (max-width: 640px) {
  .modal-body { grid-template-columns: 1fr; }
}

.modal-content-section {
  margin-bottom: 20px;
}

.modal-content-section h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 8px;
}

.modal-content-section p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}

.modal-aside {
  border-left: 1px solid var(--border);
  padding-left: 24px;
}

.modal-aside h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 10px;
}

.modal-aside ul {
  list-style: none;
  padding-left: 12px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
}

.modal-aside ul li::before {
  content: "→ ";
  color: var(--accent);
}

/* ── Filter chips ──────────────────────────────────────── */

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip:hover { border-color: var(--border-strong); color: var(--text); }

.filter-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ── Timeline ──────────────────────────────────────────── */

.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  position: relative;
}

/* Horizontal dashed line connecting the dots */
.timeline::before {
  content: "";
  position: absolute;
  top: 4px; /* vertically centered on the 10px dot */
  left: calc(100% / 8);
  right: calc(100% / 8);
  border-top: 1px dashed var(--border-strong);
  z-index: 0;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.timeline-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-content {
  padding-top: 14px;
  text-align: center;
}

.timeline-range {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.timeline-label {
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: -0.01em;
}

.timeline-tag {
  font-size: 10px;
  color: var(--faint);
  margin-top: 4px;
}

@media (max-width: 560px) {
  .timeline {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .timeline::before { display: none; }
  .timeline-step { align-items: flex-start; flex-direction: row; gap: 14px; }
  .timeline-content { padding-top: 0; text-align: left; }
}

/* ── TOML skills widget ────────────────────────────────── */

.toml-file {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.toml-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-2);
}

.toml-body {
  padding: 20px 24px;
  font-size: 13px;
  line-height: 2;
}

.toml-section { color: var(--muted); }
.toml-key     { color: var(--accent); }
.toml-val     { color: var(--text); }
.toml-eq      { color: var(--faint); }

/* ── Link row ──────────────────────────────────────────── */

.link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px;
  transition: border-color 0.15s;
}

.link-row:hover { border-color: var(--accent); }

.link-row a {
  display: contents;
  color: inherit;
}

.link-row .arrow { margin-left: auto; color: var(--muted); }

/* ── Footer ────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 32px;
  font-size: 11px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer a:hover { color: var(--accent); }

/* ── 404 page ──────────────────────────────────────────── */

.page-404 {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.error-num {
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  margin-bottom: 24px;
}

/* ── Select ────────────────────────────────────────────── */

select {
  color-scheme: dark light;
}

select:hover { border-color: var(--border-strong) !important; }
select:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent) !important; }

/* ── CV display ────────────────────────────────────────── */

.cv-iframe-wrapper {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.cv-iframe-wrapper iframe {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.414;
  border: none;
}

@media (max-width: 768px) {
  .cv-iframe-wrapper iframe {
    aspect-ratio: 9 / 16;
  }
}

@media (max-width: 480px) {
  .cv-iframe-wrapper iframe {
    aspect-ratio: 1 / 1.2;
  }
}

/* ── Language switcher ─────────────────────────────────── */

.lang-switcher {
  display: flex;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  background: transparent;
}

.lang-btn {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ── Scrollbar ─────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }