:root {
    --bg: #1a1512;
    --bg-alt: #241d18;
    --fg: #d9cfc0;
    --fg-dim: #8f8172;
    --accent: #b8873f;
    --accent-dim: #6e5233;
    --border: #3a2f27;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background:
        linear-gradient(rgba(26, 21, 18, 0.88), rgba(26, 21, 18, 0.88)),
        url('/images/site-bg.jpg');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    color: var(--fg);
    font-family: var(--mono);
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

header.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
}

header.site-header .brand {
    color: var(--accent);
    font-weight: bold;
    letter-spacing: 0.05em;
}

header.site-header nav a {
    margin-left: 1.5rem;
    color: var(--fg-dim);
}

header.site-header nav a:hover {
    color: var(--accent);
}

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

footer.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--fg-dim);
    font-size: 0.85rem;
}

/* Home hero */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 4rem 1rem 3rem;
}

.hero h1 {
    color: var(--accent);
    font-size: 1.75rem;
    letter-spacing: 0.08em;
    margin: 1.5rem 0 0.5rem;
}

.hero p.tagline {
    color: var(--fg-dim);
    margin: 0;
}

.hero-photo {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    margin: 0 0 2.5rem;
}

/* Manual quote blocks */
.manual-quote {
    background: var(--bg-alt);
    border-left: 3px solid var(--accent-dim);
    padding: 1.25rem 1.5rem;
    margin: 2.5rem 0;
}

.manual-quote p {
    margin: 0 0 0.75rem;
}

.manual-quote cite {
    display: block;
    color: var(--fg-dim);
    font-style: normal;
    font-size: 0.85rem;
}

.section-note {
    color: var(--fg-dim);
}

/* Flexowriter / admin stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 2.5rem;
}

.stat-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 1rem;
}

.stat-card .value {
    color: var(--accent);
    font-size: 1.75rem;
    font-weight: bold;
}

.stat-card .label {
    color: var(--fg-dim);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

table.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-bottom: 2.5rem;
}

table.log-table th, table.log-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.4rem 0.5rem;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

table.log-table th {
    color: var(--fg-dim);
    font-weight: normal;
    text-transform: uppercase;
    font-size: 0.7rem;
}

.status-2xx { color: var(--accent); }
.status-3xx { color: #d9c95f; }
.status-4xx { color: #e0883a; }
.status-5xx { color: #e05a5a; }

main.wide {
    max-width: 1100px;
}

/* Base converter */
.converter {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 2rem 0;
}

.converter-triple {
    display: flex;
    gap: 1rem;
}

.converter-triple .converter-field {
    flex: 1;
    min-width: 0;
}

.converter-field {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.converter-field label {
    color: var(--fg-dim);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.converter-field input[type="text"] {
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: var(--mono);
    font-size: 1.1rem;
    padding: 0.6rem 0.75rem;
}

.converter-field input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

.converter-field input[type="text"][readonly] {
    color: var(--fg-dim);
}

.converter-lgp30-times {
    color: var(--fg-dim);
    white-space: nowrap;
    flex-shrink: 0;
}

.converter-field input.converter-q {
    flex: 0 0 4.5rem;
    width: 4.5rem;
}

@media (max-width: 640px) {
    .converter-triple {
        flex-direction: column;
    }
}

.conv-error {
    color: #e0883a;
    font-size: 0.85rem;
}

.conv-note {
    color: var(--fg-dim);
    font-size: 0.85rem;
}
