/* ── C64 retro font (local files under ./assets/) ── */
@font-face {
  font-family: "C64";
  src:
    url("./assets/C64.woff2") format("woff2"),
    url("./assets/C64.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #05070c;
  --text: #f8fafc;
  --muted: rgba(248, 250, 252, 0.78);
  --line: rgba(255, 255, 255, 0.12);
  --card: linear-gradient(180deg, rgba(12,18,32,0.62), rgba(8,12,22,0.52));
  --shadow: 0 24px 80px rgba(0,0,0,0.35);
  --accent: #6ee7ff;
  --accent2: #8b5cf6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: "C64", "C64 Pro Mono", "Commodore 64", monospace;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Background video ── */
.bg-video {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
}
.overlay {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 18% 18%, rgba(110,231,255,0.14), transparent 30%),
    radial-gradient(circle at 82% 25%, rgba(139,92,246,0.14), transparent 32%),
    linear-gradient(180deg, rgba(5,7,12,0.82), rgba(5,7,12,0.68) 45%, rgba(5,7,12,0.86));
}

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 10;
  padding: 14px 24px;
  background: rgba(5,7,12,0.55);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand img { display: block; height: 48px; width: auto; }

/* ── Menu (desktop) ── */
.menu {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 14px; margin: 0; padding: 0; list-style: none;
}

.menu-link {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 8px 14px;
  border: 1px solid transparent; border-radius: 999px;
  color: #fff; text-decoration: none;
  font-size: 15px; font-weight: 600; white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.menu-link:hover, .menu-link:focus-visible {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}
.menu-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Tree / dropdown (desktop) ── */
.tree { position: relative; }
.tree summary { list-style: none; user-select: none; }
.tree summary::-webkit-details-marker { display: none; }

.tree-toggle::after {
  content: "";
  width: 7px; height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.25s ease;
}
.tree[open] .tree-toggle::after {
  transform: rotate(225deg) translateY(0);
}

.tree-children {
  position: absolute;
  top: calc(100% + 10px); left: 50%; translate: -50% 0;
  min-width: 200px; margin: 0; padding: 8px; list-style: none;
  background: rgba(8,11,20,0.92);
  border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s, translate 0.2s, visibility 0.2s;
  pointer-events: none;
}
.tree[open] .tree-children {
  opacity: 1; visibility: visible;
  pointer-events: auto;
}
.tree-children li + li { margin-top: 4px; }
.tree-children a {
  display: block; padding: 10px 14px; border-radius: 12px;
  color: var(--muted); text-decoration: none;
  font-size: 14px; font-weight: 600;
  transition: background 0.18s, color 0.18s;
}
.tree-children a:hover, .tree-children a:focus-visible {
  background: rgba(255,255,255,0.08); color: #fff;
}

/* ── Main content ── */
.page {
  min-height: calc(100svh - 72px);
  display: grid; place-items: center;
  padding: 40px 16px 60px;
}
.card {
  width: min(720px, 100%);
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 30px;
  background: var(--card);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}
h1 {
  margin: 0;
  font-family: "C64", "C64 Pro Mono", "Commodore 64", monospace;
  font-size: clamp(28px, 6vw, 52px);
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--text);
}
.subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2.5vw, 21px);
  line-height: 1.45;
}

/* Photo – fixed square so the circle is never distorted */
.photo {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: cover;
  margin: 28px auto 0;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.16);
  box-shadow: 0 18px 48px rgba(0,0,0,0.35);
}

.role { margin: 26px 0 0; text-align: center; font-size: 18px; }
.education {
  margin-top: 18px; padding: 18px;
  border: 1px solid var(--line); border-radius: 20px;
  background: rgba(255,255,255,0.04);
}
.education p { margin: 0 0 10px; font-size: 16px; }
.education ul {
  margin: 0; padding-left: 18px;
  display: grid; gap: 8px;
  color: var(--muted); line-height: 1.5; font-size: 15px;
}
.read-more { margin: 26px 0 0; text-align: center; font-size: 18px; color: var(--muted); }
.read-more a { color: #fff; text-decoration: none; font-weight: 800; }
.read-more a:hover { text-decoration: underline; }

/* ── Mobile ── */
@media (max-width: 820px) {
  .site-header {
    padding: 10px 14px;
  }

  .nav {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .brand img { height: 34px; }

  /* Compact horizontal wrapping menu */
  .menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 5px;
    width: 100%;
  }

  .menu-link {
    min-height: 30px;
    width: auto;
    padding: 5px 10px;
    font-size: 13px;
    border-radius: 8px;
  }

  /* Tree flows inline – children appear as small pills beside parent */
  .tree {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
  }

  .tree-children {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    min-width: 0;
    width: auto;
    margin: 0 0 0 2px;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    opacity: 1; visibility: visible;
    pointer-events: auto;
    translate: none;
  }
  .tree-children li + li { margin-top: 0; }
  .tree-children a {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    white-space: nowrap;
  }

  .tree-toggle::after { display: none; }

  .page {
    min-height: calc(100svh - 100px);
    padding-top: 24px;
  }
  .photo { width: 120px; height: 120px; }
}

@media (max-width: 400px) {
  .brand img { height: 28px; }
  .menu-link {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 12px;
  }
  .tree-children a {
    padding: 3px 7px;
    font-size: 11px;
  }
  .photo { width: 100px; height: 100px; }
  .card { border-radius: 24px; }
  .page {
    min-height: calc(100svh - 90px);
    padding-top: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
