/* Homepage: floating code and result panels, with a human introduction. */
.ct-h5-hero {
    --ct-h5-code: #272232;
    --ct-h5-code-bar: #302939;
    --ct-h5-code-line: #4d425c;
    --ct-h5-code-muted: #c9bfd6;
    --ct-h5-code-tag: #d6b1fa;
    --ct-h5-code-text: #c2dbad;
    --ct-h5-code-input: #3b304b;
    --ct-h5-code-value: #f6de9f;
    --ct-h5-bottom-inset: 32px;
    position: relative;
    overflow: clip;
    padding: 32px 40px var(--ct-h5-bottom-inset);
    background: radial-gradient(ellipse at 15% 45%, var(--ct-hero-glow), transparent 65%), var(--ct-hero-surface);
}
.ct-h5-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.14fr);
    align-items: center;
    gap: 56px;
    max-width: 1280px;
    margin-inline: auto;
}
.ct-h5-story, .ct-h5-details, .ct-h5-lab, .ct-h5-demo, .ct-h5-editor, .ct-h5-result-stack { min-width: 0; }
.ct-h5-story { animation: ct-h5-enter .55s ease-out both; }
.ct-h5-eyebrow {
    display: flex; align-items: center; gap: 9px;
    color: var(--ct-muted); font-size: 15px; font-weight: 650; line-height: 1.8;
    margin-bottom: 16px;
}
.ct-h5-eyebrow > span:first-child { color: var(--ct-accent); font-size: 22px; line-height: 1; flex-shrink: 0; }
.ct-h5-title { margin: 0; }
.ct-h5-welcome { display: block; font-weight: 750; letter-spacing: -.7px; }
.ct-h5-welcome-line { display: block; font-size: clamp(25px, 2.3vw, 32px); line-height: 1.6; }
.ct-h5-welcome-line:first-child { font-size: 22px; font-weight: 550; }
.ct-h5-brand {
    display: block; width: fit-content; position: relative;
    color: var(--ct-accent); font-size: clamp(48px, 4.4vw, 60px); font-weight: 850;
    line-height: 1.25; letter-spacing: -2px; margin-block: 4px 10px;
}
.ct-h5-brand-underline {
    position: absolute; bottom: -4px; left: 14%; width: 72%; height: 13px;
    color: var(--ct-accent); opacity: .7; transform: rotate(-2deg); pointer-events: none;
}
.ct-h5-story-bottom { margin-top: 15px; }
.ct-h5-description { margin: 0; color: var(--ct-muted); font-size: 16px; line-height: 1.95; max-width: 490px; }
.ct-h5-actions { display: flex; align-items: center; gap: 22px; margin-top: 22px; flex-wrap: wrap; }
.ct-h5-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 24px;
    min-height: 54px; padding: 12px 26px; border-radius: 11px;
    background: var(--ct-accent); color: var(--ct-on-accent);
    font-size: 15px; font-weight: 750; line-height: 1.5;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--ct-accent) 14%, transparent);
    transition: transform .2s, background .2s;
}
.ct-h5-primary:hover { transform: translateY(-2px); background: var(--ct-accent-hover); color: var(--ct-on-accent); }
.ct-h5-primary > span { font: 23px/1 Arial, sans-serif; }
.ct-h5-video {
    display: inline-flex; align-items: center; gap: 9px; background: transparent;
    color: var(--ct-ink); border: 0; padding: 0; font-size: 13px; font-weight: 650; min-height: 48px;
}
.ct-h5-video > svg {
    width: 13px; height: 14px; border: 1px solid var(--ct-accent); border-radius: 50%;
    padding: 14px; color: var(--ct-accent); box-sizing: content-box; transition: background .2s;
}
.ct-h5-video:hover > svg { background: var(--ct-highlight); }
.ct-h5-hero :is(a, button, input):focus-visible { outline: 2px solid var(--ct-accent); outline-offset: 4px; }
.ct-h5-proof {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--ct-line);
}
.ct-h5-proof-headline { display: block; color: var(--ct-muted); font-size: 14px; line-height: 1.8; }
.ct-h5-highlight { color: var(--ct-accent); font-size: 23px; font-weight: 800; line-height: 1.3; padding-inline: 3px; white-space: nowrap; }
.ct-h5-highlight-mark, .ct-h5-avatars { display: none; }
.ct-h5-instructors { flex-shrink: 0; }
.ct-h5-instructors > div > span { display: block; font-size: 12px; line-height: 1.5; color: var(--ct-muted); }
.ct-h5-instructors p { font-size: 13px; margin: 0; color: var(--ct-muted); line-height: 1.7; }

/* Individual panels float directly on the hero, without a shared window. */
.ct-h5-lab {
    position: relative; display: flex; flex-direction: column; align-self: stretch;
    animation: ct-h5-enter .65s .08s ease-out both;
}
.ct-h5-lab-label {
    display: flex; align-items: center; gap: 11px; min-height: 44px;
    padding: 8px 4px;
    color: var(--ct-ink);
}
.ct-h5-lab-label h2 { margin: 0; font-size: 14px; font-weight: 750; line-height: 1.8; }
.ct-h5-live-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--ct-success); box-shadow: 0 0 0 4px var(--ct-success-bg); }
.ct-h5-demo { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); gap: 0; padding: 8px 8px 28px; direction: ltr; }
.ct-h5-editor { position: relative; z-index: 2; background: var(--ct-h5-code); border-radius: 12px; overflow: hidden; transform: rotate(-3deg); box-shadow: 0 12px 28px #22133212; }
.ct-h5-code-window { color: var(--ct-h5-code-tag); height: 100%; }
.ct-h5-window-bar {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 34px; padding: 0 16px; color: var(--ct-h5-code-muted);
    background: var(--ct-h5-code-bar); border-bottom: 1px solid var(--ct-h5-code-line);
    font: 11px Consolas, monospace;
}
.ct-h5-window-dots { display: flex; gap: 5px; }
.ct-h5-window-dots i { width: 6px; height: 6px; background: #e79c9c; border-radius: 50%; }
.ct-h5-window-dots i:nth-child(2) { background: #dec186; }
.ct-h5-window-dots i:nth-child(3) { background: #96bf9b; }
.ct-h5-code-badge { font-size: 16px; font-weight: 700; }
.ct-h5-code-content { padding: 8px 16px 8px 8px; font: 13px/1.7 Consolas, monospace; }
.ct-h5-code-content > div { display: flex; align-items: center; min-height: 22px; min-width: 0; }
.ct-h5-line-number { width: 18px; flex-shrink: 0; text-align: center; margin-right: 9px; color: var(--ct-h5-code-muted); font: 11px Consolas, monospace; }
.ct-h5-syntax-comment { color: var(--ct-h5-code-muted); font: 12px/1.8 Cairo, sans-serif; }
.ct-h5-syntax-text { font: 12px/1.8 Cairo, sans-serif; padding-inline: 3px; color: var(--ct-h5-code-text); }
.ct-h5-code-input-row input {
    min-width: 0; width: 100%; height: 44px; padding: 0 10px; margin-left: 6px;
    border: 1px solid #9d85b9; border-radius: 7px; color: var(--ct-h5-code-value);
    background: var(--ct-h5-code-input); font: 16px Cairo, sans-serif; text-align: start;
}
.ct-h5-code-input-row input:focus { outline: 2px solid var(--ct-h5-code-tag); outline-offset: 2px; }
.ct-h5-code-input-row input[aria-invalid="true"] { border: 2px solid #ffb1bb; }
.ct-h5-run-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 6px 16px; background: var(--ct-h5-code-bar); border-top: 1px solid var(--ct-h5-code-line);
}
[dir="rtl"] .ct-h5-run-row { flex-direction: row-reverse; }
.ct-h5-run-row > span { font: 12px/1.7 Cairo, sans-serif; color: var(--ct-h5-code-muted); }
.ct-h5-run-button {
    display: inline-flex; justify-content: center; align-items: center; gap: 7px;
    padding: 8px 12px; min-height: 44px; flex-shrink: 0; background: #ded0f3; color: #342444;
    border: 0; border-radius: 8px; font: 750 12px Cairo, sans-serif; transition: background .2s;
}
.ct-h5-run-button:hover { background: #f0e7ff; }
.ct-h5-run-button:focus-visible { outline-color: var(--ct-h5-code-tag); }
.ct-h5-result-stack { position: relative; z-index: 1; margin-left: -16px; border: 1px solid var(--ct-line); border-radius: 12px; overflow: hidden; transform: translateY(20px) rotate(3deg); box-shadow: 0 12px 28px #2213320c; }
.ct-h5-result-window { display: flex; flex-direction: column; height: 100%; direction: rtl; background: var(--ct-surface); }
[dir="ltr"] .ct-h5-result-window { direction: ltr; }
.ct-h5-result-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 7px;
    flex-wrap: wrap; min-height: 34px; padding: 7px 14px 7px 36px; border-bottom: 1px solid var(--ct-line);
    color: var(--ct-muted); font: 11px/1.7 Cairo, sans-serif; background: var(--ct-soft);
}
.ct-h5-result-bar > span > span { color: var(--ct-accent); margin-inline-end: 3px; }
.ct-h5-result-state { color: var(--ct-success); }
.ct-h5-result-state[data-state="pending"] { color: var(--ct-muted); }
.ct-h5-result-state[data-state="error"] { color: var(--ct-error); }
.ct-h5-result-body { display: flex; align-items: center; justify-content: center; flex: 1; min-height: 185px; padding: 20px 20px 64px 36px; text-align: center; }
.ct-h5-result-body > div { flex: 1; min-width: 0; }
.ct-h5-result-symbol { display: none; }
#ct-h5-demo-result { margin: 0 0 12px; color: var(--ct-ink); font-size: 21px; font-weight: 800; line-height: 1.6; overflow-wrap: anywhere; }
.ct-h5-result-body > div > span { display: block; font: 12px/1.9 Cairo, sans-serif; color: var(--ct-muted); }
.ct-h5-lab-footer {
    display: grid; grid-template-columns: minmax(0, 1fr) 240px; align-items: center; gap: 20px; direction: ltr; flex: 1;
    padding: 8px 26px; min-height: 160px;
}
.ct-h5-lab-caption { max-width: 330px; direction: rtl; color: var(--ct-muted); font-size: 16px; font-weight: 550; line-height: 1.9; }
[dir="ltr"] .ct-h5-lab-caption { direction: ltr; }
.ct-h5-caption-text { display: block; }
.ct-h5-caption-text strong { display: block; color: var(--ct-accent); font-size: 25px; font-weight: 800; line-height: 1.6; }
.ct-h5-portrait { position: relative; z-index: 3; width: 100%; height: 240px; margin-top: -80px; margin-bottom: calc(-8px - var(--ct-h5-bottom-inset)); align-self: end; pointer-events: none; }
.ct-h5-portrait-cutout { height: 100%; }
.ct-h5-portrait-cutout > img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; display: block; }
.ct-h5-portrait-cutout > img[onclick] { pointer-events: auto; }
.ct-h5-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ct-home-page .ct-h5-video-modal + .ct-stats-compact + .category-area { padding-top: 40px; }

/* The existing Bootstrap video modal retains its theme and focus behavior. */
.ct-h5-video-modal .modal-content { background: var(--ct-surface); color: var(--ct-ink); border: 1px solid var(--ct-line); border-radius: 16px; overflow: hidden; }
.ct-h5-video-modal .modal-header { border-color: var(--ct-line); padding: 16px 20px; gap: 16px; }
.ct-h5-video-modal .modal-title { font-size: 18px; line-height: 1.5; }
.ct-h5-modal-close { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--ct-line); background: var(--ct-soft); color: var(--ct-ink); border-radius: 8px; font: 28px/1 Arial, sans-serif; margin-inline-start: auto; }
.ct-h5-video-modal .modal-body { padding: 0; background: var(--ct-soft); }
.ct-h5-video-modal iframe { display: block; width: 100%; aspect-ratio: 16/9; border: 0; }
.ct-h5-modal-close:focus-visible { outline: 2px solid var(--ct-accent); outline-offset: 3px; }
.ct-h5-video-modal .modal-footer { justify-content: flex-start; border-color: var(--ct-line); padding: 12px 20px; }
[dir="rtl"] .ct-h5-video-modal .modal-footer { justify-content: flex-end; }
.ct-h5-video-modal .modal-footer a { font-size: 13px; font-weight: 650; color: var(--ct-accent); text-decoration: underline; text-underline-offset: 3px; }
[data-ct-lesson-theme="dark"] .ct-h5-video-modal iframe { color-scheme: dark; background: var(--ct-soft); }
[dir="ltr"] .ct-h5-welcome-line { line-height: 1.3; }
[dir="ltr"] .ct-h5-description { line-height: 1.8; }
[dir="ltr"] .ct-h5-brand { margin-block: 6px 12px; }
[dir="ltr"] .ct-home-page .header-area { position: relative; z-index: 999; }
@keyframes ct-h5-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 1199px) {
    .ct-h5-hero { --ct-h5-bottom-inset: 30px; padding: 30px 28px; }
    .ct-h5-hero-grid { gap: 38px; }
    .ct-h5-eyebrow { font-size: 14px; }
    .ct-h5-welcome-line { font-size: 28px; }
    .ct-h5-actions { gap: 15px; }
    .ct-h5-primary { padding-inline: 21px; }
    .ct-h5-proof { gap: 12px; }
    .ct-h5-proof-headline { font-size: 13px; }
    .ct-h5-lab-footer { grid-template-columns: minmax(0, 1fr) 210px; padding-inline: 20px; }
}
/* On narrower screens the person introduces the lesson, before the workspace. */
@media (max-width: 991px) {
    .ct-h5-hero-grid { max-width: 650px; grid-template-columns: minmax(0, 1fr) 200px; gap: 0 24px; direction: ltr; }
    .ct-h5-story, .ct-h5-story-bottom, .ct-h5-details, .ct-h5-lab, .ct-h5-lab-footer { display: contents; }
    .ct-h5-story, .ct-h5-lab { animation: none; }
    .ct-h5-eyebrow { grid-column: 1 / -1; grid-row: 1; margin-bottom: 12px; }
    .ct-h5-title { grid-column: 1 / -1; grid-row: 2; margin-bottom: 14px; }
    .ct-h5-actions { grid-column: 1; grid-row: 3; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; margin: 0; }
    .ct-h5-portrait { grid-column: 2; grid-row: 3; height: 180px; margin: 0; }
    .ct-h5-description { grid-column: 1 / -1; grid-row: 4; margin-top: 12px; }
    .ct-h5-proof { grid-column: 1 / -1; grid-row: 5; margin-top: 18px; padding-top: 14px; }
    .ct-h5-lab-label { grid-column: 1 / -1; grid-row: 6; margin-top: 24px; }
    .ct-h5-demo { grid-column: 1 / -1; grid-row: 7; }
    .ct-h5-result-body { padding-bottom: 20px; }
    .ct-h5-lab-caption { grid-column: 1 / -1; grid-row: 8; max-width: none; padding: 12px 4px; font-size: 14px; }
    .ct-h5-caption-text strong { display: inline; font-size: inherit; }
    [dir="rtl"] :is(.ct-h5-eyebrow, .ct-h5-title, .ct-h5-actions, .ct-h5-description, .ct-h5-proof, .ct-h5-lab-label) { direction: rtl; }
    [dir="rtl"] .ct-h5-actions { align-items: flex-end; }
    .ct-h5-description { max-width: 600px; }
    .ct-h5-welcome-line { font-size: 32px; }
    .ct-h5-brand { font-size: 56px; }
}
@media (max-width: 575px) {
    .ct-h5-hero { --ct-h5-bottom-inset: 20px; padding: 20px; }
    .ct-h5-hero-grid { grid-template-columns: minmax(0, 1fr) clamp(120px, 37vw, 152px); gap: 0 12px; }
    .ct-h5-eyebrow { font-size: 12px; margin-bottom: 10px; gap: 7px; }
    .ct-h5-eyebrow > span:first-child { font-size: 20px; }
    .ct-h5-welcome-line:first-child { font-size: 17px; }
    .ct-h5-welcome-line { font-size: clamp(21px, 5.8vw, 28px); }
    .ct-h5-brand { font-size: 44px; margin-block: 3px 8px; }
    .ct-h5-description { font-size: 14px; line-height: 1.8; }
    .ct-h5-actions { gap: 10px; }
    .ct-h5-primary { min-height: 48px; padding: 10px; gap: 8px; font-size: 13px; }
    .ct-h5-primary > span { font-size: 20px; }
    .ct-h5-video { font-size: 12px; gap: 7px; }
    .ct-h5-video > svg { padding: 12px; }
    .ct-h5-proof { gap: 12px; }
    .ct-h5-proof-headline { font-size: 12px; }
    .ct-h5-highlight { font-size: 20px; }
    .ct-h5-instructors p, .ct-h5-instructors > div > span { font-size: 11px; }
    .ct-h5-lab-label { padding: 9px 4px; min-height: 44px; }
    .ct-h5-lab-label h2 { font-size: 13px; }
    .ct-h5-demo { grid-template-columns: minmax(0, 1fr); padding: 8px; }
    .ct-h5-editor { transform: rotate(-2deg); }
    .ct-h5-result-stack { z-index: 3; margin: -12px 0 0 8px; transform: rotate(2deg); }
    .ct-h5-window-bar { min-height: 36px; padding-inline: 14px; }
    .ct-h5-code-content { padding: 10px 16px 10px 7px; }
    .ct-h5-code-content > div { min-height: 24px; }
    .ct-h5-code-input-row input { font-size: 16px; }
    .ct-h5-syntax-comment, .ct-h5-syntax-text { font-size: 12px; }
    .ct-h5-run-row { padding: 8px 14px 20px; }
    .ct-h5-result-bar { font-size: 11px; padding-inline: 18px; }
    .ct-h5-result-body { min-height: 125px; padding: 18px; }
    #ct-h5-demo-result { font-size: 20px; margin-bottom: 7px; }
    .ct-h5-lab-caption { font-size: 13px; line-height: 1.9; }
    .ct-h5-portrait { height: 148px; }
    .ct-h5-video-modal .modal-header { padding: 12px; }
    .ct-h5-video-modal .modal-title { font-size: 15px; }
}
@media (max-width: 359px) {
    .ct-h5-hero { padding-inline: 16px; }
    .ct-h5-proof { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    .ct-h5-story, .ct-h5-lab { animation: none; }
    .ct-h5-hero :is(a, button, svg) { transition: none; }
}
