/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #08090d;
  --surface: rgba(18, 20, 28, 0.86);
  --surface-strong: rgba(24, 26, 36, 0.96);
  --line: rgba(255, 255, 255, 0.1);
  --accent: #00e5ff;
  --accent-2: #6ee7b7;
  --accent-3: #ff8fb8;
  --text: #ffffff;
  --text-muted: #a5adbd;
  --font: 'Space Grotesk', system-ui, sans-serif;
  --section-pad: clamp(72px, 11vh, 130px) clamp(20px, 6vw, 120px);
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.25) var(--bg);
}

body {
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(circle at 20% 10%, rgba(0, 229, 255, 0.12), transparent 28%),
              radial-gradient(circle at 80% 22%, rgba(255, 143, 184, 0.08), transparent 24%),
              var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ── Nav ───────────────────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 18px clamp(20px, 5vw, 56px);
  background: rgba(8, 9, 13, 0.74);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.35s ease, background 0.25s ease;
}

#nav.hidden { transform: translateY(-100%); }

.nav-logo {
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 2vw, 24px);
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.lang-switcher {
  position: relative;
  justify-self: end;
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

.lang-current:hover {
  color: var(--accent);
  border-color: rgba(0, 229, 255, 0.35);
}

.lang-current svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.lang-chevron {
  width: 12px !important;
  height: 12px !important;
  transition: transform 0.25s ease;
}

.lang-switcher.open .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 130px;
  padding: 6px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.lang-switcher.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.lang-option span {
  opacity: 0.65;
  font-size: 0.72rem;
}

.lang-option:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.lang-option.active {
  color: var(--accent);
}

#nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  background: none;
  border: 0;
  cursor: pointer;
}

#nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ── Shared ────────────────────────────────────────────────── */
.view {
  min-height: calc(100vh - 80px);
}

section,
.route-page {
  padding: var(--section-pad);
}

.section-inner,
.route-shell {
  max-width: 1120px;
  margin: 0 auto;
}

.compact-inner {
  max-width: 980px;
}

.narrow-shell {
  max-width: 780px;
}

.section-kicker,
.eyebrow {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.section-title {
  max-width: 820px;
  font-size: clamp(2rem, 4.8vw, 4.5rem);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 18px;
}

.section-lead,
.hero-line,
.route-header p,
.detail-block p,
.story-step p,
.project-system p,
.training-board p,
.goal-card p,
.github-panel p,
.repo-card p {
  color: var(--text-muted);
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.72;
}

.primary-link,
.text-link,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 700;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.primary-link {
  padding: 12px 20px;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
}

.text-link {
  padding: 12px 2px;
  color: var(--accent-2);
}

.back-link {
  margin-bottom: 46px;
  padding: 8px 0;
  color: var(--text-muted);
}

.back-link::before {
  content: '←';
  margin-right: 10px;
  color: var(--accent);
}

.primary-link:hover,
.text-link:hover,
.back-link:hover {
  transform: translateY(-2px);
}

.disabled-link {
  opacity: 0.45;
  cursor: default;
}

.disabled-link:hover {
  transform: none;
}

/* ── Home ──────────────────────────────────────────────────── */
.hero-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 110px;
  padding-bottom: 70px;
}

.hero-copy {
  width: min(860px, 100%);
  margin: 0 auto;
  text-align: center;
}

.hero-name {
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0;
  margin-bottom: 28px;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent) 62%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-line {
  max-width: 680px;
  margin: 0 auto 34px;
}

.hero-actions,
.link-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

.home-brief {
  padding-top: 20px;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 42px;
}

.path-card {
  display: grid;
  grid-template-rows: 190px auto auto 1fr;
  min-height: 390px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: transform 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}

.path-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 229, 255, 0.45);
  background: var(--surface-strong);
}

.media-slot {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  min-height: 190px;
  color: rgba(255, 255, 255, 0.48);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 14px);
  border-bottom: 1px solid var(--line);
}

.media-slot svg {
  width: 54px;
  height: 54px;
}

.media-slot em {
  max-width: 170px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.35;
  text-align: center;
}

.path-card .media-slot {
  width: 100%;
  height: 190px;
}

.path-card > span,
.path-card > strong,
.path-card > small {
  margin-left: 20px;
  margin-right: 20px;
}

.path-card > span {
  margin-top: 20px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.path-card > strong {
  margin-top: 10px;
  font-size: 1.28rem;
  line-height: 1.25;
}

.path-card > small {
  margin-top: 12px;
  margin-bottom: 22px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ── Detail Routes ─────────────────────────────────────────── */
.route-page {
  min-height: 100vh;
  padding-top: clamp(112px, 16vh, 160px);
}

.route-header {
  margin-bottom: clamp(42px, 6vw, 70px);
}

.route-header h1 {
  max-width: 940px;
  font-size: clamp(2.25rem, 5.5vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: 0;
  margin-bottom: 24px;
}

.route-header > p,
.split-header div > p:last-child {
  max-width: 740px;
}

.split-header {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: end;
}

.route-media {
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: 8px;
  border-bottom: 1px solid var(--line);
}

.story-flow {
  display: grid;
  gap: 14px;
}

.story-step {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 24px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.story-step span,
.project-system span {
  color: var(--accent-2);
  font-weight: 700;
  font-size: 0.84rem;
}

.story-step h2,
.detail-block h2,
.project-system h2,
.training-board h2 {
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
  margin-bottom: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.detail-block,
.project-system section,
.training-board section {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-block.wide {
  grid-column: 1 / -1;
}

.clean-list {
  padding-left: 20px;
  color: var(--text-muted);
  line-height: 1.7;
}

.clean-list li {
  margin-bottom: 10px;
}

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

.pill-row span {
  padding: 7px 12px;
  color: var(--text);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 8px;
  font-size: 0.86rem;
}

.project-system {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 34px;
}

.project-system span {
  display: block;
  margin-bottom: 16px;
}

.training-board {
  display: grid;
  gap: 18px;
  margin-bottom: 34px;
}

.github-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 24px;
  align-items: start;
  margin-top: 44px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.github-panel h2 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  margin-bottom: 12px;
}

.github-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.github-stat {
  min-height: 92px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.github-stat strong {
  display: block;
  font-size: 1.7rem;
  margin-bottom: 6px;
}

.github-stat span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.repo-card {
  display: grid;
  gap: 10px;
  min-height: 190px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.repo-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 229, 255, 0.42);
}

.repo-card span {
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 700;
}

.repo-card strong {
  font-size: 1.15rem;
  line-height: 1.3;
}

.repo-card small {
  align-self: end;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.repo-card--placeholder:hover {
  transform: none;
  border-color: var(--line);
}

.goal-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.goal-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.goal-card span {
  display: block;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.goal-card h2 {
  font-size: clamp(1.18rem, 1.8vw, 1.5rem);
  margin-bottom: 10px;
}

.progress-line {
  height: 6px;
  margin-top: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.progress-line i {
  display: block;
  height: 100%;
  background: rgba(255, 255, 255, 0.42);
  border-radius: inherit;
}

.contact-links {
  display: grid;
  gap: 14px;
  margin-top: 34px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 18px 20px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.contact-link:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 229, 255, 0.45);
}

.contact-link svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}

footer {
  position: relative;
  z-index: 1;
  padding: 34px 20px;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.82rem;
  opacity: 0.65;
}

/* ── Reveal ────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Tablet ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --section-pad: clamp(64px, 9vh, 100px) clamp(20px, 5vw, 56px); }

  .path-grid,
  .project-system,
  .github-panel,
  .goal-board,
  .repo-grid {
    grid-template-columns: 1fr;
  }

  .path-card {
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    min-height: 220px;
  }

  .path-card .media-slot {
    grid-row: 1 / 4;
    height: 100%;
  }

  .split-header {
    grid-template-columns: 1fr;
  }

  .route-media {
    max-height: 360px;
    aspect-ratio: 16 / 9;
  }
}

/* ── Mobile Nav ────────────────────────────────────────────── */
@media (max-width: 820px) {
  #nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .nav-logo { margin-right: auto; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px 18px;
    background: rgba(8, 9, 13, 0.97);
    border-bottom: 1px solid var(--line);
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 12px 0;
    font-size: 1rem;
  }

  #nav-toggle { display: flex; }

  .hero-screen {
    min-height: auto;
    padding-top: 128px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Phone ─────────────────────────────────────────────────── */
@media (max-width: 560px) {
  :root { --section-pad: 56px 16px; }

  #nav { padding: 15px 16px; }

  .hero-name {
    font-size: clamp(3rem, 17vw, 4.7rem);
  }

  .section-title,
  .route-header h1 {
    font-size: clamp(2rem, 12vw, 3rem);
  }

  .hero-actions,
  .link-row {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-link,
  .text-link {
    width: 100%;
  }

  .path-card {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 170px auto auto 1fr;
    min-height: 360px;
  }

  .path-card .media-slot {
    grid-row: auto;
    height: 170px;
  }

  .story-step {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 22px 18px;
  }

  .detail-block,
  .project-system section,
  .training-board section,
  .goal-card,
  .github-panel,
  .repo-card {
    padding: 22px 18px;
  }

  .contact-link {
    align-items: flex-start;
    word-break: break-word;
  }
}

@media (hover: none) {
  .path-card:hover,
  .primary-link:hover,
  .text-link:hover,
  .back-link:hover,
  .contact-link:hover {
    transform: none;
  }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 229, 255, 0.45); }
