.study {
    min-height: calc(100vh - 78px);
    padding: 48px 0 80px;

    background:
        radial-gradient(
            circle at 14% 35%,
            rgba(227, 39, 45, .05),
            transparent 26rem
        ),
        linear-gradient(
            180deg,
            #f8f9fc 0%,
            #ffffff 100%
        );
}


/* ============================================================
   HEADER
============================================================ */

.study__header {
    max-width: 980px;
    margin: 0 auto;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 30px;
}

.study__eyebrow {
    margin-bottom: 8px;

    color: var(--accent);

    font-size: 11px;
    font-weight: 900;
    letter-spacing: .16em;

    text-transform: uppercase;
}

.study__header h1 {
    margin: 0;

    color: var(--navy);

    font-size: 32px;
    line-height: 1.15;

    letter-spacing: -.025em;
}

.study__area {
    margin-top: 8px;

    color: var(--muted);

    font-size: 14px;
}

.study__counter {
    display: flex;
    align-items: baseline;

    gap: 6px;

    color: var(--muted);

    font-size: 15px;
}

.study__counter strong {
    color: var(--navy);

    font-size: 27px;
}


/* ============================================================
   LEARNING FLOW
============================================================ */

.learning-flow {
    max-width: 700px;

    margin: 30px auto 0;

    display: flex;
    align-items: center;
    justify-content: center;
}

.learning-flow__step {
    min-width: 90px;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 7px;

    color: #98a2b3;

    font-size: 11px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: .08em;
}

.learning-flow__number {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border: 2px solid #d9dee7;
    border-radius: 50%;

    background: #fff;

    color: #98a2b3;

    font-size: 13px;
}

.learning-flow__step.is-active {
    color: var(--accent);
}

.learning-flow__step.is-active .learning-flow__number {
    border-color: var(--accent);

    color: #fff;
    background: var(--accent);
}

.learning-flow__line {
    width: 90px;
    height: 2px;

    margin-bottom: 24px;

    background: #e1e5ec;
}


/* ============================================================
   PROGRESS BAR
============================================================ */

.study__progress {
    max-width: 700px;
    height: 5px;

    margin: 22px auto 42px;

    overflow: hidden;

    border-radius: 999px;

    background: #e5e9f0;
}

.study__progress-bar {
    width: 0;
    height: 100%;

    border-radius: inherit;

    background: var(--accent);

    transition: width .35s ease;
}


/* ============================================================
   STAGE
============================================================ */

.study__stage {
    max-width: 900px;

    margin: 0 auto;

    display: grid;
    grid-template-columns: 230px minmax(0, 520px);

    align-items: center;
    justify-content: center;

    gap: 46px;
}


/* ============================================================
   AVATAR / COACH
============================================================ */

.study-coach {
    position: relative;

    min-height: 330px;

    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.study-coach__avatar {
    display: block;

    width: 100%;
    max-width: 230px;
    height: auto;

    object-fit: contain;
}

.study-coach__bubble {
    position: absolute;

    top: 0;
    right: -15px;

    width: 165px;

    padding: 14px 16px;

    border: 1px solid var(--line);
    border-radius: 20px;

    background: #fff;

    box-shadow:
        0 10px 26px rgba(16, 33, 61, .10);

    color: var(--navy);

    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.study-coach__bubble::after {
    content: "";

    position: absolute;

    left: 26px;
    bottom: -11px;

    width: 20px;
    height: 20px;

    background: #fff;

    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);

    transform: rotate(45deg);
}


/* ============================================================
   CARD
============================================================ */

.study-card-area {
    width: 100%;
}

.study-card {
    width: 100%;
    height: 460px;

    perspective: 1400px;

    cursor: pointer;

    outline: none;
}

.study-card__inner {
    position: relative;

    width: 100%;
    height: 100%;

    transform-style: preserve-3d;

    transition:
        transform .58s cubic-bezier(.22, .75, .2, 1);
}

.study-card.is-flipped .study-card__inner {
    transform: rotateY(180deg);
}

.study-card__face {
    position: absolute;

    inset: 0;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    padding: 46px 42px;

    border: 1px solid var(--line);
    border-radius: 28px;

    background: #fff;

    box-shadow:
        0 24px 60px rgba(16, 33, 61, .12);

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    text-align: center;
}

.study-card__front {
    z-index: 2;
}

.study-card__back {
    transform: rotateY(180deg);
}

.study-card__type {
    position: absolute;

    top: 30px;

    color: var(--accent);

    font-size: 11px;
    font-weight: 900;

    letter-spacing: .11em;

    text-transform: uppercase;
}

.study-card__area {
    margin-bottom: 16px;

    color: var(--muted);

    font-size: 13px;
    font-weight: 700;
}

.study-card h2 {
    max-width: 430px;

    margin: 0;

    color: var(--navy);

    font-size: 42px;
    line-height: 1.08;

    letter-spacing: -.035em;
}

.study-card h3 {
    margin: 0 0 22px;

    color: var(--muted);

    font-size: 20px;
}

.study-card__back p {
    max-width: 420px;

    margin: 0;

    color: var(--navy);

    font-size: 20px;
    line-height: 1.55;
}

.study-card__hint {
    position: absolute;

    bottom: 26px;

    color: #98a2b3;

    font-size: 12px;
}


/* ============================================================
   ANSWER BUTTONS
============================================================ */

.study-actions {
    margin-top: 18px;

    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 12px;
}

.study-actions[hidden] {
    display: none !important;
}

.study-answer {
    min-height: 68px;

    padding: 10px 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    border-radius: 16px;

    background: #fff;

    cursor: pointer;

    font-weight: 900;

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease;
}

.study-answer:hover {
    transform: translateY(-2px);

    box-shadow:
        0 10px 24px rgba(16, 33, 61, .08);
}

.study-answer--unknown {
    border: 1px solid #d0d5dd;

    color: var(--navy);
}

.study-answer--known {
    border: 1px solid var(--accent);

    color: var(--accent);
}

.study-answer__icon {
    font-size: 27px;
    line-height: 1;
}

.study-answer span:last-child {
    display: flex;
    flex-direction: column;

    text-align: left;

    line-height: 1.1;
}

.study-answer small {
    margin-bottom: 4px;

    color: var(--muted);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: .07em;

    text-transform: uppercase;
}


/* ============================================================
   STATS
============================================================ */

.study-stats {
    margin-top: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 16px;

    color: var(--muted);

    font-size: 12px;
}

.study-stats span {
    display: flex;
    align-items: center;

    gap: 5px;
}

.study-stats b {
    color: var(--navy);

    font-size: 15px;
}

.study-stats__divider {
    width: 1px;
    height: 18px;

    background: var(--line);
}

.study-keyboard-hint {
    margin-top: 12px;

    color: #98a2b3;

    font-size: 11px;

    text-align: center;
}

.study-keyboard-hint kbd {
    padding: 2px 6px;

    border: 1px solid #d0d5dd;
    border-bottom-width: 2px;
    border-radius: 5px;

    background: #fff;

    color: var(--navy);

    font-size: 10px;
}


/* ============================================================
   COMPLETE SCREEN
============================================================ */

.study-complete {
    max-width: 850px;

    margin: 20px auto 0;

    padding: 38px 42px;

    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);

    align-items: center;

    gap: 38px;

    border: 1px solid var(--line);
    border-radius: 28px;

    background: #fff;

    box-shadow:
        0 22px 55px rgba(16, 33, 61, .10);
}

.study-complete[hidden] {
    display: none !important;
}

.study-complete__avatar img {
    display: block;

    width: 100%;
    height: auto;
}

.study-complete__content h2 {
    margin: 0 0 16px;

    color: var(--navy);

    font-size: 32px;
    line-height: 1.15;
}

.study-complete__content p {
    margin: 0;

    color: var(--muted);

    font-size: 16px;
    line-height: 1.65;
}

.study-complete__summary {
    margin: 28px 0;

    display: grid;
    grid-template-columns: repeat(3, 1fr);

    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.study-complete__summary > div {
    padding: 16px 10px;

    text-align: center;
}

.study-complete__summary > div + div {
    border-left: 1px solid var(--line);
}

.study-complete__summary strong {
    display: block;

    color: var(--navy);

    font-size: 24px;
}

.study-complete__summary span {
    color: var(--muted);

    font-size: 11px;

    text-transform: uppercase;
}

.study-complete__button {
    min-width: 260px;
}


/* ============================================================
   TABLET
============================================================ */

@media (max-width: 900px) {

    .study__stage {
        grid-template-columns: 190px minmax(0, 500px);

        gap: 28px;
    }

    .study-coach__avatar {
        max-width: 190px;
    }

    .study-coach__bubble {
        right: -5px;

        width: 150px;
    }

}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 700px) {

    .study {
        padding:
            28px 0
            55px;
    }

    .study__header {
        align-items: flex-start;
    }

    .study__header h1 {
        font-size: 24px;
    }

    .study__counter strong {
        font-size: 22px;
    }

    .learning-flow {
        margin-top: 24px;
    }

    .learning-flow__step {
        min-width: 65px;

        font-size: 9px;
    }

    .learning-flow__number {
        width: 30px;
        height: 30px;
    }

    .learning-flow__line {
        width: 45px;
    }

    .study__progress {
        margin-bottom: 24px;
    }

    .study__stage {
        display: flex;
        flex-direction: column;

        gap: 8px;
    }

    .study-coach {
        width: 100%;
        min-height: 130px;

        justify-content: flex-start;
    }

    .study-coach__avatar {
        width: 125px;
    }

    .study-coach__bubble {
        top: 8px;
        left: 115px;
        right: auto;

        width: 155px;
    }

    .study-card {
        height: 405px;
    }

    .study-card__face {
        padding: 38px 24px;
        border-radius: 22px;
    }

    .study-card h2 {
        font-size: 34px;
    }

    .study-card__back p {
        font-size: 17px;
    }

    .study-actions {
        gap: 8px;
    }

    .study-answer {
        min-height: 62px;

        padding: 8px 10px;

        font-size: 12px;
    }

    .study-answer__icon {
        font-size: 22px;
    }

    .study-complete {
        padding: 28px 22px;

        display: flex;
        flex-direction: column;

        text-align: center;
    }

    .study-complete__avatar {
        max-width: 180px;
    }

    .study-complete__content h2 {
        font-size: 26px;
    }

    .study-complete__button {
        width: 100%;
        min-width: 0;
    }

}