:root {
    color-scheme: dark;
    --bg: #090a0c;
    --surface: #111318;
    --surface-2: #171a20;
    --text: #f4f3ed;
    --muted: #9a9ca4;
    --line: rgba(244, 243, 237, 0.13);
    --blue: #5d7cff;
    --blue-soft: #b7c4ff;
    --amber: #f5a524;
    --amber-soft: #ffd48d;
    --green: #8de2a4;
    --page: min(1240px, calc(100vw - 64px));
    --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scrollbar-color: #3c414d var(--bg);
}

body {
    margin: 0;
    min-width: 320px;
    overflow-x: hidden;
    color: var(--text);
    background: var(--bg);
    font-family: "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body::selection { background: var(--blue); color: white; }

a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 12px;
    left: 12px;
    padding: 10px 14px;
    color: #07080a;
    background: var(--text);
    transform: translateY(-150%);
    transition: transform .2s ease;
}

.skip-link:focus { transform: none; }

.site-header {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    width: 100%;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(32px, calc((100vw - 1240px) / 2));
    border-bottom: 1px solid transparent;
    transition: background .25s ease, border-color .25s ease, height .25s ease;
}

.site-header.is-scrolled {
    height: 72px;
    background: rgba(9, 10, 12, .84);
    border-color: var(--line);
    backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 13px; }

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(244, 243, 237, .75);
    border-radius: 50%;
    font-size: .76rem;
    font-weight: 750;
    letter-spacing: -.04em;
}

.brand-name {
    font-size: .88rem;
    font-weight: 650;
    letter-spacing: .01em;
}

.site-nav { display: flex; align-items: center; gap: 34px; }

.site-nav a {
    position: relative;
    color: #c7c7c8;
    font-size: .86rem;
    font-weight: 600;
}

.site-nav a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -7px;
    left: 0;
    height: 1px;
    background: var(--text);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .25s var(--ease);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }

.menu-toggle { display: none; }

.hero {
    position: relative;
    min-height: 780px;
    height: 100svh;
    max-height: 960px;
    display: grid;
    grid-template-columns: minmax(0, 1.03fr) minmax(420px, .72fr);
    grid-template-rows: 1fr auto;
    gap: 48px 7vw;
    align-items: center;
    width: var(--page);
    margin: 0 auto;
    padding: 132px 0 38px;
}

.hero-grid {
    position: fixed;
    z-index: -2;
    inset: 0;
    opacity: .24;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: linear-gradient(to bottom, black, transparent 92%);
    mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.hero-orbit {
    position: absolute;
    z-index: -1;
    border: 1px solid rgba(93, 124, 255, .12);
    border-radius: 50%;
    pointer-events: none;
}

.hero-orbit-one { width: 620px; height: 620px; right: -23%; top: 3%; }
.hero-orbit-two { width: 390px; height: 390px; right: -13%; top: 18%; border-color: rgba(245, 165, 36, .1); }

.hero-copy { align-self: center; }

.kicker,
.section-index {
    margin: 0;
    color: #b4b5b9;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }
.kicker span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(141,226,164,.08); }

h1, h2, h3, p { margin-top: 0; }

h1 {
    max-width: 830px;
    margin-bottom: 28px;
    font-size: clamp(3.45rem, 6.2vw, 6.45rem);
    line-height: .98;
    letter-spacing: -.067em;
    font-weight: 650;
}

h1 em,
h2 em { color: var(--muted); font-family: Georgia, "Times New Roman", serif; font-weight: 400; }

.hero-intro {
    max-width: 620px;
    margin-bottom: 35px;
    color: #b6b7bc;
    font-size: clamp(1rem, 1.5vw, 1.18rem);
    line-height: 1.65;
}

.hero-actions { display: flex; align-items: center; gap: 28px; }

.button {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 2px;
    font-size: .85rem;
    font-weight: 700;
    transition: color .25s ease, background .25s ease, border-color .25s ease, transform .25s var(--ease);
}

.button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: #0a0b0d; background: var(--text); }
.button-primary:hover { background: var(--blue-soft); }
.button-outline { border-color: rgba(244,243,237,.32); }
.button-outline:hover { color: #08090b; background: var(--text); border-color: var(--text); }

.text-link {
    padding: 10px 0;
    color: #c9c9cb;
    font-size: .84rem;
    border-bottom: 1px solid #555860;
}

.text-link span { margin-left: 8px; }

.hero-console {
    position: relative;
    width: 100%;
    max-width: 480px;
    justify-self: end;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(15, 17, 22, .88);
    box-shadow: 0 38px 100px rgba(0,0,0,.42);
    transform: rotate(1.5deg);
    backdrop-filter: blur(14px);
}

.hero-console::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 38px -30px -30px 45px;
    background: linear-gradient(135deg, rgba(93,124,255,.17), rgba(93,124,255,0));
    filter: blur(24px);
}

.console-topbar,
.console-footer {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    color: #8d9099;
    font-family: Consolas, "SFMono-Regular", monospace;
    font-size: .68rem;
}

.console-topbar { gap: 16px; border-bottom: 1px solid var(--line); }
.console-dots { display: flex; gap: 5px; }
.console-dots i { width: 6px; height: 6px; border-radius: 50%; background: #4a4e58; }
.console-dots i:first-child { background: var(--amber); }
.console-status { margin-left: auto; color: var(--green); letter-spacing: .12em; }

.console-content { padding: clamp(26px, 4vw, 42px); }
.lesson-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 38px; }
.lesson-number { width: 46px; height: 46px; display: grid; place-items: center; color: var(--blue-soft); background: rgba(93,124,255,.12); font-size: .8rem; font-weight: 750; }
.lesson-meta div { display: grid; }
.lesson-meta span:not(.lesson-number) { color: #80838c; font-size: .7rem; }
.lesson-meta strong { font-size: .9rem; }
.question { margin-bottom: 8px; color: #8f929a; font-size: .76rem; }
.sentence { margin-bottom: 26px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.sentence span { color: var(--blue-soft); }

.answer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.answer-grid button {
    min-height: 48px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.025);
    cursor: pointer;
    font-size: .8rem;
    transition: border-color .2s ease, background .2s ease;
}
.answer-grid button:hover,
.answer-grid button:focus-visible { border-color: rgba(183,196,255,.75); background: rgba(93,124,255,.09); }
.answer-grid button.is-correct { color: #bdf2ca; border-color: rgba(141,226,164,.6); background: rgba(141,226,164,.08); }
.answer-grid button.is-wrong { color: #ffb3a9; border-color: rgba(255,125,110,.5); background: rgba(255,125,110,.06); }
.quiz-feedback { min-height: 20px; margin: 13px 0 0; color: #7e8189; font-size: .7rem; }
.quiz-feedback.is-success { color: var(--green); }

.console-footer { justify-content: space-between; border-top: 1px solid var(--line); }
.lesson-progress { display: flex; gap: 4px; }
.lesson-progress i { width: 14px; height: 2px; background: #3c3f46; }
.lesson-progress i:nth-child(-n+4) { background: var(--blue); }

.hero-foot {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 22px;
    color: #686b73;
    font-family: Consolas, monospace;
    font-size: .63rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.hero-foot i { height: 1px; background: var(--line); }

.section { width: var(--page); margin: 0 auto; padding: 140px 0; }

.section-heading {
    display: grid;
    grid-template-columns: .5fr 1.5fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 70px;
}

.section-heading > div { display: grid; grid-template-columns: 1fr .65fr; gap: 5vw; align-items: end; }

h2 {
    margin-bottom: 0;
    font-size: clamp(2.7rem, 5.2vw, 5.3rem);
    line-height: 1.02;
    letter-spacing: -.057em;
    font-weight: 625;
}

.section-heading > div > p { margin: 0 0 7px; color: var(--muted); font-size: .96rem; }

.project-list { display: grid; grid-template-columns: 1.04fr .96fr; gap: 20px; align-items: start; }

.project-card {
    position: relative;
    min-height: 690px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: clamp(26px, 4vw, 48px);
    border: 1px solid var(--line);
    background: var(--surface);
}

.project-card-amber { margin-top: 0; background: #131313; }

.project-card::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    right: -170px;
    top: 120px;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(4px);
}
.project-card-blue::after { background: rgba(93,124,255,.065); }
.project-card-amber::after { background: rgba(245,165,36,.055); }

.project-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 68px; }
.project-index { color: #7c7f87; font-family: Consolas, monospace; font-size: .68rem; }
.project-type { padding: 7px 11px; border: 1px solid var(--line); border-radius: 100px; color: #b4b6bb; font-size: .66rem; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; }

.project-copy { max-width: 510px; }
.project-copy h3 { margin-bottom: 20px; font-size: clamp(2.15rem, 3.7vw, 4rem); line-height: .98; letter-spacing: -.055em; font-weight: 620; }
.project-copy p { max-width: 470px; margin-bottom: 34px; color: #9d9fa5; font-size: .92rem; }

.screenshot-stage {
    position: relative;
    z-index: 1;
    margin: auto 0 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.14);
    isolation: isolate;
}

.screenshot-stage::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    filter: blur(45px);
}

.language-stage {
    min-height: 430px;
    display: grid;
    grid-template-columns: minmax(130px, 1fr) 172px;
    gap: 24px;
    align-items: center;
    padding: 24px 28px;
    background: linear-gradient(145deg, #111729 0%, #0c0f18 68%);
    transform: translate(38px, 22px);
}

.language-stage::after { left: -95px; bottom: -145px; background: rgba(93,124,255,.25); }

.backgammon-stage {
    min-height: 365px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 16px;
    align-items: end;
    padding: 82px 20px 20px;
    background: linear-gradient(145deg, #14231d 0%, #111713 58%, #15120e 100%);
    transform: translate(-25px, 22px);
}

.backgammon-stage::after { right: -80px; bottom: -130px; background: rgba(245,165,36,.18); }

.screen-caption {
    position: absolute;
    z-index: 3;
    top: 30px;
    left: 28px;
    max-width: 165px;
    display: grid;
}

.language-stage .screen-caption {
    position: relative;
    top: auto;
    left: auto;
    max-width: 175px;
}

.screen-caption span {
    margin-bottom: 15px;
    color: #8da2ff;
    font: 700 .61rem/1.3 Consolas, monospace;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.screen-caption strong { font-size: 1.05rem; line-height: 1.25; letter-spacing: -.025em; }
.screen-caption small { margin-top: 72px; color: #777d8e; font-size: .62rem; }
.game-caption span { color: var(--amber-soft); }
.game-caption strong { color: #f1eee6; }

.device-shot {
    position: relative;
    overflow: visible;
    margin: 0;
    background: transparent;
    box-shadow: none;
}

.device-shot img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 24px 30px rgba(0,0,0,.35));
}

.language-device {
    width: 100%;
    aspect-ratio: 1344 / 2992;
}

.landscape-device {
    width: 100%;
    aspect-ratio: 2992 / 1344;
}

.portrait-device {
    width: 100%;
    aspect-ratio: 1344 / 2992;
}

.project-tags { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 42px; }
.project-tags span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 100px; color: #8f9197; font-size: .62rem; }

.approach { padding-top: 95px; }
.approach-intro { display: grid; grid-template-columns: .5fr 1.5fr; gap: 40px; margin-bottom: 78px; }
.approach-intro h2 { max-width: 820px; }

.principles { border-top: 1px solid var(--line); }
.principle { display: grid; grid-template-columns: .5fr 1.5fr; gap: 40px; min-height: 172px; align-items: center; border-bottom: 1px solid var(--line); }
.principle > span { color: #676a72; font: .68rem Consolas, monospace; }
.principle > div { display: grid; grid-template-columns: .85fr 1fr; gap: 6vw; align-items: center; }
.principle h3 { margin: 0; font-size: clamp(1.25rem, 2.2vw, 1.8rem); letter-spacing: -.035em; }
.principle p { max-width: 470px; margin: 0; color: #8f9198; font-size: .88rem; }

.stack-panel {
    min-height: 510px;
    display: grid;
    grid-template-columns: 1fr .72fr .9fr;
    gap: 30px;
    align-items: center;
    margin-top: 120px;
    padding: clamp(34px, 6vw, 72px);
    background: #e8e7e0;
    color: #101114;
}
.stack-label { color: #5f6268; font-size: .65rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.stack-copy h3 { margin: 34px 0 22px; font-size: clamp(2.3rem, 4.1vw, 4.3rem); line-height: .98; letter-spacing: -.055em; font-weight: 640; }
.stack-copy p { max-width: 360px; margin: 0; color: #65686d; font-size: .84rem; }
.stack-list { display: grid; }
.stack-list span { display: flex; align-items: center; gap: 22px; padding: 15px 0; border-bottom: 1px solid rgba(10,11,13,.15); font-size: .96rem; font-weight: 650; }
.stack-list i { color: #999a98; font: normal .62rem Consolas, monospace; }
.stack-code { align-self: stretch; min-height: 310px; display: flex; flex-direction: column; justify-content: space-between; padding: 25px; color: #d7dae3; background: #17191f; box-shadow: 24px 28px 0 rgba(10,11,13,.08); }
.stack-code > span { color: #606572; font: .68rem Consolas, monospace; }
.stack-code pre { margin: 0; overflow: hidden; white-space: pre-wrap; color: #c2c6d1; font: .82rem/1.9 Consolas, monospace; }
.stack-code b { color: var(--blue-soft); font-weight: 500; }

.about { display: grid; grid-template-columns: 1.05fr .95fr; gap: 9vw; align-items: end; padding-top: 180px; padding-bottom: 180px; }
.about-main h2 { margin-top: 40px; font-size: clamp(4.5rem, 9.6vw, 9.5rem); line-height: .78; }
.about-main h2 span { color: var(--blue); }
.about-copy { padding-bottom: 8px; }
.about-lead { color: var(--text) !important; font-size: clamp(1.25rem, 2vw, 1.7rem) !important; line-height: 1.42; letter-spacing: -.025em; }
.about-copy > p { color: #92949a; font-size: .92rem; }
.about-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 44px 0; padding: 26px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-meta div { display: grid; }
.about-meta span { color: #70737a; font-size: .64rem; text-transform: uppercase; letter-spacing: .12em; }
.about-meta strong { margin-top: 4px; font-size: .8rem; }

.site-footer {
    min-height: 140px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: center;
    width: var(--page);
    margin: 0 auto;
    border-top: 1px solid var(--line);
}
.footer-brand { margin-right: 16px; }
.site-footer p { margin: 0; color: #8a8c92; font-size: .8rem; }
.footer-end { display: flex; align-items: center; gap: 28px; color: #6f7279; font-size: .7rem; }
.footer-end a { color: #b5b6ba; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .75s var(--ease), transform .75s var(--ease); }
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal.is-visible { opacity: 1; transform: none; }
.hero-console.reveal.is-visible { transform: rotate(1.5deg); }

:focus-visible { outline: 2px solid var(--blue-soft); outline-offset: 4px; }

@media (max-width: 1050px) {
    :root { --page: min(100% - 48px, 920px); }
    .hero { height: auto; max-height: none; min-height: 880px; grid-template-columns: 1fr .72fr; gap: 50px 36px; }
    .hero-console { max-width: 400px; }
    .section-heading > div { grid-template-columns: 1fr; }
    .section-heading > div > p { max-width: 520px; }
    .project-card { min-height: 650px; }
    .stack-panel { grid-template-columns: 1.1fr .9fr; }
    .stack-code { display: none; }
}

@media (max-width: 760px) {
    :root { --page: calc(100% - 36px); }

    .site-header { height: 72px; padding: 0 18px; }
    .brand-name { display: none; }
    .menu-toggle { display: flex; align-items: center; gap: 12px; border: 0; background: transparent; cursor: pointer; }
    .menu-toggle-label { color: #b4b5ba; font-size: .72rem; }
    .menu-toggle-lines { width: 22px; display: grid; gap: 5px; }
    .menu-toggle-lines i { height: 1px; background: var(--text); transition: transform .2s ease; }
    .menu-toggle[aria-expanded="true"] .menu-toggle-lines i:first-child { transform: translateY(3px) rotate(45deg); }
    .menu-toggle[aria-expanded="true"] .menu-toggle-lines i:last-child { transform: translateY(-3px) rotate(-45deg); }
    .site-nav { position: absolute; top: 71px; right: 0; left: 0; display: grid; gap: 0; padding: 12px 18px 24px; border-bottom: 1px solid var(--line); background: rgba(9,10,12,.97); transform: translateY(-140%); opacity: 0; pointer-events: none; transition: transform .3s var(--ease), opacity .3s ease; }
    .site-nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
    .site-nav a { padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }

    .hero { min-height: auto; display: block; padding: 142px 0 26px; }
    .hero-copy { margin-bottom: 58px; }
    .kicker { margin-bottom: 24px; }
    h1 { font-size: clamp(3rem, 13vw, 5.3rem); }
    .hero-intro { font-size: 1rem; }
    .hero-actions { flex-wrap: wrap; }
    .hero-console { width: calc(100% - 10px); margin: 0 auto; transform: none; }
    .hero-console.reveal.is-visible { transform: none; }
    .hero-console::before { inset: 30px -10px -20px 20px; }
    .console-content { padding: 26px 20px; }
    .answer-grid { grid-template-columns: 1fr; }
    .answer-grid button { min-height: 44px; }
    .hero-foot { margin-top: 58px; }

    .section { padding: 96px 0; }
    .section-heading,
    .approach-intro { grid-template-columns: 1fr; gap: 30px; margin-bottom: 50px; }
    .section-heading > div { gap: 25px; }
    h2 { font-size: clamp(2.7rem, 12vw, 4.4rem); }
    .project-list { grid-template-columns: 1fr; gap: 16px; }
    .project-card, .project-card-amber { min-height: 620px; margin-top: 0; }
    .project-card-head { margin-bottom: 50px; }
    .language-stage {
        min-height: 370px;
        grid-template-columns: minmax(110px, 1fr) 142px;
        gap: 18px;
        padding: 20px;
        transform: translate(18px, 18px);
    }
    .backgammon-stage {
        min-height: 320px;
        grid-template-columns: minmax(0, 1fr) 86px;
        gap: 10px;
        padding: 78px 12px 16px;
        transform: translate(-12px, 18px);
    }
    .screen-caption { left: 20px; max-width: 145px; }
    .screen-caption strong { font-size: .95rem; }
    .language-stage .screen-caption { left: auto; max-width: 145px; }

    .approach { padding-top: 55px; }
    .principle { grid-template-columns: 42px 1fr; gap: 14px; padding: 32px 0; }
    .principle > div { grid-template-columns: 1fr; gap: 10px; }
    .stack-panel { min-height: auto; grid-template-columns: 1fr; gap: 46px; margin-top: 80px; padding: 36px 26px; }
    .stack-copy h3 { margin-top: 24px; }

    .about { grid-template-columns: 1fr; gap: 65px; padding-top: 120px; padding-bottom: 110px; }
    .about-main h2 { font-size: clamp(4.3rem, 22vw, 7rem); }
    .about-meta { grid-template-columns: 1fr; }
    .site-footer { min-height: 180px; grid-template-columns: auto 1fr; }
    .footer-end { grid-column: 1 / -1; justify-content: space-between; }
}

@media (max-width: 410px) {
    .hero-actions { align-items: flex-start; flex-direction: column; gap: 15px; }
    .button { width: 100%; }
    .project-card { padding: 24px 20px; }
    .language-stage {
        min-height: 344px;
        grid-template-columns: minmax(100px, 1fr) 124px;
        gap: 12px;
        margin-right: -20px;
        padding: 16px;
        transform: translateY(18px);
    }
    .backgammon-stage {
        min-height: 292px;
        grid-template-columns: minmax(0, 1fr) 76px;
        gap: 8px;
        margin-left: -20px;
        padding: 72px 10px 14px;
        transform: translateY(18px);
    }
    .screen-caption { top: 20px; left: 14px; max-width: 124px; }
    .screen-caption small { margin-top: 58px; }
    .language-stage .screen-caption { top: auto; left: auto; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
    .reveal { opacity: 1; transform: none; }
    .hero-console.reveal { transform: none; }
}
