:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --text: #142033;
    --muted: #536174;
    --border: #d8e3ee;
    --teal: #0d9488;
    --blue: #2563eb;
    --soft-teal: #eefdfb;
    --soft-blue: #eef4ff;
    --shadow: 0 12px 36px rgba(20, 32, 51, 0.08);
    --shadow-soft: 0 8px 24px rgba(20, 32, 51, 0.06);
    --font: "Plus Jakarta Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(13, 148, 136, 0.12), transparent 32rem),
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.11), transparent 28rem),
        var(--bg);
    line-height: 1.65;
    font-size: 1rem;
}

a { color: var(--teal); font-weight: 700; text-underline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
code { font-family: Consolas, "Courier New", monospace; }

.page-hero, main, footer {
    width: min(1280px, calc(100% - 2rem));
    margin: 0 auto;
}

.page-hero { padding: 1.6rem 0 2.4rem; }

.top-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-bottom: 2rem;
    position: sticky;
    top: 0.75rem;
    z-index: 10;
}

.top-nav a {
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    color: var(--text);
    font-size: 0.86rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    gap: 1.5rem;
    align-items: stretch;
}

.eyebrow {
    margin: 0 0 0.5rem;
    color: var(--teal);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

h1, h2, h3 { line-height: 1.15; }
h1 { margin: 0; max-width: 860px; font-size: clamp(2.2rem, 6vw, 4.7rem); letter-spacing: 0; }
h2 { margin: 0 0 0.75rem; font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }

.hero-lead {
    max-width: 760px;
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 1.08rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.5rem; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    text-decoration: none;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-secondary { background: #fff; border: 1px solid var(--border); color: var(--text); }

.hero-panel, .section, .finding-grid article, .stat-grid div, figure {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.hero-panel { padding: 1.25rem; }
.hero-panel dl { margin: 0; display: grid; gap: 0.8rem; }
.hero-panel div { padding: 0.85rem; background: #f8fafc; border-radius: 8px; }
.hero-panel dt { color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.hero-panel dd { margin: 0.2rem 0 0; font-weight: 800; }

.section {
    margin: 1.7rem 0;
    padding: clamp(1.25rem, 4vw, 2.3rem);
    min-width: 0;
    overflow: hidden;
}

.section-copy { max-width: 920px; }
.section-copy p { color: var(--muted); }

.stat-grid, .finding-grid, .assumption-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.2rem;
}

.stat-grid div {
    padding: 1.15rem;
    box-shadow: none;
}
.stat-grid strong { display: block; color: var(--teal); font-size: 1.8rem; }
.stat-grid span { color: var(--muted); font-size: 0.86rem; }

.assumption-grid {
    grid-template-columns: repeat(3, 1fr);
}

.assumption-grid article {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
    padding: 1.15rem;
}

.assumption-grid h3 {
    margin: 0 0 0.45rem;
}

.assumption-grid p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.data-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}
table { width: 100%; min-width: 900px; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: 10px; overflow: hidden; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #0f766e; color: #fff; font-size: 0.86rem; }
td { color: var(--muted); }
td:first-child { color: var(--text); font-weight: 700; }

.workflow-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
    margin-top: 1.4rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fafc 0%, #ecfeff 100%);
    box-shadow: var(--shadow-soft);
}
.workflow-summary div {
    padding: 0.9rem 1rem;
    border: 1px solid rgba(15, 118, 110, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
}
.workflow-summary span {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.workflow-summary strong {
    color: var(--text);
    font-size: 0.98rem;
}
.workflow-map {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem;
    margin-top: 1.35rem;
    padding: 0.25rem 0 0.25rem 1.4rem;
    counter-reset: workflow;
}
.workflow-map::before {
    content: "";
    position: absolute;
    left: 27px;
    top: 1.2rem;
    bottom: 1.2rem;
    width: 2px;
    background: linear-gradient(180deg, #0f766e, #14b8a6, #64748b);
}
.workflow-step {
    position: relative;
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 1.25rem;
    min-height: auto;
    padding: 1.35rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--shadow-soft);
}
.step-number {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #0f766e;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 900;
    box-shadow: 0 0 0 8px #ffffff;
}
.workflow-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 0.7rem;
    padding: 0.28rem 0.6rem;
    border: 1px solid rgba(15, 118, 110, 0.2);
    border-radius: 999px;
    background: #ecfeff;
    color: #0f766e;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.workflow-step h3 {
    margin: 0 0 0.45rem;
    font-size: 1.12rem;
}
.workflow-step p {
    margin: 0;
    color: var(--muted);
    max-width: 78ch;
}
.workflow-step ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}
.workflow-step li {
    display: grid;
    align-content: start;
    gap: 0.35rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--muted);
}
.workflow-step strong {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 0.16rem 0.45rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--text);
    font-size: 0.78rem;
}
.workflow-step li span {
    display: block;
    font-size: 0.9rem;
    line-height: 1.55;
}

.stage-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.25rem;
}
.stage-list { display: grid; gap: 0.65rem; align-content: start; position: sticky; top: 4.5rem; }
.stage-button {
    min-height: 50px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 800;
    text-align: left;
    padding: 0.8rem 0.95rem;
    cursor: pointer;
}
.stage-button.is-active { background: var(--teal); color: #fff; border-color: var(--teal); }
.stage-panel {
    min-height: 260px;
    padding: 1.45rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--shadow-soft);
}

.tutorial-guide {
    display: grid;
    gap: 1.45rem;
    counter-reset: lesson;
}

.guide-step {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: clamp(1.2rem, 3vw, 1.75rem);
    box-shadow: var(--shadow-soft);
    position: relative;
}

.guide-intro {
    color: var(--muted);
    margin: 0 0 1rem;
    max-width: 980px;
}

.code-map {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.code-map div,
.stage-details {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 1rem;
}

.code-map div {
    box-shadow: 0 4px 14px rgba(20, 32, 51, 0.04);
}

.code-map h4 {
    margin: 0 0 0.35rem;
    color: var(--text);
}

.code-map p,
.stage-details p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.stage-details {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
    border-left: 4px solid var(--teal);
    background: #fbfefe;
}

.stage-details strong {
    color: var(--text);
}

.guide-step h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.why-what-how {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.why-what-how div {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 1rem;
    box-shadow: 0 4px 14px rgba(20, 32, 51, 0.04);
}

.why-what-how h4 {
    margin: 0 0 0.35rem;
    color: var(--teal);
    font-size: 0.9rem;
}

.why-what-how p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

pre {
    overflow-x: auto;
    margin: 1.1rem 0 0;
    padding: 1.15rem;
    border-radius: 12px;
    background: #101827;
    color: #e8eef8;
    font-size: 0.9rem;
    line-height: 1.75;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.screenshots {
    display: grid;
    gap: 1.25rem;
}
figure {
    margin: 0;
    overflow: hidden;
}
figcaption {
    padding: 0.95rem 1.1rem 1.15rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.finding-grid { grid-template-columns: repeat(3, 1fr); }
.finding-grid article { padding: 1.15rem; box-shadow: none; }
.finding-grid p { margin: 0; color: var(--muted); }

footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 2rem 0 3rem;
}

@media (max-width: 900px) {
    .hero-grid, .stage-layout { grid-template-columns: 1fr; }
    .stat-grid, .finding-grid, .assumption-grid, .workflow-summary { grid-template-columns: repeat(2, 1fr); }
    .workflow-map { grid-template-columns: 1fr; }
    .workflow-step ul { grid-template-columns: 1fr; }
    .why-what-how { grid-template-columns: 1fr; }
    .code-map { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .top-nav { justify-content: flex-start; }
    .stat-grid, .finding-grid, .assumption-grid, .workflow-summary, .workflow-map { grid-template-columns: 1fr; }
    .workflow-summary { padding: 0.75rem; }
    .workflow-map {
        padding-left: 0;
    }
    .workflow-map::before {
        display: none;
    }
    .workflow-step {
        grid-template-columns: 1fr;
        gap: 0.85rem;
        min-height: auto;
        padding: 1.05rem;
    }
    .step-number { box-shadow: none; }
    footer { flex-direction: column; }
}
