* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background:
        radial-gradient(circle at 10% 10%, rgba(255,255,255,.16), transparent 25%),
        linear-gradient(135deg, #4169a1, #89a9d0);
    color: #172033;
}

#outercontainer {
    width: 92%;
    max-width: 1250px;
    margin: 35px auto;
}

header {
    background: #101827;
    color: white;
    padding: 45px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(0,0,0,.18);
}

header:after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    right: -90px;
    top: -100px;
    border-radius: 50%;
    border: 45px solid rgba(255,255,255,.08);
}

header h1 {
    margin: 0 0 12px;
    font-size: clamp(38px, 6vw, 76px);
    line-height: .95;
    max-width: 850px;
}

header p {
    max-width: 720px;
    line-height: 1.6;
    color: #d9e3f2;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 11px 17px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
}

nav a:hover {
    background: white;
    color: #101827;
}

section {
    background: rgba(255,255,255,.94);
    margin-top: 22px;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

h2 {
    margin-top: 0;
    font-size: 30px;
}

h3 {
    margin-top: 0;
}

p {
    line-height: 1.65;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.story-card {
    background: #eef4fb;
    padding: 25px;
    border-radius: 16px;
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,.1);
}

.big-number {
    font-size: 48px;
    font-weight: bold;
    color: #4169a1;
}

button,
.control {
    font-family: Arial, sans-serif;
    border: 0;
    background: #4169a1;
    color: white;
    padding: 11px 17px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: bold;
}

button:hover,
.control:hover {
    background: #243b63;
}

button.secondary {
    background: #e7edf5;
    color: #172033;
}

button.secondary:hover {
    background: #d3deed;
}


/* HOMEPAGE INTERACTION */

.interaction-box {
    background: #101827;
    color: white;
    border-radius: 18px;
    padding: 25px;
    margin-top: 20px;
}

.interaction-box strong {
    color: #101827;
}

#messagebox {
    background: white;
    color: #172033;
    border-radius: 14px;
    padding: 22px;
    margin-top: 18px;
    min-height: 75px;
    border-left: 7px solid #4169a1;
    font-size: 18px;
    line-height: 1.7;
}

#messagebox strong {
    display: block;
    color: #172033;
    font-size: 24px;
    margin-bottom: 5px;
}


/* DATA PAGE */

.data-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

input,
select {
    padding: 12px 14px;
    border: 1px solid #b9c6d8;
    border-radius: 10px;
    font-size: 16px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

th {
    background: #4169a1;
    color: white;
    padding: 14px 10px;
    text-align: left;
    position: sticky;
    top: 0;
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid #d9e1eb;
}

tbody tr {
    transition: background .2s, transform .2s;
    cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
    background: #dce9f8;
}

.name {
    color: #4169a1;
    font-weight: bold;
}

.mass {
    font-weight: bold;
}

.fell {
    color: #9a4b00;
    font-weight: bold;
}


/* SIDE-BY-SIDE COMPARISON */

#comparison {
    display: block;
}

.comparison-heading p:first-child {
    color: #4169a1;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}

.comparison-heading h2 {
    margin-bottom: 8px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    gap: 15px;
    align-items: stretch;
    margin-top: 25px;
}

.comparison-card {
    background: #eef4fb;
    border-radius: 20px;
    padding: 25px;
    position: relative;
    border: 2px solid transparent;
    transition: transform .2s, border .2s;
}

.comparison-card:hover {
    transform: translateY(-3px);
    border: 2px solid #b7cae2;
}

.comparison-number {
    font-size: 13px;
    font-weight: bold;
    color: #4169a1;
    letter-spacing: 2px;
}

.comparison-visual {
    height: 180px;
    background: #101827;
    border-radius: 16px;
    margin: 15px 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mass-circle {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #9fb7d4;
    box-shadow:
        inset -12px -12px 18px rgba(0,0,0,.25),
        8px 10px 20px rgba(0,0,0,.35);
    transition: width .7s ease, height .7s ease;
}

.comparison-card h2 {
    font-size: 28px;
    margin-bottom: 18px;
}

.comparison-stat {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 0;
    border-bottom: 1px solid #ccd7e5;
}

.comparison-stat span {
    color: #53657d;
    font-size: 14px;
}

.comparison-stat strong {
    text-align: right;
    color: #101827;
}

.comparison-card button {
    margin-top: 18px;
}

.versus {
    align-self: center;
    justify-self: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #101827;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}


/* ANALYSIS PAGE */

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.analysis-card {
    background: #eef4fb;
    padding: 25px;
    border-radius: 18px;
}

.example {
    color: #4169a1;
    font-weight: bold;
    cursor: pointer;
    text-decoration: underline;
}

.bar {
    height: 22px;
    background: #d9e3ef;
    border-radius: 999px;
    overflow: hidden;
    margin: 10px 0 18px;
}

.bar-fill {
    height: 100%;
    background: #4169a1;
    width: 0;
    transition: width 1s ease;
}

.timeline {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 25px 0;
}

.timeline-line {
    height: 5px;
    flex: 1;
    background: #4169a1;
}

.timeline-dot {
    width: 18px;
    height: 18px;
    background: #101827;
    border-radius: 50%;
}


/* GLOSSARY */

dl {
    margin: 0;
}

dt {
    background: #eef4fb;
    padding: 16px;
    margin-top: 8px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
}

dd {
    padding: 14px 20px;
    margin: 0;
    border-left: 4px solid #4169a1;
}


/* FOOTER */

footer {
    background: #101827;
    color: #cdd7e5;
    padding: 22px;
    margin-top: 22px;
    border-radius: 20px;
    text-align: center;
}


/* MOBILE */

@media (max-width: 800px) {

    .comparison-grid,
    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .versus {
        margin: -5px auto;
    }

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

    header,
    section {
        padding: 22px;
    }

    .comparison-stat {
        flex-direction: column;
        gap: 4px;
    }

    .comparison-stat strong {
        text-align: left;
    }

}