/* =========================================================
   JAVASCRIPT KNOWLEDGE QUIZ
   Marsharine A. Simpson
   ========================================================= */

:root {
    --navy-950: #101828;
    --navy-900: #172033;
    --navy-800: #23304a;

    --blue-700: #3659a8;
    --blue-600: #4b6fc2;
    --blue-500: #6687d1;
    --blue-100: #eef3ff;

    --gold-500: #c99742;

    --green-700: #2f6d50;
    --green-100: #edf8f2;

    --red-700: #9b493f;
    --red-100: #fff0ed;

    --white: #ffffff;
    --off-white: #f8f9fc;
    --soft-gray: #edf0f5;

    --text: #202532;
    --muted: #697181;
    --border: #dce1ea;

    --shadow-sm: 0 8px 22px rgba(16, 24, 40, 0.07);
    --shadow-md: 0 18px 45px rgba(16, 24, 40, 0.11);
    --shadow-lg: 0 30px 75px rgba(16, 24, 40, 0.14);

    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 30px;

    --max-width: 1160px;
}


/* RESET */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);

    background:
        radial-gradient(
            circle at top right,
            rgba(102, 135, 209, 0.18),
            transparent 34rem
        ),
        var(--off-white);

    font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

button {
    font: inherit;
    cursor: pointer;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}


/* PAGE */

.page-shell {
    width: min(100% - 40px, var(--max-width));
    margin: 0 auto;
}


/* HERO */

.hero {
    max-width: 850px;
    margin: 0 auto;
    padding: 90px 0 52px;
    text-align: center;
}

.eyebrow,
.section-label {
    margin: 0 0 10px;
    color: var(--blue-600);
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    color: var(--navy-950);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3.2rem, 8vw, 6.3rem);
    font-weight: 600;
    letter-spacing: -0.055em;
    line-height: 0.92;
}

.hero h1 span {
    display: block;
    color: var(--blue-700);
}

.hero-description {
    max-width: 690px;
    margin: 26px auto 0;
    color: var(--muted);
    font-size: 1.08rem;
}

.hero-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 26px;
}

.hero-tags span {
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--navy-800);
    font-size: 0.82rem;
    font-weight: 700;
}


/* QUIZ CARD */

.quiz-card {
    position: relative;
    max-width: 900px;
    margin: 0 auto 95px;
    padding: clamp(28px, 5vw, 52px);
    overflow: hidden;

    border: 1px solid rgba(54, 89, 168, 0.12);
    border-radius: var(--radius-lg);

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.99),
            rgba(244, 247, 254, 0.98)
        );

    box-shadow: var(--shadow-lg);
}

.quiz-card::before {
    position: absolute;
    top: -95px;
    right: -95px;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: rgba(102, 135, 209, 0.13);
    content: "";
}

.quiz-header {
    position: relative;
    z-index: 1;

    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;

    margin-bottom: 30px;
}

.quiz-header h2 {
    margin: 0;
    color: var(--navy-950);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    line-height: 1.1;
}

.question-counter {
    display: flex;
    justify-content: center;
    align-items: center;

    min-width: 82px;
    min-height: 46px;
    padding: 8px 14px;

    border: 1px solid var(--border);
    border-radius: 999px;

    color: var(--blue-700);
    background: var(--white);

    font-size: 0.9rem;
    font-weight: 800;

    box-shadow: var(--shadow-sm);
}


/* PROGRESS */

.progress-section {
    margin-bottom: 38px;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;

    color: var(--muted);
    font-size: 0.83rem;
    font-weight: 700;
}

.progress-track {
    width: 100%;
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--soft-gray);
}

.progress-fill {
    width: 10%;
    height: 100%;
    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--blue-700),
            var(--blue-500)
        );

    transition: width 0.3s ease;
}


/* QUESTION */

.question-container {
    padding: 30px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--white);

    box-shadow: var(--shadow-sm);
}

.question-category {
    margin: 0 0 9px;
    color: var(--gold-500);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

#question-text {
    margin: 0 0 25px;

    color: var(--navy-950);

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.5rem, 3.5vw, 2.15rem);

    line-height: 1.2;
}


/* ANSWERS */

.answer-options {
    display: grid;
    gap: 12px;
}

.answer-option {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 14px;

    width: 100%;
    padding: 15px 17px;

    border: 2px solid var(--border);
    border-radius: var(--radius-sm);

    color: var(--text);
    background: var(--white);

    text-align: left;

    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.answer-option:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: var(--blue-500);
    background: var(--blue-100);
    box-shadow: 0 7px 18px rgba(54, 89, 168, 0.08);
}

.answer-letter {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    border-radius: 50%;

    color: var(--blue-700);
    background: var(--blue-100);

    font-size: 0.82rem;
    font-weight: 850;
}

.answer-option.selected {
    border-color: var(--blue-600);
    background: var(--blue-100);
}

.answer-option.selected .answer-letter {
    color: var(--white);
    background: var(--blue-700);
}

.answer-option.correct {
    border-color: rgba(47, 109, 80, 0.45);
    background: var(--green-100);
}

.answer-option.correct .answer-letter {
    color: var(--white);
    background: var(--green-700);
}

.answer-option.incorrect {
    border-color: rgba(155, 73, 63, 0.4);
    background: var(--red-100);
}

.answer-option.incorrect .answer-letter {
    color: var(--white);
    background: var(--red-700);
}

.answer-option:disabled {
    cursor: default;
}


/* FEEDBACK */

.answer-feedback {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;

    margin-top: 20px;
    padding: 20px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--blue-100);
}

.feedback-icon {
    display: grid;
    place-items: center;

    width: 42px;
    height: 42px;

    border-radius: 50%;

    color: var(--white);
    background: var(--blue-700);

    font-weight: 900;
}

.feedback-title {
    margin: 0;
    color: var(--navy-950);
    font-weight: 850;
}

.feedback-explanation {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.answer-feedback.correct-feedback {
    border-color: rgba(47, 109, 80, 0.3);
    background: var(--green-100);
}

.answer-feedback.correct-feedback .feedback-icon {
    background: var(--green-700);
}

.answer-feedback.incorrect-feedback {
    border-color: rgba(155, 73, 63, 0.3);
    background: var(--red-100);
}

.answer-feedback.incorrect-feedback .feedback-icon {
    background: var(--red-700);
}


/* CONTROLS */

.quiz-controls {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 28px;
}

.primary-button,
.secondary-button {
    min-height: 50px;
    padding: 12px 22px;

    border: 2px solid var(--navy-900);
    border-radius: 999px;

    font-weight: 780;

    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.primary-button {
    color: var(--white);
    background: var(--navy-900);
    box-shadow: 0 8px 18px rgba(23, 32, 51, 0.16);
}

.primary-button:hover:not(:disabled) {
    transform: translateY(-2px);
    background: var(--blue-700);
    box-shadow: 0 12px 24px rgba(23, 32, 51, 0.22);
}

.secondary-button {
    color: var(--navy-900);
    background: transparent;
}

.secondary-button:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--blue-600);
    background: var(--blue-100);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}


/* RESULTS */

.results-card {
    max-width: 760px;
    margin: 0 auto 95px;
    padding: clamp(34px, 6vw, 58px);

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background: var(--white);

    text-align: center;

    box-shadow: var(--shadow-lg);
}

.score-circle {
    display: grid;
    place-items: center;

    width: 145px;
    height: 145px;

    margin: 20px auto 24px;

    border: 10px solid var(--blue-100);
    border-radius: 50%;

    color: var(--blue-700);
    background: var(--white);

    box-shadow: inset 0 0 0 2px var(--blue-500);
}

#score-percent {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.35rem;
    font-weight: 700;
}

.results-card h2 {
    margin: 0;

    color: var(--navy-950);

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
}

.score-message {
    max-width: 560px;
    margin: 14px auto 28px;
    color: var(--muted);
}

.score-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 30px 0;
}

.score-details > div {
    padding: 20px 12px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--off-white);
}

.score-number {
    display: block;
    margin-bottom: 3px;

    color: var(--navy-950);

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.9rem;
    font-weight: 700;
}

.score-details span:last-child {
    color: var(--muted);
    font-size: 0.83rem;
}

.results-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}


/* REVIEW */

.review-section {
    padding-bottom: 100px;
}

.section-heading {
    max-width: 720px;
    margin-bottom: 38px;
}

.section-heading h2,
.project-info h2 {
    margin: 0 0 12px;

    color: var(--navy-950);

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.2rem, 5vw, 3.9rem);

    letter-spacing: -0.035em;
    line-height: 1.05;
}

.section-heading > p:last-child {
    margin: 0;
    color: var(--muted);
}

.review-list {
    display: grid;
    gap: 18px;
}

.review-card {
    padding: 25px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--white);

    box-shadow: var(--shadow-sm);
}

.review-card.correct-review {
    border-left: 5px solid var(--green-700);
}

.review-card.incorrect-review {
    border-left: 5px solid var(--red-700);
}

.review-number {
    margin: 0 0 5px;
    color: var(--blue-600);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.review-card h3 {
    margin: 0 0 12px;
    color: var(--navy-950);
}

.review-card p {
    margin: 6px 0;
    color: var(--muted);
}

.review-card strong {
    color: var(--text);
}

.centered-button {
    display: block;
    margin: 32px auto 0;
}


/* PROJECT INFO */

.project-info {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    align-items: center;
    gap: 60px;

    margin-bottom: 100px;
    padding: clamp(34px, 5vw, 56px);

    border-radius: var(--radius-lg);

    color: var(--white);

    background:
        linear-gradient(
            135deg,
            var(--navy-950),
            var(--navy-800)
        );

    box-shadow: var(--shadow-md);
}

.project-info .eyebrow {
    color: #a9bff1;
}

.project-info h2 {
    color: var(--white);
}

.project-info-copy > p:not(.eyebrow) {
    color: #d9dfeb;
}

.skills-panel {
    padding: 28px;

    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);

    background: rgba(255, 255, 255, 0.06);
}

.skills-heading {
    margin: 0 0 16px;
    font-weight: 850;
}

.skills-panel ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 16px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.skills-panel li {
    position: relative;

    padding-left: 18px;

    color: #e7ebf4;
    font-size: 0.9rem;
}

.skills-panel li::before {
    position: absolute;
    left: 0;
    top: 0.45rem;

    color: #a9bff1;

    content: "◆";
    font-size: 0.55rem;
}


/* FOOTER */

.site-footer {
    padding: 38px 20px;
    color: #dce2ee;
    background: var(--navy-950);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;

    width: min(100%, var(--max-width));
    margin: 0 auto;
}

.footer-inner p {
    margin: 0;
}

.footer-name {
    margin-bottom: 4px !important;
    color: var(--white);
    font-weight: 850;
}

.footer-links {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.footer-links a {
    color: #b9c8eb;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--white);
    text-decoration: underline;
    text-underline-offset: 4px;
}


/* ACCESSIBILITY */

button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(102, 135, 209, 0.45);
    outline-offset: 3px;
}


/* TABLET */

@media (max-width: 820px) {
    .project-info {
        grid-template-columns: 1fr;
        gap: 34px;
    }
}


/* MOBILE */

@media (max-width: 620px) {

    .page-shell {
        width: min(100% - 28px, var(--max-width));
    }

    .hero {
        padding: 62px 0 38px;
    }

    .hero h1 {
        font-size: clamp(3rem, 16vw, 4.6rem);
    }

    .quiz-card {
        margin-bottom: 72px;
        padding: 24px 20px;
        border-radius: 22px;
    }

    .quiz-header {
        flex-direction: column;
    }

    .question-counter {
        align-self: flex-start;
    }

    .question-container {
        padding: 22px 18px;
    }

    .answer-option {
        align-items: flex-start;
    }

    .quiz-controls {
        display: grid;
        grid-template-columns: 1fr;
    }

    .primary-button,
    .secondary-button {
        width: 100%;
    }

    .score-details {
        grid-template-columns: 1fr;
    }

    .results-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .project-info {
        margin-bottom: 72px;
        padding: 30px 24px;
    }

    .skills-panel ul {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-links {
        justify-content: flex-start;
    }
}


/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
