@font-face {
    font-family: "Syne";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/syne-500.woff2") format("woff2");
}

@font-face {
    font-family: "Syne";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/syne-700.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Sans";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Sans";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
}

:root {
    color-scheme: dark;
    --bg: #090a0c;
    --lift: #12141a;
    --ink: #f3f1ec;
    --dim: #8e96a3;
    --line: rgba(243, 241, 236, 0.1);
    --accent: #e4b15a;
    --ok: #9dba8a;
    --err: #e07a68;
    --term: #07080a;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

h1, h2, .brand, .name {
    font-family: "Syne", "Segoe UI", sans-serif;
    letter-spacing: -0.04em;
}

h1 {
    margin: 0;
    font-size: clamp(3.2rem, 7.4vw, 5.8rem);
    line-height: 0.95;
    font-weight: 700;
}

h2 {
    margin: 2rem 0 0.45rem;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

p { margin: 0.75rem 0; }

a { color: inherit; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }

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

.frame {
    width: min(68rem, calc(100% - 3rem));
    margin-inline: auto;
}

.top {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(9, 10, 12, 0.92);
    border-bottom: 1px solid var(--line);
}

.bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem 1.5rem;
    min-height: 4rem;
}

.brand {
    display: flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
}

.brand img {
    height: 6.25rem;
    width: auto;
    display: block;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1.35rem;
}

.nav a,
.nav .linkish {
    color: var(--dim);
    text-decoration: none;
    font-size: 0.95rem;
}

.nav a:hover,
.nav a[aria-current="page"],
.nav .linkish:hover {
    color: var(--ink);
}

.nav a[aria-current="page"] { color: var(--accent); }

.nav form { margin: 0; }

.linkish {
    background: transparent;
    border: 0;
    padding: 0;
    border-radius: 0;
    font: inherit;
    cursor: pointer;
}

.page { padding: 4.5rem 0 5rem; }

.sheet { max-width: 68rem; }
.narrow { max-width: 32rem; }

.kicker {
    margin: 0 0 0.85rem;
    color: var(--accent);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { color: var(--ink); }

.lede {
    max-width: 34rem;
    margin: 1.15rem 0 0;
    color: var(--dim);
    font-size: 1.12rem;
    font-weight: 400;
    font-style: normal;
    line-height: 1.5;
}

.home { padding-top: 1.5rem; }

.follow { color: var(--dim); margin-top: 1.4rem; }

.actions {
    display: flex;
    align-items: center;
    gap: 1.35rem;
    margin-top: 1.7rem;
}

a.primary {
    display: inline-block;
    background: var(--accent);
    color: #14110c;
    text-decoration: none;
    border-radius: 8px;
    padding: 0.65rem 1.05rem;
    font-weight: 500;
}

a.primary:hover { color: #14110c; }

a.quiet {
    color: var(--dim);
    text-decoration: none;
}

a.quiet:hover { color: var(--ink); }

.sommaire {
    list-style: none;
    margin: 3rem 0 0;
    padding: 0;
    border-top: 1px solid var(--line);
}

.sommaire a {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr) auto;
    gap: 0.15rem 1.25rem;
    align-items: center;
    padding: 1.15rem 0.85rem;
    margin: 0 -0.85rem;
    border-bottom: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
}

.sommaire a:hover { background: var(--lift); }
.sommaire a:hover .go { color: var(--accent); }

.num, .mono, .state, .levels td.num, td.num, .go {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.num { color: var(--dim); font-size: 0.85rem; }
.copy { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.name { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.desc { color: var(--dim); font-family: "IBM Plex Sans", "Segoe UI", sans-serif; font-size: 0.95rem; letter-spacing: 0; }
.go {
    color: var(--dim);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.specimen { margin: 3.5rem 0 0; max-width: 36rem; }
.specimen figcaption,
.doc-nav {
    color: var(--dim);
    font-size: 0.85rem;
    margin-bottom: 0.55rem;
}

.specimen pre,
.specimen-inline {
    margin: 0;
    background: var(--term);
    color: var(--ink);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.92rem;
    line-height: 1.6;
    padding: 1.1rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow-x: auto;
}

.specimen-inline { display: block; margin: 1.1rem 0; }

.ps1 { color: var(--accent); }

label {
    display: block;
    margin: 1.15rem 0 0.4rem;
    color: var(--dim);
    font-size: 0.92rem;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: var(--lift);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.7rem 0.8rem;
}

input:disabled { color: var(--dim); }

.check {
    display: flex;
    gap: 0.6rem;
    align-items: baseline;
    margin-top: 1.2rem;
    color: var(--ink);
}

.check input { margin: 0; }

button.primary {
    margin-top: 1.5rem;
    background: var(--accent);
    color: #14110c;
    border: 0;
    border-radius: 8px;
    padding: 0.65rem 1.1rem;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

button.primary:disabled {
    cursor: default;
    opacity: 0.4;
}

.form-error { color: var(--err); }
.field-error { color: var(--err); margin: 0.35rem 0 0; font-size: 0.92rem; }
.notice { color: var(--ok); }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.8rem;
}

th, td {
    text-align: left;
    font-weight: 400;
    padding: 0.8rem 1rem 0.8rem 0;
    border-bottom: 1px solid var(--line);
    vertical-align: baseline;
}

th {
    color: var(--dim);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

table.levels { width: 100%; }
.state { color: var(--dim); }

.doc {
    display: grid;
    grid-template-columns: 12rem minmax(0, 68ch);
    gap: 3rem;
    align-items: start;
}

.doc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0.35rem 0 0;
    position: sticky;
    top: 5.5rem;
}

.doc-nav a { text-decoration: none; color: var(--dim); }
.doc-nav a:hover { color: var(--ink); }

.prose p { max-width: 68ch; }

.foot {
    border-top: 1px solid var(--line);
    color: var(--dim);
    padding: 1.2rem 0 1.8rem;
    font-size: 0.9rem;
}

.play h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); }

.play-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
    gap: 1.5rem 2rem;
    align-items: start;
    margin-top: 1.8rem;
}

.term {
    background: var(--term);
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 22rem;
    display: flex;
    flex-direction: column;
}

.term:focus-within { outline: 1px solid var(--accent); }

.term-log {
    flex: 1;
    min-height: 16rem;
    max-height: 28rem;
    overflow: auto;
    padding: 1rem 1rem 0.4rem;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.term-log .err { color: var(--err); }
.term-log .cmd { margin-top: 0.35rem; }

.term-form {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 1rem 0.85rem;
}

.term-form input[type="text"] {
    width: auto;
    flex: 1;
    margin: 0;
    padding: 0.2rem 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.9rem;
}

.term-form input[type="text"]:focus { outline: none; }

.side .follow { margin-top: 1.2rem; }

.hints {
    margin: 1.2rem 0 0;
    padding-left: 1.2rem;
}

.hints li { margin: 0.35rem 0; }

button.quiet {
    margin-top: 1rem;
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--dim);
    font: inherit;
    cursor: pointer;
}

button.quiet:hover { color: var(--ink); }

.debrief {
    margin-top: 2.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--line);
}

.debrief h2 {
    margin: 1.3rem 0 0.35rem;
    font-size: 1.25rem;
}

.debrief p { max-width: 68ch; }

@media (max-width: 720px) {
    .frame { width: min(68rem, calc(100% - 2rem)); }
    .page { padding-top: 2.6rem; }
    .bar { min-height: 3.5rem; align-items: center; flex-direction: row; padding: 0.35rem 0; }
    .brand img { height: 3.4rem; }
    .sommaire a { grid-template-columns: 2.4rem minmax(0, 1fr); }
    .go { grid-column: 2; }
    .play-grid { grid-template-columns: 1fr; }
    .doc { grid-template-columns: 1fr; gap: 0.8rem; }
    .doc-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 0.45rem 1rem; }
}
