/* OpenWin's pages look like the ones Windows asks its own questions on after
   Setup (OOBE): the same card on every page, with a picture in its left half,
   and OOBE's type, buttons and lists. They take on the theme you choose: OOBE's
   colors in light mode, their dark counterparts in dark mode, and the theme's
   accent color, which app.js sets. */

:root {
    color-scheme: dark;
    --page-1: #0e141b;
    --page-2: #111923;
    --glow-top: #16355a;
    --glow-bottom: #1b3766;
    --card-1: #1d2530;
    --card-2: #202226;
    --card-stroke: rgb(255 255 255 / 9%);
    --shadow-far: rgb(0 0 0 / 30%);
    --shadow-near: rgb(0 0 0 / 25%);
    --text-strong: #fff;
    --text-primary: #e6e6e6;
    --text-secondary: #adadad;
    --text-tertiary: #8a8a8a;
    --text-disabled: rgb(255 255 255 / 36%);
    --text-critical: #ff99a4;
    --control-fill: rgb(255 255 255 / 6%);
    --control-fill-secondary: rgb(255 255 255 / 8%);
    --control-fill-input: rgb(30 30 30 / 70%);
    --control-stroke: rgb(255 255 255 / 7%);
    --control-strong-stroke: rgb(255 255 255 / 55%);
    --control-strong-stroke-disabled: rgb(255 255 255 / 16%);
    --subtle-fill-secondary: rgb(255 255 255 / 6%);
    --subtle-fill-tertiary: rgb(255 255 255 / 4%);
    --focus-stroke: #fff;
    --focus-stroke-inner: rgb(0 0 0 / 70%);
    --accent-disabled: rgb(255 255 255 / 16%);
    --text-on-accent-disabled: rgb(255 255 255 / 53%);
    --art-gray: #3e454e;
    --art-light-gray: #4d555f;
    --art-white: #353b43;
    --art-blue: linear-gradient(135deg, #0a72d4, #5545d3);
    --art-teal: linear-gradient(135deg, #66e6d4, #03bea4);
    --art-mint: #96e9dc;
    --art-line: rgb(255 255 255 / 25%);
    --preview-fill: #000;
    --logo-tile-fill: #2d3239;
    --logo-tile-stroke: rgb(255 255 255 / 12%);
    --window-fill: rgb(28 28 28 / 85%);
    --window-line: rgb(255 255 255 / 55%);
    /* The accent color's shades, which app.js sets for the theme chosen. */
    --accent: #4cc2ff;
    --accent-hover: rgb(76 194 255 / 90%);
    --accent-pressed: rgb(76 194 255 / 80%);
    --accent-text: #99ebff;
    --accent-text-hover: #99ebff;
    --accent-text-pressed: #4cc2ff;
    --text-on-accent: #000;
    --text-on-accent-pressed: rgb(0 0 0 / 50%);
    --theme-accent: #0078d4;
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-primary);
    background: var(--page-1);
}

:root.light {
    color-scheme: light;
    --page-1: #d4e2ec;
    --page-2: #dfe8f1;
    --glow-top: #c4dcfa;
    --glow-bottom: transparent;
    --card-1: #ecf2fb;
    --card-2: #f8fafc;
    --card-stroke: transparent;
    --shadow-far: rgb(0 0 0 / 11%);
    --shadow-near: rgb(0 0 0 / 9%);
    --text-strong: #000;
    --text-primary: #404040;
    --text-secondary: #666;
    --text-tertiary: #8a8a8a;
    --text-disabled: rgb(0 0 0 / 36%);
    --text-critical: #c42b1c;
    --control-fill: #fff;
    --control-fill-secondary: #f9f9f9;
    --control-fill-input: #fff;
    --control-stroke: #e5e5e5;
    --control-strong-stroke: rgb(0 0 0 / 45%);
    --control-strong-stroke-disabled: rgb(0 0 0 / 22%);
    --subtle-fill-secondary: rgb(0 0 0 / 4%);
    --subtle-fill-tertiary: rgb(0 0 0 / 2.4%);
    --focus-stroke: rgb(0 0 0 / 89%);
    --focus-stroke-inner: rgb(255 255 255 / 70%);
    --accent-disabled: rgb(0 0 0 / 22%);
    --text-on-accent-disabled: #fff;
    --art-gray: #e0dedc;
    --art-light-gray: #ecebea;
    --art-white: #fff;
    --art-line: rgb(255 255 255 / 25%);
    --preview-fill: #1c1c1c;
    --logo-tile-fill: #fff;
    --logo-tile-stroke: rgb(0 0 0 / 8%);
    --window-fill: rgb(249 249 249 / 90%);
    --window-line: rgb(0 0 0 / 35%);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 52px 16px 16px;
    background:
        radial-gradient(ellipse 70% 38% at 50% 0%, var(--glow-top), transparent 70%),
        radial-gradient(ellipse 60% 30% at 50% 100%, var(--glow-bottom), transparent 70%),
        linear-gradient(var(--page-1), var(--page-2));
    background-attachment: fixed;
    transition: background-color 0.3s;
}

/* The card, OOBE's size for the screen. */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(90vw, 1048px);
    height: min(calc(100vh - 104px), 664px);
    min-height: 560px;
    border: 1px solid var(--card-stroke);
    border-radius: 8px;
    background: radial-gradient(ellipse 80% 80% at 50% 50%, var(--card-1), var(--card-2));
    box-shadow: 0 38px 86px var(--shadow-far), 0 7px 22px var(--shadow-near);
}

@media (min-width: 1441px) and (min-height: 864px) {
    .card {
        width: min(90vw, 1200px);
        height: min(calc(100vh - 104px), 760px);
    }
}

@media (min-width: 1921px) and (min-height: 1016px) {
    .card {
        width: min(90vw, 1440px);
        height: min(calc(100vh - 104px), 912px);
    }
}

.page {
    display: none;
    flex: 1;
    min-height: 0;
}

.page.shown {
    display: flex;
}

/* A page with a picture: the picture in the left half, the rest in the right. */
.picture {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.picture svg {
    width: 100%;
    max-width: 400px;
    height: auto;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 64px 48px 44px 0;
}

/* The apps and settings take the whole card. */
.page.whole .content {
    padding: 64px 48px 44px;
}

h1 {
    margin: 0 0 16px;
    font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 24.5px;
    font-weight: 400;
    line-height: 32px;
    color: var(--text-strong);
}

.description {
    margin: 0 0 24px;
    color: var(--text-secondary);
}

.description code {
    font-family: inherit;
    font-weight: 600;
}

.body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    /* Room for focus outlines. */
    margin: -4px;
    padding: 4px;
}

/* The bottom of the card: OOBE's links on the left, its button on the right. */
.footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 16px;
    min-height: 40px;
}

.footer .status {
    flex: 1;
    min-width: 0;
    color: var(--text-secondary);
}

button,
input {
    font: inherit;
    color: inherit;
}

a {
    color: var(--accent-text);
}

a:hover {
    color: var(--accent-text-hover);
}

:focus-visible {
    outline: 2px solid var(--focus-stroke);
    outline-offset: 2px;
    border-radius: 4px;
}

/* OOBE's button, in the accent color. */
.primary {
    min-width: 128px;
    height: 40px;
    padding: 0 16px 1px;
    border: 0;
    border-radius: 4px;
    font-size: 15px;
    background: var(--accent);
    color: var(--text-on-accent);
    cursor: pointer;
}

.primary:hover {
    background: var(--accent-hover);
}

.primary:active {
    background: var(--accent-pressed);
    color: var(--text-on-accent-pressed);
}

.primary:disabled {
    background: var(--accent-disabled);
    color: var(--text-on-accent-disabled);
    cursor: default;
}

/* OOBE's links next to its button. */
.link {
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--accent-text);
    cursor: pointer;
}

.link:hover {
    color: var(--accent-text-hover);
    text-decoration: underline;
}

.link:active {
    color: var(--accent-text-pressed);
}

/* OOBE's arrow back, at the top left of the card. */
.back {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 36px;
    border: 0;
    border-radius: 4px;
    background: none;
    color: var(--text-strong);
    cursor: pointer;
}

.back:hover {
    background: var(--subtle-fill-secondary);
}

.back[hidden] {
    display: none;
}

/* The pictures' colors, which follow the mode. */
.art-gray {
    fill: var(--art-gray);
}

.art-light-gray {
    fill: var(--art-light-gray);
}

.art-white {
    fill: var(--art-white);
}

/* The welcome page's points. */
.points {
    display: grid;
    gap: 14px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.points li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.points svg {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 0;
    color: var(--accent-text);
}

.points strong {
    display: block;
    font-weight: 600;
    color: var(--text-strong);
}

.points span {
    color: var(--text-secondary);
}

/* The themes, like the thumbnails in Settings, outlined in the accent color
   when chosen. */
.themes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 112px));
    gap: 12px;
    margin: 0 0 24px;
    padding: 0;
    border: 0;
}

.theme {
    position: relative;
    display: block;
    aspect-ratio: 112 / 84;
    border-radius: 6px;
    cursor: pointer;
}

.theme input {
    position: absolute;
    opacity: 0;
}

.theme .thumbnail {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 6px;
    outline: 1px solid var(--control-stroke);
}

.theme:hover .thumbnail {
    filter: brightness(1.08);
}

.theme input:checked + .thumbnail {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.theme input:focus-visible + .thumbnail {
    outline: 2px solid var(--focus-stroke);
    outline-offset: 2px;
}

/* A wallpaper with a window on it, in the theme's mode and accent color. */
.wallpaper {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--art-gray) center / cover no-repeat;
}

.wallpaper .window {
    position: absolute;
    right: 8%;
    bottom: 10%;
    width: 38%;
    height: 44%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 12%;
    border-radius: 4px;
    background: rgb(249 249 249 / 90%);
    box-shadow: 0 2px 8px rgb(0 0 0 / 20%);
}

.wallpaper .window.dark {
    background: rgb(32 32 32 / 85%);
}

.wallpaper .window .bar {
    width: 50%;
    height: 12%;
    border-radius: 99px;
}

/* The big preview, on a screen, with lines of text in its window. */
.screen {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 400 / 256;
    padding: 10px;
    border: 1px solid var(--card-stroke);
    border-radius: 14px;
    background: var(--preview-fill);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 12%), 0 8px 24px rgb(0 0 0 / 25%);
}

.screen .wallpaper {
    border-radius: 6px;
}

.screen .wallpaper .window {
    right: 6%;
    bottom: 24%;
    width: 33%;
    height: 42%;
    padding: 6% 4% 5%;
    gap: 6px;
    justify-content: flex-start;
    align-items: stretch;
}

.screen .wallpaper .line {
    height: 2px;
    border-radius: 1px;
    background: rgb(0 0 0 / 35%);
}

.screen .wallpaper .window.dark .line {
    background: rgb(255 255 255 / 55%);
}

.screen .wallpaper .line:nth-child(4) {
    margin-right: 30%;
}

.screen .wallpaper .window .bar {
    width: 26%;
    height: 9%;
    margin-top: auto;
    align-self: flex-end;
    border-radius: 2px;
}

.theme-name {
    margin: 0 0 4px;
    font-size: 16px;
    line-height: 22px;
    color: var(--text-strong);
}

.theme-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
    margin: 0;
    color: var(--text-primary);
}

.theme-details span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.theme-details svg {
    width: 16px;
    height: 16px;
    color: var(--accent-text);
}

.swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--theme-accent);
}

/* The browsers, like the items of OOBE's lists, in the accent color once
   chosen. */
.browsers {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    border: 0;
}

.browser {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.browser:hover {
    background: var(--subtle-fill-secondary);
}

.browser input {
    position: absolute;
    opacity: 0;
}

.browser:has(input:checked) {
    background: var(--accent);
    color: var(--text-on-accent);
}

.browser:has(input:focus-visible) {
    outline: 2px solid var(--focus-stroke);
    outline-offset: 2px;
}

.browser .tile {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--logo-tile-stroke);
    border-radius: 6px;
    background: var(--logo-tile-fill);
}

.browser .tile img {
    width: 28px;
    height: 28px;
}

.browser strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-strong);
}

.browser small {
    display: block;
    font-size: 12px;
    line-height: 16px;
    color: var(--text-secondary);
}

.browser:has(input:checked) strong,
.browser:has(input:checked) small {
    color: var(--text-on-accent);
}

/* The apps, all on screen at once in three columns where there's room. */
.apps-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.search {
    position: relative;
    flex: none;
    width: 240px;
}

.search input {
    width: 100%;
    height: 32px;
    padding: 0 32px 1px 11px;
    border: 1px solid var(--control-stroke);
    border-bottom-color: var(--control-strong-stroke);
    border-radius: 4px;
    background: var(--control-fill);
    outline: none;
}

.search input:hover {
    background: var(--control-fill-secondary);
}

.search input:focus {
    border-bottom: 2px solid var(--accent);
    background: var(--control-fill-input);
}

.search input::placeholder {
    color: var(--text-secondary);
}

.search svg {
    position: absolute;
    top: 9px;
    right: 11px;
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
    pointer-events: none;
}

.apps {
    columns: 3;
    column-gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.apps li {
    break-inside: avoid;
}

.apps li[hidden] {
    display: none;
}

.check {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 26px;
    padding: 1px 0;
    cursor: pointer;
}

.check input {
    flex: none;
    appearance: none;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 1px solid var(--control-strong-stroke);
    border-radius: 4px;
    background: var(--subtle-fill-tertiary) no-repeat center / 14px;
    cursor: pointer;
}

.check:hover input {
    background-color: var(--subtle-fill-secondary);
}

.check input:checked {
    border-color: var(--accent);
    background-color: var(--accent);
    background-image: var(--check-mark);
}

.check:hover input:checked {
    border-color: var(--accent-hover);
    background-color: var(--accent-hover);
}

.check input:disabled {
    border-color: var(--control-strong-stroke-disabled);
    background-color: transparent;
    cursor: default;
}

.check input:disabled:checked {
    border-color: transparent;
    background-color: var(--accent-disabled);
}

.check:has(input:disabled) {
    cursor: default;
}

.check .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.check:has(input:disabled) .name {
    color: var(--text-disabled);
}

.no-apps {
    color: var(--text-secondary);
}

/* The settings, with toggles like those of Windows Settings, in two groups
   side by side. */
.groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

h2 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 400;
    line-height: 22px;
    color: var(--text-strong);
}

.setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 48px;
    cursor: pointer;
}

.setting .label {
    display: block;
    color: var(--text-primary);
}

.setting small {
    display: block;
    font-size: 12px;
    line-height: 16px;
    color: var(--text-secondary);
}

.toggle {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle .state {
    min-width: 24px;
    color: var(--text-primary);
}

.toggle input {
    appearance: none;
    position: relative;
    width: 40px;
    height: 20px;
    margin: 0;
    border: 1px solid var(--control-strong-stroke);
    border-radius: 10px;
    background: var(--subtle-fill-tertiary);
    cursor: pointer;
}

.toggle input::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: left 0.15s, width 0.15s;
}

.setting:hover .toggle input {
    background: var(--subtle-fill-secondary);
}

.setting:hover .toggle input::before {
    width: 14px;
    top: 2px;
    height: 14px;
}

.toggle input:checked {
    border-color: var(--accent);
    background: var(--accent);
}

.toggle input:checked::before {
    left: 22px;
    background: var(--text-on-accent);
}

.setting:hover .toggle input:checked {
    border-color: var(--accent-hover);
    background: var(--accent-hover);
}

.setting:hover .toggle input:checked::before {
    left: 21px;
}

.note {
    margin: 0 0 12px;
    color: var(--text-secondary);
}

.privacy {
    margin: 0;
    padding: 0;
    list-style: none;
}

.privacy li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 32px;
    color: var(--text-primary);
}

.privacy li span:last-child {
    color: var(--text-secondary);
}

/* Where to install Windows, like the browsers' list. */
.targets {
    display: grid;
    gap: 4px;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
}

.target {
    position: relative;
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.target:hover {
    background: var(--subtle-fill-secondary);
}

.target input {
    position: absolute;
    opacity: 0;
}

.target:has(input:checked) {
    background: var(--accent);
}

.target:has(input:focus-visible) {
    outline: 2px solid var(--focus-stroke);
    outline-offset: 2px;
}

.target strong {
    display: block;
    font-weight: 600;
    color: var(--text-strong);
}

.target small {
    display: block;
    font-size: 12px;
    line-height: 16px;
    color: var(--text-secondary);
}

.target:has(input:checked) strong,
.target:has(input:checked) small {
    color: var(--text-on-accent);
}

.steps[hidden] {
    display: none;
}

/* The download page's summary of your choices. */
.summary {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px 16px;
    align-items: baseline;
    margin: 0 0 20px;
}

.summary dt {
    color: var(--text-secondary);
}

.summary dd {
    margin: 0;
    min-width: 0;
    color: var(--text-strong);
}

.steps {
    margin: 0;
    padding-left: 20px;
    color: var(--text-primary);
}

.steps li + li {
    margin-top: 8px;
}

.steps code {
    font-family: inherit;
    font-weight: 600;
}

.progress {
    height: 4px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 2px;
    background: var(--control-strong-stroke-disabled);
}

.progress[hidden] {
    display: none;
}

.progress div {
    width: 0;
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
    transition: width 0.2s;
}

.status.error {
    color: var(--text-critical);
}

/* Below the card. */
.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 16px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.site-footer a {
    color: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* On smaller screens, the card grows with its page, the picture goes above
   the rest, and lists take fewer columns. */
@media (max-width: 900px), (max-height: 600px) {
    body {
        justify-content: flex-start;
        padding-top: 16px;
    }

    .card {
        height: auto;
        min-height: 0;
    }

    .body {
        overflow: visible;
    }
}

@media (max-width: 900px) {
    .card {
        width: 100%;
        max-width: 640px;
    }

    .page.shown {
        flex-direction: column;
    }

    .picture {
        padding: 56px 32px 0;
    }

    .picture svg,
    .picture .screen {
        max-width: 320px;
    }

    .content,
    .page.whole .content {
        padding: 32px 24px 24px;
    }

    .page.whole .content {
        padding-top: 56px;
    }

    .apps {
        columns: 2;
    }

    .groups {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .apps-header {
        flex-direction: column;
        gap: 0;
    }

    .search {
        width: 100%;
        margin-bottom: 16px;
    }
}

@media (max-width: 520px) {
    .apps {
        columns: 1;
    }

    .themes {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .footer {
        flex-wrap: wrap;
    }

    .footer .status {
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before {
        transition: none !important;
    }
}
