:root {
    --bg: #f4efe7;
    --surface: rgba(255, 250, 243, 0.84);
    --surface-strong: #fffaf2;
    --border: rgba(63, 44, 28, 0.12);
    --ink: #1f1b17;
    --muted: #6f655c;
    --accent: #b6542a;
    --accent-deep: #7a2f12;
    --accent-soft: #f2c7a7;
    --success: #23714c;
    --danger: #a63d2a;
    --warning: #996300;
    --shadow: 0 20px 70px rgba(65, 37, 11, 0.12);
    --radius: 24px;
    --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    --font-body: "Avenir Next", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(182, 84, 42, 0.18), transparent 32%),
        radial-gradient(circle at right 20%, rgba(35, 113, 76, 0.14), transparent 24%),
        linear-gradient(180deg, #fbf7f0 0%, #efe5d8 100%);
}

a {
    color: inherit;
}

.shell {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.shell::before,
.shell::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(8px);
    opacity: 0.65;
    pointer-events: none;
}

.shell::before {
    width: 18rem;
    height: 18rem;
    top: -4rem;
    right: -2rem;
    background: rgba(182, 84, 42, 0.14);
}

.shell::after {
    width: 24rem;
    height: 24rem;
    left: -6rem;
    bottom: -8rem;
    background: rgba(35, 113, 76, 0.12);
}

.page {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.brand-mark {
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
}

.brand-title,
.hero-title,
.login-title {
    font-family: var(--font-display);
    letter-spacing: -0.03em;
}

.brand-title {
    font-size: 1.5rem;
}

.brand-copy,
.hero-copy,
.metric-label,
.panel-copy,
.flash,
.field-hint,
.footer-note,
.metric-meta,
.login-copy {
    color: var(--muted);
}

.button,
button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    font: inherit;
    cursor: pointer;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.2rem;
    text-decoration: none;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover,
button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: #fff8f1;
    box-shadow: 0 14px 30px rgba(122, 47, 18, 0.2);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.48);
    color: var(--ink);
    border: 1px solid var(--border);
}

.button-quiet {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid var(--border);
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.4rem;
    margin-bottom: 1.4rem;
}

.hero-card,
.panel,
.metric-card,
.login-card {
    background: var(--surface);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 1.8rem;
}

.hero-kicker {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    color: var(--accent);
}

.hero-title {
    margin: 0.4rem 0 0.8rem;
    font-size: clamp(2.2rem, 5vw, 4.6rem);
    line-height: 0.95;
}

.hero-copy {
    max-width: 48rem;
    font-size: 1rem;
    line-height: 1.65;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1rem;
}

.badge {
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.56);
    font-size: 0.88rem;
}

.hero-side {
    padding: 1.4rem;
    display: grid;
    gap: 1rem;
}

.snapshot {
    padding: 1rem 1.05rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.48);
    border: 1px solid rgba(63, 44, 28, 0.08);
}

.snapshot-label {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.snapshot-value {
    margin-top: 0.35rem;
    font-size: 1.7rem;
    font-weight: 700;
}

.snapshot-copy {
    margin-top: 0.3rem;
    font-size: 0.92rem;
    color: var(--muted);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-card {
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 13rem;
    animation: rise 420ms ease both;
}

.metric-card:nth-child(2) { animation-delay: 40ms; }
.metric-card:nth-child(3) { animation-delay: 80ms; }
.metric-card:nth-child(4) { animation-delay: 120ms; }
.metric-card:nth-child(5) { animation-delay: 160ms; }
.metric-card:nth-child(6) { animation-delay: 200ms; }
.metric-card:nth-child(7) { animation-delay: 240ms; }

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.metric-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
}

.metric-label {
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.metric-status {
    font-size: 0.76rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.metric-meta {
    font-size: 0.92rem;
    line-height: 1.5;
}

.sparkline {
    width: 100%;
    height: 3.6rem;
    margin-top: auto;
}

.sparkline path {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sparkline .sparkline-area {
    fill: rgba(182, 84, 42, 0.12);
    stroke: none;
}

.layout-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
}

.panel {
    padding: 1.3rem;
}

.panel-title {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}

.panel-copy {
    margin: 0 0 1.15rem;
    line-height: 1.6;
}

.timeline {
    display: grid;
    gap: 0.85rem;
}

.timeline-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.9rem;
    align-items: center;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(63, 44, 28, 0.08);
}

.timeline-swatch {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
    background: var(--accent);
}

.timeline-label {
    font-weight: 700;
}

.timeline-note {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.timeline-value {
    font-weight: 700;
}

.login-wrap {
    width: min(1080px, calc(100% - 2rem));
    margin: 0 auto;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 1.4rem;
}

.login-story {
    padding: 2rem 0;
}

.login-title {
    margin: 0.4rem 0 0.9rem;
    font-size: clamp(2.4rem, 6vw, 5rem);
    line-height: 0.95;
}

.login-copy {
    max-width: 36rem;
    line-height: 1.7;
}

.login-card {
    padding: 1.6rem;
}

.login-card h2 {
    margin-top: 0;
    margin-bottom: 0.35rem;
    font-size: 1.6rem;
}

.flash {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.66);
}

.flash-error {
    color: var(--danger);
    border-color: rgba(166, 61, 42, 0.2);
    background: rgba(255, 242, 238, 0.85);
}

.field {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.field label {
    font-size: 0.92rem;
    font-weight: 700;
}

.field input {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(63, 44, 28, 0.14);
    background: rgba(255, 255, 255, 0.9);
    padding: 0.95rem 1rem;
    font: inherit;
    color: var(--ink);
    outline: none;
}

.field input:focus {
    border-color: rgba(182, 84, 42, 0.48);
    box-shadow: 0 0 0 4px rgba(182, 84, 42, 0.12);
}

.field-hint {
    font-size: 0.88rem;
}

.stack {
    display: grid;
    gap: 0.9rem;
}

.footer-note {
    margin-top: 1rem;
    font-size: 0.88rem;
}

.empty-state {
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.52);
    border: 1px dashed rgba(63, 44, 28, 0.18);
    line-height: 1.6;
}

@media (max-width: 960px) {
    .hero,
    .layout-grid,
    .login-wrap {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .page,
    .login-wrap {
        width: min(100% - 1rem, 100%);
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .hero-card,
    .hero-side,
    .panel,
    .metric-card,
    .login-card {
        border-radius: 20px;
    }
}

