/*
 * Tatiana Atelier
 * Feminine editorial design for the public website, teacher panel and E2EE classroom.
 * The palette is intentionally warm and restrained: plum, dusty rose, champagne,
 * ivory and sage. Motion uses transforms and opacity, with reduced-motion support.
 */

:root {
    --ink-deep: #2b2430;
    --ink: #4a3445;
    --ink-soft: #6c5b69;
    --rose: #b66f82;
    --rose-dark: #8e5365;
    --rose-deep: #714254;
    --rose-soft: #f8e9ee;
    --rose-mist: #f3dce4;
    --plum: #62465f;
    --plum-deep: #3c2a3a;
    --lavender: #9d8caf;
    --lavender-soft: #eee8f3;
    --champagne: #d7b475;
    --champagne-soft: #f6ead3;
    --sage: #7f9d91;
    --sage-soft: #e6efeb;
    --cream: #fff9f5;
    --cream-deep: #f5ede8;
    --paper: #ffffff;
    --text: #544854;
    --muted: #7d707b;
    --line: rgba(75, 52, 69, 0.12);
    --line-strong: rgba(75, 52, 69, 0.22);
    --success: #4f806e;
    --error: #a24455;
    --warning: #9a6a39;
    --shadow-xs: 0 8px 24px rgba(74, 52, 69, 0.06);
    --shadow-sm: 0 18px 48px rgba(74, 52, 69, 0.09);
    --shadow-md: 0 28px 72px rgba(74, 52, 69, 0.13);
    --shadow-lg: 0 42px 110px rgba(74, 52, 69, 0.17);
    --gradient-primary: linear-gradient(135deg, #8f5668 0%, #b66f82 48%, #cf8f8d 100%);
    --gradient-plum: linear-gradient(145deg, #3c2a3a 0%, #62465f 58%, #8c6078 100%);
    --gradient-soft: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 233, 238, 0.8));
    --ease-spring: cubic-bezier(.2, .78, .25, 1);
}

html {
    background: var(--cream);
}

body {
    color: var(--text);
    background:
        radial-gradient(circle at 4% 2%, rgba(182, 111, 130, 0.10), transparent 28rem),
        radial-gradient(circle at 96% 3%, rgba(215, 180, 117, 0.12), transparent 32rem),
        var(--cream);
}

body,
input,
select,
textarea,
button {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1,
h2,
h3 {
    color: var(--ink-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 600;
    letter-spacing: -0.035em;
}

p,
li {
    color: var(--text);
}

::selection {
    color: var(--ink-deep);
    background: rgba(215, 180, 117, 0.36);
}

:focus-visible {
    outline: 3px solid rgba(182, 111, 130, 0.45);
    outline-offset: 4px;
}

.scroll-progress span {
    background: linear-gradient(90deg, var(--champagne), var(--rose), var(--plum));
}

/* Shared header and brand */
.site-header,
.portal-header,
.simple-header {
    background: rgba(255, 249, 245, 0.88);
    border-bottom: 1px solid rgba(74, 52, 69, 0.08);
    backdrop-filter: blur(22px) saturate(145%);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.site-header.is-scrolled {
    background: rgba(255, 249, 245, 0.97);
    box-shadow: 0 14px 44px rgba(74, 52, 69, 0.08);
}

.brand {
    gap: 12px;
}

.brand-mark {
    position: relative;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    overflow: visible;
    color: #fffaf6;
    background:
        radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.26), transparent 28%),
        var(--gradient-primary);
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(113, 66, 84, 0.2);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.55rem;
    font-weight: 700;
}

.brand-mark::after {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 13px;
    height: 13px;
    background: var(--champagne);
    border: 3px solid var(--cream);
    border-radius: 70% 30% 65% 35%;
    transform: rotate(26deg);
    content: "";
}

.brand-copy strong {
    color: var(--ink-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.34rem;
}

.brand-copy small {
    color: var(--rose-dark);
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.primary-nav > a,
.simple-back {
    color: var(--ink-soft);
    border-radius: 999px;
    font-weight: 720;
}

.primary-nav > a:not(.nav-classroom):hover,
.simple-back:hover {
    color: var(--rose-deep);
    background: rgba(182, 111, 130, 0.09);
}

.primary-nav .nav-classroom {
    color: #fff;
    background: var(--gradient-primary);
    border: 1px solid rgba(255, 255, 255, 0.26);
    box-shadow: 0 12px 28px rgba(142, 83, 101, 0.22);
}

.primary-nav .nav-classroom:hover {
    color: #fff;
    background: linear-gradient(135deg, #7a485a, #aa6678);
    transform: translateY(-1px);
}

.primary-nav .language-link {
    color: var(--rose-dark);
    background: var(--rose-soft);
}

.menu-toggle span {
    background: var(--plum);
}

.eyebrow {
    color: var(--rose-dark);
    letter-spacing: .14em;
}

.eyebrow::before {
    width: 30px;
    background: linear-gradient(90deg, var(--champagne), var(--rose));
}

.eyebrow-light {
    color: rgba(255, 255, 255, 0.82);
}

/* Buttons */
.button {
    min-height: 48px;
    padding-inline: 22px;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: -0.01em;
    transition: transform 220ms var(--ease-spring), box-shadow 220ms ease, background 220ms ease, border-color 220ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    color: #fff;
    background: var(--gradient-primary);
    border-color: transparent;
    box-shadow: 0 16px 34px rgba(142, 83, 101, 0.24);
}

.button-primary:hover {
    color: #fff;
    background: linear-gradient(135deg, #7b485a, #a75f74 58%, #c17d7e);
    box-shadow: 0 20px 42px rgba(142, 83, 101, 0.30);
}

.button-secondary,
.button-ghost {
    color: var(--plum-deep);
    background: rgba(255, 255, 255, 0.84);
    border-color: rgba(98, 70, 95, 0.18);
    box-shadow: 0 8px 22px rgba(74, 52, 69, 0.05);
}

.button-secondary:hover,
.button-ghost:hover {
    color: var(--rose-dark);
    background: #fff;
    border-color: rgba(182, 111, 130, 0.32);
}

.button-light {
    color: var(--plum-deep);
    background: #fff;
    border-color: rgba(255, 255, 255, 0.75);
}

.button-small {
    min-height: 40px;
    padding-inline: 17px;
    font-size: .83rem;
}

.text-link {
    color: var(--rose-dark);
    font-weight: 800;
}

.text-link:hover {
    color: var(--plum);
}

/* Homepage hero */
.hero {
    position: relative;
    min-height: auto;
    padding-top: clamp(126px, 12vw, 170px);
    padding-bottom: clamp(72px, 8vw, 112px);
    overflow: hidden;
    background:
        radial-gradient(circle at 82% 18%, rgba(182, 111, 130, 0.18), transparent 25rem),
        radial-gradient(circle at 76% 80%, rgba(215, 180, 117, 0.18), transparent 27rem),
        linear-gradient(180deg, #fffaf7 0%, #fdf6f3 100%);
}

.hero::before,
.hero::after {
    position: absolute;
    pointer-events: none;
    content: "";
}

.hero::before {
    top: 112px;
    right: -10vw;
    width: 48vw;
    height: 48vw;
    min-width: 520px;
    min-height: 520px;
    border: 1px solid rgba(182, 111, 130, 0.14);
    border-radius: 50%;
}

.hero::after {
    left: -110px;
    bottom: -150px;
    width: 330px;
    height: 330px;
    background: radial-gradient(circle, rgba(215, 180, 117, 0.13), transparent 68%);
    border-radius: 50%;
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
    align-items: center;
    gap: clamp(56px, 7vw, 108px);
}

.hero-copy {
    max-width: 730px;
}

.hero h1 {
    max-width: 800px;
    margin-bottom: 24px;
    color: var(--ink-deep);
    font-size: clamp(3rem, 5.15vw, 5.35rem);
    line-height: .99;
}

.hero-title-accent {
    display: block;
    margin-top: 16px;
    color: var(--rose-dark);
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: clamp(1.28rem, 2.3vw, 2.06rem);
    font-weight: 760;
    letter-spacing: -0.03em;
    line-height: 1.16;
}

.hero-lead {
    max-width: 680px;
    color: var(--ink-soft);
    font-size: clamp(1.04rem, 1.55vw, 1.25rem);
    line-height: 1.72;
}

.hero-micro {
    color: var(--muted);
}

.trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.trust-row span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: var(--plum);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(182, 111, 130, 0.13);
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(74, 52, 69, 0.04);
    font-size: .82rem;
    font-weight: 720;
}

.trust-row span::before {
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    color: #fff;
    background: var(--sage);
    border-radius: 50%;
    content: "✓";
    font-size: .68rem;
    font-weight: 900;
}

.hero-visual {
    position: relative;
    width: min(100%, 520px);
    margin-inline: auto;
    display: grid;
    gap: 18px;
}

.hero-visual::before {
    position: absolute;
    z-index: -1;
    inset: 7% -8% 22% 10%;
    background:
        linear-gradient(145deg, rgba(248, 233, 238, 0.93), rgba(246, 234, 211, 0.82));
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 46% 54% 48% 52% / 42% 44% 56% 58%;
    box-shadow: var(--shadow-md);
    transform: rotate(-3deg);
    content: "";
}

.hero-visual::after {
    position: absolute;
    z-index: -1;
    top: -22px;
    right: -26px;
    width: 110px;
    height: 110px;
    border: 1px solid rgba(182, 111, 130, 0.22);
    border-radius: 63% 37% 68% 32%;
    transform: rotate(18deg);
    content: "";
    animation: atelierFloat 8s ease-in-out infinite;
}

.hero-orbit,
.hero-note {
    display: none !important;
}

.portrait-panel {
    position: relative;
    z-index: 2;
    width: min(100%, 442px);
    margin-inline: auto;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(98, 70, 95, 0.12);
    border-radius: 46px 46px 26px 26px;
    box-shadow: var(--shadow-lg);
    transform: none !important;
}

.portrait-panel::before {
    display: none;
}

.portrait-media {
    position: relative;
    width: 100%;
    aspect-ratio: 720 / 820;
    overflow: hidden;
    background: linear-gradient(180deg, var(--rose-soft), var(--cream-deep));
    border-radius: 44px 44px 18px 18px;
}

.portrait-media picture,
.portrait-media img {
    width: 100%;
    height: 100%;
}

.portrait-media img {
    object-fit: cover;
    object-position: center;
    transform: scale(1.005);
    transition: transform 700ms var(--ease-spring);
}

.portrait-panel:hover .portrait-media img {
    transform: scale(1.025);
}

.portrait-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 21px 24px 24px;
    background: rgba(255, 255, 255, 0.96);
}

.portrait-caption-copy {
    display: grid;
    min-width: 0;
}

.portrait-kicker {
    color: var(--rose-dark);
    font-size: .65rem;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.portrait-caption strong {
    color: var(--ink-deep);
    font-size: 1.72rem;
}

.portrait-caption small {
    color: var(--muted);
}

.portrait-status {
    position: static !important;
    inset: auto !important;
    display: inline-flex;
    width: fit-content !important;
    height: auto !important;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    color: #416f5f;
    background: var(--sage-soft);
    border: 1px solid rgba(79, 128, 110, 0.2);
    border-radius: 999px;
    box-shadow: none;
    font-size: .68rem;
    font-weight: 850;
    white-space: nowrap;
}

.portrait-status > span {
    width: 8px;
    height: 8px;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(79, 128, 110, 0.12);
}

.hero-credentials {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: min(100%, 520px);
}

.hero-credential {
    min-height: 110px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(182, 111, 130, 0.13);
    border-radius: 22px;
    box-shadow: var(--shadow-xs);
    transition: transform 260ms var(--ease-spring), border-color 260ms ease, box-shadow 260ms ease;
}

.hero-credential:hover {
    border-color: rgba(182, 111, 130, 0.32);
    box-shadow: var(--shadow-sm);
    transform: translateY(-4px);
}

.hero-credential > span {
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    margin-bottom: 11px;
    color: #fff;
    background: var(--gradient-primary);
    border-radius: 10px 10px 10px 4px;
    font-size: .64rem;
    font-weight: 900;
}

.hero-credential strong {
    display: block;
    color: var(--plum-deep);
    font-size: .78rem;
    line-height: 1.45;
}

@keyframes atelierFloat {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(18deg); }
    50% { transform: translate3d(0, -10px, 0) rotate(24deg); }
}

/* Format ribbon and code entry */
.availability-band {
    color: var(--plum-deep);
    background: var(--rose-soft);
    border-block: 1px solid rgba(182, 111, 130, 0.12);
}

.availability-track span {
    color: var(--plum);
    font-weight: 750;
}

.availability-track i {
    background: var(--rose);
}

.student-access {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 10% 20%, rgba(215, 180, 117, 0.18), transparent 18rem),
        radial-gradient(circle at 90% 80%, rgba(248, 233, 238, 0.15), transparent 22rem),
        var(--gradient-plum);
}

.student-access::before {
    position: absolute;
    top: -90px;
    right: 8%;
    width: 200px;
    height: 200px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 63% 37% 62% 38%;
    transform: rotate(25deg);
    content: "";
}

.student-access h2,
.student-access p {
    color: #fff;
}

.access-form {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 28px;
    box-shadow: 0 22px 52px rgba(43, 36, 48, 0.18);
    backdrop-filter: blur(12px);
}

.access-form input {
    color: var(--plum-deep);
    background: rgba(255, 255, 255, 0.98);
    border-color: transparent;
    border-radius: 16px;
    font-weight: 800;
    letter-spacing: .12em;
}

.access-form input:focus {
    border-color: var(--champagne);
    box-shadow: 0 0 0 4px rgba(215, 180, 117, 0.16);
}

/* Shared content sections */
.content-section {
    padding-block: clamp(82px, 9vw, 132px);
}

.section-tinted {
    background:
        radial-gradient(circle at 94% 12%, rgba(182, 111, 130, 0.08), transparent 24rem),
        linear-gradient(180deg, #fbf3f5 0%, #fff9f5 100%);
}

.section-heading h2 {
    color: var(--ink-deep);
}

.section-heading > p:last-child {
    color: var(--ink-soft);
}

.outcome-card,
.process-step,
.format-card,
.service-link-card,
.feature-item,
.faq-list details,
.contact-form,
.portal-card,
.teacher-panel,
.utility-card {
    border-color: rgba(98, 70, 95, 0.11);
}

.outcome-card,
.process-step,
.service-link-card,
.feature-item,
.faq-list details {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-xs);
}

.outcome-card,
.service-link-card,
.format-card {
    border-radius: 26px;
    transition: transform 260ms var(--ease-spring), box-shadow 260ms ease, border-color 260ms ease;
}

.outcome-card:hover,
.service-link-card:hover,
.format-card:hover {
    border-color: rgba(182, 111, 130, 0.27);
    box-shadow: var(--shadow-sm);
    transform: translateY(-6px);
}

.card-index,
.process-step > span,
.feature-item > span,
.service-card-number {
    color: var(--rose-dark);
}

.outcome-card::before {
    background: linear-gradient(90deg, var(--rose), var(--champagne));
}

.process-list {
    gap: 16px;
}

.process-step {
    border-radius: 24px;
}

.process-step > span {
    background: var(--rose-soft);
    border-color: rgba(182, 111, 130, 0.18);
}

/* Professional timeline */
.about-section {
    background:
        radial-gradient(circle at 7% 18%, rgba(215, 180, 117, 0.13), transparent 23rem),
        var(--cream);
}

.about-grid {
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    align-items: center;
    gap: clamp(52px, 7vw, 94px);
}

.career-panel {
    position: relative;
    padding: clamp(28px, 4vw, 42px);
    overflow: hidden;
    background:
        radial-gradient(circle at 100% 0%, rgba(215, 180, 117, 0.24), transparent 16rem),
        linear-gradient(155deg, #fff 0%, #f9edf1 62%, #f3e2e6 100%);
    border: 1px solid rgba(182, 111, 130, 0.16);
    border-radius: 36px;
    box-shadow: var(--shadow-md);
}

.career-panel::before,
.career-panel::after {
    position: absolute;
    pointer-events: none;
    content: "";
}

.career-panel::before {
    right: -60px;
    bottom: -74px;
    width: 190px;
    height: 190px;
    border: 1px solid rgba(182, 111, 130, 0.17);
    border-radius: 62% 38% 58% 42%;
}

.career-panel::after {
    top: 38px;
    right: 34px;
    width: 12px;
    height: 12px;
    background: var(--champagne);
    border-radius: 70% 30% 65% 35%;
    transform: rotate(24deg);
}

.career-panel-head {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 8px;
    padding-bottom: 22px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(98, 70, 95, 0.12);
}

.career-panel-head span {
    color: var(--rose-dark);
    font-size: .69rem;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.career-panel-head strong {
    max-width: 440px;
    color: var(--ink-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.55rem, 2.5vw, 2.3rem);
    line-height: 1.12;
}

.career-timeline {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
}

.career-timeline::before {
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 34px;
    width: 1px;
    background: linear-gradient(180deg, var(--champagne), rgba(182, 111, 130, 0.25));
    content: "";
}

.career-timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 18px;
    padding: 20px 0;
}

.career-year {
    position: relative;
    z-index: 1;
    display: grid;
    width: 68px;
    min-height: 38px;
    place-items: center;
    align-self: start;
    padding: 6px;
    color: #fff;
    background: var(--gradient-primary);
    border: 5px solid #f9edf1;
    border-radius: 999px;
    font-size: .66rem;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
}

.career-timeline h3 {
    margin-bottom: 7px;
    color: var(--plum-deep);
    font-size: 1.14rem;
    letter-spacing: -0.02em;
}

.career-timeline p {
    color: var(--ink-soft);
    font-size: .91rem;
    line-height: 1.58;
}

.check-list li span {
    color: var(--rose-dark);
    background: var(--rose-soft);
}

.about-link-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    margin-top: 26px;
}

/* Dark editorial section */
.section-dark {
    background:
        radial-gradient(circle at 8% 12%, rgba(215, 180, 117, 0.15), transparent 24rem),
        radial-gradient(circle at 92% 88%, rgba(182, 111, 130, 0.24), transparent 28rem),
        var(--gradient-plum);
}

.section-dark h2,
.section-dark h3,
.section-dark p {
    color: #fff;
}

.section-heading-dark > p:last-child,
.format-card p {
    color: rgba(255, 255, 255, 0.7);
}

.format-card {
    background: rgba(255, 255, 255, 0.075);
    border-color: rgba(255, 255, 255, 0.13);
    backdrop-filter: blur(10px);
}

.format-card > span {
    color: #f3dca9;
}

/* Services and illustrations */
.services-section {
    background: #fff;
}

.service-link-card {
    overflow: hidden;
    background: linear-gradient(180deg, #fff 0%, #fffaf8 100%);
}

.service-card-art {
    overflow: hidden;
    background: linear-gradient(145deg, var(--rose-soft), var(--lavender-soft));
    border-radius: 22px;
}

.service-card-art img,
.service-illustration img,
.classroom-illustration img,
.editorial-illustration img {
    transition: transform 600ms var(--ease-spring);
}

.service-link-card:hover .service-card-art img,
.service-illustration:hover img,
.classroom-illustration:hover img,
.editorial-illustration:hover img {
    transform: scale(1.025) translateY(-3px);
}

.service-link-card small {
    color: var(--rose-dark);
}

.service-link-card > strong {
    color: var(--rose-dark);
}

/* Classroom preview */
.classroom-section {
    background:
        radial-gradient(circle at 15% 30%, rgba(182, 111, 130, 0.08), transparent 22rem),
        linear-gradient(180deg, #fff9f5 0%, #f7eff2 100%);
}

.classroom-illustration {
    padding: 18px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(182, 111, 130, 0.12);
    border-radius: 34px;
    box-shadow: var(--shadow-md);
}

.feature-item {
    border-radius: 22px;
}

/* Reviews */
.reviews-section {
    background: #fff;
}

.reviews-grid {
    gap: 18px;
}

.review-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #fff 0%, #fff7f8 100%);
    border: 1px solid rgba(182, 111, 130, 0.14);
    border-radius: 28px;
    box-shadow: var(--shadow-xs);
}

.review-card::before {
    color: rgba(182, 111, 130, 0.24);
}

.review-card-author strong {
    color: var(--plum-deep);
}

/* FAQ and contact */
.faq-section {
    background: var(--cream);
}

.faq-list details {
    border-radius: 20px;
}

.faq-list summary {
    color: var(--plum-deep);
}

.faq-list summary::after {
    color: var(--rose-dark);
    background: var(--rose-soft);
}

.contact-section {
    background:
        radial-gradient(circle at 8% 6%, rgba(215, 180, 117, 0.12), transparent 22rem),
        linear-gradient(145deg, #3c2a3a 0%, #64455f 68%, #8b5c73 100%);
}

.contact-section h2,
.contact-section p,
.contact-section a,
.contact-section label {
    color: #fff;
}

.contact-direct {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    border-radius: 24px;
}

.contact-direct a:hover {
    color: #f8dca7;
}

.contact-form {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 32px;
    box-shadow: 0 32px 80px rgba(43, 36, 48, 0.28);
}

.contact-form label,
.contact-form p,
.contact-form a {
    color: var(--text);
}

.field-group input,
.field-group select,
.field-group textarea,
.access-form input,
.classroom-code-form input {
    color: var(--ink-deep);
    background: #fff;
    border-color: rgba(98, 70, 95, 0.17);
    border-radius: 15px;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus,
.classroom-code-form input:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 4px rgba(182, 111, 130, 0.11);
}

.privacy-check input {
    accent-color: var(--rose);
}

/* Footer */
.site-footer {
    background: #2f2530;
    border-top-color: rgba(255, 255, 255, 0.06);
}

.site-footer h2,
.site-footer .brand-copy strong {
    color: #fff;
}

.site-footer p,
.site-footer a,
.site-footer .brand-copy small {
    color: rgba(255, 255, 255, 0.66);
}

.site-footer a:hover {
    color: #f2d79f;
}

.site-footer .brand-mark::after {
    border-color: #2f2530;
}

.footer-bottom {
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* WhatsApp pill */
.floating-contact {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1200;
    display: inline-flex;
    width: auto;
    min-width: 58px;
    height: 58px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 19px 0 15px;
    color: #fff;
    background: linear-gradient(135deg, #2e9e63, #25c06e);
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 999px;
    box-shadow: 0 18px 46px rgba(37, 160, 96, 0.28);
    text-decoration: none;
    font-size: .87rem;
    font-weight: 850;
    transition: transform 220ms var(--ease-spring), box-shadow 220ms ease;
}

.floating-contact svg {
    width: 27px;
    height: 27px;
    flex: 0 0 auto;
    fill: currentColor;
}

.floating-contact:hover {
    color: #fff;
    box-shadow: 0 22px 54px rgba(37, 160, 96, 0.36);
    transform: translateY(-4px) scale(1.015);
}

.cookie-banner {
    background: rgba(47, 37, 48, 0.96);
    border-color: rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
}

.cookie-banner p {
    color: rgba(255, 255, 255, 0.82);
}

/* Service pages */
.service-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 86% 18%, rgba(182, 111, 130, 0.16), transparent 24rem),
        radial-gradient(circle at 12% 88%, rgba(215, 180, 117, 0.13), transparent 24rem),
        linear-gradient(180deg, #fffaf7 0%, #f9eff2 100%);
}

.service-hero::after {
    position: absolute;
    top: 120px;
    right: -80px;
    width: 260px;
    height: 260px;
    border: 1px solid rgba(182, 111, 130, 0.15);
    border-radius: 61% 39% 67% 33%;
    transform: rotate(20deg);
    content: "";
}

.breadcrumbs,
.breadcrumbs a {
    color: var(--muted);
}

.breadcrumbs a:hover {
    color: var(--rose-dark);
}

.service-lead {
    color: var(--ink-soft);
}

.service-illustration,
.editorial-illustration {
    overflow: hidden;
    background: linear-gradient(145deg, #fff, var(--rose-soft));
    border: 1px solid rgba(182, 111, 130, 0.13);
    border-radius: 34px;
    box-shadow: var(--shadow-md);
}

.service-highlight-list li {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(182, 111, 130, 0.12);
    border-radius: 18px;
}

.service-prose h2,
.service-prose h3 {
    color: var(--plum-deep);
}

.service-prose a {
    color: var(--rose-dark);
}

.related-service-grid a {
    background: #fff;
    border-color: rgba(182, 111, 130, 0.12);
    border-radius: 24px;
    box-shadow: var(--shadow-xs);
}

.related-service-grid a:hover {
    border-color: rgba(182, 111, 130, 0.28);
    box-shadow: var(--shadow-sm);
    transform: translateY(-4px);
}

.service-cta-section {
    background: var(--cream);
}

.service-cta-card,
.profile-cta-card {
    background:
        radial-gradient(circle at 90% 10%, rgba(215, 180, 117, 0.18), transparent 18rem),
        var(--gradient-plum);
    border-radius: 34px;
    box-shadow: var(--shadow-lg);
}

.service-cta-card h2,
.service-cta-card p,
.profile-cta-card h2,
.profile-cta-card p {
    color: #fff;
}

/* Profile page */
.profile-hero {
    position: relative;
    padding-top: clamp(130px, 12vw, 170px);
    padding-bottom: clamp(76px, 8vw, 112px);
    overflow: hidden;
    background:
        radial-gradient(circle at 86% 20%, rgba(182, 111, 130, 0.17), transparent 25rem),
        linear-gradient(180deg, #fffaf7, #f9eef2);
}

.profile-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, .72fr);
    align-items: center;
    gap: clamp(50px, 7vw, 90px);
}

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

.profile-portrait {
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(182, 111, 130, 0.14);
    border-radius: 42px 42px 24px 24px;
    box-shadow: var(--shadow-lg);
}

.profile-portrait picture,
.profile-portrait img {
    width: 100%;
}

.profile-portrait img {
    aspect-ratio: 720 / 820;
    object-fit: cover;
}

.profile-portrait figcaption {
    display: grid;
    padding: 22px 24px 25px;
}

.profile-portrait figcaption span {
    color: var(--rose-dark);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.profile-portrait figcaption strong {
    color: var(--ink-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.8rem;
}

.profile-portrait figcaption small {
    color: var(--muted);
}

.profile-proof-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 28px;
}

.profile-proof-grid article {
    padding: 18px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(182, 111, 130, 0.13);
    border-radius: 20px;
}

.profile-proof-grid strong {
    display: block;
    color: var(--rose-dark);
    font-size: 1.1rem;
}

.profile-proof-grid span {
    color: var(--ink-soft);
    font-size: .78rem;
    line-height: 1.42;
}

.profile-reading-grid,
.profile-visual-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: clamp(48px, 7vw, 90px);
    align-items: start;
}

.profile-prose p {
    font-size: 1.06rem;
    line-height: 1.8;
}

.profile-principles {
    display: grid;
    gap: 15px;
    margin-top: 26px;
}

.profile-principles article {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 16px;
    padding: 18px;
    background: #fff;
    border: 1px solid rgba(182, 111, 130, 0.12);
    border-radius: 20px;
}

.profile-principles article > span {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #fff;
    background: var(--gradient-primary);
    border-radius: 14px;
    font-size: .72rem;
    font-weight: 900;
}

.profile-visual-grid-reverse > :first-child {
    order: 1;
}

.profile-cta-section {
    padding-block: clamp(70px, 8vw, 110px);
    background: var(--cream);
}

/* Privacy and utility pages */
.utility-page,
.portal-page {
    background:
        radial-gradient(circle at 8% 2%, rgba(182, 111, 130, 0.10), transparent 26rem),
        radial-gradient(circle at 92% 8%, rgba(215, 180, 117, 0.10), transparent 28rem),
        var(--cream);
}

.utility-card,
.portal-card {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 30px;
    box-shadow: var(--shadow-sm);
}

.policy-section {
    border-color: rgba(182, 111, 130, 0.12);
}

.policy-section h2 {
    color: var(--plum-deep);
}

.policy-updated,
.policy-language {
    color: var(--rose-dark);
    background: var(--rose-soft);
    border-color: rgba(182, 111, 130, 0.14);
}

/* Teacher dashboard */
.teacher-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 4% 0%, rgba(182, 111, 130, 0.13), transparent 28rem),
        radial-gradient(circle at 96% 0%, rgba(215, 180, 117, 0.12), transparent 30rem),
        #fbf5f7;
}

.portal-header {
    min-height: 78px;
}

.portal-header .header-inner {
    min-height: 78px;
}

.portal-main {
    padding-top: 118px;
    padding-bottom: 80px;
}

.teacher-dashboard-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 32px;
    margin-bottom: 22px;
    padding: clamp(28px, 4vw, 42px);
    overflow: hidden;
    background:
        radial-gradient(circle at 92% 10%, rgba(215, 180, 117, 0.22), transparent 16rem),
        linear-gradient(145deg, #fff 0%, #faedf1 100%);
    border: 1px solid rgba(182, 111, 130, 0.14);
    border-radius: 34px;
    box-shadow: var(--shadow-md);
}

.teacher-dashboard-hero::after {
    position: absolute;
    right: -42px;
    bottom: -54px;
    width: 150px;
    height: 150px;
    border: 1px solid rgba(182, 111, 130, 0.16);
    border-radius: 62% 38% 65% 35%;
    transform: rotate(18deg);
    content: "";
}

.teacher-dashboard-hero h1 {
    margin-bottom: 12px;
    font-size: clamp(2.2rem, 4.6vw, 4rem);
}

.teacher-dashboard-hero > div:first-child > p:last-child {
    max-width: 690px;
    color: var(--ink-soft);
}

.teacher-dashboard-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(105px, 1fr));
    gap: 10px;
}

.teacher-dashboard-stats article {
    min-width: 112px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(182, 111, 130, 0.12);
    border-radius: 20px;
    text-align: center;
}

.teacher-dashboard-stats span {
    display: block;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 750;
}

.teacher-dashboard-stats strong {
    display: block;
    margin-top: 4px;
    color: var(--rose-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.8rem;
}

.teacher-system-card {
    margin-bottom: 22px;
    padding: 0;
    overflow: hidden;
}

.teacher-system-card > summary {
    display: flex;
    min-height: 84px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 24px;
    cursor: pointer;
    list-style: none;
}

.teacher-system-card > summary::-webkit-details-marker {
    display: none;
}

.teacher-system-card > summary span:first-child {
    display: grid;
    gap: 4px;
}

.teacher-system-card > summary small {
    color: var(--rose-dark);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.teacher-system-card > summary strong {
    color: var(--plum-deep);
    font-size: 1.05rem;
}

.system-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 850;
}

.system-status-pill.is-ready {
    color: #3d6d5d;
    background: var(--sage-soft);
}

.system-status-pill.needs-attention {
    color: var(--warning);
    background: var(--champagne-soft);
}

.teacher-system-content {
    padding: 0 24px 24px;
    border-top: 1px solid rgba(98, 70, 95, 0.1);
}

.teacher-system-content .lesson-summary {
    margin-top: 22px;
}

.teacher-layout {
    display: grid;
    grid-template-columns: minmax(330px, .78fr) minmax(0, 1.22fr);
    gap: 22px;
    align-items: start;
}

.teacher-panel {
    padding: clamp(24px, 3vw, 34px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: var(--shadow-sm);
}

.teacher-panel h2,
.portal-card h1,
.portal-card h2 {
    color: var(--ink-deep);
}

.teacher-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.teacher-panel-heading h2 {
    margin-bottom: 0;
}

.portal-form label {
    color: var(--plum-deep);
    font-weight: 800;
}

.portal-form input,
.portal-form select,
.portal-form textarea {
    background: #fff;
    border-color: rgba(98, 70, 95, 0.16);
    border-radius: 14px;
}

.portal-form input:focus,
.portal-form select:focus,
.portal-form textarea:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 4px rgba(182, 111, 130, 0.1);
}

.invite-result-premium {
    display: grid;
    gap: 15px;
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(145deg, #fff8fa, #f9eef2);
    border: 1px solid rgba(182, 111, 130, 0.16);
    border-radius: 24px;
}

.invite-result-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.invite-result-heading > span {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #fff;
    background: var(--sage);
    border-radius: 13px;
    font-weight: 900;
}

.invite-result-heading div {
    display: grid;
}

.invite-result-heading strong {
    color: var(--plum-deep);
}

.invite-result-heading small {
    color: var(--muted);
}

.invite-code-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 15px;
    background: #fff;
    border: 1px solid rgba(182, 111, 130, 0.12);
    border-radius: 18px;
}

.invite-code-card > span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
}

.invite-code {
    color: var(--rose-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.18rem;
    letter-spacing: .1em;
}

.copy-row input {
    color: var(--ink-soft);
    background: #fff;
    border-radius: 14px;
}

.invite-list {
    gap: 12px;
}

.invite-item {
    padding: 18px;
    background: linear-gradient(145deg, #fff, #fff9fa);
    border: 1px solid rgba(182, 111, 130, 0.13);
    border-radius: 22px;
}

.invite-item.is-expired {
    background: #f8f4f5;
    opacity: .82;
}

.invite-item h3 {
    color: var(--plum-deep);
    font-size: 1.05rem;
}

.invite-item-code {
    display: inline-flex;
    margin-left: 7px;
    padding: 5px 8px;
    color: var(--rose-dark);
    background: var(--rose-soft);
    border-radius: 999px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .68rem;
    letter-spacing: .08em;
}

.invite-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.text-button {
    color: var(--rose-dark);
    font-weight: 800;
}

.text-button:hover {
    color: var(--plum-deep);
}

.text-button-danger {
    color: var(--error);
}

.empty-state {
    color: var(--muted);
    background: var(--cream);
    border: 1px dashed rgba(182, 111, 130, 0.22);
    border-radius: 20px;
}

.review-manager {
    margin-top: 22px;
}

.review-manager-grid {
    gap: 24px;
}

.review-admin-item {
    background: #fff;
    border-color: rgba(182, 111, 130, 0.13);
    border-radius: 20px;
}

.review-admin-item.is-published {
    border-color: rgba(79, 128, 110, 0.24);
    box-shadow: inset 4px 0 0 var(--sage);
}

.portal-alert {
    border-radius: 16px;
}

.portal-alert-success {
    color: #3f6e5e;
    background: var(--sage-soft);
    border-color: rgba(79, 128, 110, 0.22);
}

.portal-alert-info {
    color: #6d5430;
    background: var(--champagne-soft);
    border-color: rgba(215, 180, 117, 0.26);
}

.portal-alert-error {
    color: #8a3545;
    background: #f9e8ec;
    border-color: rgba(162, 68, 85, 0.2);
}

.lesson-summary > div {
    background: var(--cream);
    border-color: rgba(182, 111, 130, 0.11);
    border-radius: 18px;
}

.lesson-summary span {
    color: var(--muted);
}

.lesson-summary strong {
    color: var(--plum-deep);
}

/* Classroom entry and call */
.classroom-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 0%, rgba(182, 111, 130, 0.11), transparent 26rem),
        radial-gradient(circle at 92% 4%, rgba(215, 180, 117, 0.11), transparent 28rem),
        var(--cream);
}

.classroom-access-card {
    max-width: 780px;
    margin-inline: auto;
    padding: clamp(28px, 5vw, 48px);
}

.classroom-access-intro {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 20px;
    align-items: start;
}

.classroom-access-icon {
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    color: #fff;
    background: var(--gradient-primary);
    border-radius: 22px;
    box-shadow: 0 16px 36px rgba(142, 83, 101, 0.22);
}

.classroom-access-icon svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.classroom-code-form {
    margin-top: 24px;
}

.classroom-code-form > label {
    display: block;
    margin-bottom: 8px;
    color: var(--plum-deep);
    font-weight: 850;
}

.classroom-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.classroom-code-row input {
    min-height: 54px;
    padding-inline: 18px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.classroom-home-link {
    display: inline-flex;
    margin-top: 8px;
}

.classroom-access-actions {
    align-items: center;
}

.portal-progress span {
    background: linear-gradient(90deg, var(--rose), var(--champagne));
}

.portal-main-classroom {
    padding-top: 94px;
    padding-inline: 18px;
    padding-bottom: 22px;
}

.private-classroom-shell {
    width: min(100%, 1560px);
    margin-inline: auto;
}

.classroom-topbar {
    min-height: 58px;
    padding: 8px 4px 12px;
}

.classroom-meta span {
    color: var(--plum);
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(182, 111, 130, 0.14);
    border-radius: 999px;
}

.rtc-security-badge {
    color: #3d6d5d;
    background: var(--sage-soft);
    border-color: rgba(79, 128, 110, 0.2);
    border-radius: 999px;
}

.rtc-security-badge svg {
    width: 17px !important;
    height: 17px !important;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.private-classroom {
    position: relative;
    overflow: hidden;
    background: #241c26;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    box-shadow: 0 32px 90px rgba(43, 36, 48, 0.28);
}

.rtc-workspace {
    min-height: min(72vh, 760px);
    gap: 12px;
    padding: 12px;
}

.rtc-stage {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #1c171f, #302532);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
}

.rtc-video-card {
    background: #1d1720;
    border-color: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
}

.rtc-remote-card {
    min-height: 100%;
}

.rtc-local-card {
    right: 18px;
    bottom: 18px;
    width: min(28%, 300px);
    min-width: 190px;
    border: 2px solid rgba(248, 233, 238, 0.84);
    border-radius: 20px;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
}

.rtc-video-placeholder {
    color: rgba(255, 255, 255, 0.76);
}

.rtc-video-placeholder h1,
.rtc-video-placeholder p {
    color: rgba(255, 255, 255, 0.78);
}

.rtc-placeholder-mark {
    color: #fff;
    background: var(--gradient-primary);
    border-radius: 22px;
}

.rtc-video-label {
    color: #fff;
    background: rgba(43, 36, 48, 0.76);
    border-color: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    backdrop-filter: blur(10px);
}

.rtc-presence-dot {
    background: #61c49e;
}

.rtc-chat-panel {
    background: #fffaf8;
    border-color: rgba(255, 255, 255, 0.1);
    border-radius: 22px;
}

.rtc-chat-header {
    background: #fff;
    border-bottom-color: rgba(98, 70, 95, 0.1);
}

.rtc-chat-header h2 {
    color: var(--plum-deep);
}

.rtc-chat-header p,
.rtc-chat-empty,
.rtc-chat-waiting {
    color: var(--muted);
}

.rtc-chat-form {
    background: #fff;
    border-top-color: rgba(98, 70, 95, 0.1);
}

.rtc-chat-form textarea {
    background: var(--cream);
    border-color: rgba(98, 70, 95, 0.14);
    border-radius: 15px;
}

.rtc-bottom-bar {
    background: rgba(36, 28, 38, 0.98);
    border-top-color: rgba(255, 255, 255, 0.08);
}

.rtc-status {
    color: rgba(255, 255, 255, 0.74);
}

.rtc-control {
    color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.rtc-control:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.rtc-control[aria-pressed="false"] {
    color: #f2d7de;
    background: rgba(182, 111, 130, 0.22);
    border-color: rgba(182, 111, 130, 0.28);
}

.rtc-control-leave {
    color: #fff;
    background: var(--gradient-primary);
    border-color: transparent;
}

.rtc-control-icon svg {
    stroke: currentColor;
}

.rtc-error-panel {
    background: rgba(125, 43, 59, 0.97);
    border-color: rgba(255, 255, 255, 0.12);
    border-radius: 20px;
}

/* Error page */
.error-page .utility-card {
    text-align: center;
}

/* Reveal animation */
[data-reveal] {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
    transition:
        opacity 640ms var(--ease-spring) var(--reveal-delay, 0ms),
        transform 640ms var(--ease-spring) var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Responsive */
@media (max-width: 1120px) {
    .hero-grid,
    .about-grid,
    .service-hero-grid,
    .profile-hero-grid,
    .profile-reading-grid,
    .profile-visual-grid {
        gap: 48px;
    }

    .teacher-dashboard-hero {
        grid-template-columns: 1fr;
    }

    .teacher-dashboard-stats {
        width: 100%;
    }
}

@media (max-width: 980px) {
    .hero-grid,
    .about-grid,
    .service-hero-grid,
    .profile-hero-grid,
    .profile-reading-grid,
    .profile-visual-grid,
    .teacher-layout {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        max-width: none;
    }

    .hero-visual {
        width: min(100%, 620px);
    }

    .hero-credentials {
        width: 100%;
    }

    .about-copy,
    .profile-method-copy {
        max-width: 760px;
    }

    .profile-visual-grid-reverse > :first-child {
        order: initial;
    }

    .rtc-workspace {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .rtc-stage {
        min-height: 62vh;
    }

    .rtc-chat-panel {
        min-height: 360px;
    }
}

@media (max-width: 760px) {
    .site-header,
    .portal-header,
    .simple-header {
        backdrop-filter: blur(16px);
    }

    .brand-mark {
        width: 43px;
        height: 43px;
        border-radius: 16px;
    }

    .hero {
        padding-top: 112px;
        padding-bottom: 72px;
    }

    .hero h1 {
        font-size: clamp(2.62rem, 13vw, 4.25rem);
    }

    .hero-grid {
        gap: 42px;
    }

    .portrait-panel {
        width: min(100%, 430px);
        border-radius: 36px 36px 22px 22px;
    }

    .portrait-media {
        border-radius: 34px 34px 16px 16px;
    }

    .portrait-caption {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-credentials,
    .profile-proof-grid,
    .teacher-dashboard-stats {
        grid-template-columns: 1fr;
    }

    .hero-credential {
        min-height: auto;
        display: grid;
        grid-template-columns: 34px 1fr;
        align-items: center;
        gap: 12px;
    }

    .hero-credential > span {
        margin-bottom: 0;
    }

    .availability-track {
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .availability-track::-webkit-scrollbar {
        display: none;
    }

    .classroom-code-row,
    .invite-code-card {
        grid-template-columns: 1fr;
    }

    .classroom-access-intro {
        grid-template-columns: 1fr;
    }

    .classroom-access-icon {
        width: 54px;
        height: 54px;
    }

    .teacher-panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .invite-actions {
        justify-content: flex-start;
    }

    .classroom-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .rtc-stage {
        min-height: 56vh;
    }

    .rtc-local-card {
        width: 34%;
        min-width: 142px;
    }

    .rtc-bottom-bar {
        gap: 10px;
    }

    .rtc-controls {
        width: 100%;
        justify-content: center;
    }

    .rtc-control {
        min-width: 62px;
    }

    .floating-contact {
        right: 14px;
        bottom: 14px;
        width: 58px;
        padding: 0;
    }

    .floating-contact span {
        display: none;
    }
}

@media (max-width: 520px) {
    .button-row {
        align-items: stretch;
        flex-direction: column;
    }

    .button-row .button,
    .button-row form,
    .button-row form .button {
        width: 100%;
    }

    .hero h1 {
        font-size: clamp(2.45rem, 13vw, 3.7rem);
    }

    .hero-title-accent {
        font-size: 1.16rem;
    }

    .portrait-caption {
        padding: 18px;
    }

    .portrait-status {
        white-space: normal;
    }

    .teacher-dashboard-hero,
    .teacher-panel,
    .portal-card,
    .utility-card {
        border-radius: 24px;
    }

    .teacher-dashboard-stats article {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }

    .teacher-dashboard-stats strong {
        margin-top: 0;
    }

    .invite-item {
        align-items: stretch;
        flex-direction: column;
    }

    .portal-main-classroom {
        padding-inline: 8px;
    }

    .private-classroom {
        border-radius: 20px;
    }

    .rtc-workspace {
        padding: 8px;
    }

    .rtc-stage,
    .rtc-chat-panel {
        border-radius: 16px;
    }

    .rtc-local-card {
        right: 10px;
        bottom: 10px;
        min-width: 120px;
        border-radius: 14px;
    }

    .rtc-control span:last-child {
        display: none;
    }

    .rtc-control {
        min-width: 50px;
        min-height: 50px;
        padding: 8px;
        border-radius: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }
}

/* ========================================================================== 
   Final responsive stabilization
   Fixes long Russian headings, service-card sizing, contact contrast and the
   mobile LiveKit classroom without changing the established visual identity.
   ========================================================================== */

/* Defensive layout rules for every language and every grid-based page. */
.site-page main,
.service-hero-grid > *,
.service-reading-grid > *,
.contact-grid > *,
.footer-grid > *,
.profile-reading-grid > *,
.profile-hero-grid > *,
.teacher-layout > *,
.rtc-workspace > * {
    min-width: 0;
}

.site-page h1,
.site-page h2,
.site-page h3,
.portal-page h1,
.portal-page h2,
.portal-page h3 {
    text-wrap: balance;
}

.site-page p,
.site-page li,
.site-page a,
.portal-page p,
.portal-page li,
.portal-page a {
    overflow-wrap: break-word;
}

/* Contact panel: stronger contrast and safe wrapping for long addresses. */
.contact-direct {
    width: min(100%, 540px);
    padding: 20px 22px;
}

.contact-direct > span {
    color: rgba(255, 255, 255, 0.78);
}

.contact-direct a {
    max-width: 100%;
    overflow-wrap: anywhere;
    text-decoration-color: rgba(255, 255, 255, 0.46);
}

.site-footer a,
.footer-grid p {
    overflow-wrap: anywhere;
}

/* Service hero artwork: a complete card instead of an unstyled figure. */
.service-hero-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.68fr);
    gap: clamp(44px, 6.5vw, 88px);
}

.service-hero-copy h1 {
    max-width: 15ch;
    font-size: clamp(3rem, 5.4vw, 5.2rem);
    line-height: 0.98;
    hyphens: auto;
}

.service-illustration {
    display: grid;
    width: min(100%, 430px);
    margin: 0;
    justify-self: end;
    grid-template-rows: auto auto;
    isolation: isolate;
}

.service-illustration img {
    width: 100%;
    aspect-ratio: 36 / 31;
    padding: clamp(16px, 2.2vw, 26px);
    object-fit: contain;
    background:
        radial-gradient(circle at 85% 15%, rgba(215, 180, 117, 0.17), transparent 42%),
        linear-gradient(145deg, #fffaf8, #f7e9ee);
}

.service-illustration figcaption {
    display: grid;
    gap: 6px;
    padding: 20px 24px 24px;
    background: rgba(255, 255, 255, 0.88);
    border-top: 1px solid rgba(98, 70, 95, 0.09);
}

.service-illustration figcaption span {
    color: var(--rose-dark);
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.service-illustration figcaption strong {
    color: var(--plum-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.22rem, 1.8vw, 1.62rem);
    line-height: 1.22;
    letter-spacing: -0.02em;
    overflow-wrap: normal;
    hyphens: auto;
}

.service-illustration figcaption small {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

/* Long editorial service headings must never cross into the prose column. */
.service-reading-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: clamp(42px, 5.5vw, 72px);
}

.service-reading-grid .section-heading {
    width: 100%;
    max-width: none;
}

.service-reading-grid .section-heading h2 {
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
    font-size: clamp(2.55rem, 3.25vw, 3.55rem);
    line-height: 0.99;
    letter-spacing: -0.045em;
    hyphens: auto;
    overflow-wrap: normal;
    word-break: normal;
}

.service-detail-section .service-reading-grid .section-heading h2 {
    max-width: 100%;
}

.service-prose {
    width: 100%;
    max-width: 720px;
}

.service-prose p {
    max-width: 68ch;
}

.section-dark .service-prose p {
    color: rgba(255, 255, 255, 0.82);
}

/* Floating WhatsApp control must stay fully inside narrow viewports. */
.floating-contact {
    max-width: calc(100vw - 28px);
}

/* Classroom: remove the old desktop-sized blank area above the lesson. */
.portal-main-classroom {
    min-height: calc(100dvh - 78px);
    padding: 10px 12px 14px;
}

.private-classroom-shell {
    display: flex;
    min-height: calc(100dvh - 102px);
    flex-direction: column;
}

.classroom-topbar {
    flex: 0 0 auto;
}

.private-classroom {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
}

.rtc-workspace {
    min-height: 0;
    flex: 1 1 auto;
}

.rtc-stage {
    min-height: 440px;
}

.rtc-video-card video {
    object-position: center;
}

.rtc-control-chat,
.rtc-chat-close,
.rtc-chat-backdrop {
    display: none;
}

.rtc-chat-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

/* Stack editorial columns before Russian headings become cramped. */
@media (max-width: 1180px) {
    .service-reading-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .service-reading-grid .section-heading {
        position: static;
    }

    .service-reading-grid .section-heading h2,
    .service-detail-section .service-reading-grid .section-heading h2 {
        max-width: 18ch;
        font-size: clamp(2.55rem, 5vw, 4.25rem);
    }

    .service-prose {
        max-width: 820px;
    }
}

@media (max-width: 980px) {
    .service-hero-grid {
        grid-template-columns: 1fr;
    }

    .service-hero-copy h1 {
        max-width: 16ch;
    }

    .service-illustration {
        width: min(100%, 520px);
        justify-self: center;
    }
}

/* Mobile classroom: large remote video, unobtrusive self-view and chat drawer. */
@media (max-width: 820px) {
    .classroom-page {
        overflow-x: hidden;
    }

    .classroom-page .portal-header {
        min-height: 64px;
    }

    .classroom-page .portal-header .header-inner {
        min-height: 64px;
    }

    .classroom-page .brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 15px;
        font-size: 1.25rem;
    }

    .classroom-page .brand-copy strong {
        font-size: 1.08rem;
    }

    .classroom-page .brand-copy small {
        font-size: 0.55rem;
    }

    .classroom-page .portal-actions {
        gap: 2px;
    }

    .classroom-page .portal-actions .button {
        min-height: 40px;
        padding-inline: 14px;
        font-size: 0.72rem;
    }

    .portal-main-classroom {
        min-height: calc(100dvh - 64px);
        padding: 5px 5px max(5px, env(safe-area-inset-bottom));
    }

    .private-classroom-shell {
        width: 100%;
        min-height: calc(100dvh - 74px);
        padding: 0;
    }

    .classroom-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 6px;
        min-height: 48px;
        padding: 5px 4px 7px;
    }

    .classroom-meta {
        min-width: 0;
        gap: 5px;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .classroom-meta::-webkit-scrollbar {
        display: none;
    }

    .classroom-meta span {
        flex: 0 0 auto;
        padding: 5px 8px;
        font-size: 0.62rem;
        white-space: nowrap;
    }

    .classroom-topbar-actions {
        gap: 5px;
    }

    .classroom-topbar-actions .simple-back {
        display: none;
    }

    .rtc-security-badge {
        max-width: 44px;
        min-height: 34px;
        justify-content: center;
        padding: 7px 10px;
        overflow: hidden;
        font-size: 0;
        white-space: nowrap;
    }

    .rtc-security-badge svg {
        width: 18px !important;
        height: 18px !important;
    }

    .private-classroom {
        min-height: 0;
        border-radius: 20px;
    }

    .rtc-workspace {
        display: block;
        min-height: 0;
        padding: 7px;
    }

    .rtc-stage {
        width: 100%;
        height: calc(100dvh - 196px - env(safe-area-inset-bottom));
        min-height: 390px;
        max-height: 760px;
        border-radius: 16px;
    }

    .rtc-remote-card video {
        object-fit: contain !important;
        background: #18121a;
    }

    .rtc-local-card {
        top: 10px;
        right: 10px;
        bottom: auto;
        width: clamp(105px, 28vw, 150px);
        min-width: 0;
        aspect-ratio: 3 / 4;
        border-width: 2px;
        border-radius: 16px;
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
    }

    .rtc-local-card video {
        object-fit: cover !important;
    }

    .rtc-video-label {
        right: auto;
        bottom: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        padding: 6px 9px;
        font-size: 0.64rem;
    }

    .rtc-video-label-local {
        right: 6px;
        bottom: 6px;
        left: 6px;
        justify-content: center;
        max-width: none;
        padding: 5px 7px;
        font-size: 0.58rem;
    }

    .rtc-video-placeholder {
        padding: 24px 18px;
    }

    .rtc-placeholder-mark {
        width: 64px;
        height: 64px;
        margin-bottom: 14px;
        border-radius: 20px;
        font-size: 1.9rem;
    }

    .rtc-video-placeholder h1 {
        max-width: 12ch;
        margin-bottom: 8px;
        font-size: clamp(1.7rem, 8vw, 2.45rem);
    }

    .rtc-video-placeholder p {
        max-width: 32ch;
        font-size: 0.76rem;
        line-height: 1.55;
    }

    .rtc-bottom-bar {
        z-index: 35;
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
        min-height: auto;
        padding: 7px 7px calc(7px + env(safe-area-inset-bottom));
    }

    .rtc-status {
        grid-column: 1;
        grid-row: 1;
        min-height: 20px;
        justify-self: center;
        padding-left: 13px;
        overflow: hidden;
        max-width: 100%;
        font-size: 0.6rem;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .rtc-controls {
        display: grid;
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 5px;
    }

    .rtc-control-chat {
        display: grid;
    }

    .rtc-control {
        min-width: 0;
        min-height: 52px;
        padding: 7px 3px;
        border-radius: 14px;
        font-size: 0.52rem;
    }

    .rtc-control-icon,
    .rtc-control-icon svg {
        width: 19px;
        height: 19px;
    }

    .rtc-control-chat.has-unread::after {
        position: absolute;
        top: 5px;
        right: 7px;
        width: 8px;
        height: 8px;
        background: #f2b7c5;
        border: 2px solid #2e2430;
        border-radius: 50%;
        content: "";
    }

    .rtc-control-chat {
        position: relative;
    }

    .rtc-chat-backdrop {
        position: absolute;
        z-index: 38;
        inset: 0;
        width: 100%;
        height: 100%;
        padding: 0;
        background: rgba(20, 14, 22, 0.58);
        border: 0;
        opacity: 0;
        pointer-events: none;
        transition: opacity 220ms ease;
    }

    .rtc-chat-panel {
        position: absolute;
        z-index: 40;
        right: 7px;
        bottom: 7px;
        left: 7px;
        display: grid;
        height: min(76dvh, 680px);
        min-height: 360px;
        max-height: calc(100% - 14px);
        border-radius: 20px;
        opacity: 0;
        pointer-events: none;
        transform: translate3d(0, calc(100% + 18px), 0);
        transition: transform 280ms var(--ease-spring), opacity 200ms ease;
    }

    .private-classroom.is-chat-open .rtc-chat-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .private-classroom.is-chat-open .rtc-chat-panel {
        opacity: 1;
        pointer-events: auto;
        transform: translate3d(0, 0, 0);
    }

    .rtc-chat-header {
        padding: 14px 15px;
    }

    .rtc-chat-header h2 {
        font-size: 0.95rem;
    }

    .rtc-chat-header p {
        max-width: 34ch;
        font-size: 0.62rem;
        line-height: 1.45;
    }

    .rtc-chat-close {
        display: grid;
        flex: 0 0 auto;
        width: 38px;
        height: 38px;
        place-items: center;
        color: var(--plum-deep);
        background: var(--rose-soft);
        border: 1px solid rgba(182, 111, 130, 0.15);
        border-radius: 13px;
    }

    .rtc-chat-close svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-width: 2;
    }

    .rtc-chat-messages {
        padding: 13px;
    }

    .rtc-chat-form {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 9px;
    }

    .rtc-chat-form textarea {
        min-height: 48px;
        max-height: 96px;
    }

    .rtc-error-panel {
        right: 8px;
        bottom: calc(78px + env(safe-area-inset-bottom));
        left: 8px;
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        padding: 14px;
        border-radius: 16px;
    }

    .rtc-error-panel .button {
        width: 100%;
    }
}

@media (max-width: 620px) {
    .container {
        width: min(calc(100% - 28px), var(--container));
    }

    .service-hero {
        padding-bottom: 64px;
    }

    .service-hero-copy h1 {
        max-width: none;
        font-size: clamp(2.55rem, 12vw, 3.8rem);
    }

    .service-reading-grid .section-heading h2,
    .service-detail-section .service-reading-grid .section-heading h2 {
        max-width: none;
        font-size: clamp(2.35rem, 11vw, 3.35rem);
        line-height: 1;
    }

    .service-illustration {
        width: 100%;
        border-radius: 26px;
    }

    .service-illustration figcaption {
        padding: 18px 19px 21px;
    }

    .service-highlight-list {
        grid-template-columns: 1fr;
    }

    .contact-direct {
        padding: 18px;
    }

    .classroom-code-row {
        grid-template-columns: 1fr;
    }

    .classroom-code-row .button {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .classroom-page .portal-header .brand-copy small {
        display: none;
    }

    .classroom-page .portal-actions .simple-back:first-child {
        padding-inline: 8px;
        font-size: 0.68rem;
    }

    .rtc-stage {
        height: calc(100dvh - 188px - env(safe-area-inset-bottom));
        min-height: 350px;
    }

    .rtc-local-card {
        width: 104px;
    }

    .rtc-control span:last-child {
        display: none;
    }

    .rtc-control {
        min-height: 48px;
        padding: 8px 2px;
    }

    .rtc-status {
        max-width: 92vw;
    }
}

@media (max-height: 660px) and (max-width: 820px) {
    .rtc-stage {
        height: calc(100dvh - 178px - env(safe-area-inset-bottom));
        min-height: 300px;
    }

    .rtc-placeholder-mark {
        width: 52px;
        height: 52px;
        margin-bottom: 9px;
        font-size: 1.55rem;
    }

    .rtc-video-placeholder h1 {
        font-size: 1.65rem;
    }

    .rtc-video-placeholder p {
        display: none;
    }
}

/* Keep the complete mobile classroom, including controls, inside the viewport. */
@media (max-width: 760px) {
    .rtc-stage {
        height: calc(100dvh - 255px - env(safe-area-inset-bottom));
        min-height: 320px;
    }

    .rtc-bottom-bar {
        position: relative;
        bottom: auto;
    }
}

@media (max-width: 430px) {
    .rtc-stage {
        height: calc(100dvh - 255px - env(safe-area-inset-bottom));
        min-height: 320px;
    }
}

@media (max-height: 660px) and (max-width: 900px) {
    .portal-main-classroom {
        padding-top: 2px;
    }

    .classroom-topbar {
        min-height: 40px;
        margin-bottom: 5px;
        padding-block: 3px 5px;
    }

    .rtc-stage {
        height: calc(100dvh - 222px - env(safe-area-inset-bottom));
        min-height: 210px;
    }

    .rtc-bottom-bar {
        padding-top: 5px;
    }
}

/* Compact landscape classroom for phones and small tablets. */
@media (max-height: 660px) and (max-width: 900px) {
    .classroom-page .portal-header {
        display: none;
    }

    .portal-main-classroom {
        min-height: 100dvh;
        padding: 3px 5px;
    }

    .private-classroom-shell {
        width: 100%;
        min-height: calc(100dvh - 6px);
        padding: 0;
    }

    .classroom-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 42px;
        margin-bottom: 4px;
        padding: 3px 5px;
        border-radius: 13px;
    }

    .classroom-meta {
        flex-wrap: nowrap;
        min-width: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .classroom-meta::-webkit-scrollbar {
        display: none;
    }

    .classroom-meta > span {
        flex: 0 0 auto;
        padding: 5px 8px;
        font-size: 0.58rem;
    }

    .classroom-topbar-actions .simple-back {
        display: none;
    }

    .rtc-security-badge {
        width: 38px;
        max-width: 38px;
        min-height: 32px;
        justify-content: center;
        padding: 6px;
        overflow: hidden;
        font-size: 0;
    }

    .private-classroom {
        height: calc(100dvh - 52px);
        min-height: 0;
        padding: 0;
        overflow: hidden;
        border-radius: 17px;
    }

    .rtc-workspace {
        position: relative;
        display: block;
        min-height: 0;
        padding: 5px;
    }

    .rtc-stage {
        width: 100%;
        height: 100%;
        min-height: 0;
        border-radius: 13px;
    }

    .rtc-local-card {
        top: 8px;
        right: 8px;
        bottom: auto;
        width: clamp(92px, 18vw, 128px);
        min-width: 0;
        aspect-ratio: 4 / 3;
        border-radius: 13px;
    }

    .rtc-video-placeholder {
        padding: 12px;
    }

    .rtc-placeholder-mark {
        width: 52px;
        height: 52px;
        margin-bottom: 7px;
        border-radius: 18px;
        font-size: 1.55rem;
    }

    .rtc-video-placeholder h1 {
        max-width: none;
        margin-bottom: 4px;
        font-size: clamp(1.35rem, 4vw, 2rem);
    }

    .rtc-video-placeholder p {
        max-width: 46ch;
        font-size: 0.65rem;
    }

    .rtc-video-label {
        bottom: 7px;
        left: 7px;
        padding: 5px 8px;
        font-size: 0.58rem;
    }

    .rtc-video-label-local {
        right: 5px;
        bottom: 5px;
        left: 5px;
        padding: 4px 6px;
        font-size: 0.52rem;
    }

    .rtc-bottom-bar {
        display: grid;
        min-height: 58px;
        padding: 5px 7px calc(5px + env(safe-area-inset-bottom));
    }

    .rtc-status {
        display: none;
    }

    .rtc-controls {
        display: grid;
        width: min(100%, 520px);
        margin-inline: auto;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 5px;
    }

    .rtc-control-chat {
        display: grid;
    }

    .rtc-control {
        min-width: 0;
        min-height: 46px;
        padding: 5px 3px;
        border-radius: 12px;
        font-size: 0.5rem;
    }

    .rtc-control-icon,
    .rtc-control-icon svg {
        width: 18px;
        height: 18px;
    }

    .rtc-chat-backdrop {
        position: absolute;
        z-index: 38;
        inset: 0;
        width: 100%;
        height: 100%;
        padding: 0;
        background: rgba(20, 14, 22, 0.58);
        border: 0;
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    .rtc-chat-panel {
        position: absolute;
        z-index: 40;
        top: 5px;
        right: 5px;
        bottom: 5px;
        left: 5px;
        display: grid;
        width: auto;
        height: auto;
        min-height: 0;
        max-height: none;
        border-radius: 16px;
        opacity: 0;
        pointer-events: none;
        transform: translate3d(0, calc(100% + 10px), 0);
        transition: transform 240ms var(--ease-spring), opacity 180ms ease;
    }

    .private-classroom.is-chat-open .rtc-chat-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .private-classroom.is-chat-open .rtc-chat-panel {
        opacity: 1;
        pointer-events: auto;
        transform: translate3d(0, 0, 0);
    }

    .rtc-chat-close {
        display: grid;
    }

    .rtc-chat-header {
        padding: 10px 12px;
    }

    .rtc-chat-header p {
        display: none;
    }

    .rtc-chat-messages {
        padding: 10px;
    }

    .rtc-chat-form {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 7px;
    }

    .rtc-chat-form textarea {
        min-height: 42px;
        max-height: 70px;
    }

    .rtc-error-panel {
        right: 7px;
        bottom: 64px;
        left: 7px;
        padding: 10px;
    }
}

/* Final mobile classroom viewport corrections.
   Keep controls and the chat drawer fully inside portrait phones, and preserve
   the complete student video in compact landscape orientation. */
@media (max-width: 820px) and (min-height: 661px) {
    .rtc-chat-backdrop {
        position: fixed;
        z-index: 998;
        inset: 0;
        width: 100vw;
        height: 100dvh;
    }

    .rtc-chat-panel {
        position: fixed;
        z-index: 999;
        top: auto;
        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
        left: max(10px, env(safe-area-inset-left));
        width: auto;
        height: min(76dvh, 680px);
        min-height: min(340px, calc(100dvh - 20px));
        max-height: calc(100dvh - 20px);
    }
}

@media (max-width: 430px) and (min-height: 661px) {
    .rtc-stage {
        height: calc(100dvh - 265px - env(safe-area-inset-bottom));
    }
}

@media (max-height: 660px) and (max-width: 900px) {
    .rtc-remote-card video {
        object-fit: contain !important;
        background: #18121a;
    }
}

/* Official Yandex Business reviews widget */
.yandex-reviews-section {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 18%, rgba(246, 205, 215, 0.5), transparent 24rem),
        radial-gradient(circle at 92% 86%, rgba(215, 180, 117, 0.18), transparent 28rem),
        linear-gradient(180deg, #fffaf7 0%, #fbf1f4 100%);
}

.yandex-reviews-section::before {
    content: '';
    position: absolute;
    width: 340px;
    height: 340px;
    top: -170px;
    right: -100px;
    border: 1px solid rgba(182, 111, 130, 0.18);
    border-radius: 50%;
    pointer-events: none;
}

.yandex-reviews-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(280px, 0.78fr) minmax(300px, 1.22fr);
    align-items: center;
    gap: clamp(34px, 6vw, 84px);
}

.yandex-reviews-copy h2 {
    max-width: 11ch;
    margin-bottom: 22px;
    font-size: clamp(2.4rem, 5vw, 5rem);
    line-height: 0.98;
}

.yandex-reviews-copy > p:not(.eyebrow):not(.yandex-reviews-status) {
    max-width: 600px;
    font-size: 1.08rem;
    line-height: 1.8;
}

.yandex-reviews-trust {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 28px 0;
    padding: 17px 18px;
    max-width: 560px;
    border: 1px solid rgba(75, 52, 69, 0.10);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-xs);
}

.yandex-mark,
.yandex-widget-symbol {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    background: linear-gradient(145deg, #e5484d 0%, #d8262e 100%);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    box-shadow: 0 14px 30px rgba(216, 38, 46, 0.20);
}

.yandex-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 1.45rem;
}

.yandex-reviews-trust strong,
.yandex-reviews-trust span {
    display: block;
}

.yandex-reviews-trust strong {
    margin-bottom: 3px;
    color: var(--ink-deep);
}

.yandex-reviews-trust span {
    color: var(--muted);
    font-size: 0.91rem;
    line-height: 1.5;
}

.yandex-reviews-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.yandex-reviews-actions .button {
    min-height: 52px;
}

.button-refresh-icon {
    display: inline-block;
    margin-right: 7px;
    font-size: 1.15em;
    transition: transform 320ms ease;
}

.yandex-reviews-section.is-loading .button-refresh-icon {
    animation: yandexRefreshSpin 900ms linear infinite;
}

@keyframes yandexRefreshSpin {
    to { transform: rotate(360deg); }
}

.yandex-reviews-status {
    min-height: 1.5em;
    margin-top: 15px;
    color: var(--muted);
    font-size: 0.88rem;
}

.yandex-widget-card {
    position: relative;
    width: min(100%, 760px);
    min-width: 0;
    min-height: 560px;
    justify-self: center;
    overflow: hidden;
    border: 1px solid rgba(75, 52, 69, 0.12);
    border-radius: 32px;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.yandex-widget-card::before {
    content: '';
    position: absolute;
    z-index: 2;
    inset: 0 auto auto 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #e5484d, #b66f82, #d7b475);
    pointer-events: none;
}

.yandex-widget-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 13px;
    padding: 36px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 36%, rgba(246, 205, 215, 0.5), transparent 15rem),
        #fff;
}

.yandex-widget-placeholder[hidden] {
    display: none;
}

.yandex-widget-symbol {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    font-size: 2rem;
}

.yandex-widget-placeholder strong {
    color: var(--ink-deep);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.yandex-widget-placeholder p {
    max-width: 420px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.yandex-reviews-frame {
    display: block;
    width: 100%;
    height: 600px;
    border: 0;
    background: #fff;
}

.yandex-reviews-frame[hidden] {
    display: none;
}

.yandex-widget-attribution {
    position: absolute;
    z-index: 3;
    right: 16px;
    bottom: 12px;
    left: 16px;
    padding: 8px 12px;
    border-radius: 999px;
    color: rgba(74, 52, 69, 0.72);
    background: rgba(255, 255, 255, 0.92);
    font-size: 0.72rem;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 7px 22px rgba(74, 52, 69, 0.08);
}

.yandex-widget-attribution:hover,
.yandex-widget-attribution:focus-visible {
    color: var(--rose-dark);
}

@media (max-width: 980px) {
    .yandex-reviews-grid {
        grid-template-columns: 1fr;
    }

    .yandex-reviews-copy h2 {
        max-width: 15ch;
    }

    .yandex-widget-card {
        width: min(100%, 760px);
        justify-self: start;
    }
}

@media (max-width: 600px) {
    .yandex-reviews-grid {
        gap: 28px;
    }

    .yandex-reviews-copy h2 {
        font-size: clamp(2.35rem, 12vw, 3.55rem);
    }

    .yandex-reviews-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .yandex-reviews-actions .button {
        width: 100%;
        justify-content: center;
    }

    .yandex-widget-card {
        min-height: 520px;
        border-radius: 24px;
    }

    .yandex-reviews-frame {
        height: 560px;
    }

    .yandex-widget-placeholder {
        padding: 28px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .yandex-reviews-section.is-loading .button-refresh-icon {
        animation: none;
    }
}

/* ================================================================
   Final responsive and classroom quality pass, v8
   ================================================================ */

/* Remote classroom video must preserve the complete participant frame. */
.rtc-remote-card video,
.rtc-video-card.rtc-remote-card video {
    object-fit: contain !important;
    object-position: center !important;
    background: #1b151d;
}

.rtc-local-card video {
    object-fit: cover !important;
    object-position: center !important;
}

/* Prevent narrow Russian copy, form controls and cards from creating a few
   pixels of horizontal overflow on compact phones. */
.process-list,
.process-step,
.process-step > div,
.service-reading-grid,
.service-reading-grid > *,
.profile-reading-grid,
.profile-reading-grid > *,
.contact-grid,
.contact-grid > *,
.teacher-layout,
.teacher-layout > *,
.invite-item,
.invite-item > * {
    min-width: 0;
    max-width: 100%;
}

.process-step {
    width: 100%;
    box-sizing: border-box;
}

.service-prose,
.profile-prose,
.privacy-prose,
.contact-direct,
.contact-direct a,
.site-footer a {
    overflow-wrap: anywhere;
}

@media (max-width: 520px) {
    .container {
        width: min(100% - 28px, var(--container, 1180px));
    }

    .content-section,
    .services-section,
    .about-section,
    .profile-story-section,
    .profile-method-section,
    .profile-leadership-section,
    .privacy-section {
        padding-top: 58px;
        padding-bottom: 58px;
    }

    h1,
    h2,
    h3,
    .hero-copy h1,
    .service-hero-copy h1,
    .profile-hero-copy h1,
    .service-reading-grid .section-heading h2,
    .service-detail-section .service-reading-grid .section-heading h2 {
        max-width: 100%;
        overflow-wrap: break-word;
        word-break: normal;
        hyphens: auto;
    }

    .hero-copy h1,
    .service-hero-copy h1,
    .profile-hero-copy h1 {
        font-size: clamp(2.25rem, 11.5vw, 3.25rem);
        line-height: 1.01;
        letter-spacing: -0.045em;
    }

    .section-heading h2,
    .service-reading-grid .section-heading h2,
    .service-detail-section .service-reading-grid .section-heading h2,
    .profile-method-copy h2,
    .profile-cta-card h2,
    .yandex-reviews-copy h2 {
        font-size: clamp(2rem, 10.5vw, 3rem);
        line-height: 1.03;
        letter-spacing: -0.038em;
    }

    .hero-lead,
    .profile-lead,
    .service-hero-copy > p:not(.eyebrow),
    .section-heading > p:not(.eyebrow),
    .service-prose p,
    .profile-prose p {
        font-size: 1rem;
        line-height: 1.68;
    }

    .button-row {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .button-row .button,
    .hero-copy .button,
    .profile-hero-copy .button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .service-hero,
    .profile-hero {
        padding-top: 34px;
        padding-bottom: 58px;
    }

    .service-hero-grid,
    .profile-hero-grid,
    .profile-visual-grid,
    .profile-visual-grid-reverse,
    .service-reading-grid,
    .profile-reading-grid,
    .contact-grid,
    .yandex-reviews-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 30px;
    }

    .service-illustration,
    .editorial-illustration {
        width: 100%;
        min-height: 0;
        padding: 18px;
        border-radius: 26px;
    }

    .service-illustration img,
    .editorial-illustration img {
        display: block;
        width: 100%;
        height: auto;
        max-height: 360px;
        object-fit: contain;
    }

    .process-list {
        gap: 12px;
    }

    .process-step {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 13px;
        padding: 18px 16px;
        margin: 0;
        border-radius: 22px;
    }

    .process-step > span {
        width: 42px;
        height: 42px;
        min-width: 42px;
        font-size: 0.78rem;
    }

    .process-step h3 {
        font-size: 1.12rem;
        line-height: 1.25;
    }

    .process-step p {
        font-size: 0.94rem;
        line-height: 1.58;
    }

    .profile-proof-grid,
    .teacher-dashboard-stats,
    .format-grid,
    .outcome-grid,
    .service-grid,
    .review-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-proof-grid article,
    .teacher-dashboard-stats article,
    .format-card,
    .outcome-card,
    .service-card {
        width: 100%;
        min-width: 0;
    }

    .contact-direct {
        padding: 22px 18px;
        border-radius: 24px;
    }

    .contact-direct a {
        display: flex;
        width: 100%;
        min-width: 0;
        white-space: normal;
        line-height: 1.4;
    }

    .floating-contact {
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        max-width: calc(100vw - 20px);
        min-height: 46px;
        padding: 11px 15px;
        border-radius: 999px;
        font-size: 0.78rem;
    }

    .yandex-reviews-frame,
    .yandex-reviews-widget,
    .yandex-reviews-widget iframe {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .teacher-dashboard-hero,
    .teacher-panel,
    .portal-card,
    .teacher-system-content {
        padding: 20px 16px;
        border-radius: 24px;
    }

    .teacher-dashboard-hero h1,
    .teacher-panel h2,
    .portal-card h1,
    .portal-card h2 {
        font-size: clamp(1.85rem, 9vw, 2.65rem);
        line-height: 1.05;
    }

    .invite-item {
        align-items: stretch;
        gap: 14px;
        padding: 16px;
    }

    .invite-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
    }

    .invite-actions .button,
    .invite-actions button,
    .invite-actions a {
        width: 100%;
        min-width: 0;
        justify-content: center;
        padding-inline: 10px;
        text-align: center;
    }
}

/* Compact phones need a slightly smaller navigation and safe form spacing. */
@media (max-width: 360px) {
    .container {
        width: min(100% - 22px, var(--container, 1180px));
    }

    .site-header .header-inner,
    .portal-header .header-inner {
        padding-inline: 10px;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 14px;
    }

    .brand-copy strong {
        font-size: 1rem;
    }

    .brand-copy small {
        font-size: 0.54rem;
    }

    .hero-copy h1,
    .service-hero-copy h1,
    .profile-hero-copy h1 {
        font-size: clamp(2.05rem, 11.5vw, 2.75rem);
    }

    .section-heading h2,
    .service-reading-grid .section-heading h2,
    .service-detail-section .service-reading-grid .section-heading h2,
    .profile-method-copy h2 {
        font-size: clamp(1.9rem, 10.5vw, 2.55rem);
    }

    .process-step {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 11px;
        padding: 16px 13px;
    }

    .process-step > span {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    .invite-actions {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Classroom portrait phones */
@media (max-width: 820px) {
    .private-classroom,
    .rtc-stage,
    .rtc-workspace,
    .rtc-video-card {
        min-width: 0;
        max-width: 100%;
    }

    .rtc-stage {
        overflow: hidden;
    }

    .rtc-bottom-bar {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
        padding: 7px max(6px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    }

    .rtc-control {
        min-width: 0;
        width: 100%;
        padding: 8px 2px;
        gap: 4px;
        border-radius: 14px;
        font-size: 0.58rem;
        line-height: 1.1;
    }

    .rtc-control svg {
        width: 18px;
        height: 18px;
    }

    .rtc-local-card {
        width: clamp(94px, 25vw, 132px);
        max-width: 32%;
        aspect-ratio: 3 / 4;
    }

    .rtc-error-panel {
        max-height: calc(100dvh - 90px);
        overflow-y: auto;
    }
}

/* Very short portrait phones and landscape phones: prioritise the lesson. */
@media (max-width: 480px) and (max-height: 700px),
       (max-width: 900px) and (max-height: 560px) {
    .classroom-page .portal-header {
        display: none;
    }

    .portal-main-classroom {
        min-height: 100dvh;
        padding: 3px;
    }

    .private-classroom-shell {
        min-height: calc(100dvh - 6px);
    }

    .classroom-topbar {
        min-height: 40px;
        padding: 3px 4px 5px;
    }

    .classroom-meta span {
        padding: 4px 7px;
        font-size: 0.56rem;
    }

    .rtc-security-badge {
        min-height: 30px;
        padding: 5px 8px;
    }

    .rtc-workspace {
        padding: 4px;
    }

    .rtc-stage {
        height: calc(100dvh - 100px - env(safe-area-inset-bottom));
        min-height: 250px;
        max-height: none;
        border-radius: 14px;
    }

    .rtc-local-card {
        top: 7px;
        right: 7px;
        width: clamp(78px, 22vw, 112px);
        border-radius: 13px;
    }

    .rtc-bottom-bar {
        padding-top: 4px;
    }

    .rtc-control {
        min-height: 46px;
        padding-block: 5px;
    }

    .rtc-video-placeholder h1 {
        font-size: clamp(1.45rem, 7vw, 2rem);
    }

    .rtc-video-placeholder p {
        display: none;
    }
}

/* Browser default figure margins can push responsive illustrations outside
   narrow viewports. These components provide their own spacing. */
.service-illustration,
.editorial-illustration,
.classroom-illustration,
.profile-portrait,
.portrait-panel {
    margin: 0;
    box-sizing: border-box;
}

/* Final mobile classroom control layout. The status and controls are separate
   rows so the five actions never collapse into a single narrow grid cell. */
@media (max-width: 820px) {
    .rtc-bottom-bar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: auto auto;
        align-items: stretch;
        width: 100%;
        gap: 6px;
    }

    .rtc-status {
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        justify-self: stretch;
        padding-inline: 16px 4px;
        text-align: left;
    }

    .rtc-controls {
        display: grid !important;
        grid-column: 1 !important;
        grid-row: 2 !important;
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0;
        margin: 0 !important;
        gap: 5px;
    }

    .rtc-controls .rtc-control {
        width: 100%;
        min-width: 0;
        max-width: none;
    }
}

@media (max-width: 900px) and (max-height: 660px) {
    .rtc-bottom-bar {
        grid-template-rows: auto;
    }

    .rtc-status {
        display: none;
    }

    .rtc-controls {
        grid-row: 1 !important;
        width: min(100%, 560px) !important;
        margin-inline: auto !important;
    }
}
