.learning-welcome { overflow-x: clip; }
.learning-welcome [hidden] { display: none !important; }
.welcome-wrap { width: min(1120px, calc(100% - 72px)); margin-inline: auto; }
.learning-welcome main { color: var(--text-primary); }
.learning-welcome main a { color: inherit; }
.learning-welcome main button, .learning-welcome main input { font: inherit; }
.welcome-eyebrow { font-size: .62rem; font-weight: 700; letter-spacing: .13em; line-height: 1.6; color: var(--text-secondary); }
.welcome-eyebrow > span { color: var(--focus-accent); font-size: 1.1rem; margin-right: 8px; vertical-align: middle; }
.learning-welcome h1, .learning-welcome h2, .learning-welcome h3 { letter-spacing: -.045em; }
.learning-welcome h1 em, .learning-welcome h2 em { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; color: var(--focus-accent); }
.welcome-hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 52px; align-items: center; padding-block: calc(var(--nav-h, 80px) + 75px) 85px; }
.welcome-hero-copy { min-width: 0; }
.welcome-hero h1 { font-size: clamp(2.8rem, 4.7vw, 4.6rem); line-height: 1.12; margin: 24px 0; }
.welcome-intro { font-size: 1.02rem; color: var(--text-secondary); line-height: 1.75; max-width: 480px; }
.welcome-search { margin: 32px 0 18px; }
.welcome-search-field { display: flex; gap: 12px; align-items: center; border: 1px solid var(--border-color); padding: 7px 7px 7px 18px; border-radius: 12px; background: var(--bg-card); }
.welcome-search-field > svg { color: var(--focus-accent); flex-shrink: 0; }
.welcome-search input { width: 100%; min-width: 0; border: 0; padding: 12px 0; background: transparent; color: var(--text-primary); font-size: .87rem !important; }
.welcome-search input::placeholder { color: var(--text-secondary); opacity: 1; }
.welcome-search-field:focus-within { outline: 2px solid var(--focus-accent); outline-offset: 3px; }
.welcome-search input:focus-visible { outline: 0 !important; box-shadow: none; }
.learning-welcome .welcome-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 8px; padding: 15px 22px; font-size: .85rem; line-height: 1.4; font-weight: 650; background: var(--focus-accent); color: var(--bg-primary); white-space: nowrap; text-decoration: none; cursor: pointer; transition: background .18s, transform .18s; }
.welcome-search .welcome-button { font-size: .78rem; padding: 14px 16px; }
.learning-welcome .welcome-button:hover { background: color-mix(in srgb, var(--focus-accent) 80%, var(--text-primary)); transform: translateY(-1px); }
.learning-welcome .welcome-button--small { padding: 11px 15px; font-size: .78rem; }
.welcome-signin { font-size: .82rem; text-decoration: none; color: var(--text-primary); padding: 10px; white-space: nowrap; }
.welcome-hero-links { display: flex; flex-direction: column; gap: 16px; }
.welcome-hero-links > a { align-self: flex-start; font-size: .85rem; text-underline-offset: 5px; }
.welcome-hero-links > span { color: var(--text-secondary); font-size: .7rem; }
.welcome-hero-art { position: relative; min-width: 0; width: 100%; max-width: 440px; aspect-ratio: 1; justify-self: end; }
.welcome-orbit { position: absolute; inset: 2% 0 0; border: 1px solid var(--border-color); border-radius: 50%; }
.welcome-orbit::before { content: ''; position: absolute; inset: 9%; border: 1px dashed var(--border-color); border-radius: 50%; }
.welcome-art-spark { position: absolute; right: 0; top: 0; font-size: 3rem; color: var(--focus-accent); }
.welcome-note { position: absolute; width: 65%; height: 78%; border-radius: 18px; padding: 22px; box-shadow: 0 16px 35px #00000015; color: #263e2e; }
.welcome-note span { font-size: .58rem; letter-spacing: .12em; font-weight: 700; }
.welcome-note > strong { display: block; letter-spacing: -.04em; font-size: 1.75rem; line-height: 1.15; }
.welcome-note--back { background: #cbbff5; left: 33%; top: 19%; transform: rotate(12deg); display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; gap: 10px; }
.welcome-note--middle { background: #f4b6a0; top: 6%; left: 3%; transform: rotate(-11deg); display: flex; flex-direction: column; justify-content: flex-start; gap: 10px; }
.welcome-note--middle > span { writing-mode: vertical-rl; align-self: flex-start; }
.welcome-note--front { background: #f3f0d9; left: 20%; top: 7%; transform: rotate(2deg); display: flex; flex-direction: column; }
.welcome-note-top { display: flex; justify-content: space-between; }
.welcome-note--front img { width: 100%; height: auto; min-height: 0; flex: 1; object-fit: contain; }
.welcome-note--front strong { font-size: clamp(1.3rem, 2.4vw, 2.1rem); }
.welcome-note--front strong em { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; }
.welcome-note--front p { margin-top: 12px; font-size: .65rem; color: #5b6c51; }
.welcome-subjects { border-top: 1px solid var(--border-color); padding-top: 42px; }
.welcome-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.welcome-section-heading h2 { font-size: clamp(1.65rem, 2.7vw, 2.45rem); line-height: 1.18; margin-top: 12px; }
.welcome-section-heading > a { font-size: .82rem; white-space: nowrap; text-decoration: none; padding: 10px 0; }
.welcome-section-heading > p { color: var(--text-secondary); font-size: .9rem; line-height: 1.8; }
.welcome-subject-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; }
.welcome-subject { --subject: #d9e79d; display: flex; flex-direction: column; min-width: 0; text-decoration: none; border: 1px solid var(--border-color); border-radius: 15px; background: var(--bg-card); overflow: hidden; transition: transform .2s, border-color .2s; }
.welcome-subject[data-subject="algorithms"] { --subject: #cbbff5; }
.welcome-subject[data-subject="science"] { --subject: #f4b6a0; }
[data-theme="light"] .welcome-subject { --subject: #405a24; }
[data-theme="light"] .welcome-subject[data-subject="algorithms"] { --subject: #635292; }
[data-theme="light"] .welcome-subject[data-subject="science"] { --subject: #8e4e3a; }
.welcome-subject img { width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; }
.welcome-subject > div { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.welcome-subject > div > span { font-size: .58rem; color: var(--subject); letter-spacing: .09em; font-weight: 700; }
.welcome-subject h3 { font-size: 1.25rem; line-height: 1.3; margin: 10px 0; }
.welcome-subject p { color: var(--text-secondary); font-size: .84rem; line-height: 1.65; margin-bottom: 24px; }
.welcome-subject strong { margin-top: auto; display: flex; gap: 12px; justify-content: space-between; font-size: .76rem; font-weight: 600; }
.welcome-subject strong span { color: var(--subject); font-size: 1.1rem; }
@media(hover:hover) { .welcome-subject:hover { border-color: var(--subject); transform: translateY(-4px); } }
.welcome-how { padding-block: 100px 80px; scroll-margin-top: 80px; }
.welcome-how h2 { font-size: clamp(2rem, 3.5vw, 3rem); }
.welcome-steps { list-style: none; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 40px; padding: 0; margin-top: 40px; }
.welcome-steps li { border-top: 1px solid var(--border-color); padding-top: 24px; }
.welcome-step-number { display: block; font-family: Georgia, 'Times New Roman', serif; font-size: 2.3rem; color: var(--focus-accent); margin-bottom: 20px; }
.welcome-steps h3 { font-size: 1.1rem; margin-bottom: 12px; line-height: 1.35; }
.welcome-steps p { font-size: .88rem; line-height: 1.75; color: var(--text-secondary); }
.welcome-memory-panel { background: #d6e8ba; color: #213c2c; border-radius: 24px; padding: 48px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 50px; align-items: center; }
.welcome-memory-art { text-align: center; }
.welcome-memory-art img { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto 16px; }
.welcome-memory-art span { font-size: .61rem; font-weight: 700; letter-spacing: .12em; }
.welcome-memory-copy .welcome-eyebrow { color: #425d3c; }
.welcome-memory-copy h2 { font-size: clamp(2rem, 3.5vw, 3rem); line-height: 1.16; margin: 16px 0 20px; }
.welcome-memory-copy h2 em { color: #425d3c; }
.welcome-memory-copy > p:not(.welcome-eyebrow) { font-size: .9rem; line-height: 1.8; color: #425b3e; }
.welcome-memory-copy .welcome-button { background: #213c2c; color: #f4f7e8; margin-top: 26px; }
.welcome-memory-copy .welcome-button:hover { background: #345a43; }
.welcome-faq { display: grid; grid-template-columns: .8fr 1.2fr; gap: 70px; padding-block: 95px; }
.welcome-faq h2 { font-size: clamp(2rem, 3.5vw, 3rem); line-height: 1.15; margin-top: 18px; }
.welcome-faq details { border-bottom: 1px solid var(--border-color); }
.welcome-faq details:first-child { border-top: 1px solid var(--border-color); }
.welcome-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; list-style: none; cursor: pointer; font-size: .95rem; font-weight: 600; padding-block: 24px; }
.welcome-faq summary::-webkit-details-marker { display: none; }
.welcome-faq summary::after { content: '+'; color: var(--focus-accent); font-size: 1.4rem; font-weight: 400; }
.welcome-faq details[open] summary::after { content: '−'; }
.welcome-faq details p { color: var(--text-secondary); font-size: .88rem; line-height: 1.8; padding-bottom: 25px; padding-right: 25px; }
.welcome-finish { text-align: center; padding: 56px 0 70px; border-top: 1px solid var(--border-color); }
.welcome-finish > span { color: var(--focus-accent); font-size: 2.4rem; }
.welcome-finish h2 { font-size: clamp(2.6rem, 4.6vw, 4rem); line-height: 1.15; margin: 18px 0 28px; }
.welcome-finish p { color: var(--text-secondary); font-size: .74rem; margin-top: 18px; }
.learning-welcome .welcome-footer { padding: 0; background: var(--bg-secondary); border-top: 1px solid var(--border-color); text-align: left; }
.welcome-footer > div { padding-block: 30px; display: flex; align-items: center; flex-wrap: wrap; gap: 25px; justify-content: space-between; }
.welcome-footer-brand { font-family: Fredoka, sans-serif; font-size: 1.2rem; text-decoration: none; color: var(--text-primary); }
.welcome-footer-brand span { display: block; font-family: system-ui, sans-serif; color: var(--text-secondary); font-size: .7rem; margin-top: 6px; }
.welcome-footer-links { display: flex; gap: 24px; }
.welcome-footer-links a { font-size: .8rem; color: var(--text-secondary); text-decoration: none; padding-block: 12px; }
.welcome-footer > div > p { flex-basis: 100%; color: var(--text-secondary); font-size: .64rem; margin: 0; }
.learning-welcome .login-dialog { border-color: var(--border-color); box-shadow: 0 24px 80px #00000040; }
.learning-welcome :focus-visible { outline: 3px solid var(--focus-accent); outline-offset: 4px; }
.welcome-memory-panel :focus-visible { outline-color: #213c2c; }
@media(max-width:1050px) {
 .welcome-wrap { width: calc(100% - 56px); }
 .welcome-hero { gap: 26px; padding-top: calc(var(--nav-h, 80px) + 55px); }
 .welcome-hero h1 { font-size: clamp(2.6rem, 4.6vw, 3.7rem); }
 .welcome-note { padding: 18px; }
 .welcome-hero-art { align-self: center; }
 .welcome-subject-grid { gap: 16px; }
 .welcome-subject > div { padding: 20px; }
 .welcome-subject h3 { font-size: 1.15rem; }
 .welcome-memory-panel { padding: 36px; gap: 30px; }
 .welcome-faq { gap: 45px; }
 .learning-welcome > nav .nav-links { gap: 18px; }
 .learning-welcome > nav .nav-links a { font-size: .8rem; }
 .learning-welcome > nav .theme-toggle { padding-inline: 5px; }
 .learning-welcome > nav .language-text { display: none; }
}
@media(max-width:739px) {
 .welcome-wrap { width: calc(100% - 44px); }
 .welcome-hero { grid-template-columns: 1fr; gap: 38px; padding-block: calc(var(--nav-h, 80px) + 30px) 45px; }
 .welcome-hero h1 { font-size: clamp(2.55rem, 8.5vw, 3.6rem); }
 .welcome-intro { font-size: .94rem; }
 .welcome-eyebrow { font-size: .56rem; letter-spacing: .08em; }
 .welcome-hero-art { max-width: 340px; width: 86%; justify-self: center; }
 .welcome-note--front strong { font-size: 1.4rem; }
 .welcome-search-field { flex-wrap: wrap; padding: 12px; gap: 8px; }
 .welcome-search input { font-size: 16px !important; flex: 1; width: 0; }
 .welcome-search .welcome-button { width: 100%; font-size: .88rem; }
 .welcome-hero-links { gap: 15px; }
 .welcome-hero-links > span { font-size: .67rem; }
 .welcome-section-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
 .welcome-section-heading h2 { font-size: 1.8rem; }
 .welcome-subject-grid { grid-template-columns: 1fr; gap: 20px; }
 .welcome-subject img { max-height: 180px; }
 .welcome-subject h3 { font-size: 1.45rem; }
 .welcome-subject > div { padding: 24px; }
 .welcome-subject > div > span { font-size: .62rem; }
 .welcome-subject p { margin-bottom: 18px; font-size: .9rem; }
 .welcome-subject strong { font-size: .85rem; }
 .welcome-how { padding-block: 65px; }
 .welcome-how h2, .welcome-faq h2 { font-size: 2.4rem; }
 .welcome-steps { grid-template-columns: 1fr; gap: 26px; margin-top: 25px; }
 .welcome-step-number { font-size: 1.8rem; margin-bottom: 12px; }
 .welcome-steps h3 { font-size: 1.2rem; }
 .welcome-memory-panel { grid-template-columns: 1fr; gap: 24px; padding: 30px 25px; }
 .welcome-memory-art { display: none; }
 .welcome-memory-copy h2 { font-size: 2.3rem; }
 .welcome-faq { grid-template-columns: 1fr; gap: 30px; padding-block: 65px; }
 .welcome-faq summary { font-size: .88rem; padding-block: 22px; }
 .welcome-finish { padding-block: 45px 55px; }
 .welcome-finish h2 { font-size: 2.8rem; }
 .welcome-footer > div { flex-direction: column; align-items: flex-start; gap: 18px; }
}
@media(prefers-reduced-motion:reduce) { .welcome-subject, .learning-welcome .welcome-button { transition: none; } .welcome-subject:hover, .learning-welcome .welcome-button:hover { transform: none; } }
@layer reset { .learning-welcome[data-welcome-auth="true"] .welcome-signin { display: none !important; } }
