/* patrickbennett.dev - single stylesheet. No external fonts, no frameworks. */

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;

  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d1f23;
  --muted: #565c66;
  --border: #e2ded5;
  --accent: #1d6b58;
  --accent-hover: #14513f;
  --focus: #2563eb;

  --todo-bg: #fff4cc;
  --todo-border: #d9a900;
  --todo-text: #4f3b00;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --radius: 10px;
  --wrap: 64rem;
  --prose: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1c1f25;
    --text: #e8e6e1;
    --muted: #a4a9b2;
    --border: #2f343c;
    --accent: #6cccb1;
    --accent-hover: #9ae0cb;
    --focus: #8ab4ff;

    --todo-bg: #3a3014;
    --todo-border: #a3831f;
    --todo-text: #f4de93;
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2.25rem;
}

h3 {
  font-size: 1.15rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

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

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

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

/* ---------- Layout ---------- */

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 40rem) {
  .wrap {
    padding: 0 1.5rem;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: var(--surface);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.site-name {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.inline-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

/* ---------- Home ---------- */

.hero {
  padding: 3.5rem 0 1.5rem;
}

.role {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1rem;
}

.tagline {
  font-size: 1.25rem;
  max-width: var(--prose);
}

.principles {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 48rem) {
  .principles {
    grid-template-columns: repeat(3, 1fr);
  }
}

.principles li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.principles strong {
  display: block;
  margin-bottom: 0.25rem;
}

/* ---------- Project cards ---------- */

.cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-media {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem 1.25rem 1.25rem;
}

.card-body h3 a {
  color: var(--text);
  text-decoration: none;
}

.card-body h3 a:hover {
  text-decoration: underline;
}

.card-links {
  margin-top: auto;
  margin-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-weight: 600;
}

/* ---------- Write-ups ---------- */

.writeup {
  max-width: var(--prose);
  padding-top: 2.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.lede {
  font-size: 1.2rem;
}

.figure-placeholder {
  aspect-ratio: 16 / 9;
  margin: 0 0 1rem;
}

/* ---------- TODO placeholders (remove once content is filled in) ---------- */

.todo {
  background: var(--todo-bg);
  border-left: 4px solid var(--todo-border);
  color: var(--todo-text);
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
}

.placeholder {
  display: grid;
  place-items: center;
  background: var(--todo-bg);
  border: 2px dashed var(--todo-border);
  color: var(--todo-text);
  font-weight: 600;
  font-size: 0.95rem;
}

.card .placeholder {
  border-width: 0 0 2px;
}

/* A drafted detail that still needs checking. The title attribute carries "TODO: verify" so Preflight counts it. */
mark.verify {
  background: var(--todo-bg);
  color: var(--todo-text);
  border-bottom: 2px dotted var(--todo-border);
  padding: 0 0.15em;
}

.figure {
  margin: 0 0 1rem;
}

.figure img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.figure figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
