/* Adalia Academy: dark sci-fi theme
   One stylesheet for the whole site. Colours are defined once below. */

/* ---------- Fonts (stored on this site; licences in assets/fonts) ---------- */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Jura"; font-weight: 300; font-display: swap; src: url("../fonts/jura-300.woff2") format("woff2"); }
@font-face { font-family: "Jura"; font-weight: 400; font-display: swap; src: url("../fonts/jura-400.woff2") format("woff2"); }
@font-face { font-family: "Jura"; font-weight: 500; font-display: swap; src: url("../fonts/jura-500.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("../fonts/jetbrains-mono-500.woff2") format("woff2"); }

/* ---------- Colours and settings ---------- */

:root {
    color-scheme: dark;

    --bg: #080f1c;            /* deep space navy */
    --surface: #0e1828;       /* panels */
    --surface-2: #142236;     /* raised panels, hover */
    --border: #1f3048;
    --border-strong: #2c4566;
    --text: #e5edf6;
    --muted: #94a3b8;
    --accent: #38bdf8;        /* sky-blue: links, buttons, highlights */
    --accent-soft: rgba(56, 189, 248, 0.12);
    --on-accent: #04121c;

    /* Class colours, taken from the live Influence game client */
    --miner: #ff984f;
    --engineer: #ff564d;
    --merchant: #ffd94f;
    --scientist: #4f90ff;
    --pilot: #884fff;
    --pilot-text: #a67bff;    /* lighter Pilot purple, readable as small text */

    /* In-game crewmate card frame */
    --card-frame: #267590;
    --card-strip: #12242a;

    /* Crew action counts, as in the game's Objectives tabs */
    --action-ready: #00fff0;
    --action-ready-bg: #00403c;
    --action-progress: #57d5ff;
    --action-progress-bg: #1b5467;

    --up: #4ade80;
    --down: #ff564d;

    --font-head: "Jura", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

    --radius: 10px;
    --max-width: 1100px;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

/* Anything marked hidden stays hidden, even if its style sets display: flex or grid */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    color: var(--text);
    font: 16px/1.65 var(--font-body);
    /* Faint starfield and a soft glow at the top of the page */
    background-image:
        radial-gradient(1px 1px at 12% 18%, #ffffff55 50%, transparent 51%),
        radial-gradient(1px 1px at 72% 9%, #ffffff40 50%, transparent 51%),
        radial-gradient(1px 1px at 38% 62%, #ffffff30 50%, transparent 51%),
        radial-gradient(1px 1px at 88% 44%, #ffffff45 50%, transparent 51%),
        radial-gradient(1px 1px at 22% 88%, #ffffff35 50%, transparent 51%),
        radial-gradient(1px 1px at 58% 30%, #ffffff25 50%, transparent 51%),
        radial-gradient(1px 1px at 5% 50%, #ffffff30 50%, transparent 51%),
        radial-gradient(1px 1px at 94% 80%, #ffffff35 50%, transparent 51%),
        radial-gradient(900px 500px at 80% -10%, rgba(56, 189, 248, 0.10), transparent 70%);
    background-attachment: fixed;
}

main { flex: 1; }

/* Headings use Jura, light like the original Academy site:
   the largest headings are lightest, smaller ones a touch firmer to stay readable */
h1, h2, h3 {
    font-family: var(--font-head);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: 0.01em;
    margin: 0 0 0.5em;
}
h1 { font-size: clamp(30px, 5vw, 42px); font-weight: 300; }
h2 { font-size: 27px; margin-top: 1.4em; }
h3 { font-size: 21px; }

p { margin: 0 0 1em; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #7dd3fc; }

img { max-width: 100%; height: auto; }

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

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.block { padding-top: 48px; padding-bottom: 48px; }

.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.lede { color: var(--muted); font-size: 18px; max-width: 60ch; }

.label {
    display: inline-block;
    font: 500 12px/1 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 20;
    background: var(--accent);
    color: var(--on-accent);
    padding: 8px 12px;
    border-radius: 6px;
}
.skip-link:focus { left: 8px; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-block;
    font: 600 14px/1 var(--font-body);
    padding: 12px 18px;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--on-accent);
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow 0.2s, background-color 0.2s;
}
.btn:hover { color: var(--on-accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { color: var(--accent); background: var(--accent-soft); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; background: transparent; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ---------- Top bar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(8, 15, 28, 0.88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    /* Matches the brand logo file: Jura 500, letter-spacing 0.16em */
    font: 500 17px/1 var(--font-head);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.logo:hover { color: var(--text); }
.logo-accent { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; }
.site-nav a:hover, .site-nav a.is-active { color: var(--text); }
.site-nav a.is-active { box-shadow: inset 0 -2px 0 var(--accent); padding-bottom: 4px; }

/* Drop-down under a menu item (e.g. My Assets → Crews, Asteroids, Ships) */
.nav-group { position: relative; }
.nav-parent::after { content: "▾"; margin-left: 5px; font-size: 11px; color: var(--muted); }
.nav-submenu {
    display: none;
    position: absolute;
    left: -14px;
    top: 100%;
    z-index: 20;
    min-width: 170px;
    padding-top: 10px;            /* invisible bridge, so the menu stays open while the pointer moves down */
}
.nav-group:hover .nav-submenu,
.nav-group:focus-within .nav-submenu { display: block; }
.site-nav .nav-submenu a {
    display: block;
    padding: 11px 14px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-top-width: 0;
    color: var(--muted);
}
.site-nav .nav-submenu a:first-child { border-top-width: 1px; border-radius: var(--radius) var(--radius) 0 0; }
.site-nav .nav-submenu a:last-child { border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
.site-nav .nav-submenu a:hover { color: var(--accent); }
.site-nav .nav-submenu a.is-current { color: var(--text); }

.menu-toggle {
    display: none;
    margin-left: auto;
    font: 500 13px/1 var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 9px 12px;
    cursor: pointer;
}

/* ---------- Wallet login ---------- */

.wallet { position: relative; }
.wallet-button { font-family: var(--font-mono); font-weight: 500; }

.wallet-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 15;
    width: 300px;
    max-width: calc(100vw - 32px);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.wallet-menu-label { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.wallet-menu-label span { color: var(--text); }
.wallet-menu-address { font-size: 12px; word-break: break-all; color: var(--text); margin: 0 0 12px; }
.wallet-menu a,
.wallet-menu button {
    display: block;
    width: 100%;
    text-align: left;
    font: 500 14px/1 var(--font-body);
    color: var(--text);
    background: transparent;
    border: 0;
    border-top: 1px solid var(--border);
    padding: 11px 2px;
    cursor: pointer;
}
.wallet-menu a { text-decoration: none; }
.wallet-menu a:hover,
.wallet-menu button:hover { color: var(--accent); }

.wallet-dialog {
    width: min(440px, calc(100vw - 32px));
    padding: 22px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.wallet-dialog::backdrop { background: rgba(2, 6, 14, 0.7); backdrop-filter: blur(2px); }
.wallet-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wallet-dialog h2 { font-size: 24px; margin: 0; }
.dialog-close {
    font: 400 26px/1 var(--font-body);
    color: var(--muted);
    background: transparent;
    border: 0;
    padding: 4px 8px;
    cursor: pointer;
}
.dialog-close:hover { color: var(--text); }
.wallet-intro { font-size: 14px; color: var(--muted); margin: 10px 0 18px; }

.wallet-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.wallet-option-main {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    font: 500 15px/1.2 var(--font-body);
    color: var(--text);
    text-align: left;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}
button.wallet-option-main { cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
button.wallet-option-main:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wallet-option-main.is-unavailable { opacity: 0.6; }
.wallet-icon { width: 28px; height: 28px; flex: none; border-radius: 6px; }
.wallet-icon-blank {
    display: grid;
    place-items: center;
    font: 500 14px/1 var(--font-mono);
    color: var(--muted);
    border: 1px solid var(--border-strong);
}
.wallet-name { flex: 1; }
.wallet-tag {
    font: 500 11px/1 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
button.wallet-option-main .wallet-tag { color: var(--up); }
.wallet-help { font-size: 13px; color: var(--muted); margin: 6px 2px 0; }
.wallet-option-note { font-size: 13px; color: var(--muted); padding: 2px; }
.wallet-status { font-size: 14px; color: var(--accent); margin: 14px 0 0; min-height: 1em; }
.wallet-status:empty { display: none; }
.wallet-error { font-size: 14px; color: #ff8a84; margin: 14px 0 0; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

/* ---------- Hero ---------- */

.hero { padding: 72px 0 32px; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); max-width: 16ch; }
/* ---------- Panels with corner brackets ---------- */

.panel {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}
.panel::before, .panel::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border: 0 solid var(--accent);
    opacity: 0.8;
    pointer-events: none;
}
.panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-top-left-radius: var(--radius); }
.panel::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-bottom-right-radius: var(--radius); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card-link { color: inherit; text-decoration: none; transition: border-color 0.2s, transform 0.2s; }
.card-link:hover { color: inherit; border-color: var(--border-strong); transform: translateY(-2px); }
.card-link h3 { margin-top: 2px; }
.card-link p { color: var(--muted); margin: 0; font-size: 15px; }

.section-title { margin-bottom: 20px; }
.section-title h2 { margin: 0; }

/* ---------- Professor Grey's notes ---------- */

.prof-note {
    display: flex;
    gap: 20px;
    align-items: center;
    background: linear-gradient(135deg, rgba(79, 144, 255, 0.12), rgba(56, 189, 248, 0.05));
    border: 1px solid #23406e;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 24px 0;
    font-size: 18px;
    line-height: 1.55;
}
.prof-portrait {
    flex: none;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--scientist);
}
.prof-heading { font-family: var(--font-head); font-size: 22px; font-weight: 500; color: var(--scientist); letter-spacing: 0.04em; margin: 0 0 6px; }
.prof-note p:last-child { margin-bottom: 0; }

/* ---------- Class colours ---------- */

.chip {
    display: inline-block;
    font: 500 13px/1 var(--font-mono);
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid currentColor;
    background: color-mix(in srgb, currentColor 12%, transparent);
}
.chip.miner { color: var(--miner); }
.chip.engineer { color: var(--engineer); }
.chip.merchant { color: var(--merchant); }
.chip.scientist { color: var(--scientist); }
.chip.pilot { color: var(--pilot-text); border-color: var(--pilot); }

/* Crewmate cards, matching the in-game portrait style:
   the class colour fades up from near-black inside a thin teal frame */
.crew-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: var(--card-strip); border-radius: 4px; width: max-content; max-width: 100%; }
.crewmate-card {
    --class-colour: var(--miner);
    position: relative;
    width: 78px;
    height: 98px;
    border: 1px solid var(--card-frame);
    background: linear-gradient(180deg, #020304 0%, color-mix(in srgb, var(--class-colour) 55%, #000) 100%);
    overflow: hidden;
}
.crewmate-card.miner { --class-colour: var(--miner); }
.crewmate-card.engineer { --class-colour: var(--engineer); }
.crewmate-card.merchant { --class-colour: var(--merchant); }
.crewmate-card.scientist { --class-colour: var(--scientist); }
.crewmate-card.pilot { --class-colour: var(--pilot); }

/* ---------- My Assets ---------- */

.assets { display: grid; gap: 20px; margin-top: 28px; }
/* Filter buttons, e.g. All / Light Transports / Shuttles (one chosen at a time) */
.asset-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.filter-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: 500 12px/1 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 8px 14px;
    cursor: pointer;
}
.filter-button:hover { color: var(--text); }
.filter-button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.filter-button:disabled { opacity: 0.4; cursor: default; }
.filter-count { color: var(--text); }

.assets-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.assets-toolbar p { margin: 0; font-size: 13px; }
.assets-message h2 { margin-top: 0; }

.crew-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.crew-head h2 { margin: 0; font-size: 24px; }
.crew-head .label { margin: 0; }

/* Asteroid and ship panels: the game's card image beside a list of details */
.asset-body { display: grid; grid-template-columns: 150px 1fr; gap: 28px; align-items: start; margin-top: 18px; }
.asset-body .crew-details { border-top: 0; padding-top: 0; }
.asset-image { width: 150px; height: 200px; border-radius: 6px; background: var(--surface-2); }
.asset-bonuses { display: flex; flex-wrap: wrap; gap: 6px 18px; }
@media (max-width: 640px) {
    .asset-body { grid-template-columns: 1fr; }
}

.crew-body { display: grid; grid-template-columns: auto minmax(220px, 1fr); gap: 28px; align-items: start; margin: 18px 0; }
/* Always as wide as a full crew of five, so the "Good at" column lines up across crews */
.crew-row { display: grid; grid-template-columns: repeat(5, 104px); gap: 12px; }

.crew-strengths-title {
    font: 500 12px/1 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 4px 0 10px;
}
.crew-strengths ul { list-style: none; margin: 0; padding: 0; }
.crew-strengths li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    cursor: help;
}
.crew-strengths li:last-child { border-bottom: 0; }
.strength-bonus { font-family: var(--font-mono); color: var(--up); white-space: nowrap; }

@media (max-width: 900px) {
    .crew-body { grid-template-columns: 1fr; }
}
/* Phones: fit as many cards per row as the screen allows */
@media (max-width: 640px) {
    .crew-row { grid-template-columns: repeat(auto-fill, 104px); }
}
.crewmate { margin: 0; width: 104px; }
.crewmate .crewmate-card { width: 104px; height: 130px; display: grid; place-items: end center; }
.crewmate .crewmate-card img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.crewmate-initial { font: 300 40px/1 var(--font-head); color: var(--text); align-self: center; }
.crewmate figcaption { display: grid; margin-top: 8px; justify-items: start; }
/* One line each for first name and surname, so every class badge lines up */
.crewmate-name {
    display: block;
    width: 100%;
    min-height: 1.3em;
    font-size: 14px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.crewmate-first { font-size: 16px; }
.crewmate-collection {
    display: block;
    width: 100%;
    min-height: 1.5em;
    margin-top: 4px;
    font: 500 12px/1.5 var(--font-body);   /* narrower than the mono font, so "Arvad Specialist" fits the card */
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Class badge: full card width, square corners, centred text */
.crewmate .chip { justify-self: stretch; text-align: center; border-radius: 0; font-size: 11px; padding: 5px 8px; margin-top: 6px; }

.crew-details { display: grid; gap: 10px; margin: 0; border-top: 1px solid var(--border); padding-top: 14px; }
.crew-detail { display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: center; }
.crew-detail dt { font: 500 12px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.crew-detail dd { margin: 0; }

.status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.status.is-ready::before { background: var(--up); box-shadow: 0 0 8px var(--up); }
.status.is-busy::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.action-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.action-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; font: 500 12px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.action-count { color: var(--text); }
.action-pill.is-ready { background: var(--action-ready-bg); color: var(--action-ready); }
.action-pill.is-progress { background: var(--action-progress-bg); color: var(--action-progress); }
.action-pill.is-none { background: var(--surface-2); color: var(--muted); }
.action-pill.is-none .action-count { color: var(--muted); }

.food { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.food-bar { width: 160px; height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.food-bar span { display: block; height: 100%; border-radius: inherit; }
.food-bar.is-fed span { background: var(--up); }
.food-bar.is-rationing span { background: #f5b84a; }
.food-bar.is-starving span { background: var(--down); }
.food-bar.is-hold span { background: var(--accent); }    /* ship cargo and propellant */
.food-text { font-size: 14px; }
.food-text.is-rationing { color: #f5b84a; }
.food-text.is-starving { color: #ff8a84; }

/* ---------- Tutor crews (Training Ground page) ---------- */

.tutorial-crews-box { margin-top: 40px; }
.tutorial-crews-box h2 { margin: 4px 0 6px; }
.tutorial-crews { display: grid; gap: 28px; margin-top: 18px; }    /* "Available now" above "Currently hired" */
.tutor-group .label { display: block; margin: 0 0 10px; }
.tutor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tutorial-crew { display: grid; gap: 12px; align-content: start; }
.tutorial-crew h3 { margin: 0; font-size: 20px; }
.tutorial-crew-classes { display: flex; flex-wrap: wrap; gap: 6px; }
.tutorial-crew-classes .chip { font-size: 11px; padding: 5px 8px; }
.tutorial-crew-terms { margin: 0; font-size: 13px; color: var(--text); }
.tutorial-crew .status { margin: 0; font-size: 14px; }
.tutorial-crew .btn { justify-self: start; }

/* ---------- Guide and section pages ---------- */

.with-sidebar {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 48px;
    align-items: start;
}
.sidebar { position: sticky; top: 88px; font-size: 14px; }
.sidebar-heading {
    font: 600 12px/1 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}
.sidebar a {
    display: block;
    color: var(--muted);
    text-decoration: none;
    padding: 6px 10px;
    border-left: 2px solid var(--border);
}
.sidebar a:hover { color: var(--text); }
.sidebar a.is-active { color: var(--text); border-left-color: var(--accent); background: var(--accent-soft); }
.sidebar .mono { font-size: 12px; opacity: 0.7; line-height: inherit; }
/* Number in its own column, so a title that wraps lines up under its first word, not under the number */
.sidebar a, .sidebar-planned { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: baseline; }

.content { max-width: 72ch; }

/* Guide pages */
.sidebar-planned { display: block; padding: 6px 10px; color: var(--muted); opacity: 0.55; border-left: 2px solid var(--border); }
.guide-checked { font-size: 12px; color: var(--muted); margin: -6px 0 28px; letter-spacing: 0.06em; }
.prose h2 { font-size: 24px; margin: 1.8em 0 0.5em; }
.prose .prof-note { margin: 28px 0; }
.guide-sources { margin-top: 48px; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.guide-sources .label { margin-bottom: 8px; }
.guide-sources ul { margin: 0 0 10px; }
.guide-sources p.muted { margin: 0; font-size: 14px; }
.guide-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; }
.guide-nav-link { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); max-width: 48%; }
.guide-nav-link:hover { border-color: var(--accent); color: var(--text); }
.guide-nav-link .label { margin: 0; }
.guide-nav-link.is-next { text-align: right; margin-left: auto; }

.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }

.guide-list { list-style: none; counter-reset: guide; padding: 0; margin: 24px 0 0; border-top: 1px solid var(--border); }
.guide-list li {
    counter-increment: guide;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
ol.guide-list li::before {
    content: counter(guide, decimal-leading-zero);
    font: 500 12px/1 var(--font-mono);
    color: var(--muted);
    width: 24px;
}
.guide-list li > span:first-of-type { color: var(--muted); }
.guide-list.compact { border-top: 0; margin-top: 8px; }
.guide-list.compact li { padding: 6px 0; font-size: 15px; border-bottom: 0; gap: 10px; }
/* The site's bullets: small sky-blue squares. "prose" marks the main text of a
   guide or article; its ordinary bulleted lists get them automatically. */
.prose ul { list-style: none; padding-left: 0; }
.prose ul li { position: relative; padding-left: 18px; margin: 6px 0; }
.prose ul li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.65em;
    width: 5px;
    height: 5px;
    background: var(--accent);
}

/* The same bullets on the All guides page, so the guides stand apart from the section description */
ul.guide-list.compact li::before {
    content: "";
    flex: none;
    width: 5px;
    height: 5px;
    background: var(--accent);
}

.badge {
    margin-left: auto;
    flex: none;
    font: 500 11px/1 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 5px 9px;
}

.catalogue { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 32px; }
.catalogue h2 { font-size: 22px; margin: 0 0 6px; }
.catalogue h2 a { color: var(--text); text-decoration: none; }
.catalogue h2 a:hover { color: var(--accent); }
.catalogue .count { font-size: 12px; color: var(--muted); margin: 12px 0 0; }

/* ---------- Tables ---------- */

table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
th { font: 600 12px/1.2 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
td.num { font-family: var(--font-mono); }
.up { color: var(--up); }
.down { color: var(--down); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; padding: 28px 0; margin-top: 40px; }
.site-footer strong { color: var(--text); }
.site-footer p { margin: 0 0 6px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--text); }

/* ---------- Phones and small screens ---------- */

@media (max-width: 800px) {
    .menu-toggle { display: inline-block; }
    .topbar-inner { flex-wrap: wrap; }
    .site-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 8px 0 18px;
    }
    .site-nav.is-open { display: flex; }
    .wallet-menu { left: 0; right: auto; }
    /* Phone menu: no hovering, so the sub-items are always listed, indented */
    .nav-parent::after { content: none; }
    .nav-submenu { display: block; position: static; min-width: 0; padding: 10px 0 0 16px; }
    .site-nav .nav-submenu a { padding: 6px 0; background: none; border: 0; box-shadow: none; }

    .with-sidebar { grid-template-columns: 1fr; gap: 24px; }
    .sidebar { position: static; order: 2; }

    .hero { padding-top: 48px; }
}

/* Narrow phones: the Professor's portrait sits above his message */
@media (max-width: 520px) {
    .prof-note { flex-direction: column; align-items: flex-start; }
    .prof-portrait { width: 104px; height: 104px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
