/* Singapore Study Hub: friendly, rounded, illustration-led. Small on purpose (no frameworks, no web fonts). */
:root {
  --bg: #fffdf8; --bg2: #f1f8f6; --surface: #fff; --text: #1b2433; --muted: #596377; --line: #e4e9e7;
  --brand: #0b7a70; --brand-ink: #fff; --brand-soft: #dff5f1; --sun: #ffc83d; --sun-soft: #fff3cf; --coral: #ff7a59; --sky: #4cb8ff;
  --warn: #9a5b00; --warn-soft: #fff1cc; --bad: #c0352b; --bad-soft: #fde7e4; --good: #1a7f43; --good-soft: #def7e6;
  --radius: 18px; --radius-sm: 12px; --shadow: 0 1px 2px rgba(20, 40, 60, .06), 0 8px 24px rgba(20, 40, 60, .07);
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1517; --bg2: #11201f; --surface: #15221f; --text: #e8f0ee; --muted: #9db0aa; --line: #263632; --brand: #2dd4bf; --brand-ink: #032b26; --brand-soft: #12403b; --sun-soft: #3a2f0c; --warn: #fbbf24; --warn-soft: #3a2c08; --bad: #ff8a80; --bad-soft: #3d1c19; --good: #5ee08d; --good-soft: #123a22; --shadow: 0 1px 0 rgba(255, 255, 255, .04); }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.75 var(--font); color: var(--text); background: var(--bg); -webkit-text-size-adjust: 100%; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
a { color: var(--brand); text-underline-offset: 3px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 9; border-radius: 8px; }

/* header */
.site-header { background: rgba(7, 18, 43, .92); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255, 255, 255, .08); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; gap: 14px; min-height: 62px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: #fff; text-decoration: none; letter-spacing: -.01em; }
.logo { width: 36px; height: 36px; flex: none; transition: transform .3s; }
.brand:hover .logo { transform: rotate(-8deg) scale(1.06); }
.nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav a { padding: 7px 13px; border-radius: 999px; color: rgba(255, 255, 255, .72); text-decoration: none; font-size: 15px; font-weight: 600; transition: background .2s, color .2s; }
.nav a:hover, .nav a.active { background: rgba(255, 255, 255, .12); color: #fff; }
.lang { display: flex; border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; overflow: hidden; background: transparent; }
.lang a { padding: 4px 13px; font-size: 14px; text-decoration: none; color: rgba(255, 255, 255, .72); font-weight: 600; }
.lang a.on { background: #fff; color: #07122b; }
main { padding-top: 30px; padding-bottom: 64px; flex: 1 0 auto; width: 100%; }

/* type */
h1 { font-size: clamp(1.8rem, 4.4vw, 2.7rem); line-height: 1.2; margin: 0 0 12px; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 1.45rem; margin: 2.2rem 0 .7rem; line-height: 1.3; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 .4rem; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 46em; }
.muted { color: var(--muted); font-size: .92rem; }

/* hero */
.hero { display: grid; gap: 18px; grid-template-columns: 1.1fr .9fr; align-items: center; padding: 14px 0 6px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--sun) 62%, var(--sun) 92%, transparent 92%); padding: 0 .1em; }
.hero-art { width: 100%; height: auto; max-height: 420px; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } .hero-art { order: -1; max-height: 260px; } }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; padding: 0; list-style: none; }
.chips li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: .88rem; color: var(--muted); }

/* cards */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
a.card { color: inherit; text-decoration: none; display: block; transition: transform .22s ease, box-shadow .22s ease, border-color .22s; }
a.card:hover { transform: translateY(-4px); border-color: var(--brand); box-shadow: 0 14px 34px rgba(20, 60, 60, .13); }
a.card:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.card h3 { margin: 0 0 6px; } .card p { margin: 0; color: var(--muted); font-size: .96rem; }
.tool-card .ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; font-size: 24px; margin-bottom: 12px; background: var(--brand-soft); transition: transform .3s; }
.tool-card:nth-child(3n+2) .ico { background: var(--sun-soft); } .tool-card:nth-child(3n) .ico { background: var(--bad-soft); }
.tool-card:hover .ico { transform: scale(1.12) rotate(-6deg); }
.band { background: var(--bg2); border-radius: 28px; padding: 8px 22px 28px; margin: 34px 0; }

/* buttons, forms */
.btn { display: inline-block; padding: 11px 22px; border-radius: 999px; border: 0; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .2s, background .2s; box-shadow: 0 4px 14px rgba(11, 122, 112, .28); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(11, 122, 112, .32); } .btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--brand); border: 2px solid var(--brand); box-shadow: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.stack { display: grid; gap: 14px; }
.fields { display: grid; gap: 14px 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
label { display: grid; gap: 4px; font-weight: 600; font-size: .95rem; }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); transition: border-color .2s; }
input:hover, select:hover, textarea:hover { border-color: var(--brand); }
textarea { min-height: 120px; resize: vertical; }
.err { color: var(--bad); font-weight: 600; font-size: .9rem; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 18px; }
.tabs a { padding: 6px 15px; border-radius: 999px; border: 1.5px solid var(--line); text-decoration: none; color: var(--muted); font-size: .95rem; font-weight: 600; background: var(--surface); transition: all .2s; }
.tabs a:hover { border-color: var(--brand); color: var(--text); }
.tabs a.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.notice { background: var(--warn-soft); border-left: 5px solid var(--sun); padding: 11px 16px; border-radius: 10px; margin: 14px 0; font-size: .95rem; }
.notice.ok { background: var(--brand-soft); border-color: var(--brand); }
.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--text); white-space: nowrap; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; font-size: .95rem; }
th, td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--brand-soft); font-weight: 700; } tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }
.meter { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; } .meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #14b8a6); border-radius: 999px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.meter.unknown > i { background: repeating-linear-gradient(45deg, var(--line), var(--line) 6px, var(--muted) 6px, var(--muted) 8px); width: 100% !important; opacity: .5; }
.dims { display: grid; gap: 14px; } .dim { display: grid; gap: 4px; } .dim .top { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.page-head { margin-bottom: 8px; }

/* articles */
.article { max-width: 46em; } .article img { max-width: 100%; }
.article .anchor { display: none; }
.article h2 { padding-top: .5rem; border-top: 1px solid var(--line); }
.article blockquote { margin: 1rem 0; padding: .2rem 1rem; border-left: 4px solid var(--sun); color: var(--muted); }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 20px; margin: 18px 0; } .toc ol { margin: 6px 0 0; padding-left: 1.2rem; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 8px; } .crumbs a { color: var(--muted); }
.copybox { width: 100%; min-height: 220px; font: 13px/1.5 ui-monospace, Consolas, monospace; }
.msg { border-bottom: 1px solid var(--line); padding: 12px 0; } .msg:last-child { border: 0; } .msg b { margin-right: 8px; }
.site-footer { margin-top: 56px; flex: none; border-top: 1px solid var(--line); padding: 24px 0 44px; color: var(--muted); font-size: .9rem; background: var(--bg2); }
.site-footer a { color: var(--muted); }
.pager { margin-top: 16px; } .pager nav { display: flex; gap: 8px; flex-wrap: wrap; } .pager svg { width: 18px; height: 18px; }

/* practice */
.stage-card { text-align: left; }
.stage-card .emoji { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; font-size: 30px; background: var(--sun-soft); margin-bottom: 10px; transition: transform .3s; }
.stage-card:hover .emoji { transform: scale(1.15) rotate(-8deg); }
.stage-card[data-stage="primary"] .emoji, .stage-card[data-stage="preuni"] .emoji { background: var(--brand-soft); }
.stage-card[data-stage="secondary"] .emoji, .stage-card[data-stage="master"] .emoji { background: var(--bad-soft); }
.quiz-bar { position: sticky; top: 62px; z-index: 3; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); padding: 10px 0; display: grid; gap: 4px; }
.question { margin: 16px 0; border: 1px solid var(--line); }
.q-no { float: left; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 800; margin-right: 12px; padding: 0; }
.q-text { margin: 0 0 14px; font-size: 1.08rem; font-weight: 600; overflow: hidden; }
.options { display: grid; gap: 10px; }
.option { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 2px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; transition: transform .15s, border-color .2s, background .2s; }
.option:hover { border-color: var(--brand); transform: translateX(3px); }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
.letter { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); font-weight: 800; font-size: .9rem; }
.option.is-correct { border-color: var(--good); background: var(--good-soft); animation: pop .4s ease; }
.option.is-wrong { border-color: var(--bad); background: var(--bad-soft); animation: shake .4s ease; }
.option:has(input:disabled) { cursor: default; } .option:has(input:disabled):hover { transform: none; }
.feedback { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: .96rem; animation: rise .35s ease; }
.feedback.good { background: var(--good-soft); } .feedback.bad { background: var(--bad-soft); }
.feedback .verdict { display: block; }
.result { position: relative; overflow: hidden; text-align: center; padding: 30px 20px; margin-top: 22px; }
.result.pop { animation: pop .5s ease; }
.score { font-size: 3rem; font-weight: 800; margin: 0; color: var(--brand); line-height: 1.1; }
.skills { list-style: none; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.skills li { background: var(--brand-soft); border-radius: 999px; padding: 3px 14px; font-weight: 600; }
.result .row { justify-content: center; margin-top: 12px; }
.burst i { position: absolute; top: 40px; left: 50%; width: 10px; height: 10px; border-radius: 3px; opacity: 0; }
.result.pop .burst i { animation: burst 1.1s ease-out forwards; }
.burst i:nth-child(1) { background: var(--sun); --x: -140px; --y: -20px; } .burst i:nth-child(2) { background: var(--coral); --x: -90px; --y: 40px; }
.burst i:nth-child(3) { background: var(--sky); --x: -40px; --y: -50px; } .burst i:nth-child(4) { background: var(--brand); --x: 30px; --y: 50px; }
.burst i:nth-child(5) { background: var(--sun); --x: 80px; --y: -40px; } .burst i:nth-child(6) { background: var(--coral); --x: 130px; --y: 30px; }
.burst i:nth-child(7) { background: var(--sky); --x: 170px; --y: -30px; } .burst i:nth-child(8) { background: var(--brand); --x: -170px; --y: 30px; }

/* motion: purposeful, short, and off when the visitor asks for less */
.js .reveal:not(.in) { opacity: 0; transform: translateY(16px); animation: force-in .01s 2.2s forwards; }
.reveal { transition: opacity .55s ease var(--d, 0ms), transform .55s ease var(--d, 0ms); }
@keyframes force-in { to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.96); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes burst { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(260deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(14px); } }
@keyframes twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes fly { 0%, 100% { transform: translate(0, 0) rotate(-8deg); } 50% { transform: translate(14px, -14px) rotate(-2deg); } }
.hero-art .plane { animation: fly 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.hero-art .sun { animation: bob 6s ease-in-out infinite; }
.hero-art .cloud { animation: drift 9s ease-in-out infinite; } .hero-art .cloud.b { animation-duration: 12s; animation-delay: -4s; }
.hero-art .star { animation: twinkle 2.6s ease-in-out infinite; } .hero-art .star.b { animation-delay: -1.1s; } .hero-art .star.c { animation-delay: -1.8s; }
.hero-art .book { animation: bob 7s ease-in-out infinite; animation-delay: -2s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal:not(.in) { opacity: 1; transform: none; }
}
@media print {
  .site-header, .site-footer, .noprint { display: none !important; }
  body { background: #fff; color: #000; } .card, table { box-shadow: none; }
}
@media (max-width: 640px) { .nav { order: 3; flex-basis: 100%; } .bar { gap: 8px; padding-top: 6px; padding-bottom: 6px; } .quiz-bar { top: 96px; } }

/* planner wizard */
.wizard { display: grid; gap: 16px; max-width: 46rem; }
.wiz-head { display: grid; gap: 6px; position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 8px 0; }
.wiz-step { display: grid; gap: 28px; padding: 24px 22px 26px; scroll-margin-top: 80px; outline: none; animation: wiz-in .3s ease both; }
@keyframes wiz-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wiz-step { animation: none; } }
.wizard .field { display: grid; gap: 10px; }
.q-title { font-size: 1.28rem; font-weight: 800; line-height: 1.35; }
.wizard .field-note { color: var(--brand); font-weight: 600; }
.wiz-nav { display: flex; gap: 10px; justify-content: space-between; position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); padding: 18px 0 12px; z-index: 2; }
.wiz-nav .btn { flex: 1 1 0; max-width: 14rem; text-align: center; padding: 13px 22px; }
.wiz-nav .btn:only-child { margin-left: auto; }
.wizard .wiz-foot { margin: 0; font-size: .85rem; text-align: center; }
.wizard .linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.wizard [hidden] { display: none !important; }

/* answer cards (options with a short explanation) */
.choices { display: grid; gap: 10px; }
.choice { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 2px; align-items: start; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-weight: 400; transition: border-color .2s, background .2s, transform .15s; }
.choice:hover { border-color: var(--brand); transform: translateY(-1px); }
.choice input { width: 1.1rem; height: 1.1rem; margin-top: 4px; grid-row: 1 / span 2; accent-color: var(--brand); }
.choice-t { font-weight: 700; font-size: 1.02rem; }
.choice-d { color: var(--muted); font-size: .92rem; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice:has(input:focus-visible), .pill-opt:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }

/* pills (short options) */
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-opt { display: grid; justify-items: center; align-content: center; min-width: 4.6rem; padding: 10px 18px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-weight: 700; transition: border-color .2s, background .2s, transform .15s; text-align: center; line-height: 1.3; }
.pill-opt:hover { border-color: var(--brand); transform: translateY(-1px); }
.pill-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill-s { font-size: .76rem; font-weight: 400; color: var(--muted); }
.pill-opt:has(input:checked) { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.pill-opt:has(input:checked) .pill-s { color: inherit; opacity: .85; }
.pills-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); }
.pills-grade .pill-opt { border-radius: var(--radius-sm); }

/* year stepper */
.stepper { display: inline-grid; grid-template-columns: auto 8rem auto; gap: 10px; align-items: center; }
.stepper input { text-align: center; font-size: 1.5rem; font-weight: 800; padding: 10px 8px; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-btn { width: 3rem; height: 3rem; border-radius: 50%; border: 2px solid var(--brand); background: var(--surface); color: var(--brand); font-size: 1.5rem; font-weight: 700; line-height: 1; cursor: pointer; transition: background .2s, color .2s; }
.step-btn:hover { background: var(--brand); color: var(--brand-ink); }
.step-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* sliders */
.slider-box { display: grid; gap: 10px; }
.slider-out { font-size: 1.5rem; font-weight: 800; color: var(--brand); min-height: 2.2rem; display: block; }
.slider-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; }
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 999px; background: var(--line); padding: 0; border: 0; cursor: pointer; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); border: 4px solid var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); border: 4px solid var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.slider:focus-visible { outline: 3px solid var(--brand); outline-offset: 6px; }
.slider-num, .num-input { max-width: 14rem; font-size: 1.1rem; }

/* helper text */
.help { font-size: .93rem; }
.help summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.help p { margin: 6px 0 0; color: var(--muted); }
.wizard:not(.is-wizard) .wiz-step { margin-bottom: 14px; }
.wizard:not(.is-wizard) .wiz-nav { position: static; }

/* paired number fields (score and full mark) sit side by side */
.wiz-step:has([data-field="score_value"]) { grid-template-columns: 1fr 1fr; align-items: start; }
.wiz-step:has([data-field="score_value"]) .field-note { grid-column: 1 / -1; }
@media (max-width: 520px) { .wiz-step { padding: 20px 16px 22px; } .q-title { font-size: 1.15rem; } .wiz-step:has([data-field="score_value"]) { grid-template-columns: 1fr; } }

/* mobile header: one row (logo, name, language, menu); links open in a dropdown */
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .bar { flex-wrap: nowrap; gap: 10px; min-height: 56px; }
  .brand { min-width: 0; font-size: 16px; }
  .brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lang { margin-left: auto; flex: none; }
  .lang a { padding: 4px 11px; }
  .js .nav-toggle { display: grid; gap: 4px; place-content: center; width: 40px; height: 40px; flex: none; background: transparent; border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px; cursor: pointer; }
  .nav-toggle span { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
  .site-header.open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .site-header.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-header.open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .js .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 2px; padding: 8px 16px 14px; background: #07122b; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .js .site-header.open .nav { display: flex; }
  .nav a { padding: 12px 14px; font-size: 16px; border-radius: 12px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { white-space: nowrap; flex: none; }
}

main:not(.wrap) + .site-footer { margin-top: 0; }

/* wide tables in articles scroll sideways on phones instead of crushing their columns */
@media (max-width: 640px) {
  .article table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .article th, .article td { min-width: 8.5em; }
}
