:root {
    --ish-primary: #20233c;
    --ish-secondary: #0f1121;
    --ish-blue: #85beff;
    --ish-purple: #636cc2;
    --background: #161616;
    --background-alt: #0a0a0a;
    --accent: #2d2d2d;
}

body {
    background-color: var(--background);
    color: #fff;
    font-family: "Ubuntu", "Noto Sans", sans-serif;
    text-align: center;
    margin: 0;
    font-size: 13pt;
}

h1, h2 { font-weight: 400; }

a {
    color: var(--ish-blue);
    text-decoration: none;
    outline: 0;
}

a:hover, a:focus { text-decoration: underline; }

hr {
    border: 0;
    border-top: 1px solid #818181;
    width: 50%;
}

header {
    height: 60px;
    width: 100%;
    line-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

nav { display: inherit; }

nav a {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0 8px 0 8px;
    width: 140px;
    margin: 0 12px 0 12px;
    border-radius: 8px;
    transition: background .05s ease-in-out, border-color .2s;
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: white;
}

nav a:hover, nav a:focus {
    background-color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    border-color: #fff;
}

footer {
    margin-top: 8px;
    background-color: var(--ish-primary);
}

footer a { color: #aaa; }

footer p {
    font-size: 14pt;
    padding: 12px;
    margin: 0;
    color: #ddd;
}

#home {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, var(--ish-primary), var(--ish-secondary));
    height: 100vh;
}

/* Contains entire front page */
.front-container {
    display: flex;
    align-items: center;
    width: 90%;
    max-width: 70em;
    justify-content: space-evenly;
    flex-grow: 2;
}

/* The large iSH icon */
.icon {
    height: 190px;
    width: 190px;
    border-radius: 32px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Fancy Get buttons */
.actions {
    align-items: center;
    font-size: 20pt;
    max-width: 300px;
}

.get {
    display: flex;
    align-items: center;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: #000;
    background-clip: padding-box; /* border colour alphaing to button's background */
    width: 280px;
    color: #4b4d5c; /* otherwise border flashes blue on load */
    transition: border-color .15s ease-in-out;
    padding: 0.4em;
    margin-bottom: 6px;
}

.get img {
    height: 40px;
    width: 40px;
    border-radius: 9px;
}

.get p {
    text-align: center;
    flex-grow: 1;
    font-size: 15pt;
    margin: 0;
    color: #fff;
}

.get:hover, .get:focus {
    border-color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

.title {
    text-align: left;
    flex-grow: 1;
    margin: 0 2em 0 2em;
}

.title h1 {
    font-size: 36pt;
    line-height: 48px;
}

.title h1, .title h2 { margin: 10px 0 10px 0; }

.iphone {
    height: auto;
    max-width: 100%;
    max-height: 75vh;
}

.alt-section {
    background-color: var(--background-alt);
    color: #fff;
    padding: 1px;
}

section > h1 {
    font-size: 22pt;
    margin: 20px 0 0 0;
}

section > p {
    padding: 0 12px;
    margin-top: 8px;
}

#info > p { margin-bottom: 0; }

.getcontainer {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tidbits {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.tidbit.large { grid-row-end: span 2; }

.tidbit, #altstore-container {
    box-shadow: 0px 0px 30px 4px rgba(0, 0, 0, 0.3);
    background-color: var(--background);
    border: 2px solid var(--accent);
    border-radius: 10px;
    padding: 12px;
}

.tidbit p { margin: 4px 0 12px 0; }
.tidbit h2 {
    margin: 4px 0 0 0;
    color: var(--ish-purple);
}

.tidbit img {
    max-width: 95%;
    width: 95%;
    vertical-align: middle;
}

.tidbit.large {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.growth { flex-grow: 1; }

.actions svg {
    width: 40px;
    height: 40px;
    color: #f1f1f1;
    fill: currentColor;
    transition: .4s transform;
}

.mini-dl { margin: 12px; }

.bottomtext {
    text-align: left;
    margin: 0 auto;
    padding: 0 20px 0 20px;
    max-width: 37em;
}

#info, #get {
    border-top: 2px solid var(--accent);
}

/* Feed */
.feed {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.version, .posts {
    width: 500px;
    margin: 12px;
}

.version {
    background-color: #1f1f1f;
    border-radius: 10px;
    box-shadow: 0 0 0 2px var(--accent) inset; /* An inset allows for both titles to align */
}

.changelog p {
    text-align: left;
    font-size: 12pt;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: ui-monospace, monospace;
}

.changelog {
    min-height: 40px;
    max-height: 150px;
    overflow-y: auto;
}

.changelog p {
    margin: 0 12px 0 12px;
}

.posts { text-align: left; }
.posts h2 { margin-bottom: 0; }
.posts p { margin: 2px 0 0 2px; }

.midline {
    border-left: 2px solid var(--accent);
    height: 80px;
    margin: 0 30px 0 30px;
    display: inline-block;
}

.feed h2 { font-size: 16pt; }

/* Mobile optimisations */
@media only screen and (max-width: 750px) {
    header { justify-content: space-around; }
    nav a {
        padding: 0 5px 0 5px;
        width: 80px;
        margin: 6px;
    }
    .front-container {
        flex-direction: column;
        margin: 0;
        width: 100%;
    }
    .icon {
        height: 140px;
        width: 140px;
    }
    .iphone, .midline { display: none; }
    .title {
        flex-grow: 0;
        text-align: center;
        margin: 2em 0 0 0;
    }
    .ipad { max-width: 80% !important; }
    .block { margin: 6px 0 6px 0; }
    .getcontainer { flex-direction: column; }
    .tidbits {
        grid-template-columns: auto;
        max-width: 500px;
    }
    .feed { flex-direction: column; }
    .feed div { width: auto; }
    .posts h2 { margin: 0; }
}

@media only screen and (max-height: 500px) {
    .hhidden { display: none; }
}

@media only screen and (max-width: 860px) {
    .iphone { display: none; }
}

@media only screen and (max-width: 400px) {
    nav a {
        padding: 2px 8px 2px 8px;
        width: auto;
        margin: 4px;
        font-size: 13.5pt;
    }
}

/* AltStore page */
#altstore-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    gap: 4px;
}

.step {
    margin: 4px;
    display: flex;
    align-items: center;
    text-align: left;
    width: 275px;
}

.step h2 {
    font-size: 22pt;
    margin: 0;
}

.number {
    background-color: rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 1em;
}

/* Light theme */
@media (prefers-color-scheme: light) {
    :root {
        --background: #ffffff;
        --background-alt: #f1f1f1;
        --ish-blue: #0055b6;
        --accent: #dadada;
    }
    body, .alt-section, #altstore-container { color: #000; }
    #home { color: #fff; }
    .tidbit {
        border: 2px solid var(--accent);
        background-color: var(--background);
        box-shadow: 0px 0px 30px 4px rgba(0, 0, 0, 0.1);
    }
    .version {
        background-color: var(--background-alt);
        box-shadow: 0 0 0 2px var(--accent) inset;
    }
    .number { background-color: rgba(0, 0, 0, 0.1); }
}
