/* ashbetts.com: "night shift" theme */

:root {
    --bg: #0b0d0c;
    --surface: #111412;
    --line: #1e2421;
    --line-strong: #2a322d;
    --fg: #e9efe6;
    --body: #c9d1c8;
    --muted: #8a948c;
    --green: #55d68a;
    --gold: #d6aa55;
    --error: #e57d86;

    --font-display: "Major Mono Display", ui-monospace, monospace;
    --font-body: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

    --gutter: max(16px, min(4vw, 48px));
    color-scheme: dark;
}

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

html { background: var(--bg); }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

/* Major Mono Display's lowercase letters are its clean capitals; its
   uppercase set uses block glyphs, so everything in it is lowercased. */
h1, .logo, .prose h2 { text-transform: lowercase; }

h1 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.12;
    text-wrap: balance;
}

/* ---------- header and footer ---------- */

.site-header {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 32px;
    padding: 20px var(--gutter);
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}

.logo {
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 1;
    text-decoration: none;
}
.logo:hover { color: var(--green); }

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    font-family: var(--font-mono);
    font-size: 14px;
}
.nav a { text-decoration: none; padding-block: 4px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--green); }

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 32px;
    padding: 20px var(--gutter);
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
}

main { flex: 1; display: flex; flex-direction: column; }

/* ---------- ascii field and decode ---------- */

.field { position: relative; overflow: hidden; touch-action: pan-y; }
.field-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}
.scr { color: var(--green); }
.w { cursor: default; }

/* ---------- home ---------- */

.hero {
    flex: 1;
    min-height: 520px;
    display: flex;
    align-items: center;
    padding: 64px max(16px, min(6vw, 96px));
}

.panel {
    position: relative;
    z-index: 1;
    max-width: 620px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: clamp(24px, 4vw, 44px);
    background: var(--bg);
    border: 1px solid rgba(85, 214, 138, 0.35);
}

.lede {
    margin: 0;
    max-width: 44ch;
    font-size: clamp(17px, 1.6vw, 19px);
    line-height: 1.55;
    color: var(--body);
}

.hint {
    position: absolute;
    right: var(--gutter);
    bottom: 20px;
    z-index: 1;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}

@media (max-width: 640px), (hover: none) {
    .hint { display: none; }
}

/* ---------- contact ---------- */

.strip { height: 170px; flex: none; border-bottom: 1px solid var(--line); }

.contact {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 48px 80px;
    padding: 64px max(16px, min(6vw, 96px));
}

.contact-intro {
    flex: 1 1 300px;
    min-width: 0;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.contact-intro p { margin: 0; font-size: 17px; color: var(--body); }

.details {
    margin: 8px 0 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 10px 24px;
    font-family: var(--font-mono);
    font-size: 13px;
}
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.details a { text-decoration: none; }
.details a:hover { color: var(--green); }

.form, .thanks { flex: 999 1 480px; min-width: 0; max-width: 680px; }

.form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-content: start;
}
.form .full, .form-error, .form .btn { grid-column: 1 / -1; }

.form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}

.form input, .form textarea {
    width: 100%;
    padding: 14px;
    font: 16px var(--font-body);
    color: var(--fg);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 0;
    outline: none;
}
.form textarea { min-height: 150px; resize: vertical; }
.form input:focus, .form textarea:focus { border-color: var(--green); }
.form [aria-invalid="true"] { border-color: var(--error); }

.form-error { margin: 0; font-size: 14px; color: var(--error); }

.btn {
    justify-self: start;
    min-height: 48px;
    padding: 0 28px;
    font: 500 14px var(--font-mono);
    color: var(--bg);
    background: var(--green);
    border: 0;
    border-radius: 0;
    cursor: pointer;
}
.btn:hover { background: var(--fg); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.bot-field { position: absolute; left: -9999px; }

.thanks { margin: 0; font-size: 17px; color: var(--body); align-self: start; }

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

/* ---------- text pages (privacy, 404) ---------- */

.page {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 64px max(16px, min(6vw, 96px));
}

.page-meta { margin: 0; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }

.prose { max-width: 68ch; margin-top: 16px; color: var(--body); }
.prose h2 {
    margin: 40px 0 12px;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 22px;
    line-height: 1.2;
    color: var(--fg);
}
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul { margin: 0 0 16px; }
.prose ul { padding-left: 20px; }
.prose a { color: var(--green); }
.prose a:hover { color: var(--fg); }

.page .lede a { color: var(--green); }
