/* Nevity — an early-1980s terminal: green phosphor on a dark screen, VT323
   headings, IBM Plex Mono text. Documents come out of the printer on
   green-bar fanfold paper. */

@font-face {
    font-family: "VT323";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/vt323-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "VT323";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/vt323-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/ibm-plex-mono-400-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/ibm-plex-mono-600-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/ibm-plex-mono-600-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --screen: #0b100c;
    --phosphor: #7ee8a6;
    --phosphor-dim: #4fae76;
    --phosphor-faint: #22432f;
    --glow: 0 0 6px rgba(126, 232, 166, 0.35);
    --paper: #fbfaf2;
    --paper-bar: #e3f0e1;
    --paper-ink: #1e2620;
    --paper-muted: #56625a;
    --pixel: "VT323", "Courier New", monospace;
    --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --gutter: clamp(20px, 4.5vw, 64px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 64px;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--screen);
    font-family: var(--mono);
    font-size: 16px;
    line-height: 1.65;
    color: var(--phosphor);
    text-shadow: var(--glow);
}

/* The screen: scan lines over everything, darker towards the corners. */
body:not(.page-document)::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
}

body:not(.page-document)::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 49;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.5) 100%);
}

::selection {
    background: var(--phosphor);
    color: var(--screen);
    text-shadow: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-underline-offset: 0.22em;
}

a:focus-visible {
    outline: 2px solid var(--phosphor);
    outline-offset: 3px;
}

/* Short pages still fill the screen, with the footer at the bottom. */
main {
    display: flex;
    flex-direction: column;
    flex: 1;
}

main > :last-child {
    flex: 1;
}

.label {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Reversed video: how the terminal marks what is selected. */
.bar-nav a:hover,
.languages a[aria-current],
.footer a:hover,
.contact-email a:hover,
.not-found a:hover {
    background: var(--phosphor);
    color: var(--screen);
    text-shadow: none;
}

/* Top bar */

.bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px 32px;
    padding: 12px var(--gutter);
    border-bottom: 1px solid var(--phosphor-faint);
    background: var(--screen);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    font-family: var(--pixel);
    font-size: 28px;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
}

.brand img {
    width: 28px;
    height: 28px;
}

.bar-nav {
    display: flex;
    gap: 18px;
    white-space: nowrap;
}

.bar-nav a,
.languages a {
    padding: 2px 6px;
    text-decoration: none;
}

.languages {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--phosphor-dim);
}

@media (max-width: 520px) {
    .bar {
        gap: 10px 12px;
    }

    .brand span {
        display: none;
    }

    .bar-nav {
        gap: 6px;
    }
}

/* Introduction */

.intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 24px 40px;
    padding: clamp(56px, 10vw, 128px) var(--gutter) clamp(48px, 8vw, 96px);
    border-bottom: 1px solid var(--phosphor-faint);
}

.intro .label {
    margin: 0;
    color: var(--phosphor-dim);
}

.intro .label::before {
    content: "> ";
}

.intro h1 {
    max-width: 14ch;
    margin: 16px 0 0;
    font-family: var(--pixel);
    font-size: clamp(3.4rem, 11vw, 9rem);
    font-weight: 400;
    line-height: 0.88;
    text-transform: uppercase;
    text-wrap: balance;
}

/* The cursor, waiting after the last word. */
.intro h1::after {
    content: "";
    display: inline-block;
    width: 0.42em;
    height: 0.78em;
    margin-left: 0.1em;
    vertical-align: -0.04em;
    background: currentColor;
    box-shadow: var(--glow);
    animation: blink 1.06s steps(1) infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.intro-badge {
    width: clamp(84px, 13vw, 160px);
    margin-bottom: 0.5em;
    filter: drop-shadow(0 0 18px rgba(85, 182, 122, 0.35));
}

/* On a phone the headline takes the full width, the badge above it. */
@media (max-width: 640px) {
    .intro {
        grid-template-columns: minmax(0, 1fr);
    }

    .intro h1 {
        font-size: 13vw;
    }

    .intro-badge {
        grid-row: 1;
        justify-self: end;
        width: 64px;
        margin: 0 0 -24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .intro h1::after {
        animation: none;
    }
}

/* Sections */

.section {
    padding: clamp(56px, 8vw, 104px) var(--gutter);
}

.section-head {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 6px 24px;
    margin-bottom: clamp(28px, 4.5vw, 48px);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--phosphor-dim);
}

.section-no {
    color: var(--phosphor-dim);
}

.section-no::before {
    content: "[";
}

.section-no::after {
    content: "]";
}

.section-head h2 {
    margin: 0;
    font-family: var(--pixel);
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    font-weight: 400;
    line-height: 0.9;
    text-transform: uppercase;
}

/* The section's motto, as a comment in the code. */
.section-head p {
    margin: 0;
    color: var(--phosphor-dim);
}

.section-head p::before {
    content: "// ";
}

@media (max-width: 640px) {
    .section-head {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .section-head p {
        grid-column: 2;
    }
}

/* Services */

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

.service {
    display: grid;
    grid-template-columns: 64px minmax(0, 0.9fr) minmax(0, 1.3fr);
    align-items: center;
    gap: 8px 24px;
    padding: 24px 0;
    border-bottom: 1px dashed var(--phosphor-faint);
}

.service:first-child {
    padding-top: 4px;
}

.service svg {
    width: 48px;
    height: 48px;
    fill: var(--phosphor);
    filter: drop-shadow(0 0 4px rgba(126, 232, 166, 0.45));
}

.service svg [fill="#fff"] {
    fill: var(--screen);
}

.service h3 {
    margin: 0;
    font-family: var(--pixel);
    font-size: clamp(2rem, 3.6vw, 2.8rem);
    font-weight: 400;
    line-height: 1;
    text-transform: uppercase;
}

.service p {
    max-width: 48ch;
    margin: 0;
    color: var(--phosphor-dim);
}

@media (max-width: 640px) {
    .service {
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: start;
    }

    .service svg {
        width: 36px;
        height: 36px;
    }

    .service p {
        grid-column: 2;
    }
}

/* Contact */

.section-night {
    border-top: 1px solid var(--phosphor-faint);
}

.contact {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
}

.contact-email {
    margin: 0 0 24px;
    font-family: var(--pixel);
    font-size: clamp(2rem, 4.6vw, 3.8rem);
    line-height: 1;
    overflow-wrap: break-word;
}

.contact-email a {
    padding: 0 4px;
    text-decoration: underline 2px;
}

.contact address {
    font-style: normal;
    color: var(--phosphor-dim);
}

.contact address strong {
    font-weight: 400;
    color: var(--phosphor);
}

/* The registry details in a box drawn with double lines, as on the screen
   of the day, with dot leaders running to each value. */
.bcard {
    justify-self: center;
    width: min(100%, 420px);
    padding: 20px 24px 22px;
    border: 4px double var(--phosphor-dim);
    box-shadow: 0 0 14px rgba(126, 232, 166, 0.12), inset 0 0 14px rgba(126, 232, 166, 0.08);
}

.bcard-name {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--phosphor-faint);
    font-family: var(--pixel);
    font-size: 2rem;
    line-height: 1;
    text-transform: uppercase;
}

.bcard-name img {
    width: 34px;
    height: 34px;
}

.bcard dl {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 0;
    margin: 0;
}

.bcard dt {
    display: flex;
    align-items: baseline;
    color: var(--phosphor-dim);
}

.bcard dt::after {
    content: "";
    flex: 1;
    min-width: 16px;
    margin: 0 8px;
    border-bottom: 2px dotted var(--phosphor-faint);
}

.bcard dd {
    margin: 0;
}

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

@media (max-width: 420px) {
    .bcard dl {
        grid-template-columns: minmax(0, 1fr);
    }

    .bcard dt::after {
        display: none;
    }

    .bcard dd {
        margin-bottom: 6px;
    }
}

/* Footer */

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    padding: 20px var(--gutter);
    border-top: 1px solid var(--phosphor-faint);
    color: var(--phosphor-dim);
}

.footer p {
    margin: 0;
}

.footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.footer a {
    padding: 0 4px;
    text-decoration: none;
    color: var(--phosphor);
}

/* Legal documents: a printout on green-bar fanfold paper, its tractor holes
   along both edges. */

.page-document main {
    padding: clamp(32px, 6vw, 72px) var(--gutter);
}

.document {
    position: relative;
    width: 100%;
    max-width: 840px;
    margin: 0 auto;
    padding: 48px 72px 56px;
    background: repeating-linear-gradient(to bottom, var(--paper-bar) 0 3.4em, var(--paper) 3.4em 6.8em);
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.9);
    font-size: 15px;
    line-height: 1.7;
    color: var(--paper-ink);
    text-shadow: none;
}

.document::before,
.document::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    background: radial-gradient(circle at 15px 12px, var(--screen) 0 5px, transparent 5.5px) 0 0 / 30px 24px repeat-y;
}

.document::before {
    left: 0;
    border-right: 1px dashed rgba(30, 38, 32, 0.2);
}

.document::after {
    right: 0;
    border-left: 1px dashed rgba(30, 38, 32, 0.2);
}

.document h1,
.document h2,
.document h3 {
    font-weight: 600;
    text-transform: uppercase;
    text-wrap: balance;
}

.document h1 {
    margin: 0 0 32px;
    font-size: 1.6rem;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.document h2 {
    margin: 36px 0 10px;
    font-size: 1.1rem;
    line-height: 1.4;
}

.document h3 {
    margin: 24px 0 6px;
    font-size: 1rem;
}

.document ol,
.document ul {
    padding-left: 1.5em;
}

.document li + li {
    margin-top: 4px;
}

.document .important {
    font-weight: 600;
    text-transform: uppercase;
}

.document ::selection {
    background: var(--paper-ink);
    color: var(--paper);
}

@media (max-width: 640px) {
    .page-document main {
        padding: 16px 10px;
    }

    .document {
        padding: 32px 36px 40px;
        font-size: 14px;
    }

    .document::before,
    .document::after {
        width: 20px;
        background-image: radial-gradient(circle at 10px 12px, var(--screen) 0 4px, transparent 4.5px);
        background-size: 20px 24px;
    }
}

/* Not found */

.not-found {
    padding: clamp(64px, 12vw, 160px) var(--gutter);
}

.not-found h1 {
    margin: 0;
    font-family: var(--pixel);
    font-size: clamp(6rem, 22vw, 14rem);
    font-weight: 400;
    line-height: 0.85;
}

.not-found p {
    margin: 12px 0 28px;
    color: var(--phosphor-dim);
}

.not-found p::before {
    content: "ERROR: ";
}

.not-found a {
    padding: 2px 6px;
    text-decoration: none;
}
