/* undo.sh — flat-design bento, burgundy-cream */

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

:root {
    --cream: #f5efe8;
    --cell: #faf7f2;
    --burgundy: #7a3040;
    --burgundy-light: #a85060;
    --sage: #6a8a60;
    --blue: #4a7aaa;
    --amber: #c8943a;
    --ink: #2a2020;
    --terminal-bg: #2a2020;
}

html, body {
    background: var(--cream);
    color: var(--ink);
    font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    min-height: 100%;
}

.page {
    width: 100%;
    overflow-x: hidden;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    position: relative;
}

.hero::before {
    content: "";
    position: absolute;
    width: 520px;
    height: 480px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: rgba(122, 48, 64, 0.05);
    top: 8%;
    left: -120px;
    z-index: 0;
}

.hero::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 380px;
    border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%;
    background: rgba(106, 138, 96, 0.06);
    bottom: 4%;
    right: -100px;
    z-index: 0;
}

.terminal {
    width: min(720px, 92vw);
    background: var(--terminal-bg);
    color: var(--cream);
    border: 2px solid var(--burgundy);
    border-radius: 8px;
    overflow: hidden;
    font-family: "Fira Code", monospace;
    z-index: 1;
}

.terminal-bar {
    background: var(--burgundy);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot-red { background: var(--burgundy-light); }
.dot-amber { background: var(--amber); }
.dot-green { background: var(--sage); }

.terminal-title {
    margin-left: 12px;
    color: var(--cream);
    font-size: 13px;
    font-family: "Fira Code", monospace;
}

.terminal-body {
    padding: 24px 28px;
}

.prompt-line {
    font-size: clamp(28px, 5.5vw, 56px);
    font-family: "Recursive", "Fira Code", monospace;
    font-variation-settings: "wght" 800, "CASL" 0.7, "MONO" 0.4;
    line-height: 1.15;
    margin-bottom: 18px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 14px;
}

.prompt-symbol {
    color: var(--sage);
}

.prompt-cmd {
    color: var(--cream);
    cursor: pointer;
    user-select: none;
}

.cursor {
    display: inline-block;
    color: var(--sage);
    animation: blink 1.05s step-end infinite;
    font-weight: 800;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.terminal-output {
    font-size: 14px;
    color: rgba(245, 239, 232, 0.78);
    margin-top: 4px;
}

.terminal-output.ok {
    color: var(--sage);
}

.tagline {
    font-family: "Recursive", sans-serif;
    font-variation-settings: "wght" 800, "CASL" 0.5;
    font-size: clamp(28px, 4.5vw, 48px);
    text-align: center;
    margin-top: 48px;
    line-height: 1.1;
    z-index: 1;
}

.tagline .emphasis {
    color: var(--burgundy);
    font-variation-settings: "wght" 900, "CASL" 1;
}

.subline {
    text-align: center;
    margin-top: 18px;
    font-size: 17px;
    max-width: 540px;
    color: rgba(42, 32, 32, 0.78);
    z-index: 1;
}

.undo-trigger {
    margin-top: 36px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--burgundy);
    color: var(--cream);
    border: 2px solid var(--burgundy);
    border-radius: 8px;
    padding: 14px 22px;
    font-family: "Recursive", sans-serif;
    font-variation-settings: "wght" 700, "CASL" 0.4;
    font-size: 16px;
    cursor: pointer;
    transition: background 120ms linear, color 120ms linear;
    z-index: 1;
}

.undo-trigger:hover {
    background: var(--burgundy-light);
    border-color: var(--burgundy-light);
}

.undo-trigger .key {
    font-family: "Fira Code", monospace;
    font-size: 14px;
    background: var(--cream);
    color: var(--burgundy);
    padding: 4px 10px;
    border-radius: 4px;
}

.undo-trigger .key-hint {
    font-size: 13px;
    opacity: 0.85;
}

/* Bento grid */
.bento {
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
        "hero hero hero"
        "a b c"
        "d d e"
        "f g g";
    gap: 2px;
    background: var(--burgundy);
}

.cell {
    background: var(--cell);
    padding: 24px;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 180px;
    position: relative;
}

.cell-hero {
    background: var(--burgundy);
    color: var(--cream);
    min-height: 220px;
    padding: 36px 28px;
}

.cell-a { background: #f0e2d6; }
.cell-b { background: var(--cell); }
.cell-c { background: #e9e0d0; }
.cell-d { background: var(--cream); }
.cell-e { background: #ecd9c5; }
.cell-f { background: var(--sage); color: var(--cream); }
.cell-g { background: #2a2020; color: var(--cream); }

.cell-eyebrow {
    font-family: "Fira Code", monospace;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    color: var(--burgundy);
    opacity: 0.85;
}

.cell-hero .cell-eyebrow,
.cell-f .cell-eyebrow,
.cell-g .cell-eyebrow {
    color: var(--cream);
    opacity: 0.7;
}

.cell-title {
    font-family: "Recursive", sans-serif;
    font-variation-settings: "wght" 800, "CASL" 0.6;
    font-size: 22px;
    line-height: 1.2;
}

.cell-hero .cell-title {
    font-size: 30px;
}

.cell-body {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(42, 32, 32, 0.85);
}

.cell-hero .cell-body,
.cell-f .cell-body,
.cell-g .cell-body {
    color: rgba(245, 239, 232, 0.86);
}

/* Snapshot strip */
.snapshot-strip {
    margin-top: auto;
    display: flex;
    gap: 6px;
    align-items: center;
}

.snap {
    width: 28px;
    height: 12px;
    background: var(--burgundy);
    opacity: 0.3;
    border-radius: 2px;
}

.snap-active {
    opacity: 1;
    background: var(--sage);
    width: 36px;
    height: 14px;
}

/* Code blocks */
.code {
    background: var(--terminal-bg);
    color: var(--cream);
    padding: 16px;
    border-radius: 6px;
    font-family: "Fira Code", monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    margin-top: auto;
    white-space: pre;
}

.cell-g .code {
    background: rgba(245, 239, 232, 0.06);
    border: 1px solid rgba(245, 239, 232, 0.15);
}

.code .kw { color: var(--sage); }
.code .str { color: var(--amber); }
.code .cm { color: rgba(245, 239, 232, 0.45); }

/* Error card */
.error-card {
    background: rgba(74, 122, 170, 0.12);
    border-left: 3px solid var(--blue);
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.55;
    margin-top: auto;
}

.error-tag {
    display: inline-block;
    font-family: "Fira Code", monospace;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--blue);
    margin-right: 8px;
    font-weight: 700;
}

.error-card code {
    font-family: "Fira Code", monospace;
    background: rgba(42, 32, 32, 0.08);
    padding: 1px 6px;
    border-radius: 3px;
}

/* Diagram */
.diagram {
    margin-top: 12px;
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto;
    grid-template-rows: auto 36px;
    align-items: center;
    gap: 4px 8px;
    padding: 16px 4px 8px;
    position: relative;
}

.node {
    padding: 14px 18px;
    border: 2px solid var(--burgundy);
    border-radius: 6px;
    font-family: "Fira Code", monospace;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    background: var(--cell);
    grid-row: 1;
}

.node-clean {
    border-color: var(--sage);
    color: var(--sage);
    grid-column: 1;
}

.node-staged {
    border-color: var(--amber);
    color: var(--amber);
    grid-column: 3;
}

.node-committed {
    border-color: var(--burgundy);
    color: var(--burgundy);
    grid-column: 5;
}

.arrow {
    grid-row: 1;
    height: 2px;
    background: var(--ink);
    position: relative;
    align-self: center;
}

.arrow span {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-family: "Fira Code", monospace;
    font-size: 11px;
    color: var(--ink);
    opacity: 0.7;
    background: var(--cream);
    padding: 0 6px;
}

.arrow-right {
    grid-column: 2 / span 1;
}

.arrow-right.arrow + * + .arrow-right {
    grid-column: 4 / span 1;
}

.diagram > .arrow-right:nth-of-type(2) {
    grid-column: 4;
}

.arrow-right::after {
    content: "";
    position: absolute;
    right: -1px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 8px solid var(--ink);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.arrow-back {
    grid-row: 2;
    height: 2px;
    background: var(--burgundy);
    position: relative;
}

.arrow-back-1 {
    grid-column: 2;
}

.arrow-back-2 {
    grid-column: 4;
}

.arrow-back span {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--burgundy);
    background: var(--cream);
    padding: 0 6px;
    font-family: "Fira Code", monospace;
    font-size: 11px;
}

.arrow-back::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 50%;
    transform: translateY(-50%);
    border-right: 8px solid var(--burgundy);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

/* Big stat */
.big-stat {
    margin-top: auto;
    font-family: "Recursive", sans-serif;
    font-variation-settings: "wght" 900, "CASL" 0.2, "MONO" 0.5;
    font-size: 56px;
    line-height: 1;
    color: var(--cream);
}

.big-stat .unit {
    font-size: 22px;
    margin-left: 4px;
    opacity: 0.8;
}

/* Nature band */
.nature-band {
    background: #ecf2e8;
    padding: 56px 24px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}

.leaf-pattern {
    height: 80px;
    background-image:
        radial-gradient(ellipse 14px 6px at 25% 50%, rgba(106, 138, 96, 0.35), rgba(106, 138, 96, 0.35) 60%, transparent 61%),
        radial-gradient(ellipse 10px 4px at 65% 30%, rgba(106, 138, 96, 0.25), rgba(106, 138, 96, 0.25) 60%, transparent 61%),
        radial-gradient(ellipse 12px 5px at 90% 70%, rgba(106, 138, 96, 0.3), rgba(106, 138, 96, 0.3) 60%, transparent 61%);
    background-size: 110px 80px, 90px 80px, 130px 80px;
    background-repeat: repeat-x;
}

.band-content {
    text-align: center;
    max-width: 540px;
}

.band-quote {
    font-family: "Recursive", serif;
    font-variation-settings: "wght" 600, "CASL" 1, "slnt" -8;
    font-size: clamp(18px, 2.5vw, 24px);
    color: var(--sage);
    font-style: normal;
    line-height: 1.4;
}

/* Changelog */
.changelog {
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 24px;
}

.changelog-title {
    font-family: "Fira Code", monospace;
    font-size: 14px;
    color: var(--burgundy);
    text-transform: lowercase;
    margin-bottom: 22px;
    letter-spacing: 0.05em;
}

.log-list {
    list-style: none;
    border: 2px solid var(--burgundy);
    border-radius: 8px;
    overflow: hidden;
    background: var(--cell);
}

.log-entry {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 16px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(122, 48, 64, 0.18);
    font-family: "Fira Code", monospace;
    font-size: 14px;
    transition: background 120ms linear;
}

.log-entry:last-child {
    border-bottom: 0;
}

.log-entry:hover {
    background: rgba(122, 48, 64, 0.05);
}

.log-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-sage { background: var(--sage); }
.dot-burgundy { background: var(--burgundy); }
.dot-blue { background: var(--blue); }

.log-meta {
    display: flex;
    gap: 12px;
    align-items: baseline;
    flex-shrink: 0;
}

.log-hash {
    color: var(--burgundy);
    font-weight: 500;
}

.log-when {
    color: rgba(42, 32, 32, 0.55);
    font-size: 12px;
}

.log-msg {
    color: var(--ink);
}

/* Footer */
.page-footer {
    text-align: center;
    padding: 40px 24px 60px;
    color: rgba(42, 32, 32, 0.6);
    font-family: "Fira Code", monospace;
    font-size: 13px;
}

/* Glitch */
.glitching {
    animation: glitch 150ms steps(2, jump-none);
}

@keyframes glitch {
    0% { transform: translateX(0); text-shadow: none; }
    25% { transform: translateX(-3px); text-shadow: 2px 0 #7a3040, -2px 0 #4a7aaa; }
    50% { transform: translateX(3px); text-shadow: -2px 0 #7a3040, 2px 0 #4a7aaa; }
    100% { transform: translateX(0); text-shadow: none; }
}

/* Responsive */
@media (max-width: 760px) {
    .bento {
        grid-template-columns: 1fr;
        grid-template-areas:
            "hero"
            "a"
            "b"
            "c"
            "d"
            "e"
            "f"
            "g";
        gap: 2px;
    }

    .diagram {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto 36px auto 36px auto;
    }

    .node-clean { grid-column: 1; grid-row: 1; }
    .arrow-right:first-of-type { grid-column: 2; grid-row: 1; }
    .node-staged { grid-column: 3; grid-row: 1; }
    .node-committed { grid-column: 1; grid-row: 3; }
    .arrow-back-1 { grid-column: 2; grid-row: 2; }
    .arrow-back-2 { grid-column: 2; grid-row: 4; }

    .nature-band {
        grid-template-columns: 1fr;
    }
    .leaf-pattern {
        height: 40px;
    }
}
