@font-face {
  font-family: "Fira Code";
  src: url("FiraCode-VariableFont_wght.ttf") format("truetype");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Symbols Nerd Font Mono";
  src: url("SymbolsNerdFontMono-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #080b14;
  --bg-2: #0f1525;
  --panel: #11192b;
  --panel-alt: #0c121f;
  --text: #e8eefc;
  --muted: #9cabc2;
  --accent: #3dd8c0;
  --accent-2: #4c7df5;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --border: 1px solid rgba(255, 255, 255, 0.06);
}

body.terminal-mode {
  --bg: #050b06;
  --bg-2: #0b140d;
  --panel: #0a130d;
  --panel-alt: #081109;
  --text: #c9f5d4;
  --muted: #7db18b;
  --accent: #3de07d;
  --accent-2: #77f59f;
  --border: 1px solid rgba(95, 225, 132, 0.2);
}

body.terminal-mode .glow {
  background: radial-gradient(circle, rgba(61, 224, 125, 0.16), transparent 55%);
}

body.terminal-mode .status {
  border-color: rgba(95, 225, 132, 0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Fira Code", "Fira Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: radial-gradient(circle at 20% 20%, #12203a, transparent 30%),
              radial-gradient(circle at 80% 10%, #1a2c57, transparent 25%),
              linear-gradient(135deg, var(--bg), var(--bg-2));
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

#bg-code-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 6;
  opacity: 0.8;
}

.bg-code-token {
  position: absolute;
  color: rgba(185, 205, 236, 0.42);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px rgba(156, 171, 194, 0.12);
  mix-blend-mode: screen;
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(0.96);
  animation: bg-code-float var(--float-duration, 7s) ease-out forwards;
}

@keyframes bg-code-float {
  0% {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(0.95);
  }
  20% {
    opacity: 0.45;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift-x, 0px), calc(var(--drift-y, -40px)), 0) scale(1.03);
  }
}

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

.hero {
  position: relative;
  padding: 32px min(8vw, 120px) 80px;
  overflow: hidden;
  z-index: 1;
}

.hero__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.hero__actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 18px;
  font-weight: 500;
}

.hero__content {
  margin-top: 80px;
  max-width: none;
  position: relative;
  z-index: 2;
}

.eyebrow {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.15;
  max-width: 900px;
}

h2, h3 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 32px);
}

.lede, .panel__lede, p.lede {
  color: var(--muted);
  margin: 0 0 24px;
  max-width: 760px;
}

.hero__lede-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.hero__lede-row .lede {
  margin-bottom: 24px;
  width: min(760px, 100%);
  max-width: 760px;
}

.terminal-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
  flex: 0 0 auto;
  margin-left: auto;
  color: #c6f7d8;
  border-color: rgba(95, 225, 132, 0.45);
  background: rgba(95, 225, 132, 0.1);
}

.terminal-glyph {
  display: inline-block;
  font-family: "Symbols Nerd Font Mono", monospace;
  font-size: 18px;
  line-height: 1;
  vertical-align: middle;
  filter: drop-shadow(0 0 6px rgba(95, 225, 132, 0.35));
}

.phone-glyph {
  display: inline-block;
  font-family: "Symbols Nerd Font Mono", monospace;
  font-size: 18px;
  line-height: 1;
  vertical-align: middle;
}

.mail-glyph {
  display: inline-block;
  font-family: "Symbols Nerd Font Mono", monospace;
  font-size: 18px;
  line-height: 1;
  vertical-align: middle;
}

.terminal-toggle:hover,
.terminal-toggle:focus-visible {
  color: #e6fff0;
  border-color: rgba(95, 225, 132, 0.72);
  background: rgba(95, 225, 132, 0.18);
}

.terminal-toggle:not(.is-active):not(:hover):not(:focus-visible) {
  animation: terminal-idle-pulse 4s ease-in-out infinite;
}

@keyframes terminal-idle-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(95, 225, 132, 0);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(95, 225, 132, 0.2), 0 0 8px rgba(95, 225, 132, 0.16);
  }
}

.terminal-toggle.is-active {
  color: #d7fff7;
  border-color: rgba(61, 216, 192, 0.7);
  background: rgba(61, 216, 192, 0.18);
  box-shadow: 0 0 0 1px rgba(61, 216, 192, 0.35), 0 0 14px rgba(61, 216, 192, 0.45);
}

.terminal-toggle::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  padding: 6px 8px;
  border-radius: 8px;
  border: var(--border);
  background: rgba(8, 11, 20, 0.92);
  color: var(--text);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.03em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.terminal-toggle:hover::after,
.terminal-toggle:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.typewriter::after {
  content: "_";
  margin-left: 2px;
  color: var(--accent);
  animation: typing-cursor-blink 1s steps(1, end) infinite;
}

@keyframes typing-cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  border: var(--border);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041025;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.print-btn {
  padding: 10px 12px;
  border-radius: 12px;
}

.print-btn svg { display: block; }

.glow {
  position: absolute;
  inset: -20% auto auto 20%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(77, 127, 245, 0.15), transparent 55%);
  filter: blur(40px);
  z-index: 1;
  pointer-events: none;
}

.page {
  padding: 0 min(8vw, 120px) 80px;
  display: grid;
  gap: 28px;
  position: relative;
  z-index: 1;
}

.panel {
  background: var(--panel);
  border-radius: 18px;
  padding: 28px;
  border: var(--border);
  box-shadow: var(--shadow);
}

.panel--alt { background: var(--panel-alt); }

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.panel__lede { margin-top: 6px; }

.status {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.65s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.status:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.status.is-flipped {
  transform: rotateY(180deg);
}

.status__text {
  display: inline-block;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.status.is-flipped .status__text {
  transform: rotateY(180deg);
}

.status--checking {
  color: #ffe8b2;
  background: rgba(242, 193, 79, 0.14);
  border-color: rgba(242, 193, 79, 0.45);
}

.status--checking::before {
  background: #f2c14f;
  box-shadow: 0 0 10px rgba(242, 193, 79, 0.85);
}

.status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f2c14f;
  box-shadow: 0 0 8px rgba(242, 193, 79, 0.75);
  animation: led-pulse 1.2s ease-in-out infinite;
}

.mode-switch {
  display: inline-flex;
  gap: 6px;
}

.mode-switch button {
  background: rgba(255, 255, 255, 0.06);
  color: #f5f7fb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-switch button:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
}

.mode-switch button.is-active {
  background: #f2c14f;
  color: #0b1324;
  border-color: rgba(0, 0, 0, 0.35);
}

.status--ok {
  color: #b8f9de;
  background: rgba(107, 224, 181, 0.14);
  border-color: rgba(107, 224, 181, 0.45);
}

.status--ok::before {
  background: #43e08b;
  box-shadow: 0 0 10px rgba(67, 224, 139, 0.85);
}

.status--warn {
  color: #ffe8b2;
  background: rgba(242, 193, 79, 0.14);
  border-color: rgba(242, 193, 79, 0.45);
}

.status--warn::before {
  background: #f2c14f;
  box-shadow: 0 0 10px rgba(242, 193, 79, 0.85);
}

.status--error {
  color: #ffc2c2;
  background: rgba(242, 107, 107, 0.14);
  border-color: rgba(242, 107, 107, 0.45);
}

.status--error::before {
  background: #ff5c5c;
  box-shadow: 0 0 10px rgba(255, 92, 92, 0.85);
}

.mindmap-controls {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.mindmap-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mindmap-label {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.mindmap-btn {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  box-shadow: none;
  min-height: 30px;
}

.filter-chip {
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.filter-chip:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.filter-chip.is-selected {
  background: rgba(61, 216, 192, 0.22);
  border-color: rgba(61, 216, 192, 0.6);
  color: #d7fff7;
}

.mindmap-btn.is-active {
  background: rgba(61, 216, 192, 0.22);
  border-color: rgba(61, 216, 192, 0.6);
  color: #d7fff7;
}

@keyframes led-pulse {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

.mermaid-shell {
  background: #0b111d;
  border-radius: 14px;
  border: var(--border);
  padding: 18px;
  height: 640px;
  overflow: auto;
}

#skills-mermaid {
  min-height: 600px;
  height: 100%;
}

#skills-mermaid svg {
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

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

.card {
  background: #0d1524;
  border-radius: 14px;
  padding: 16px;
  border: var(--border);
  display: grid;
  gap: 8px;
}

.card h4 { margin: 0; font-size: 16px; }

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

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: var(--border);
  font-size: 13px;
  color: var(--muted);
}

.timeline {
  position: relative;
  display: grid;
  gap: 18px;
  padding-left: 18px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, rgba(77, 127, 245, 0.6), rgba(61, 216, 192, 0.35));
}

.timeline__item {
  position: relative;
  padding-left: 18px;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 0 6px rgba(76, 125, 245, 0.18);
}

.timeline__card {
  background: #0d1524;
  border-radius: 14px;
  padding: 14px 16px 16px;
  border: var(--border);
  box-shadow: var(--shadow);
}

.timeline__date {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.timeline__title {
  margin: 6px 0 4px;
  font-size: 18px;
}

.timeline__meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.timeline__summary {
  margin: 0 0 10px;
  color: var(--text);
}

.footer {
  padding: 26px min(8vw, 120px) 40px;
  border-top: var(--border);
  background: #080b14;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.footer__content {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__links {
  display: flex;
  gap: 14px;
  align-items: center;
}

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

.prose {
  display: grid;
  gap: 12px;
  color: var(--text);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  margin: 18px 0 6px;
  line-height: 1.2;
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose ul { padding-left: 18px; margin: 0 0 12px; }
.prose a { color: var(--accent); }
.prose a:hover { color: var(--accent-2); }

@media (max-width: 640px) {
  .hero { padding: 24px 20px 64px; }
  .page { padding: 0 20px 64px; }
  .panel { padding: 22px; }
  .hero__content { margin-top: 60px; }
  .nav { gap: 12px; }
  .hero__lede-row {
    align-items: center;
  }
}
