:root {
    /* Surfaces — dark slate, never black; layered by elevation */
    --bg-primary:   #0f1216;
    --bg-secondary: #141820;
    --bg-surface:   #1a1f28;  /* cards */
    --bg-elevated:  #222832;
    --bg-hover:     #2a313d;

    /* Text — soft, never pure white */
    --text-heading:   #f0f2f5;
    --text-primary:   #d4d7dd;
    --text-secondary: #9ca3ae;
    --text-muted:     #5c6370;

    /* Accent — the one true teal */
    --accent:        #5ba3a3;
    --accent-light:  #7ab3b3;
    --accent-subtle: rgba(91, 163, 163, 0.12);
    --accent-muted:  rgba(91, 163, 163, 0.15);

    /* Semantic — desaturated, meaning only */
    --success: #5b9a73;
    --warning: #c9a35f;
    --danger:  #c97a5f;

    /* Lines */
    --border:       rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.10);

    /* Radius */
    --radius:    14px;
    --radius-sm: 10px;
    --radius-xs:  6px;

    /* Type */
    --font-ui:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
    font-family: var(--font-ui);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.app {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px 96px;
}

/* ---------- Hero ---------- */
.hero { padding: 64px 0 28px; }
.eyebrow {
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 12px;
}
.hero h1 {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-heading);
    line-height: 1.05;
}
.lede {
    margin-top: 14px;
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 52ch;
}

/* ---------- Sticky sub-nav ---------- */
.subnav {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding: 12px 0;
    margin-bottom: 8px;
    background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.subnav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    transition: background 0.15s, color 0.15s;
}
.subnav a:hover { color: var(--text-heading); background: var(--bg-hover); }

/* ---------- Cards ---------- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-top: 24px;
}
.card-head { margin-bottom: 20px; }
.card h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-heading);
    letter-spacing: -0.01em;
}
.card-sub { margin-top: 6px; color: var(--text-secondary); font-size: 15px; }

/* ---------- Controls ---------- */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 24px;
}
.control { flex: 1; min-width: 200px; }
.control label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.hint { margin-top: 8px; font-size: 13px; color: var(--text-muted); }

.stepper {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-secondary);
    width: fit-content;
}
.stepper input {
    width: 80px;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--text-heading);
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 500;
    -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step {
    width: 44px;
    border: none;
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    transition: background 0.12s;
}
.step:hover { background: var(--bg-hover); color: var(--text-heading); }
.step:active { background: var(--accent-muted); }

input[type="datetime-local"] {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-heading);
    font-family: var(--font-ui);
    font-size: 16px;
    padding: 11px 14px;
    width: 100%;
    max-width: 280px;
    color-scheme: dark;
}
input:focus-visible, .step:focus-visible, summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Recipe table ---------- */
.recipe-table { width: 100%; border-collapse: collapse; }
.recipe-table th {
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0 0 10px;
    border-bottom: 1px solid var(--border);
}
.recipe-table th.num, .recipe-table td.num { text-align: right; }
.recipe-table td {
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}
.recipe-table tr:last-child td { border-bottom: none; }
.recipe-table .ingredient { color: var(--text-primary); font-weight: 500; }
.recipe-table .grams {
    font-family: var(--font-mono);
    font-size: 17px;
    color: var(--text-heading);
    font-weight: 500;
}
.recipe-table .measure { color: var(--text-secondary); font-size: 14px; }
.total-line {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}
.total-line strong { color: var(--text-heading); font-family: var(--font-mono); }

/* ---------- Advanced ---------- */
.advanced { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 18px; }
.advanced summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    list-style: none;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: "+ "; color: var(--text-muted); }
.advanced[open] summary::before { content: "− "; }
.adv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 14px;
    margin-top: 18px;
}
.adv-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.adv-grid .unit { color: var(--text-muted); }
.adv-grid input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xs);
    color: var(--text-heading);
    font-family: var(--font-mono);
    font-size: 15px;
    padding: 9px 11px;
    -moz-appearance: textfield;
}
.adv-grid input::-webkit-outer-spin-button,
.adv-grid input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; position: relative; padding-left: 28px; }
.timeline::before {
    content: "";
    position: absolute;
    left: 7px; top: 8px; bottom: 8px;
    width: 2px;
    background: var(--border-light);
}
.timeline li { position: relative; padding: 0 0 22px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
    content: "";
    position: absolute;
    left: -25px; top: 5px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--accent);
}
.timeline li.fire::before { border-color: var(--warning); background: var(--warning); }
.timeline li.eat::before { background: var(--accent); }
.tl-when {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-light);
    display: block;
}
.tl-what { color: var(--text-heading); font-weight: 600; margin-top: 2px; }
.tl-detail { color: var(--text-secondary); font-size: 14px; margin-top: 2px; }
.timeline-empty { color: var(--text-muted); font-style: italic; }

/* ---------- Steps / instructions ---------- */
.steps { display: flex; flex-direction: column; gap: 26px; }
.step-group h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tag {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-subtle);
    padding: 3px 8px;
    border-radius: 100px;
}
.tag-fire { color: var(--warning); background: rgba(201, 163, 95, 0.12); }
.step-group ol, .step-group ul { padding-left: 22px; }
.step-group li { margin-bottom: 8px; color: var(--text-primary); font-size: 15px; }
.step-group li::marker { color: var(--text-muted); }
.step-group li.rest { color: var(--accent-light); }
.aside {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    border-left: 2px solid var(--border-light);
    padding-left: 14px;
}

/* ---------- Rules ---------- */
.rules {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.rules h3 { font-size: 16px; color: var(--text-heading); margin-bottom: 12px; }
.rules ol { padding-left: 22px; }
.rules li { margin-bottom: 10px; color: var(--text-primary); font-size: 15px; }
.rules li::marker { color: var(--accent); font-family: var(--font-mono); }

/* ---------- Footer ---------- */
.foot {
    margin-top: 40px;
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
    .hero { padding: 44px 0 20px; }
    .hero h1 { font-size: 42px; }
    .lede { font-size: 16px; }
    .card { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
