/* rjmacarthy — quiet, dark, minimal. One mono, one column, nothing loud. */

:root {
  --bg: #0b0b0c;
  --fg: #ececea;
  --fg-2: #9a9995;
  --fg-3: #5f5f5c;
  --line: #1c1c1e;
  --line-2: #2a2a2d;
  --danger: #ff7a70;
  --mono: ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: var(--mono);
  --wrap: 34rem;
  --gutter: clamp(1.25rem, 6vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 1.5px solid var(--fg); outline-offset: 3px; border-radius: 2px; }

a { color: var(--fg); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--fg-3); text-underline-offset: .22em; transition: text-decoration-color .15s ease, color .15s ease; }
a:hover { text-decoration-color: var(--fg); }

h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
h2 { font-size: .8125rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 1.5rem; }
h3 { font-size: 1.0625rem; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--fg-2); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--fg); color: var(--bg); padding: .4rem .8rem; border-radius: 4px; z-index: 200; }
.skip-link:focus { top: 1rem; }

/* Background: falling tetrominoes, drawn by bg.js */
#bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.site-header, main, .site-footer { position: relative; z-index: 1; }

/* Header */
.site-header { padding-block: 1.75rem; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { text-decoration: none; font-weight: 500; letter-spacing: -0.01em; }
.header-nav { display: flex; gap: 1.5rem; }
.header-nav a { color: var(--fg-2); text-decoration: none; font-size: .9375rem; }
.header-nav a:hover { color: var(--fg); }

/* Hero */
.hero { padding-block: clamp(4rem, 14vh, 8rem) clamp(3rem, 8vh, 5rem); }
.hero h1 { margin-bottom: 1.25rem; }
.hero h1 span { color: var(--fg-2); }
.hero .lede { color: var(--fg-2); font-size: 1.125rem; max-width: 30rem; }
.hero .lede a { color: var(--fg); }

/* Reveal: a small, one-off fade on load */
.reveal { opacity: 0; transform: translateY(6px); animation: reveal .7s cubic-bezier(.2,.7,.2,1) forwards; }
.reveal:nth-child(2) { animation-delay: .08s; }
.reveal:nth-child(3) { animation-delay: .16s; }
@keyframes reveal { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; opacity: 1; transform: none; } }

/* Sections */
.section { padding-block: clamp(2.5rem, 7vw, 4rem); border-top: 1px solid var(--line); }

/* Projects: a plain list of things */
.things { list-style: none; margin: 0; padding: 0; }
.things li { padding-block: 1rem; border-top: 1px solid var(--line); }
.things li:first-child { border-top: 0; padding-top: 0; }
.things li:last-child { padding-bottom: 0; }
.things a { text-decoration: none; display: block; }
.things a h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.things a h3 small { font-family: var(--mono); font-size: .75rem; font-weight: 400; color: var(--fg-3); letter-spacing: 0; white-space: nowrap; }
.things a:hover h3 small { color: var(--fg-2); }
.things p { margin: .25rem 0 0; color: var(--fg-2); }
.things .note { color: var(--fg-3); }

/* Work: a few flat lines */
.plain { list-style: none; margin: 0; padding: 0; color: var(--fg-2); }
.plain li { padding-block: .35rem; }
.plain li::before { content: "—"; color: var(--fg-3); margin-right: .75rem; }

/* Buttons */
.btn {
  display: inline-block; font: inherit; font-weight: 500;
  color: var(--bg); background: var(--fg);
  border: 0; border-radius: 6px; padding: .7rem 1.15rem;
  text-decoration: none; cursor: pointer;
  transition: opacity .15s ease, transform .15s ease;
}
.btn:hover { opacity: .88; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: progress; }

/* Form */
form { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
.field { display: grid; gap: .35rem; }
label { color: var(--fg-2); font-size: .9375rem; }
input, textarea {
  font: inherit; color: var(--fg);
  background: transparent;
  border: 0; border-bottom: 1px solid var(--line-2);
  border-radius: 0; padding: .5rem 0; width: 100%;
  transition: border-color .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--fg-3); }
input:focus, textarea:focus { outline: none; border-bottom-color: var(--fg); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-bottom-color: var(--danger); }
textarea { min-height: 6.5rem; resize: vertical; }
.error { color: var(--danger); font-size: .875rem; margin: 0; min-height: 1.2em; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.form-actions .small { color: var(--fg-3); font-size: .875rem; margin: 0; }
.form-actions .small a { color: var(--fg-3); }

.alert { border: 1px solid var(--line-2); border-radius: 8px; padding: 1rem 1.15rem; margin-top: 1.5rem; }
.alert h3 { margin-bottom: .2rem; }
.alert p { margin: 0; color: var(--fg-2); }
.alert-error { border-color: var(--danger); }
.alert-error h3 { color: var(--danger); }
.alert:focus { outline: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 1.75rem 3.5rem; color: var(--fg-3); font-size: .875rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; }
.footer-nav { display: flex; gap: 1.25rem; }
.footer-nav a { color: var(--fg-3); text-decoration: none; }
.footer-nav a:hover { color: var(--fg); }

/* Prose pages: privacy, 404 */
.prose { padding-block: 2rem 4rem; }
.prose h1 { font-size: 1.5rem; margin-bottom: 1.25rem; }
.prose h2 { margin-top: 2.5rem; }
.prose p, .prose li { color: var(--fg-2); }
.prose ul { padding-left: 1.2rem; }
.prose code { font-family: var(--mono); font-size: .9em; color: var(--fg); }
