/* ==========================================================================
   Linguistic Communication — SyntaxMap learning journey (/testing/)
   Learn → practise → test. Same brand tokens as the LC apps.
   ========================================================================== */

:root {
  --navy: #111826;
  --navy-2: #182232;
  --navy-3: #22304a;
  --paper: #f6f4ee;
  --paper-2: #efece4;
  --white: #fff;
  --gold: #ffd149;
  --gold-deep: #d9a92e;
  --gold-ink: #8a6a05;
  --ink: #111826;
  --body: #3a4252;
  --muted: #6a7284;
  --line: #ddd8cc;
  --line-strong: #c9c3b4;
  --ok: #1f8a54;
  --ok-bg: #e8f5ee;
  --warn: #b9720f;
  --warn-bg: #fdf2e0;
  --bad: #b8382f;
  --bad-bg: #fbeae8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17, 24, 38, .06), 0 10px 26px -20px rgba(17, 24, 38, .4);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0 0 .7em; }
a { color: var(--navy-3); }
img { max-width: 100%; display: block; }

/* ------------------------------------------------------------------ header */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--navy); color: var(--white); border-bottom: 3px solid var(--gold); }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 11px 20px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; min-width: 0; }
.brand img { height: 32px; width: auto; }
.brand-name { display: block; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: #9aa4b8; }
.brand-app { display: block; font-size: 14.5px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.home-link { color: #c8d0e0; text-decoration: none; font-size: 13px; border: 1px solid #33415c; border-radius: 999px; padding: 6px 12px; }
.home-link:hover { color: #fff; border-color: #5b6b8c; }
.lang-toggle { display: flex; border: 1px solid #33415c; border-radius: 999px; overflow: hidden; }
.lang-toggle button { background: transparent; border: 0; color: #93a0b8; font: inherit; font-size: 12px; letter-spacing: .08em; padding: 6px 10px; cursor: pointer; }
.lang-toggle button[aria-pressed="true"] { background: var(--gold); color: var(--navy); font-weight: 700; }

/* -------------------------------------------------------------------- main */
.wrap { max-width: 1120px; margin: 0 auto; padding: 26px 20px 70px; }
.screen { display: none; }
.screen.is-active { display: block; }

.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-ink); font-weight: 700; margin-bottom: 8px; }
.title { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 10px; }
.lede { font-size: 17px; color: var(--muted); max-width: 70ch; }
.small { font-size: 13.5px; color: var(--muted); }

/* ------------------------------------------------------------------- steps */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 26px 0 18px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

.step {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow);
}
.step::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; border-radius: var(--radius) var(--radius) 0 0; background: var(--gold); }
.step.is-done::before { background: var(--ok); }
.step-num { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--gold-ink); margin-bottom: 8px; }
.step h2 { font-size: 20px; margin-bottom: 6px; }
.step p { font-size: 14px; color: var(--muted); flex: 1 0 auto; }
.step-progress { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.step .btn { margin-top: 12px; width: 100%; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 14.5px; font-weight: 600; border-radius: 999px; padding: 10px 18px; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-3); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-deep); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--body); }
.btn-ghost:hover { border-color: var(--muted); color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ----------------------------------------------------------------- mission */
.mission { background: var(--navy); color: var(--white); border-radius: var(--radius); padding: 24px 26px; margin-bottom: 22px; position: relative; overflow: hidden; }
.mission::after {
  content: ""; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%;
  border: 26px solid rgba(255, 255, 255, .04); box-shadow: 0 0 0 26px rgba(255, 255, 255, .03), 0 0 0 80px rgba(255, 255, 255, .02);
}
.mission .eyebrow { color: var(--gold); }
.mission h1 { font-size: clamp(24px, 3vw, 32px); color: #fff; margin-bottom: 8px; }
.mission p { color: #c9d2e2; max-width: 62ch; margin-bottom: 0; }
.progress-line { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: 12.5px; color: #c9d2e2; }
.progress-line b { color: var(--gold); }

/* ------------------------------------------------------------------ module */
.list { display: grid; gap: 12px; }
.module-row {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center;
  width: 100%; text-align: left;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 18px; font: inherit; cursor: pointer;
}
.module-row:hover { border-color: var(--line-strong); }
.module-row .num { font-size: 20px; font-weight: 700; color: var(--line-strong); }
.module-row .t { font-weight: 600; font-size: 15.5px; }
.module-row .k { font-size: 13px; color: var(--muted); }
.module-row .st { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.module-row.is-done .st { color: var(--ok); }
.module-row.is-done .num { color: var(--ok); }

/* ------------------------------------------------------------------ lesson */
.brief { display: flex; gap: 14px; align-items: flex-start; background: #fffaeb; border: 1px solid #f0e2b8; border-radius: var(--radius-sm); padding: 14px 16px; margin: 16px 0 22px; }
.brief .who { width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: var(--gold); font-weight: 700; display: grid; place-items: center; flex: 0 0 auto; font-size: 14px; }
.brief p { margin: 0; font-size: 14.5px; color: #6a5410; }

.section-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.section-card h2 { font-size: 21px; margin-bottom: 8px; }
.section-card p { color: var(--body); }
.section-figure { margin: 4px 0 18px; }
.section-figure img { width: 100%; height: auto; aspect-ratio: 1600 / 1018; object-fit: contain; border-radius: 12px; background: var(--paper-2); }
.figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }

ul.bullets { margin: 6px 0 4px; padding-left: 18px; }
ul.bullets li { margin-bottom: 6px; color: var(--body); }

.trap { border-left: 4px solid var(--gold); background: #fffaeb; padding: 10px 14px; border-radius: 0 10px 10px 0; font-size: 14px; color: #6a5410; margin-top: 12px; }

/* ------------------------------------------------------------------- check */
.check { background: var(--white); border: 2px solid var(--navy); border-radius: var(--radius); padding: 22px; margin: 6px 0 18px; }
.check .eyebrow { color: var(--navy-3); }
.check h2 { font-size: 19px; margin-bottom: 14px; }
.opt { display: block; width: 100%; text-align: left; font: inherit; font-size: 14.5px; background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.opt:hover { border-color: var(--navy-3); }
.opt[data-state="right"] { border-color: var(--ok); background: var(--ok-bg); }
.opt[data-state="wrong"] { border-color: var(--bad); background: var(--bad-bg); }
.opt:disabled { cursor: default; }

.feedback { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; margin-top: 10px; }
.feedback.is-ok { background: var(--ok-bg); color: #14603c; }
.feedback.is-bad { background: var(--bad-bg); color: #8c2a22; }
.feedback.is-warn { background: var(--warn-bg); color: #7d4d05; }
.feedback.is-info { background: #eef2f7; color: var(--navy-3); }

.stamp { display: inline-flex; align-items: center; gap: 8px; background: var(--ok-bg); color: #14603c; border: 1px solid #bfe3ce; border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; }

/* ---------------------------------------------------------------- practice */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card h2 { font-size: 19px; margin-bottom: 6px; }
.card .small { margin-bottom: 12px; }

.field { margin-bottom: 14px; }
.field > label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
textarea, select, input[type="text"] {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--ink);
  background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; resize: vertical;
}
textarea:focus, select:focus, input:focus { outline: 2px solid rgba(217, 169, 46, .45); outline-offset: 1px; border-color: var(--gold-deep); }

.gwt { display: grid; grid-template-columns: 110px 1fr; gap: 8px 10px; align-items: start; }
.gwt label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding-top: 11px; }
@media (max-width: 620px) { .gwt { grid-template-columns: 1fr; } .gwt label { padding-top: 0; } }

.score-line { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 10px; }
.score-line b { font-size: 30px; }
.checklist { list-style: none; margin: 10px 0 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--body); }
.checklist li:first-child { border-top: 0; }
.checklist .mark { font-weight: 700; }
.checklist li.pass .mark { color: var(--ok); }
.checklist li.part .mark { color: var(--warn); }
.checklist li.fail .mark { color: var(--bad); }

details.model { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
details.model summary { cursor: pointer; font-weight: 600; color: var(--navy-3); font-size: 14px; }
details.model ul { margin: 10px 0 0; padding-left: 18px; color: var(--body); font-size: 14px; }
details.model li { margin-bottom: 6px; }

/* home: the product under test, above the three steps */
.product-strip { display: flex; align-items: center; justify-content: space-between; gap: 18px;
  border: 1px solid var(--navy); background: #fff; padding: 16px 18px; margin: 0 0 18px; }
.ps-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-2, #8f6f1f); font-weight: 700; }
.ps-name { font-family: Georgia, serif; font-size: 21px; color: var(--navy); line-height: 1.2; margin: 2px 0 4px; }
.card.after { margin-top: 22px; }
@media (max-width: 620px) { .product-strip { flex-direction: column; align-items: flex-start; gap: 12px; } }

/* the five checks of the exercise: number, page, what to do, what to expect */
.ms-step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ms-step:first-of-type { border-top: 0; }
.ms-n { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: var(--gold); font-weight: 700; display: grid; place-items: center; font-size: 13px; }
.ms-h { font-weight: 700; font-size: 14.5px; margin-bottom: 2px; }
.ms-h code { font-weight: 500; font-size: 12.5px; color: var(--navy-3); }
.ms-expect { color: #14603c; }

/* the five deliverables of the exercise: level on the left, task on the right */
.ms-task { display: grid; grid-template-columns: 132px 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--body); }
.ms-task:first-of-type { border-top: 0; }
.ms-level { align-self: start; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--navy); background: #f3efe2; border-radius: 999px; padding: 3px 9px; text-align: center; }
@media (max-width: 560px) { .ms-task { grid-template-columns: 1fr; gap: 6px; } .ms-level { justify-self: start; } }

/* map of the live product (mission workshop): 8 routes, so the column count is
   fixed at 4 / 2 / 1 — auto-fit would leave a ragged third row. */
.ms-map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.ms-cell { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.ms-cell b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.ms-cell code { font-size: 12px; color: var(--navy-3); word-break: break-all; }
@media (max-width: 1100px) { .ms-map { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ms-map { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ footer */
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(10px); background: var(--navy); color: #fff; border-radius: 999px; padding: 10px 20px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: .2s ease; z-index: 90; }
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 560px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .brand { width: 100%; }
  .brand-app { font-size: 13.5px; }
  .topbar-right { margin-left: 0; width: 100%; justify-content: flex-end; }
  .wrap { padding: 18px 14px 60px; }
  .section-card, .card, .check { padding: 16px 15px; }
  .brief { padding: 12px 13px; }
}

@media print { .topbar, .btn-row, .pager { display: none; } }
