/* Roj Keyboard's website: the app's colors, light or dark as the phone or computer is (or as picked), system fonts
   for Latin and Cyrillic, and Vazirmatn from this site for the Arabic script (nothing is loaded from elsewhere). */

/* Vazirmatn (SIL Open Font License 1.1, fonts/OFL.txt), its Arabic-only cut with every weight in one file: the same
   Sorani on every phone and computer, instead of a different system font on each. Only the Arabic script's letters
   take it, so Latin words in a Sorani sentence keep the system font, as on the English pages. */
@font-face {
    font-family: "Vazirmatn";
    src: url("/fonts/vazirmatn-nl.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F;
}

:root {
    --background: #1A1C1E;
    --card: #2A2C2F;
    --text: #E3E3E3;
    --muted: #A8ABAF;
    --accent: #A8C7FA;
    --line: #44474A;
    --sun: #FFB300;
    color-scheme: dark;
}

:root[data-theme="light"] {
    --background: #F1F3F4;
    --card: #FFFFFF;
    --text: #1F1F1F;
    --muted: #5F6368;
    --accent: #0B57D0;
    --line: #DADCE0;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font: 16px/1.6 "Vazirmatn", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, sans-serif;
}

main {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 16px 48px;
}

h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 500;
    line-height: 1.25;
}

h2 {
    margin: 28px 0 8px;
    font-size: 20px;
    font-weight: 500;
}

p, li {
    margin: 0 0 12px;
}

ul {
    padding-inline-start: 24px;
    margin: 0 0 12px;
}

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

.card {
    background: var(--card);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 12px;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

/* The start page. */
.home .wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

.home img {
    display: block;
    max-width: 100%;
}

.top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.top img {
    border-radius: 10px;
}

.top nav {
    margin-inline-start: auto;
    display: flex;
    gap: 18px;
    font-size: 15px;
}


.stores {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.store {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 12px;
    background: var(--text);
    color: var(--background);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
}

.soon {
    font-size: 14px;
    color: var(--muted);
    margin: 10px 0 0;
}

.frame {
    margin: 0;
    background: var(--card);
    box-shadow: 0 0 0 1px var(--line);
    border-radius: 22px;
    padding: 8px;
}

.frame img {
    width: 100%;
    border-radius: 15px;
}

.film {
    padding: 8px 0 24px;
}

.film + .soon, .stores + .soon {
    text-align: center;
    margin: 0 0 40px;
}

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

.film video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 15px;
}

.promise {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: center;
    background: linear-gradient(120deg, color-mix(in srgb, var(--sun) 14%, var(--card)), var(--card) 55%);
    box-shadow: 0 0 0 1px var(--line);
    border-radius: 24px;
    padding: 28px 32px;
    margin-bottom: 48px;
}

.lock {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: var(--sun);
    background: color-mix(in srgb, var(--sun) 16%, transparent);
}

.promise h2, .about h2 {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 600;
}

.promise p {
    margin: 0;
    color: var(--muted);
}

.home h2.sec {
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 16px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}

.grid > div {
    background: linear-gradient(140deg, color-mix(in srgb, var(--sun) 9%, var(--card)), var(--card) 60%);
    box-shadow: 0 0 0 1px var(--line);
    border-radius: 20px;
    padding: 20px;
}

/* Each feature's Material icon in the sun's colour on a round tint, as the lock in the promise. */
.dot {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 12px;
    border-radius: 50%;
    color: var(--sun);
    background: color-mix(in srgb, var(--sun) 16%, transparent);
}

.grid h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
}

.grid p {
    margin: 0;
    font-size: 15px;
    color: var(--muted);
}

.about {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 28px;
    align-items: start;
    background: linear-gradient(140deg, color-mix(in srgb, var(--sun) 9%, var(--card)), var(--card) 60%);
    box-shadow: 0 0 0 1px var(--line);
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 48px;
}

.about img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 60% 30%;
}

/* LinkedIn's own [in] logo, unchanged and alone (their rules: no words or other marks combined with it): blue on the
   light card, white on the dark one, with a logo's height of free space above it. */
.about .linkedin {
    display: inline-block;
    margin-top: 28px;
}

.about .linkedin img {
    width: auto;
    height: 44px;
    border-radius: 0;
    object-fit: contain;
}

:root[data-theme="light"] .about .linkedin .on-dark, :root:not([data-theme="light"]) .about .linkedin .on-light {
    display: none;
}

/* App Store first, then Google Play, same visible height; each keeps a quarter of its height clear around it
   (built into the Google Play file, given by padding for the App Store badge). */
.stores {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 4px 0 28px;
}

/* The same buttons again at the end, for whoever read the whole page. */
.stores.end {
    margin: -16px 0 32px;
}

.stores img {
    display: block;
}

.stores .apple {
    padding: 12px;
}

.stores .apple img {
    width: auto;
    height: 48px;
}

.stores .play img {
    width: auto;
    height: 71.4px;
}

.home footer .legal {
    flex-basis: 100%;
    margin: 0;
    font-size: 12px;
}

.home footer {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 15px;
    color: var(--muted);
    padding-bottom: 44px;
}

@media (max-width: 760px) {
    .grid, .about {
        grid-template-columns: 1fr;
    }

    .promise {
        grid-template-columns: 1fr;
    }

}

/* The links at the top, underlined only under the pointer, and the light or dark button. */
.top nav {
    align-items: center;
}

.top nav a {
    text-decoration: none;
}

.top nav a:hover {
    text-decoration: underline;
}

.top b a {
    color: inherit;
    text-decoration: none;
}

.mode {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin: -8px 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.mode:hover {
    background: var(--card);
}

/* The sun switches to light, the moon to dark. */
:root[data-theme="light"] .mode .sun, :root:not([data-theme="light"]) .mode .moon {
    display: none;
}

/* The link at the end of a sentence keeps its words together. */
.promise a {
    white-space: nowrap;
}

/* A line under a heading that has no section of its own. */
.home p.sub {
    color: var(--muted);
    margin: 0 0 18px;
}

/* The sun's line under the headings. */
.home h2.sec::after, .policy .card h2::after {
    content: "";
    display: block;
    width: 44px;
    height: 4px;
    border-radius: 2px;
    background: var(--sun);
    margin-top: 8px;
}

/* The languages, as keys with their flags. */
.langs {
    margin-bottom: 48px;
}

.langs p {
    color: var(--muted);
    margin: 0 0 18px;
}

.keys {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
}

.keys span {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 4px 0;
}

.home .keys img {
    width: 26px;
    height: 19px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(127, 127, 127, .3);
}


/* The privacy policy. */
.policy main {
    max-width: 760px;
    padding-top: 0;
}

.policy h1 {
    font-size: 40px;
    font-weight: 600;
    margin: 16px 0 20px;
}

.policy .card {
    padding: 28px;
}

.policy .card h2 {
    margin-top: 0;
    font-weight: 600;
}

.policy .short {
    font-size: 18px;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.tiles div {
    background: var(--card);
    border-radius: 20px;
    padding: 18px;
    text-align: center;
    font-weight: 600;
}

.tiles b {
    display: block;
    color: var(--sun);
    font-size: 22px;
    line-height: 1.2;
}

@media (max-width: 760px) {
    .tiles {
        grid-template-columns: 1fr;
    }
}

/* The themes, as a row to scroll through. */
.browse {
    margin-bottom: 48px;
}

.browse p {
    color: var(--muted);
    margin: 0 0 18px;
}

.carousel {
    --w: 40%;
    --near: 60%;
    --far: 93%;
    position: relative;
    aspect-ratio: 1 / .3;
    overflow: hidden;
    outline-offset: 4px;
}

.home .carousel img {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--w);
    max-width: none;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    cursor: pointer;
    transform: translate(-50%, -50%) scale(.5);
    opacity: 0;
    transition: transform .3s ease, opacity .3s ease, filter .3s ease;
}

.home .carousel img[data-o="0"] {
    transform: translate(-50%, -50%);
    opacity: 1;
    z-index: 3;
    cursor: default;
}

.home .carousel img[data-o="1"] {
    transform: translate(calc(-50% + var(--near)), -50%) scale(.8);
    opacity: 1;
    filter: brightness(.72);
    z-index: 2;
}

.home .carousel img[data-o="-1"] {
    transform: translate(calc(-50% - var(--near)), -50%) scale(.8);
    opacity: 1;
    filter: brightness(.72);
    z-index: 2;
}

.home .carousel img[data-o="2"] {
    transform: translate(calc(-50% + var(--far)), -50%) scale(.62);
    opacity: 1;
    filter: brightness(.5);
    z-index: 1;
}

.home .carousel img[data-o="-2"] {
    transform: translate(calc(-50% - var(--far)), -50%) scale(.62);
    opacity: 1;
    filter: brightness(.5);
    z-index: 1;
}

.browse .carousel-name {
    margin: 12px 0 0;
    min-height: 1.5em;
    text-align: center;
    font-weight: 600;
    unicode-bidi: plaintext;
}

.carousel button {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--card);
    color: var(--text);
    box-shadow: 0 0 0 1px var(--line), 0 2px 8px rgba(0, 0, 0, .3);
    cursor: pointer;
}

.carousel .prev {
    left: 4px;
}

.carousel .next {
    right: 4px;
}

@media (max-width: 760px) {
    .stores .apple {
        padding: 11px;
    }

    .stores .apple img {
        height: 44px;
    }

    .stores .play img {
        height: 65.5px;
    }

    .carousel {
        --w: 64%;
        --near: 46%;
        aspect-ratio: 1 / .48;
    }

    .home .carousel img[data-o="2"], .home .carousel img[data-o="-2"] {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home .carousel img {
        transition: none;
    }
}


/* Sorani reads better a little larger, with more room between the lines. */
html[lang="ckb"] body {
    font-size: 18px;
    line-height: 1.85;
}

html[lang="ckb"] .top nav, html[lang="ckb"] .grid p, html[lang="ckb"] .soon, html[lang="ckb"] .muted, html[lang="ckb"] footer {
    font-size: 17px;
}

html[lang="ckb"] .policy .short {
    font-size: 18px;
}

html[lang="ckb"] .grid h3 {
    font-size: 19px;
}

html[lang="ckb"] h1, html[lang="ckb"] h2, html[lang="ckb"] h3 {
    line-height: 1.5;
}

html[lang="ckb"] .policy .card h2 {
    font-size: 22px;
}
