:root {
    --paper: #f7f3e8;
    --paper-light: #fffdf7;
    --ink: #19324a;
    --ink-soft: #486174;
    --blue: #2f6685;
    --blue-dark: #214b67;
    --accent: var(--blue);
    --yellow: #f3c85b;
    --red: #c85d4d;
    --line: #d9e1df;
    --shadow: 0 5px 0 rgba(25, 50, 74, 0.08);
    --radius: 8px;
    --pill-radius: 999px;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--ink);
}

* { box-sizing: border-box; }

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

button, a {
    -webkit-tap-highlight-color: transparent;
}

html {
    min-height: 100%;
    background: var(--paper);
    background-image:
        linear-gradient(rgba(47, 102, 133, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(47, 102, 133, 0.025) 1px, transparent 1px);
    background-size: 100% 30px, 30px 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    padding-top: 69px;
    line-height: 1.65;
}

a { color: var(--blue-dark); }
a:hover { color: var(--red); }

.bar {
    position: fixed;
    top: 0;
    left: 50%;
    width: calc(100% - 32px);
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 14px 24px;
    background: var(--paper-light);
    border-bottom: 3px solid var(--yellow);
    box-shadow: var(--shadow);
}

.brand {
    margin-right: 22px;
    color: var(--blue-dark);
    font-family: Georgia, serif;
    font-size: 1.25rem;
    font-weight: bold;
    letter-spacing: -0.02em;
}

.brand span { color: var(--red); }

.bar-element,
.bar-element-about {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 6px 13px;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--ink);
    font-weight: bold;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.bar-element:hover,
.bar-element:focus-visible,
.bar-element-about:hover,
.bar-element-about:focus-visible {
    background: #edf3f1;
    border-color: var(--line);
    color: var(--blue-dark);
    outline: none;
}

.bar-element.active,
.bar-element-about.active {
    background: var(--yellow);
    color: var(--ink);
}

.bar-element-about { margin-left: auto; }

.main {
    width: min(100% - 32px, 1000px);
    margin: 0 auto;
    padding: 54px 0 72px;
}

#box {
    position: relative;
    width: min(calc(100% - 32px), 900px);
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(24px, 5vw, 52px);
    background: var(--paper-light);
    border: 1px solid #e3ded0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

h1, h2, h3 {
    margin-top: 0;
    color: var(--blue-dark);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { margin-bottom: 6px; font-size: 1.25rem; }

p {
    width: 100%;
    max-width: none;
}

.eyebrow {
    margin-bottom: 10px;
    color: var(--red);
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lead {
    color: var(--ink-soft);
    font-size: 1.15rem;
}

.section-heading {
    margin-top: 38px;
    padding-top: 24px;
    border-top: 2px solid var(--line);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 28px 0;
}

.card {
    padding: 20px;
    background: #f1f6f3;
    border-left: 5px solid var(--blue);
    border-radius: 4px;
}

.card p { margin-bottom: 0; }

.button-link {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: 5px;
    background: var(--blue);
    color: white;
    font-weight: bold;
    text-decoration: none;
}

.button-link:hover { background: var(--blue-dark); color: white; }

ul { padding-left: 1.4rem; }
li { margin: 7px 0; }

img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.brand img {
    display: block;
    width: clamp(26px, 8vw, 34px);
    height: clamp(26px, 8vw, 34px);
    object-fit: contain;
    padding-top: 0;
}

.quiz-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.quiz-actions button {
    flex: 1 1 0;
    min-height: 44px;
}

.quiz-image {
    width: 90% !important;
    max-height: 62vh;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

#progress-bar {
    width: 100%;
    height: 10px;
    margin-bottom: 28px;
    overflow: hidden;
    background: #e5e8e1;
    border-radius: 2px;
}

#progress-fill {
    height: 100%;
    background: var(--blue);
    transition: width 0.3s ease;
}

.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 60%;
}

@media (max-width: 680px) {
    .bar {
        position: static;
        left: auto;
        width: 100%;
        max-width: none;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 8px 12px;
        scrollbar-width: none;
        transform: none;
    }

    body { padding-top: 0; }

    .bar::-webkit-scrollbar { display: none; }

    .brand {
        flex: 0 0 auto;
        margin-right: 6px;
    }

    .bar-element, .bar-element-about {
        flex: 0 0 auto;
        min-height: 44px;
        padding: 6px 9px;
        white-space: nowrap;
    }

    .bar-element-about { margin-left: 0; }
    .main {
        width: calc(100% - 24px);
        padding: 24px 0 40px;
    }

    #box {
        width: 100%;
        max-width: none;
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
        overflow-wrap: anywhere;
    }

    h2 { font-size: 1.5rem; }
    .lead { font-size: 1.05rem; }
    .card-grid { grid-template-columns: 1fr; }

    .card {
        padding: 16px;
    }

    .button-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .eyebrow {
        line-height: 1.4;
        overflow-wrap: anywhere;
    }

    img[style*="width:50%"] {
        width: 100% !important;
    }

    .quiz-image {
        width: 100% !important;
        max-height: none;
    }
}

@media (max-width: 420px) {
    .quiz-actions {
        flex-direction: column;
    }

    .quiz-actions button {
        width: 100%;
    }

    .main {
        width: calc(100% - 16px);
    }

    #box {
        padding: 16px;
    }

    .button-link {
        width: 100%;
    }

    ul, ol {
        padding-left: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
