@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=Chakra+Petch:wght@500;700&display=swap");

:root {
  --bg: #041421;
  --bg-soft: #0b2336;
  --card: #0e2d45;
  --ink: #e8f3ff;
  --muted: #9bb4c8;
  --accent: #29d8ba;
  --accent-2: #ffb347;
  --line: #1f4765;
  --shadow: 0 12px 24px rgb(0 0 0 / 25%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, rgb(41 216 186 / 0.15), transparent 30%),
    radial-gradient(circle at 80% 10%, rgb(255 179 71 / 0.2), transparent 26%),
    linear-gradient(180deg, #051928 0%, #071f30 45%, #041421 100%);
  line-height: 1.6;
}

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

a {
  color: var(--accent);
}

.hero {
  padding: 1.5rem 6vw 4rem;
  min-height: 72vh;
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.main-nav h1 {
  margin: 0;
  font-family: "Chakra Petch", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  color: var(--ink);
  opacity: 0.9;
}

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

.hero-content {
  margin-top: 3rem;
  max-width: 56rem;
}

.chip {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-2);
  font-size: 0.85rem;
}

.hero-content h2 {
  font-family: "Chakra Petch", sans-serif;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.1;
  margin: 0;
}

.hero-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  border-radius: 0.7rem;
  text-decoration: none;
  border: 1px solid transparent;
  font-weight: 700;
}

.btn-primary {
  background: var(--accent);
  color: #06242a;
}

.btn-outline {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

main {
  padding: 0 6vw 3.2rem;
}

.section {
  margin-bottom: 2.2rem;
  background: rgb(10 31 48 / 0.7);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.section-alt {
  background: rgb(7 26 40 / 0.88);
}

.section h3 {
  margin-top: 0;
  font-family: "Chakra Petch", sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 1rem;
}

.card h4 {
  margin-top: 0;
}

.hover-grid {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.hover-card {
  position: relative;
  background: linear-gradient(160deg, #11344d, #0c2840);
  border: 1px solid #2b5e80;
  border-radius: 0.75rem;
  padding: 0.9rem;
  min-height: 114px;
  cursor: default;
}

.hover-card h5 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.hover-card > p {
  margin: 0;
  color: #b8d2e6;
  font-size: 0.92rem;
}

.detail-trigger {
  margin-top: 0.65rem;
  padding: 0.4rem 0.7rem;
  border-radius: 0.45rem;
  border: 1px solid #2f7299;
  background: #103752;
  color: #d9efff;
  font-weight: 600;
  font-size: 0.82rem;
}

.detail-trigger:hover {
  background: #164565;
}

.hover-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hover-detail {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  width: min(280px, 90vw);
  transform: translate(-50%, 8px);
  background: #08263a;
  border: 1px solid #2b668d;
  border-radius: 0.7rem;
  padding: 0.8rem;
  box-shadow: 0 12px 24px rgb(0 0 0 / 35%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 5;
}

.hover-detail::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: #2b668d transparent transparent transparent;
}

.hover-detail h6 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: #d9edff;
}

.hover-detail p {
  margin: 0.2rem 0;
  color: #c4dced;
  font-size: 0.86rem;
}

.hover-card:hover .hover-detail,
.hover-card:focus-within .hover-detail,
.hover-card:focus .hover-detail {
  opacity: 1;
  transform: translate(-50%, 0);
}

.astro-dialog {
  width: min(640px, 92vw);
  border: none;
  padding: 0;
  background: transparent;
  color: var(--ink);
}

.astro-dialog::backdrop {
  background: rgb(2 10 16 / 72%);
  backdrop-filter: blur(2px);
}

.dialog-shell {
  background: linear-gradient(160deg, #0b2a40, #153a58);
  border: 1px solid #2f6b92;
  border-radius: 0.95rem;
  box-shadow: 0 20px 42px rgb(0 0 0 / 40%);
  padding: 1rem;
  animation: dialogIn 0.2s ease;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.dialog-close-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #3d7496;
  background: #103552;
  color: #e1f1ff;
  font-size: 1.4rem;
  line-height: 1;
}

.astro-dialog h4 {
  margin: 0.4rem 0 0.45rem;
}

.dialog-topics {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
}

.dialog-topics li {
  margin-bottom: 0.45rem;
  color: #d1e7f8;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.dialog-actions .btn-outline {
  background: #0f3652;
  border-color: #3b7da5;
  color: #e8f3ff;
}

.dialog-actions .btn-outline:hover {
  background: #17496b;
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

caption {
  text-align: left;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

th,
td {
  border: 1px solid var(--line);
  padding: 0.7rem;
  text-align: left;
}

thead th {
  background: #103653;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.85rem;
}

.ok {
  background: rgb(41 216 186 / 0.2);
  color: #65e8d1;
}

.run {
  background: rgb(255 179 71 / 0.22);
  color: #ffd08c;
}

.wait {
  background: rgb(130 161 188 / 0.2);
  color: #c2d5e5;
}

.media-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.2fr 1fr;
}

figure {
  margin: 0;
}

figure img {
  border-radius: 0.8rem;
  border: 1px solid var(--line);
}

figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.snippet {
  border: 1px solid var(--line);
  background: #0c3049;
  border-radius: 0.8rem;
  padding: 1rem;
}

.video-card {
  margin-top: 1rem;
  border: 1px solid var(--line);
  background: #0b2a40;
  border-radius: 0.8rem;
  padding: 1rem;
}

.video-card h4 {
  margin-top: 0;
}

.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 0.7rem;
  overflow: hidden;
  border: 1px solid var(--line);
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

pre {
  overflow: auto;
  background: #062336;
  border-radius: 0.6rem;
  border: 1px solid var(--line);
  padding: 0.8rem;
}

blockquote {
  margin: 1rem 0 0;
  padding-left: 1rem;
  border-left: 4px solid var(--accent);
  color: #cbe6fc;
  font-style: italic;
}

.register-form {
  display: grid;
  gap: 1rem;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 1rem;
}

legend {
  padding: 0 0.4rem;
  color: var(--accent-2);
}

label,
input,
select,
button,
textarea {
  font: inherit;
}

input,
select {
  width: 100%;
  margin: 0.3rem 0 0.9rem;
  border: 1px solid #25506f;
  border-radius: 0.45rem;
  background: #08253a;
  color: var(--ink);
  padding: 0.55rem 0.65rem;
}

input[type="radio"],
input[type="checkbox"] {
  width: auto;
  margin-right: 0.45rem;
}

input[type="range"] {
  padding: 0;
}

button {
  cursor: pointer;
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 1rem 6vw 2rem;
}

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

.muted {
  color: var(--muted);
}

.academy-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.4fr 1fr;
  margin-top: 1rem;
}

.academy-grid.two-columns {
  grid-template-columns: 1fr 1fr;
}

.panel {
  background: rgb(9 35 53 / 0.9);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 1rem;
}

.panel h4 {
  margin: 0 0 0.5rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.editor-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-ghost {
  border: 1px solid #2a607f;
  background: #11344e;
  color: #bde5ff;
}

.editor-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0.8rem 0;
}

.tab-btn {
  border: 1px solid #255b79;
  background: #0d2d44;
  color: #d7edff;
  border-radius: 0.5rem;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.tab-btn.active {
  background: #1e4e71;
  border-color: #3d8ec1;
}

.editor-stack {
  min-height: 300px;
}

.code-editor {
  width: 100%;
  min-height: 300px;
  border: 1px solid #285c7d;
  border-radius: 0.6rem;
  background: #041d2f;
  color: #e6f2ff;
  padding: 0.85rem;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.93rem;
  line-height: 1.45;
}

.hidden {
  display: none;
}

#preview {
  width: 100%;
  min-height: 330px;
  border: 1px solid #255b79;
  border-radius: 0.7rem;
  background: white;
}

.checklist {
  margin-top: 0.6rem;
  padding-left: 1.2rem;
}

.checklist li {
  margin-bottom: 0.5rem;
  color: #d9eaf8;
}

.checklist li.passed {
  color: #74f0cf;
}

.checklist li.passed::marker {
  content: "✓ ";
}

.quiz-form {
  display: grid;
  gap: 0.8rem;
}

.quiz-form fieldset {
  margin: 0;
}

.quiz-form label {
  display: block;
  margin-bottom: 0.45rem;
}

.progress-panel {
  margin-top: 1rem;
}

.beginner-panel {
  margin-top: 1rem;
}

.mission-steps {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.mission-steps li {
  border: 1px solid #2a5d7d;
  border-radius: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: #0b3048;
  color: #cce2f2;
}

.mission-steps li.done {
  border-color: #2f8f7c;
  background: #123f4a;
  color: #bdf7e8;
}

.mission-steps li.current {
  border-color: #4f8dc0;
  background: #163a58;
  color: #e7f3ff;
  box-shadow: inset 0 0 0 1px rgb(125 182 232 / 30%);
}

.mission-steps li.locked {
  opacity: 0.6;
}

.mission-hint {
  margin: 0.85rem 0 0;
  border: 1px dashed #4f7d9b;
  border-radius: 0.65rem;
  padding: 0.7rem 0.8rem;
  background: rgb(11 44 65 / 60%);
  color: #c8e3f7;
}

.mission-actions {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.progress-track {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: #082437;
  border: 1px solid #245371;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #29d8ba, #ffb347);
  transition: width 0.35s ease;
}

.score {
  margin: 0.55rem 0 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #dff1ff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 980px) {
  .academy-grid,
  .academy-grid.two-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .hover-detail {
    position: static;
    width: 100%;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    margin-top: 0.65rem;
  }

  .hover-detail::after {
    display: none;
  }
}
