:root {
  --light-tint-color: rgb(0, 122, 255);
  --dark-tint-color: rgba(10, 132, 255);

  --light-primary-background-color: #ffffff;
  --dark-primary-background-color: #000000;

  --light-secondary-background-color: #f2f2f2;
  --dark-secondary-background-color: #28282e;

  --light-primary-text-color: #000000;
  --dark-primary-text-color: #ffffff;

  --light-button-background-color: #000000;
  --dark-button-background-color: #ffffff;

  --light-button-text-color: #ffffff;
  --dark-button-text-color: #ffffff;

  --iphone13-screen-width: 375px;
  --iphone13-screen-height: 811px;
  --iphone13-top-bottom-margin: 20px;
  --iphone13-left-right-margin: 22px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--light-primary-background-color);
    color: var(--light-primary-text-color);
    font-family: ui-rounded, -apple-system, BlinkMacSystemFont, Helvetica, Arial;
    font-size: 1em;
}

a {
    color: var(--light-tint-color);
    text-decoration: none;
}

a:hover, a.selected {
    text-decoration: underline;
}

p {
    line-height: 1.6em;
}

h1 {
    font-size: 1.75em;
    line-height: 1.3em;
}

.short {
    display: block !important;
}

.long {
    display: none !important;
}

/**
 * Page content
 */
.page-container {
    position: relative;
    min-height: 100vh;
}

.page-content {
    padding-top: 20px;
    padding-bottom: 80px; /* Make room for footer */
}

.layout-guide {
    padding-left: 20px;
    padding-right: 20px;
}

/**
 * Header
 */
header {
    width: 100%;
}

header.sticky {
    position: sticky;
    top: 0;
}

header.fixed {
    position: fixed;
}

nav {
    width: 100%;
    padding-top: 15px;
    padding-bottom: 15px;
    background-color: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(4px);
    -o-backdrop-filter: blur(4px);
    -moz-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

nav > :first-child {
    display: flex;
    align-items: center;
}

nav .flex-spacer {
    flex-grow: 1;
}

.app-icon {
    width: 45px;
    height: 45px;
    background-image: url('/images/appicon.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

nav .title {
    color: #000000;
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1em;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

nav .subtitle {
    color: #000000;
    font-size: 0.8em;
    font-weight: 400;
    line-height: 1em;
}

nav .title-subtitle-stack {
    color: var(--light-primary-text-color);
    margin-left: 10px;
    margin-bottom: 5px;
}

nav .title-subtitle-stack:hover {
    text-decoration: none;
}

article ul li {
    margin-bottom: 5px;
    list-style-position: inside;
}

article ul li:last-child {
    margin-bottom: 0;
}

article h1, article p, article pre, article ul, article table, article blockquote, article div {
    margin-bottom: 20px;
}

article h1:last-child, article p:last-child, article pre:last-child, article ul:last-child, article table:last-child {
    margin-bottom: 0;
}

article blockquote {
    padding: 20px;
    border-radius: 2px;
    border-left: 4px solid var(--light-primary-text-color);
    border-right: 4px solid transparent;
    background-color: var(--light-secondary-background-color);
}

table {
    text-align: left;
    margin: auto;
}

table tr > td, table tr > th {
    padding-bottom: 10px;
}

table tr:last-child > td  {
    padding-bottom: 0;
}

table tr th, table tr td {
    padding-right: 20px;
}

table tr th:last-child, table tr td:last-child {
    padding-right: 0;
}

/*
 * Footer
 */
footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding-top: 20px;
    padding-bottom: 20px;
}

footer .link-list {
    display: flex;
    align-items: center;
    justify-content: center;
}

footer .link-list a {
    margin-right: 30px;
    font-size: 0.8em;
}

footer .link-list a:last-child {
    margin-right: 0;
}

footer a {
    display: block;
    background-size: contain;
    background-repeat: no-repeat;
    color: var(--light-primary-text-color);
}

footer a.github {
    width: 22px;
    height: 21px;
    background-image: url('/images/github-black.png');
}

footer a.mail {
    width: 19px;
    height: 15px;
    background-image: url('/images/mail-black.png');
}

/**
 * Button
 */
a.button {
    display: block;
    background: var(--light-tint-color);
    color: var(--light-button-text-color);
    padding: 10px;
    font-size: 1em;
    border-radius: 9px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

a.button:hover {
    text-decoration: none;
    -webkit-filter: brightness(94%);
}

a.github-button {
    background-image: url('/images/github-white.png');
    background-size: 33px 32px;
    background-position: 10px center;
    background-repeat: no-repeat;
    padding-top: 17px;
    padding-bottom: 17px;
    padding-left: 53px !important;
}

.button-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.button-container * {
    margin-bottom: 20px;
}

.button-container *:last-child {
    margin-bottom: 0;
}

/**
 * Landing page
 */
.landing-page .banner {
    width: 100%;
    height: 450px;
    background-image: url('/images/header-graphic.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.landing-page .pitch {
    font-size: 1.6em;
    line-height: 1.2em;
    font-weight: 200;
    text-align: center;
    letter-spacing: 1px;
}

.landing-page .pitch {
    margin-top: 20px;
}

.landing-page .app-store-badge {
    margin: auto;
    margin-top: 25px;
}

.landing-page ul.sections {
    list-style-type: none;
    padding: 0;
    margin-top: 40px;
}

.landing-page ul li {
    margin-top: 30px;
    font-size: 1em;
    line-height: 1em;
    letter-spacing: 0.5px;
}

.landing-page ul li:first-child {
    margin-top: 0px;
}

.landing-page ul li h1 {
    font-size: 1em;
    line-height: 1.2em;
    margin-bottom: 7px;
}

.landing-page .sections .button-container {
    margin-top: 20px;
    margin-bottom: 20px;
}

/**
 * Help page
 */
.help-page ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    margin-top: 20px;
}

.help-page ul li {
    font-size: 1.2em;
    margin-top: 20px;
    line-height: 1.4em;
}

.help-page ul li:first-child {
    margin-top: 0;
}

.iphone13 {
    display: grid;
    justify-content: center;
}

.iphone13 img, .iphone13 div {
    grid-area: 1 / 1;
}

.iphone13 img {
    aspect-ratio: var(--iphone13-screen-width) / var(--iphone13-screen-height);
    width: calc(var(--iphone13-screen-width) * 0.5);
    margin-left: calc(var(--iphone13-left-right-margin) * 0.5);
    margin-top: calc(var(--iphone13-top-bottom-margin) * 0.5);
    margin-right: calc(var(--iphone13-left-right-margin) * 0.5);
    margin-bottom: calc(var(--iphone13-top-bottom-margin) * 0.5);
}

.iphone13 div {
    width: 100%;
    height: 100%;
    background-image: url('/images/help/iphone13.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

/**
 * Privacy policy
 */
.privacy-policy-page h1 {
    margin-bottom: 10px;
}

.privacy-policy-page h2 {
    margin-top: 20px;
    margin-bottom: 10px;
}

.privacy-policy-page ul {
    margin-top: 20px;
    margin-left: 20px;
}

/**
 * App Store Badge
 */
a.app-store-badge {
    display: block;
    width: 156px;
    height: 52px;
}

a.app-store-badge {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: all .2s ease-in-out;
}

.app-store-badge-download {
    background-image: url('/images/app-store-download-black.svg');
}

.app-store-badge-preorder {
    background-image: url('/images/app-store-preorder-black.svg');
}

a.app-store-badge:hover {
    transform: scale(1.04);
}

/**
 * iPhones larger than iPhone SE
 */
@media (min-width: 321px) {
    nav .subtitle {
        font-size: 1em;
    }

    .landing-page .pitch {
        font-size: 1.8em;
        padding-left: 20px;
        padding-right: 20px;
    }
}

/**
 * Desktop
 */
@media (min-width: 720px) {
    nav .title {
        font-size: 1.8em;
    }

    nav .subtitle {
        font-size: 1.2em;
    }

    h1 {
        font-size: 2.5em;
    }

    article {
        font-size: 1.2em;
    }

    article h1, article p, article pre, article ul, article table, article blockquote, article div {
        margin-bottom: 30px;
    }

    .short {
        display: none !important;
    }

    .long {
        display: block !important;
    }

    .app-icon {
        width: 70px;
        height: 70px;
    }

    .layout-guide {
        width: 720px;
        margin: auto;
        padding: 0;
    }

    .page-content {
        padding-bottom: 100px;
    }

    .page-content .description {
        font-size: 1.2em;
    }

    a.button {
        padding: 15px;
        border-radius: 12px;
    }

    .button-container {
        flex-direction: row;
        align-items: center;
    }

    .button-container * {
        margin-bottom: 0;
        margin-right: 20px;
    }

    .button-container *:last-child {
        margin-right: 0;
    }

    a.github-button {
        padding-top: 15px;
        padding-bottom: 15px;
    }

    a.app-store-badge {
        display: block;
        width: 180px;
        height: 60px;
    }

    .landing-page .pitch {
        margin-top: 40px;
    }

    .landing-page ul.sections {
        margin-top: 70px;
    }

    .landing-page ul li {
        margin-top: 50px;
        font-size: 1.2em;
        line-height: 1.2em;
    }

    .landing-page .banner {
        height: 750px;
    }

    .landing-page .pitch {
        font-size: 2.5em;
        padding-left: 100px;
        padding-right: 100px;
    }

    .help-page ul {
        margin-top: 30px;
    }

    .help-page ul li {
        font-size: 2em;
        margin-top: 30px;
    }

    .iphone13 img {
        width: calc(var(--iphone13-screen-width) * 0.8);
        margin-left: calc(var(--iphone13-left-right-margin) * 0.8);
        margin-top: calc(var(--iphone13-top-bottom-margin) * 0.8);
        margin-right: calc(var(--iphone13-left-right-margin) * 0.8);
        margin-bottom: calc(var(--iphone13-top-bottom-margin) * 0.8);
    }

    footer .link-list a {
        margin-right: 50px;
        font-size: 1em;
    }

    footer a.github {
        width: 33px;
        height: 32px;
    }

    footer a.twitter {
        width: 30px;
        height: 24px;
    }

    footer a.mail {
        width: 29px;
        height: 23px;
    }
}

/**
 * Dark mode
 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: var(--dark-primary-background-color);
        color: var(--dark-primary-text-color);
    }

    nav {
        background-color: rgba(0, 0, 0, 0.75);
    }

    nav .title {
        color: #ffffff;
    }

    nav .subtitle {
        color: #ffffff;
    }

    nav .title-subtitle-stack {
        color: var(--dark-primary-text-color);
    }

    a {
        color: var(--dark-tint-color);
    }

    a:hover, a.selected {
        color: var(--dark-tint-color);
        text-decoration: underline;
    }

    a.button {
        background: var(--dark-tint-color);
        color: var(--dark-button-text-color);
        padding: 15px;
        border-radius: 12px;
    }

    a.github-button {
        background-image: url('/images/github-white.png');
        background-size: 33px 32px;
        background-position: 10px center;
        background-repeat: no-repeat;
    }

    article blockquote {
        border-left: 4px solid var(--dark-primary-text-color);
        background-color: var(--dark-secondary-background-color);
    }

    .app-store-badge-download {
        background-image: url('/images/app-store-download-white.svg');
    }

    .app-store-badge-preorder {
        background-image: url('/images/app-store-preorder-white.svg');
    }

    footer a {
        color: var(--dark-primary-text-color);
    }

    footer a.github {
        background-image: url('/images/github-white.png');
    }

    footer a.twitter {
        background-image: url('/images/twitter-white.png');
    }

    footer a.mail {
        background-image: url('/images/mail-white.png');
    }
}
