/* ============================================================
   AWS Foundation Class — student showcase site
   Light theme: white + AWS orange + squid-ink slate
   ============================================================ */

:root {
  --orange:      #ff9900;
  --orange-deep: #ec7211;
  --orange-soft: #fff4e5;
  --orange-line: #ffd9a0;

  --ink:    #12181f;
  --slate:  #232f3e;
  --slate2: #37475a;
  --muted:  #5f6b7a;
  --faint:  #8b97a6;

  --bg:      #ffffff;
  --bg-soft: #f6f8fb;
  --bg-tint: #eef3f9;
  --line:    #e2e8f0;
  --line2:   #cbd5e1;

  --teal:   #0d7f8c;
  --teal-l: #e6f4f6;
  --green:  #1f7a4d;
  --green-l:#e8f5ee;
  --red:    #c0392b;
  --red-l:  #fdeeeb;
  --violet: #6d4aa0;
  --violet-l:#f2ecfa;
  --blue:   #1f6feb;
  --blue-l: #e8f1fe;

  --radius:   14px;
  --radius-s: 9px;
  --shadow:   0 1px 2px rgba(16,24,40,.05), 0 8px 24px -12px rgba(16,24,40,.16);
  --shadow-lg:0 2px 4px rgba(16,24,40,.05), 0 24px 48px -20px rgba(16,24,40,.25);

  --sans: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.68;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--orange-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.22; color: var(--slate); margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.02rem; }
p  { margin: 0 0 1.05em; }

code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--bg-tint);
  padding: .12em .42em;
  border-radius: 5px;
  color: #0b3d5c;
  overflow-wrap: anywhere;   /* a long identifier must not widen the page on a phone */
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 900px; }

/* ---------------- skip link ---------------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--slate); color: #fff; padding: 10px 18px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ================= NAVIGATION ================= */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--orange), var(--orange-deep));
  z-index: 120; transition: width .08s linear;
}

.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav.scrolled { box-shadow: 0 4px 18px -10px rgba(16,24,40,.35); }

.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; gap: 18px; height: 66px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--slate); font-size: 1.02rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px;
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  display: grid; place-items: center; color: #fff; font-size: 1.05rem;
  box-shadow: 0 4px 12px -4px rgba(236,114,17,.7);
}
.brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links > a, .drop > button {
  font: inherit; font-size: .93rem; font-weight: 600; color: var(--slate2);
  background: none; border: 0; cursor: pointer;
  padding: 9px 13px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px;
}
.nav-links > a:hover, .drop > button:hover { background: var(--bg-tint); color: var(--slate); text-decoration: none; }
.nav-links > a.active { background: var(--orange-soft); color: var(--orange-deep); }

.nav-cta {
  background: var(--slate) !important; color: #fff !important;
  padding: 9px 17px !important; border-radius: 999px !important;
}
.nav-cta:hover { background: var(--orange-deep) !important; }

.drop { position: relative; }
.drop-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 10px;
  width: 540px; display: none; grid-template-columns: 1fr 1fr; gap: 2px;
}
.drop.open .drop-panel { display: grid; }
.drop-panel a {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 11px; border-radius: 9px; color: var(--slate2); font-size: .88rem; line-height: 1.35;
}
.drop-panel a:hover { background: var(--bg-soft); text-decoration: none; }
.drop-panel a b { display: block; color: var(--slate); font-size: .9rem; }
.drop-panel a span { color: var(--faint); font-size: .78rem; }
.drop-panel .dp-num {
  flex: 0 0 26px; height: 26px; border-radius: 7px; background: var(--orange-soft);
  color: var(--orange-deep); font-weight: 800; font-size: .76rem; display: grid; place-items: center;
}

.burger { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--slate); margin-left: auto; }

@media (max-width: 980px) {
  .burger { display: block; }
  .nav-links {
    position: fixed; inset: 66px 0 auto 0; background: #fff;
    border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch;
    padding: 12px; gap: 2px; margin: 0; display: none; max-height: calc(100vh - 66px); overflow-y: auto;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-links > a, .drop > button { width: 100%; justify-content: space-between; }
  .drop-panel { position: static; width: 100%; grid-template-columns: 1fr; box-shadow: none; border: 0; padding: 0 0 6px 12px; }
  .nav-cta { text-align: center; justify-content: center !important; }
}

/* ================= HERO ================= */
.hero { position: relative; overflow: hidden; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(700px 380px at 88% -10%, rgba(255,153,0,.20), transparent 65%),
    radial-gradient(600px 320px at 5% 110%, rgba(35,47,62,.10), transparent 60%);
}
.hero-inner { position: relative; max-width: var(--maxw); margin: 0 auto; padding: 60px 22px 66px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 46px; align-items: center; }
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; gap: 30px; padding: 42px 22px 48px; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--orange-line); color: var(--orange-deep);
  font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 6px 13px; border-radius: 999px; margin-bottom: 16px;
}
.hero h1 { margin-bottom: .35em; }
.hero .tagline { font-size: 1.13rem; color: var(--muted); max-width: 56ch; }

.hero-photo {
  border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg);
  aspect-ratio: 4/3; background: linear-gradient(135deg, var(--slate), var(--slate2) 55%, var(--orange-deep));
  position: relative;
}
/* the SVG sits behind the photo, so the hero still looks designed if the CDN image
   is blocked or the URL ever changes */
.hero-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-photo img { position: relative; width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.hero-photo .ph-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 18px;
  background: linear-gradient(transparent, rgba(18,24,31,.82));
  color: #fff; font-size: .85rem; font-weight: 600;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--orange); color: #1a1205; box-shadow: 0 6px 18px -6px rgba(255,153,0,.75); }
.btn-primary:hover { background: var(--orange-deep); color: #fff; }
.btn-dark { background: var(--slate); color: #fff; }
.btn-dark:hover { background: var(--slate2); }
.btn-ghost { background: #fff; color: var(--slate); border-color: var(--line2); }
.btn-ghost:hover { border-color: var(--slate); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ================= SECTIONS ================= */
section { padding: 62px 0; }
section.tint { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { max-width: 760px; margin-bottom: 34px; }
.sec-head .kicker {
  font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--orange-deep); margin-bottom: 8px;
}
.sec-head p { color: var(--muted); margin-bottom: 0; }

/* ================= CARDS / GRIDS ================= */
.grid { display: grid; gap: 20px; }
/* grid and flex children default to min-width:auto, which lets a wide <pre> or table
   blow the whole track out past the viewport on a phone. Reset it everywhere. */
.grid > *, .layout > *, .pc > *, .hero-inner > *, .stats > *, .svc > *, .pager > *,
.foot-grid > *, .breakdown > *, .bd-row > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }

/* module cards */
.mod-card {
  display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  color: inherit;
}
.mod-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--orange-line); text-decoration: none; }
.mod-thumb { height: 128px; position: relative; background: linear-gradient(135deg, var(--slate), var(--slate2)); overflow: hidden; }
.mod-card[data-m="01"] .mod-thumb { background: linear-gradient(135deg,#17364f,#2e7bb0); }
.mod-card[data-m="02"] .mod-thumb { background: linear-gradient(135deg,#1f4a6b,#0d7f8c); }
.mod-card[data-m="03"] .mod-thumb { background: linear-gradient(135deg,#14483a,#1f7a4d); }
.mod-card[data-m="04"] .mod-thumb { background: linear-gradient(135deg,#8c2f18,#ec7211); }
.mod-card[data-m="05"] .mod-thumb { background: linear-gradient(135deg,#3b2450,#6d4aa0); }
.mod-card[data-m="06"] .mod-thumb { background: linear-gradient(135deg,#123a6b,#1f6feb); }
.mod-card[data-m="07"] .mod-thumb { background: linear-gradient(135deg,#4a2f6b,#8d6cc0); }
.mod-card[data-m="08"] .mod-thumb { background: linear-gradient(135deg,#0b4a52,#0d7f8c); }
.mod-card[data-m="09"] .mod-thumb { background: linear-gradient(135deg,#7a3d0a,#ff9900); }
.mod-card[data-m="10"] .mod-thumb { background: linear-gradient(135deg,#6b1d10,#c0392b); }
.mod-card[data-m="11"] .mod-thumb { background: linear-gradient(135deg,#17364f,#1f7a4d); }
.mod-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .78; }
.mod-thumb .mod-emoji {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.6rem;
  text-shadow: 0 4px 14px rgba(0,0,0,.45);
}
.mod-badge {
  position: absolute; top: 11px; left: 11px; background: rgba(255,255,255,.95);
  color: var(--slate); font-size: .7rem; font-weight: 800; letter-spacing: .08em;
  padding: 4px 10px; border-radius: 999px; text-transform: uppercase;
}
.mod-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.mod-body h3 { font-size: 1.05rem; margin-bottom: .35em; color: var(--slate); }
.mod-body p { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.mod-meta { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  display: inline-block; font-size: .73rem; font-weight: 700; padding: 3px 10px;
  border-radius: 999px; background: var(--bg-tint); color: var(--slate2);
}
.chip-orange { background: var(--orange-soft); color: var(--orange-deep); }
.chip-teal   { background: var(--teal-l); color: var(--teal); }
.chip-green  { background: var(--green-l); color: var(--green); }
.chip-red    { background: var(--red-l); color: var(--red); }
.chip-violet { background: var(--violet-l); color: var(--violet); }
.chip-blue   { background: var(--blue-l); color: var(--blue); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 780px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; text-align: center; box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 2.1rem; color: var(--orange-deep); line-height: 1.1; font-weight: 800; }
.stat span { font-size: .84rem; color: var(--muted); font-weight: 600; }

/* profile */
.profile {
  display: grid; grid-template-columns: 190px 1fr; gap: 30px; align-items: start;
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 30px;
  box-shadow: var(--shadow);
}
@media (max-width: 720px) { .profile { grid-template-columns: 1fr; text-align: left; } }
.avatar {
  width: 190px; height: 190px; border-radius: 24px; overflow: hidden;
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  display: grid; place-items: center; font-size: 4.2rem; color: #fff;
  box-shadow: 0 10px 30px -12px rgba(236,114,17,.8);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.edit-hint {
  background: var(--orange-soft); border: 1px dashed var(--orange-line); color: #7a4a06;
  border-radius: var(--radius-s); padding: 12px 15px; font-size: .87rem; margin-top: 18px;
}
.edit-hint b { color: #5e3803; }

/* timeline */
.timeline { position: relative; padding-left: 34px; }
.timeline::before { content:""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--line2); }
.tl-item { position: relative; padding-bottom: 24px; }
.tl-item::before {
  content: ""; position: absolute; left: -28px; top: 7px; width: 13px; height: 13px;
  border-radius: 50%; background: var(--orange); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--orange-line);
}
.tl-item h4 { margin-bottom: .2em; }
.tl-item p { font-size: .92rem; color: var(--muted); margin-bottom: 0; }

/* ================= MODULE PAGE LAYOUT ================= */
.page-head {
  background: var(--slate); color: #fff; position: relative; overflow: hidden;
  border-bottom: 4px solid var(--orange);
}
.page-head::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(620px 320px at 90% 0%, rgba(255,153,0,.28), transparent 62%);
}
.page-head .wrap { position: relative; padding-top: 46px; padding-bottom: 46px; }
.page-head h1 { color: #fff; margin-bottom: .3em; }
.page-head p { color: #c8d3e0; max-width: 66ch; margin-bottom: 0; font-size: 1.04rem; }
.crumbs { font-size: .84rem; color: #9fb0c4; margin-bottom: 14px; }
.crumbs a { color: #ffd9a0; }
.head-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.head-chips .chip { background: rgba(255,255,255,.14); color: #fff; }

/* About page header: stack the avatar above the text on a narrow screen */
@media (max-width: 660px) {
  .about-head { grid-template-columns: 1fr !important; gap: 18px !important; }
  .about-head .avatar { width: 104px !important; height: 104px !important; font-size: 2.3rem !important; }
}

.layout { display: grid; grid-template-columns: 232px 1fr; gap: 44px; align-items: start; padding: 44px 0 66px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; gap: 24px; } }

.toc { position: sticky; top: 88px; font-size: .88rem; }
@media (max-width: 900px) {
  .toc { position: static; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
}
.toc b { display: block; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.toc a { display: block; padding: 6px 12px; border-left: 2px solid var(--line); color: var(--muted); }
.toc a:hover { color: var(--slate); border-left-color: var(--line2); text-decoration: none; }
.toc a.active { color: var(--orange-deep); border-left-color: var(--orange); font-weight: 700; background: var(--orange-soft); }

.content h2 { margin-top: 8px; padding-top: 10px; }
.content > section { padding: 0 0 40px; }

/* objectives */
.objectives { background: var(--bg-soft); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: var(--radius); padding: 22px 26px; }
.objectives h3 { margin-bottom: .6em; font-size: 1.02rem; }
.objectives ul { margin: 0; padding-left: 20px; }
.objectives li { margin-bottom: .45em; }
.objectives li::marker { color: var(--orange-deep); }

/* callouts */
.note {
  border-radius: var(--radius); padding: 16px 20px; margin: 20px 0;
  border: 1px solid var(--line); background: var(--bg-soft); border-left: 4px solid var(--muted);
}
.note b.lbl { display: block; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 5px; }
.note p:last-child { margin-bottom: 0; }
.note.tip   { background: var(--green-l); border-color: #bfe3ce; border-left-color: var(--green); }
.note.tip b.lbl { color: var(--green); }
.note.warn  { background: var(--red-l); border-color: #f6cfc8; border-left-color: var(--red); }
.note.warn b.lbl { color: var(--red); }
.note.info  { background: var(--blue-l); border-color: #cfe0fb; border-left-color: var(--blue); }
.note.info b.lbl { color: var(--blue); }
.note.exam  { background: var(--violet-l); border-color: #ddd0f0; border-left-color: var(--violet); }
.note.exam b.lbl { color: var(--violet); }

/* tables */
.tw { overflow-x: auto; margin: 20px 0; border-radius: var(--radius); border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; background: #fff; min-width: 480px; }
thead th { background: var(--slate); color: #fff; text-align: left; padding: 11px 15px; font-weight: 700; font-size: .87rem; white-space: nowrap; }
tbody td { padding: 11px 15px; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr:nth-child(even) { background: var(--bg-soft); }
tbody td:first-child { font-weight: 600; color: var(--slate); }

/* code blocks */
pre {
  max-width: 100%;
  background: #1b2430; color: #e6edf3; border-radius: var(--radius); padding: 18px 20px;
  overflow-x: auto; font-family: var(--mono); font-size: .855rem; line-height: 1.62; margin: 18px 0;
  border: 1px solid #2b3947;
}
pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.cmd-label {
  display: inline-block; background: var(--slate); color: #ffd9a0; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; padding: 4px 12px; border-radius: 8px 8px 0 0; margin-bottom: -18px; position: relative; z-index: 1;
}
.cmd-label + pre { border-top-left-radius: 0; }

/* ascii / diagram box */
.ascii {
  max-width: 100%;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; overflow-x: auto; font-family: var(--mono); font-size: .8rem;
  line-height: 1.45; white-space: pre; color: var(--slate); margin: 20px 0;
}

/* svg figure */
figure { margin: 24px 0; }
figure svg { width: 100%; height: auto; display: block; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); }
figcaption { font-size: .84rem; color: var(--faint); text-align: center; margin-top: 9px; font-style: italic; }

/* key list */
.keylist { list-style: none; padding: 0; margin: 0; }
.keylist li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.keylist li:last-child { border-bottom: 0; }
.keylist .k { flex: 0 0 30px; font-size: 1.3rem; line-height: 1.3; }
.keylist .v b { display: block; color: var(--slate); }
.keylist .v span { color: var(--muted); font-size: .92rem; }

/* pros/cons */
.pc { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 20px 0; }
@media (max-width: 640px) { .pc { grid-template-columns: 1fr; } }
.pc > div { border-radius: var(--radius); padding: 18px 20px; border: 1px solid var(--line); }
.pc .good { background: var(--green-l); border-color: #bfe3ce; }
.pc .bad  { background: var(--red-l); border-color: #f6cfc8; }
.pc h4 { margin-bottom: .5em; }
.pc .good h4 { color: var(--green); }
.pc .bad h4 { color: var(--red); }
.pc ul { margin: 0; padding-left: 20px; font-size: .92rem; }
.pc li { margin-bottom: .35em; }

/* service tiles */
.svc { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; margin: 20px 0; }
.svc-tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px 16px; box-shadow: var(--shadow); }
.svc-tile .e { font-size: 1.5rem; line-height: 1; }
.svc-tile b { display: block; color: var(--slate); margin: 7px 0 3px; font-size: .95rem; }
.svc-tile span { font-size: .84rem; color: var(--muted); }

/* prev/next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
@media (max-width: 640px) { .pager { grid-template-columns: 1fr; } }
.pager a {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px;
  background: #fff; box-shadow: var(--shadow); color: var(--slate);
}
.pager a:hover { border-color: var(--orange); text-decoration: none; }
.pager small { display: block; color: var(--faint); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.pager .next { text-align: right; }
.pager .empty { visibility: hidden; }

/* ================= QUIZ ================= */
.quiz {
  background: #fff; border: 2px solid var(--orange-line); border-radius: 18px;
  padding: 26px 28px; box-shadow: var(--shadow); margin-top: 10px;
}
.quiz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.quiz-head h3 { margin: 0; }
.quiz-sub { color: var(--muted); font-size: .93rem; margin-bottom: 20px; }

.q { padding: 18px 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; padding-top: 4px; }
.q-text { font-weight: 700; color: var(--slate); margin-bottom: 12px; display: flex; gap: 10px; }
.q-text .qn {
  flex: 0 0 26px; height: 26px; border-radius: 7px; background: var(--slate); color: #fff;
  font-size: .8rem; display: grid; place-items: center; font-weight: 800;
}
.opts { display: grid; gap: 8px; }
.opt {
  display: flex; gap: 11px; align-items: flex-start; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-s); padding: 11px 14px;
  background: #fff; transition: border-color .12s, background .12s; font-size: .95rem;
}
.opt:hover { border-color: var(--orange); background: var(--orange-soft); }
.opt input { margin: 4px 0 0; accent-color: var(--orange-deep); flex: 0 0 auto; }
.opt.correct { background: var(--green-l); border-color: var(--green); }
.opt.wrong   { background: var(--red-l); border-color: var(--red); }
.opt.locked  { cursor: default; }
.opt.locked:hover { border-color: var(--line); background: #fff; }
.opt.locked.correct:hover { background: var(--green-l); border-color: var(--green); }
.opt.locked.wrong:hover   { background: var(--red-l); border-color: var(--red); }
.tick { margin-left: auto; font-weight: 800; font-size: .95rem; }

.explain {
  margin-top: 10px; font-size: .9rem; background: var(--bg-soft); border-left: 3px solid var(--orange);
  padding: 10px 14px; border-radius: 0 8px 8px 0; color: var(--slate2);
}
.explain b { color: var(--slate); }

.quiz-foot { display: flex; gap: 12px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.score-pill {
  font-weight: 800; padding: 9px 18px; border-radius: 999px;
  background: var(--bg-tint); color: var(--slate);
}
.score-pill.pass { background: var(--green-l); color: var(--green); }
.score-pill.fail { background: var(--red-l); color: var(--red); }

/* ================= EXAM ================= */
.exam-card {
  max-width: 620px; margin: 0 auto; background: #fff; border: 1px solid var(--line);
  border-radius: 20px; padding: 34px; box-shadow: var(--shadow-lg); text-align: center;
}
.exam-card .avatar { margin: 0 auto 18px; width: 84px; height: 84px; font-size: 2.2rem; border-radius: 20px; }
.field { text-align: left; margin: 20px 0; }
.field label { display: block; font-weight: 700; font-size: .88rem; color: var(--slate); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; font: inherit; font-size: 1rem; padding: 12px 15px;
  border: 1px solid var(--line2); border-radius: var(--radius-s); background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid var(--orange); outline-offset: 1px; border-color: var(--orange); }
.field .hint { font-size: .8rem; color: var(--faint); margin-top: 5px; }
.err { color: var(--red); font-size: .87rem; font-weight: 600; margin-top: 10px; min-height: 1.2em; }

.exam-bar {
  position: sticky; top: 66px; z-index: 60; background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 0; margin-bottom: 24px; box-shadow: 0 4px 14px -10px rgba(16,24,40,.4);
}
.exam-bar .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.exam-bar .who { font-weight: 700; color: var(--slate); }
.exam-bar .spacer { margin-left: auto; }
.timer {
  font-family: var(--mono); font-weight: 700; font-size: 1.02rem; background: var(--bg-tint);
  padding: 7px 15px; border-radius: 999px; color: var(--slate);
}
.timer.low { background: var(--red-l); color: var(--red); }
.bar { height: 7px; background: var(--bg-tint); border-radius: 999px; overflow: hidden; flex: 1 1 150px; min-width: 120px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-deep)); width: 0%; transition: width .25s; }

.result-hero {
  text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 20px;
  padding: 40px 30px; box-shadow: var(--shadow-lg); margin-bottom: 26px;
}
.ring { width: 172px; height: 172px; margin: 0 auto 20px; position: relative; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring .val {
  position: absolute; inset: 0; display: grid; place-items: center; align-content: center;
  font-size: 2.4rem; font-weight: 800; color: var(--slate); line-height: 1;
}
.ring .val small { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-top: 4px; }
.verdict { font-size: 1.32rem; font-weight: 800; margin: 6px 0 4px; }
.verdict.pass { color: var(--green); }
.verdict.fail { color: var(--red); }

.breakdown { display: grid; gap: 10px; }
.bd-row { display: grid; grid-template-columns: 1fr 110px 64px; gap: 14px; align-items: center; font-size: .92rem; }
@media (max-width: 560px) { .bd-row { grid-template-columns: 1fr 70px 54px; gap: 8px; font-size: .86rem; } }
.bd-row .nm { color: var(--slate); font-weight: 600; }
.bd-row .sc { text-align: right; font-weight: 700; color: var(--muted); }

/* ================= FOOTER ================= */
footer {
  background: var(--slate); color: #b9c6d6; padding: 46px 0 30px; font-size: .9rem; margin-top: 0;
}
footer h4 { color: #fff; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; }
footer a { color: #d7e2ee; }
footer a:hover { color: var(--orange); }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
@media (max-width: 840px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin-bottom: 7px; }
.foot-bottom {
  border-top: 1px solid #3a4a5e; margin-top: 34px; padding-top: 20px;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: .84rem; color: #8ea0b4;
}

/* back to top */
.totop {
  position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--slate); color: #fff; border: 0; cursor: pointer; font-size: 1.1rem;
  display: grid; place-items: center; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 90;
}
.totop.show { opacity: 1; pointer-events: auto; }
.totop:hover { background: var(--orange-deep); transform: translateY(-3px); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .btn:hover, .mod-card:hover, .totop:hover { transform: none; }
}

/* print */
@media print {
  .nav, .totop, .progress, .quiz, .pager, footer { display: none !important; }
  body { font-size: 11pt; }
  .page-head { background: #fff; color: #000; border-bottom: 2px solid #000; }
  .page-head h1, .page-head p { color: #000; }
  .layout { grid-template-columns: 1fr; }
  .toc { display: none; }
}


/* ---------- link back to the main PITC website ---------- */
.nav-links > a.back-to-pitc {
  background: var(--slate); color: #fff !important; border-radius: 999px;
  padding: 9px 16px; font-weight: 700; margin-right: 6px;
}
.nav-links > a.back-to-pitc:hover { background: var(--orange-deep); color: #fff !important; text-decoration: none; }
@media (max-width: 980px) {
  .nav-links > a.back-to-pitc { text-align: center; justify-content: center; margin: 0 0 6px; }
}
footer .back-home {
  display: inline-block; margin-top: 14px; background: var(--orange); color: #1a1205 !important;
  padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: .88rem;
}
footer .back-home:hover { background: var(--orange-deep); color: #fff !important; text-decoration: none; }
