:root {
  --navy-950: #020a17;
  --navy-900: #06152b;
  --navy-850: #0a1e39;
  --navy-800: #0c2a50;
  --blue: #16a9f5;
  --blue-2: #58d4ff;
  --cyan: #5ce4e8;
  --green: #83e39f;
  --lime: #a7ed55;
  --gold: #f2c24d;
  --red: #e55f6d;
  --paper: #f5f8fc;
  --ink: #e6f3ff;
  --muted: #91acc3;
  --line: rgba(102, 180, 226, .2);
  --panel: rgba(7, 26, 51, .91);
  --shadow: 0 26px 70px rgba(0, 7, 19, .42);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--navy-950); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 5%, rgba(0, 139, 255, .17), transparent 29rem),
    radial-gradient(circle at 87% 72%, rgba(0, 217, 231, .08), transparent 34rem),
    linear-gradient(145deg, #06162d, #020a17 62%, #06162d);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(65, 154, 211, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(65, 154, 211, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000, transparent 96%);
}
button, input, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
a { color: inherit; }
code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 999; left: 16px; top: -70px; padding: 9px 13px; color: #06152b; border-radius: 8px; background: #fff; font-weight: 800; }
.skip-link:focus { top: 16px; }

/* Welcome */
.welcome-screen { min-height: 100vh; }
.top-nav, .lab-header {
  width: min(1420px, calc(100% - 48px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.top-nav { min-height: 84px; border-bottom: 1px solid rgba(111, 189, 233, .14); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; border-radius: 12px; background: linear-gradient(145deg, #14b4f8, #0767c9); box-shadow: 0 10px 26px rgba(5, 142, 232, .27), inset 0 1px rgba(255,255,255,.35); font: 900 15px/1 ui-monospace, monospace; }
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { color: #fff; font-size: 19px; letter-spacing: 1px; }
.brand-copy small { margin-top: 5px; color: var(--blue-2); font-size: 9px; font-weight: 850; letter-spacing: 1.8px; text-transform: uppercase; }
.brand.compact .brand-mark { width: 39px; height: 39px; }
.brand.compact .brand-copy strong { font-size: 15px; }
.nav-actions { display: flex; align-items: center; gap: 18px; }
.nav-link { color: #9db6cc; text-decoration: none; font-size: 12px; font-weight: 750; }
.nav-link:hover { color: #fff; }
.nav-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; color: #a8c0d2; border: 1px solid var(--line); border-radius: 999px; background: rgba(6, 25, 50, .58); font-size: 10px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.nav-dot, .env-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px rgba(167, 237, 85, .7); }
.hero-shell { width: min(1210px, calc(100% - 48px)); min-height: calc(100vh - 124px); margin: 0 auto; padding: clamp(58px, 8vh, 105px) 0 68px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .67fr); align-items: center; gap: clamp(50px, 8vw, 115px); }
.eyebrow, .section-kicker { color: var(--blue-2); font-size: 10px; font-weight: 900; letter-spacing: 1.8px; text-transform: uppercase; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; }
.eyebrow > span { width: 31px; height: 1px; background: var(--blue-2); }
.hero-copy h1 { margin: 18px 0 25px; color: #f6fbff; font-size: clamp(51px, 6.1vw, 84px); line-height: .98; letter-spacing: -.055em; }
.hero-copy h1 em { color: var(--blue); font-style: normal; }
.hero-lead { max-width: 690px; margin: 0; color: #a1b9ce; font-size: 16px; line-height: 1.78; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 38px; }
.feature { min-width: 0; display: flex; gap: 11px; align-items: flex-start; padding: 13px; border: 1px solid rgba(91, 170, 216, .16); border-radius: 12px; background: rgba(5, 25, 49, .42); }
.feature-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; color: var(--cyan); border: 1px solid rgba(88, 212, 255, .28); border-radius: 8px; background: rgba(52, 178, 236, .08); font-weight: 900; }
.feature strong, .feature small { display: block; }
.feature strong { color: #eaf6ff; font-size: 11px; }
.feature small { margin-top: 3px; color: #688aa5; font-size: 9px; line-height: 1.4; }
.hero-stats { display: flex; align-items: center; gap: 0; margin-top: 32px; }
.hero-stats div { min-width: 105px; padding: 0 22px; border-left: 1px solid rgba(103, 177, 218, .2); }
.hero-stats div:first-child { padding-left: 0; border-left: 0; }
.hero-stats strong, .hero-stats span { display: block; }
.hero-stats strong { color: #fff; font: 800 28px/1 ui-monospace, monospace; }
.hero-stats span { margin-top: 6px; color: #6788a3; font-size: 9px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase; }
.entry-card { position: relative; overflow: hidden; padding-bottom: 28px; border: 1px solid rgba(77, 174, 230, .28); border-radius: 21px; background: linear-gradient(155deg, rgba(13, 45, 81, .96), rgba(4, 20, 42, .98)); box-shadow: var(--shadow); }
.entry-card::after { content: ""; position: absolute; right: -80px; bottom: -100px; width: 220px; height: 220px; border-radius: 50%; background: rgba(0, 166, 255, .11); filter: blur(8px); }
.entry-card > * { position: relative; z-index: 1; margin-left: 31px; margin-right: 31px; }
.entry-card-top { min-height: 76px; margin: 0 0 27px; padding: 13px 26px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid rgba(88, 176, 225, .14); background: rgba(4, 22, 43, .35); }
.entry-card-top small { display: block; color: #6689a4; font-size: 8px; font-weight: 850; letter-spacing: 1.3px; }
.entry-card-top h2 { margin: 4px 0 0; font-size: 19px; }
.terminal-icon { width: 41px; height: 41px; display: grid; place-items: center; color: var(--cyan); border: 1px solid rgba(76, 205, 239, .3); border-radius: 11px; background: rgba(7, 53, 83, .7); font: 900 14px ui-monospace, monospace; }
.entry-card > p:not(.entry-error):not(.entry-note) { color: #8da9c1; font-size: 12px; line-height: 1.65; }
.entry-card label { display: block; margin-top: 23px; margin-bottom: 8px; color: #a7bed0; font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.entry-card input { width: calc(100% - 62px); min-height: 49px; padding: 0 14px; color: #fff; border: 1px solid rgba(91, 164, 207, .25); border-radius: 10px; outline: 0; background: rgba(2, 14, 31, .56); }
.entry-card input::placeholder { color: #56758e; }
.entry-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22, 169, 245, .1); }
.entry-error { min-height: 19px; margin-top: 6px; margin-bottom: 3px; color: #ff9595; font-size: 11px; font-weight: 700; }
.entry-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 16px; margin-bottom: 0; color: #6687a1; font-size: 9px; }
.entry-note span { color: var(--lime); font-size: 7px; }
.welcome-footer { padding: 0 24px 24px; color: #4e708c; text-align: center; font-size: 10px; }

/* Buttons */
.btn { min-height: 45px; padding: 10px 17px; border: 0; border-radius: 10px; cursor: pointer; font-size: 12px; font-weight: 850; transition: transform .18s ease, filter .18s ease, border-color .18s ease; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:focus-visible, .header-btn:focus-visible, .hint-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn-primary { color: #031526; background: linear-gradient(135deg, #5ae0ff, #17a5f0); box-shadow: 0 12px 26px rgba(8, 157, 235, .22); }
.btn-secondary { color: #9fc0d7; border: 1px solid rgba(88, 174, 224, .27); background: #102d4d; }
.btn-danger { color: #fff; background: #c94556; }
.btn-wide { width: calc(100% - 62px); display: flex; align-items: center; justify-content: space-between; }

/* Lab chrome */
.lab-screen { min-height: 100vh; }
.lab-header { position: sticky; top: 0; z-index: 20; width: 100%; min-height: 72px; padding-inline: max(24px, calc((100% - 1500px) / 2)); background: rgba(3, 14, 29, .94); border-bottom: 1px solid rgba(95, 177, 222, .17); backdrop-filter: blur(15px); }
.lab-header-left, .lab-header-right { display: flex; align-items: center; gap: 17px; }
.header-divider { width: 1px; height: 34px; background: rgba(112, 183, 222, .19); }
.lab-title-small { display: grid; line-height: 1.2; }
.lab-title-small small { color: #62829b; font-size: 8px; font-weight: 850; letter-spacing: 1.2px; }
.lab-title-small strong { margin-top: 4px; color: #e1eff8; font-size: 12px; }
.progress-wrap { width: 180px; }
.progress-wrap > span { display: block; margin-bottom: 5px; color: #7898b0; text-align: right; font-size: 8px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(105, 159, 190, .17); }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--lime)); box-shadow: 0 0 12px rgba(41, 195, 255, .35); transition: width .4s ease; }
.score-chip { min-width: 88px; display: flex; align-items: baseline; justify-content: center; gap: 3px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(10, 36, 68, .75); }
.score-chip small { margin-right: 4px; color: #6687a0; font-size: 7px; font-weight: 850; letter-spacing: .8px; }
.score-chip strong { color: var(--lime); font: 850 20px/1 ui-monospace, monospace; }
.score-chip span { color: #63849d; font-size: 10px; }
.header-btn { width: 35px; height: 35px; display: grid; place-items: center; padding: 0; color: #9ab6cb; border: 1px solid var(--line); border-radius: 9px; background: rgba(10, 38, 70, .64); cursor: pointer; font-weight: 900; }
.header-btn:hover { color: #fff; border-color: rgba(89, 205, 255, .55); }
.lab-layout { width: min(1500px, calc(100% - 36px)); margin: 26px auto 54px; display: grid; grid-template-columns: 390px minmax(0, 1fr); overflow: hidden; border: 1px solid rgba(81, 164, 211, .2); border-radius: 20px; background: rgba(4, 19, 39, .75); box-shadow: var(--shadow); }

/* Task panel */
.task-panel { padding: 28px 24px; border-right: 1px solid rgba(81, 164, 211, .18); background: linear-gradient(180deg, rgba(11, 41, 75, .97), rgba(5, 25, 49, .95)); }
.task-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.task-panel h2 { margin: 7px 0 0; font-size: 22px; letter-spacing: -.025em; }
.mission-status { flex: 0 0 auto; padding: 6px 8px; color: var(--lime); border: 1px solid rgba(167, 237, 85, .25); border-radius: 6px; background: rgba(167, 237, 85, .06); font-size: 8px; font-weight: 900; letter-spacing: .8px; text-transform: uppercase; }
.task-intro { margin: 20px 0; color: #86a3ba; font-size: 11px; line-height: 1.65; }
.tasks { display: grid; gap: 10px; }
.task-card { position: relative; display: grid; grid-template-columns: 29px minmax(0, 1fr) 22px; gap: 10px; align-items: start; padding: 13px 11px; border: 1px solid rgba(83, 157, 199, .16); border-radius: 11px; background: rgba(2, 16, 34, .34); transition: border-color .2s ease, background .2s ease; }
.task-card.active { border-color: rgba(52, 187, 247, .42); background: rgba(11, 73, 110, .18); }
.task-card.complete { border-color: rgba(131, 227, 159, .3); background: rgba(50, 128, 72, .09); }
.task-number, .task-check { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid rgba(115, 176, 210, .28); border-radius: 50%; color: #7697af; font-size: 10px; font-weight: 850; }
.task-check { visibility: hidden; color: #072214; border-color: var(--green); background: var(--green); }
.task-card.complete .task-number { display: none; }
.task-card.complete .task-check { grid-column: 1; grid-row: 1; visibility: visible; }
.task-card.complete .task-body { grid-column: 2; }
.task-body { min-width: 0; }
.task-row { display: flex; justify-content: space-between; gap: 8px; }
.task-row h3 { margin: 2px 0 4px; color: #d8e9f5; font-size: 11px; }
.task-points { color: var(--gold); white-space: nowrap; font: 750 8px ui-monospace, monospace; }
.task-body > p { margin: 0; color: #7190a7; font-size: 9px; line-height: 1.5; }
.task-body code { color: var(--cyan); font-size: .96em; }
.hint-toggle { margin-top: 7px; padding: 0; color: #58bde7; border: 0; background: transparent; cursor: pointer; font-size: 8px; font-weight: 800; }
.hint-box { margin-top: 7px; padding: 8px; color: #7899b0; border-left: 2px solid #2d92c4; background: rgba(1, 11, 24, .4); font-size: 8px; line-height: 1.6; }
.points-note { display: flex; gap: 9px; margin-top: 18px; padding: 12px; color: #6e8da5; border: 1px solid rgba(84, 158, 201, .12); border-radius: 9px; background: rgba(3, 18, 36, .32); }
.points-note span { width: 18px; height: 18px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue-2); border: 1px solid rgba(70, 189, 239, .3); border-radius: 50%; font-size: 9px; font-weight: 900; }
.points-note p { margin: 0; font-size: 9px; line-height: 1.5; }

/* Workspace and terminal */
.workspace-panel { min-width: 0; padding: 21px; background: rgba(2, 13, 28, .38); }
.environment-bar { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 15px; border: 1px solid rgba(90, 171, 218, .15); border-radius: 11px 11px 0 0; background: #0b2340; }
.env-info { display: flex; align-items: center; gap: 11px; }
.env-info div { display: grid; }
.env-info small { color: #64859f; font-size: 7px; font-weight: 850; letter-spacing: 1px; }
.env-info strong { margin-top: 3px; color: #cfe0ed; font-size: 10px; }
.env-tags { display: flex; gap: 7px; }
.env-tags span { padding: 5px 7px; color: #698ca7; border: 1px solid rgba(103, 171, 211, .16); border-radius: 6px; font-size: 7px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.terminal-card { position: relative; min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(85, 163, 207, .17); border-top: 0; border-radius: 0 0 12px 12px; background: #020a15; }
.terminal-titlebar { min-height: 43px; padding: 0 15px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid rgba(88, 160, 201, .14); background: #0a1c32; }
.window-dots { display: flex; gap: 6px; }
.window-dots span { width: 8px; height: 8px; border-radius: 50%; background: #f16d68; }
.window-dots span:nth-child(2) { background: #edbd55; }
.window-dots span:nth-child(3) { background: #59cb70; }
.terminal-title { color: #65839a; font: 650 9px ui-monospace, monospace; }
.terminal-titlebar button { justify-self: end; padding: 4px 7px; color: #64859f; border: 1px solid rgba(90, 160, 200, .16); border-radius: 5px; background: transparent; cursor: pointer; font-size: 8px; }
.terminal-titlebar button:hover { color: #fff; }
.terminal-body { min-height: 480px; max-height: 590px; overflow-y: auto; padding: 23px 25px 12px; color: #b9d2e3; font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; scrollbar-width: thin; scrollbar-color: #224968 #06111e; }
.terminal-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.terminal-line.command { margin-top: 8px; color: #eff8ff; }
.terminal-line.success { color: #7ce6a1; }
.terminal-line.warning { color: #f3cf70; }
.terminal-line.error { color: #ff8c94; }
.terminal-line.diff-add { color: #82e79a; }
.terminal-line.diff-remove { color: #ff9b9b; }
.terminal-line.muted { color: #5d7d95; }
.cyan { color: var(--cyan); }
.terminal-input-row { display: flex; align-items: center; gap: 5px; padding: 2px 25px 17px; color: #d9eaf4; font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.prompt-user { color: var(--lime); }
.prompt-path { color: var(--blue-2); }
.terminal-input-row input { flex: 1; min-width: 0; padding: 0 3px; color: #fff; border: 0; outline: 0; background: transparent; font: inherit; caret-color: var(--lime); }
.terminal-input-row input:disabled { opacity: .45; cursor: not-allowed; }
.command-hint { min-height: 40px; padding: 11px 24px; color: #4f7088; border-top: 1px solid rgba(90, 160, 200, .12); background: #071628; font-size: 8px; }
.command-hint code { color: #75bcd9; }
.tips-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 13px; }
.tip-card { display: flex; gap: 11px; padding: 13px; border: 1px solid rgba(89, 165, 210, .14); border-radius: 10px; background: rgba(8, 31, 59, .58); }
.tip-card > span { color: var(--blue-2); font-size: 18px; }
.tip-card strong { color: #bfd5e4; font-size: 10px; }
.tip-card p { margin: 3px 0 0; color: #66869f; font-size: 8px; line-height: 1.5; }
kbd { display: inline-block; min-width: 20px; padding: 2px 5px; color: #c8e8f7; border: 1px solid #36546f; border-bottom-width: 2px; border-radius: 4px; background: #102238; text-align: center; font-size: 9px; }

/* Embedded Vim */
.vim-editor { position: absolute; inset: 43px 0 0; z-index: 8; min-height: 535px; display: grid; grid-template-rows: auto minmax(280px, 1fr) auto auto auto; color: #e8eef7; background: #07111f; }
.vim-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 14px; color: #a9bad0; border-bottom: 1px solid #23364e; background: #101d2e; font-size: 10px; }
.vim-toolbar > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vim-toolbar strong { overflow: hidden; color: #fff; text-overflow: ellipsis; white-space: nowrap; }
.vim-logo { padding: 3px 7px; color: #03140b; border-radius: 4px; background: #5de290; font-size: 9px; font-weight: 950; letter-spacing: .6px; }
.vim-modified { color: #ffd46d; font-weight: 800; }
.vim-buffer { display: block; width: 100%; min-height: 280px; resize: none; padding: 16px 18px 26px; color: #dbe8f8; border: 0; outline: 0; background: #07111f; caret-color: #fff; font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; }
.vim-buffer[readonly] { cursor: default; }
.vim-status { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; color: #08131f; background: #65d990; font: 11px/1.2 ui-monospace, monospace; }
.vim-command-row { min-height: 34px; padding: 3px 12px; display: flex; align-items: center; border-top: 1px solid #1f3148; background: #07111f; font: 13px ui-monospace, monospace; }
.vim-command-row input { flex: 1; min-width: 0; padding: 4px; color: #fff; border: 0; outline: 0; background: transparent; font: inherit; }
.vim-controls { display: flex; gap: 7px; flex-wrap: wrap; padding: 9px 12px; border-top: 1px solid #20324a; background: #101d2e; }
.vim-controls button { min-height: 32px; padding: 6px 10px; color: #d7e5f5; border: 1px solid #38516f; border-radius: 7px; background: #14253a; cursor: pointer; font: 10px ui-monospace, monospace; }
.vim-controls button:hover, .vim-controls button:focus-visible { color: #06111f; outline: none; border-color: #78dda0; background: #78dda0; }

/* Dialogs */
.modal { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 22px; place-items: center; color: #152842; border: 0; background: rgba(0, 8, 20, .78); backdrop-filter: blur(9px); }
.modal[open] { display: grid; }
.modal::backdrop { background: rgba(0, 8, 20, .78); }
.modal-card { width: min(750px, calc(100vw - 30px)); max-height: calc(100vh - 40px); overflow: auto; padding: 27px; border: 1px solid #d4e3f0; border-radius: 19px; background: #fff; box-shadow: 0 28px 90px rgba(0,0,0,.4); }
.small-modal-card { width: min(510px, calc(100vw - 30px)); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.modal-head h2 { margin: 5px 0 0; color: #102848; }
.modal-close { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; color: #64748b; border: 1px solid #d2deeb; border-radius: 9px; background: #f8fafc; cursor: pointer; font-size: 21px; }
.modal-close:hover { color: #0f2849; }
.modal-close.light { color: #b8cce0; border-color: rgba(179, 215, 239, .25); background: rgba(1, 13, 31, .3); }
.modal-actions, .completion-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 23px; }
.guide-modal-card { width: min(850px, calc(100vw - 30px)); }
.guide-content { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.guide-content section { padding: 15px; border: 1px solid #dce7f3; border-radius: 13px; background: #f7faff; }
.guide-content section:last-child { grid-column: 1 / -1; }
.guide-content h3 { margin: 0 0 9px; color: #0d2344; }
.guide-content p { margin: 0; color: #566780; }
.guide-content pre { margin: 0; overflow: auto; padding: 12px; color: #d9edff; border-radius: 9px; background: #071526; font: 11px/1.55 ui-monospace, monospace; }
.completion-modal { text-align: center; }
.completion-card { position: relative; width: min(570px, calc(100vw - 30px)); overflow: hidden; text-align: center; }
.confetti-strip { position: absolute; inset: 0 0 auto; height: 7px; display: grid; grid-template-columns: repeat(5, 1fr); }
.confetti-strip span:nth-child(odd) { background: var(--blue); }
.confetti-strip span:nth-child(even) { background: var(--gold); }
.completion-medal { width: 72px; height: 72px; margin: 7px auto 18px; display: grid; place-items: center; color: #fff4b5; border: 6px solid #fde08c; border-radius: 50%; background: linear-gradient(145deg, #e3ae28, #b77a0f); box-shadow: 0 0 0 8px #fff5d8; font-size: 32px; }
.completion-card h2 { margin: 6px 0 9px; color: #102848; font-size: 31px; }
.completion-card > p { color: #65758a; }
.final-score { width: 190px; margin: 23px auto; padding: 13px; border: 1px solid #d5e2ed; border-radius: 13px; background: #f4f8fc; }
.final-score span { display: block; color: #69819a; font-size: 8px; font-weight: 900; letter-spacing: 1.2px; }
.final-score strong { color: #0b5fa4; font-size: 47px; line-height: 1; }
.final-score small { color: #70849a; }
.completion-actions { justify-content: center; }

/* Certificate */
.certificate-modal { overflow: auto; padding: 15px; }
.certificate-shell { width: min(1180px, calc(100vw - 24px)); max-height: calc(100vh - 26px); overflow: auto; border-radius: 16px; background: #0b1f3b; box-shadow: 0 32px 100px rgba(0,0,0,.48); }
.certificate-toolbar { position: sticky; top: 0; z-index: 4; min-height: 62px; padding: 10px 17px; display: flex; align-items: center; justify-content: space-between; color: #fff; background: #0b1f3b; border-bottom: 1px solid rgba(129, 190, 230, .19); }
.certificate-toolbar div { display: grid; }
.certificate-toolbar small { color: #799bb7; font-size: 9px; }
.certificate-canvas { position: relative; width: 1120px; height: 792px; margin: 25px auto; overflow: hidden; color: #172945; background: linear-gradient(145deg, #fffdf6, #edf6ff); box-shadow: 0 20px 60px rgba(0,0,0,.38); font-family: Georgia, "Times New Roman", serif; }
.certificate-canvas::before { content: ""; position: absolute; inset: 0; opacity: .26; background-image: radial-gradient(#98b7d7 .6px, transparent .7px); background-size: 12px 12px; }
.certificate-border { position: absolute; pointer-events: none; }
.certificate-border.outer { inset: 18px; border: 7px solid #0b2f63; }
.certificate-border.inner { inset: 34px; border: 2px solid #d6a720; box-shadow: 0 0 0 6px #fff, 0 0 0 7px #89a8c9; }
.cert-corner { position: absolute; z-index: 1; width: 67px; height: 67px; border-color: #d6a720; }
.cert-corner.top-left { top: 48px; left: 48px; border-top: 4px solid; border-left: 4px solid; }
.cert-corner.top-right { top: 48px; right: 48px; border-top: 4px solid; border-right: 4px solid; }
.cert-corner.bottom-left { left: 48px; bottom: 48px; border-left: 4px solid; border-bottom: 4px solid; }
.cert-corner.bottom-right { right: 48px; bottom: 48px; border-right: 4px solid; border-bottom: 4px solid; }
.cert-brand { position: absolute; z-index: 2; top: 72px; left: 85px; display: flex; align-items: center; gap: 13px; font-family: Arial, sans-serif; }
.cert-logo { color: #0b2f63; font-size: 40px; font-weight: 950; letter-spacing: -2px; }
.cert-brand div { display: grid; }
.cert-brand strong { color: #0b2f63; font-size: 17px; letter-spacing: 1px; }
.cert-brand small { color: #6c7f95; font-size: 8px; letter-spacing: 1px; text-transform: uppercase; }
.cert-content { position: absolute; z-index: 2; top: 145px; left: 120px; right: 120px; text-align: center; }
.cert-kicker { color: #617995; font: 800 13px Arial, sans-serif; letter-spacing: 3px; }
.cert-content h2 { margin: 13px 0 16px; color: #0b2f63; font-size: 46px; font-style: italic; letter-spacing: -1px; }
.cert-presented, .cert-copy { margin: 0; color: #68778b; font: 15px Arial, sans-serif; }
.cert-content h3 { margin: 12px 0 2px; color: #172945; font-size: 43px; }
.cert-name-line { width: 540px; height: 2px; margin: 0 auto 15px; background: #d6a720; }
.cert-content h4 { margin: 8px 0; color: #0b2f63; font: 800 22px Arial, sans-serif; }
.cert-description { max-width: 760px; margin: 0 auto; color: #586b82; font: 13px/1.55 Arial, sans-serif; }
.cert-score-line { width: 610px; margin: 18px auto 0; padding: 9px 15px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 15px; color: #58708a; border: 1px solid #cadbea; background: rgba(239, 246, 252, .75); font: 11px Arial, sans-serif; }
.cert-score-line strong { color: #0b2f63; font-size: 20px; }
.cert-footer { position: absolute; z-index: 2; left: 87px; right: 87px; bottom: 76px; display: grid; grid-template-columns: 1fr 100px 1fr; align-items: end; font-family: Arial, sans-serif; }
.cert-date { display: grid; }
.cert-date strong { color: #1e3855; font-size: 15px; }
.cert-date span { color: #728399; font-size: 9px; }
.cert-seal { width: 78px; height: 78px; margin: auto; display: grid; place-items: center; align-content: center; color: #fff7cc; border: 5px double #f4d46f; border-radius: 50%; background: #0b2f63; box-shadow: 0 0 0 3px #0b2f63; }
.cert-seal span { font-size: 16px; line-height: 1; }
.cert-seal strong { font-size: 16px; }
.cert-seal small { font-size: 6px; letter-spacing: 1px; }
.cert-signature { justify-self: end; display: flex; align-items: center; gap: 11px; }
.cert-signature img { width: 61px; height: 72px; object-fit: cover; object-position: center top; border: 2px solid #d6a720; border-radius: 50%; }
.cert-signature div { display: grid; }
.cert-signature strong { color: #172945; font: italic 20px Georgia, serif; }
.cert-signature span { color: #63768d; font-size: 9px; }
.cert-signature small { color: #0b2f63; font-size: 9px; font-weight: 800; }
.cert-id { position: absolute; z-index: 2; bottom: 45px; left: 0; right: 0; color: #788ba1; text-align: center; font: 8px ui-monospace, monospace; letter-spacing: .7px; }
.certificate-actions { position: sticky; bottom: 0; z-index: 4; display: flex; justify-content: flex-end; gap: 10px; padding: 13px 17px; background: #0b1f3b; border-top: 1px solid rgba(129, 190, 230, .19); }

@media (max-width: 1050px) {
  .hero-shell { grid-template-columns: minmax(0, 1fr) 380px; gap: 45px; }
  .hero-copy h1 { font-size: 59px; }
  .lab-layout { grid-template-columns: 340px minmax(0, 1fr); }
  .task-panel { padding-inline: 18px; }
  .lab-title-small, .header-divider { display: none; }
}
@media (max-width: 820px) {
  .top-nav { width: min(100% - 28px, 720px); }
  .hero-shell { width: min(100% - 28px, 680px); grid-template-columns: 1fr; padding-top: 45px; gap: 42px; }
  .hero-copy { text-align: center; }
  .eyebrow, .hero-stats { justify-content: center; }
  .hero-lead { margin-inline: auto; }
  .feature-grid { text-align: left; }
  .entry-card { width: min(450px, 100%); margin-inline: auto; }
  .lab-header { padding-inline: 14px; }
  .lab-header-right { gap: 9px; }
  .progress-wrap { width: 130px; }
  .lab-layout { width: min(100% - 22px, 720px); grid-template-columns: 1fr; }
  .task-panel { border-right: 0; border-bottom: 1px solid rgba(81, 164, 211, .18); }
  .tasks { grid-template-columns: 1fr 1fr; }
  .workspace-panel { padding: 14px; }
  .terminal-body { max-height: 62vh; }
}
@media (max-width: 580px) {
  .top-nav { min-height: 69px; }
  .nav-link { display: none; }
  .brand-copy strong { font-size: 16px; }
  .brand-mark { width: 39px; height: 39px; }
  .hero-shell { width: min(100% - 22px, 520px); padding-top: 34px; }
  .hero-copy h1 { font-size: 45px; }
  .hero-lead { font-size: 14px; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero-stats div { min-width: 90px; padding-inline: 15px; }
  .entry-card > * { margin-left: 22px; margin-right: 22px; }
  .entry-card-top { margin-left: 0; margin-right: 0; }
  .entry-card input, .btn-wide { width: calc(100% - 44px); }
  .lab-header .brand-copy { display: none; }
  .progress-wrap { display: none; }
  .score-chip { min-width: 72px; }
  .tasks { grid-template-columns: 1fr; }
  .workspace-panel { padding: 8px; }
  .env-tags { display: none; }
  .terminal-titlebar { grid-template-columns: 1fr auto; }
  .terminal-title { display: none; }
  .terminal-body { min-height: 430px; padding: 18px 14px 10px; font-size: 11px; }
  .terminal-input-row { padding: 2px 14px 14px; font-size: 11px; }
  .tips-grid { grid-template-columns: 1fr; }
  .vim-toolbar > span { display: none; }
  .vim-buffer { font-size: 12px; }
  .vim-controls button { flex: 1 1 calc(33.33% - 7px); }
  .guide-content { grid-template-columns: 1fr; }
  .guide-content section:last-child { grid-column: auto; }
  .modal { padding: 10px; }
  .modal-card { padding: 21px 17px; }
  .modal-actions, .completion-actions { flex-direction: column; }
  .modal-actions .btn, .completion-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  @page { size: A4 landscape; margin: 0; }
  body.printing-certificate { background: #fff; }
  body.printing-certificate > *:not(#certificateModal) { display: none !important; }
  body.printing-certificate #certificateModal { position: static; display: block; width: auto; height: auto; padding: 0; border: 0; background: #fff; }
  body.printing-certificate .certificate-toolbar, body.printing-certificate .certificate-actions { display: none !important; }
  body.printing-certificate .certificate-shell { width: 100%; max-height: none; overflow: visible; padding: 0; background: #fff; box-shadow: none; }
  body.printing-certificate .certificate-canvas { width: 1120px; height: 792px; margin: 0; transform: scale(.752); transform-origin: top left; box-shadow: none; }
}
