:root {
    --ink: #1a1a1a;
    --paper: #fbf8f3;
    --rule: #d8cfbf;
    --accent: #8b3a2a;
    --muted: #6b6557;
    --ok: #2f7a3f;
    --warn: #b07a16;
    --err: #a83232;
}

* { box-sizing: border-box; }

body {
    font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
    background: var(--paper);
    color: var(--ink);
    margin: 0;
    line-height: 1.55;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 1.2rem 2rem;
    border-bottom: 1px solid var(--rule);
}

.brand {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0.02em;
}

nav a, nav .who, nav button.link {
    margin-left: 1.2rem;
    color: var(--accent);
    text-decoration: none;
}
nav .who { color: var(--muted); }

button.link {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

main {
    max-width: 760px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

footer {
    margin-top: 4rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

h1, h2, h3 {
    font-family: "Iowan Old Style", Georgia, serif;
    color: var(--ink);
}

h1 { margin-top: 0; }

.hero {
    margin-bottom: 3rem;
}

.cta {
    display: inline-block;
    background: var(--accent);
    color: var(--paper);
    padding: 0.5rem 1.1rem;
    border-radius: 3px;
    text-decoration: none;
}

.passages {
    list-style: none;
    padding: 0;
}
.passages li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--rule);
}
.passages a {
    color: var(--ink);
    text-decoration: none;
}
.passages a strong { color: var(--accent); }
.meta {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    font-style: italic;
}

.passage .text, .attempt .text {
    background: #fff;
    border: 1px solid var(--rule);
    padding: 1rem 1.2rem;
    white-space: pre-wrap;
    font-family: Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.7;
}

.passage-form, .auth {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 1rem 0 2rem;
}
.passage-form label, .auth label {
    display: flex;
    flex-direction: column;
    font-size: 0.95rem;
    color: var(--muted);
}
.passage-form input, .passage-form select, .passage-form textarea,
.auth input {
    margin-top: 0.2rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--rule);
    background: #fff;
    font: inherit;
    color: var(--ink);
}
.passage-form textarea {
    font-family: Georgia, serif;
    line-height: 1.6;
}
button[type=submit] {
    align-self: flex-start;
    background: var(--accent);
    color: var(--paper);
    border: none;
    padding: 0.55rem 1.1rem;
    cursor: pointer;
    font: inherit;
}

.error {
    background: #fbeaea;
    border-left: 3px solid var(--err);
    padding: 0.6rem 0.9rem;
    color: var(--err);
}

.grade {
    margin-top: 2rem;
    border-top: 2px solid var(--rule);
    padding-top: 1.5rem;
}
.grade .score {
    float: right;
    color: var(--accent);
    font-size: 1rem;
}
.grade .overall {
    font-style: italic;
    background: #fff;
    border-left: 3px solid var(--accent);
    padding: 0.7rem 1rem;
}

.segments {
    list-style: decimal;
    padding-left: 1.5rem;
}
.seg {
    margin: 1rem 0;
    padding: 0.7rem 1rem;
    border-left: 3px solid var(--rule);
    background: #fff;
}
.seg-match, .seg-faithful { border-left-color: var(--ok); }
.seg-stylistic, .seg-loose { border-left-color: var(--warn); }
.seg-error { border-left-color: var(--err); }
.seg-row {
    margin: 0.2rem 0;
}
.seg-row .label {
    display: inline-block;
    min-width: 6rem;
    color: var(--muted);
    font-style: italic;
    font-size: 0.9rem;
}
.seg .rationale {
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}
