/* maclir.net — one stylesheet, no build step, no external requests. */

:root {
  --bg: #0b0d10;
  --bg-raised: #12151a;
  --bg-hover: #171b22;
  --line: #232830;
  --line-soft: #1a1e25;
  --ink: #e8e6e1;
  --ink-dim: #9aa1ab;
  --ink-faint: #77808a;

  /* --accent is the brand hue a page or card sets inline. It is tuned for the
     dark ground, so light mode reads --accent-light instead; --accent-ink is
     the one text and focus rings use, and it always meets 4.5:1. */
  --accent: #e8e6e1;
  --accent-light: #1a1a19;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 34rem;
  --page: 62rem;
}

* { box-sizing: border-box; }

/* Declared on every element, not just :root, so a card or body that sets its
   own --accent inline re-derives the readable version from it. */
* { --accent-ink: var(--accent); }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* A single soft light source at the top of the page, so the dark tiles
   the projects ship with sit on a ground rather than a void. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 60vh;
  background: radial-gradient(60rem 30rem at 50% -12rem, #1b2029 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

a { color: inherit; }

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.masthead a { color: var(--ink-dim); text-decoration: none; }
.masthead a:hover { color: var(--ink); }

.masthead .home { color: var(--ink); font-weight: 600; letter-spacing: 0.08em; }

.masthead nav { display: flex; gap: 1.25rem; }

/* ---------- hero ---------- */

.hero { padding: 5rem 0 4rem; max-width: 40rem; }

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0 0 1.5rem;
}

.hero p {
  font-size: 1.12rem;
  color: var(--ink-dim);
  max-width: var(--measure);
  margin: 0 0 1rem;
}

.hero p strong { color: var(--ink); font-weight: 500; }

/* ---------- section headings ---------- */

.rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3.5rem 0 2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- project cards ---------- */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.5rem;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--bg-raised);
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent-ink) 45%, var(--line));
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.card:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
}

.card-head { display: flex; align-items: center; gap: 0.85rem; }

.mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex: none;
  object-fit: cover;
  background: #000;
  border: 1px solid var(--line);
}

.card h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card .domain {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent-ink);
  letter-spacing: 0.02em;
  margin-top: 0.15rem;
}

.card p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.94rem;
  line-height: 1.55;
}

.card .more {
  margin-top: auto;
  padding-top: 0.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.card:hover .more { color: var(--accent-ink); }

/* ---------- story pages ---------- */

.story { max-width: var(--measure); margin: 0 auto; }

.story-head {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 4rem 0 2rem;
}

.story-head .mark { width: 64px; height: 64px; border-radius: 14px; }

.story-head h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.6rem);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
}

.story-head .domain {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-ink);
  margin-top: 0.35rem;
  text-decoration: none;
}

.story-head .domain:hover { text-decoration: underline; }

.dek {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line-soft);
}

.story p { margin: 0 0 1.35rem; }

.story p.lede::first-letter {
  font-family: var(--serif);
  font-size: 3.1rem;
  line-height: 0.82;
  float: left;
  padding: 0.1rem 0.6rem 0 0;
  color: var(--accent-ink);
}

.story h2 {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 2.75rem 0 1rem;
  font-weight: 600;
}

.story a { color: var(--accent-ink); text-underline-offset: 3px; }

.story ul { padding-left: 1.1rem; color: var(--ink-dim); }
.story li { margin-bottom: 0.5rem; }

.facts {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.55rem 1rem;
  margin: 2.5rem 0;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--bg-raised);
  font-size: 0.9rem;
}

.facts dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.15rem;
}

.facts dd { margin: 0; color: var(--ink-dim); }
.facts dd a { color: var(--accent-ink); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 2.5rem 0 1rem; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: 9px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.btn:hover { border-color: var(--accent-ink); background: var(--bg-hover); }

.btn-primary {
  border-color: color-mix(in srgb, var(--accent-ink) 55%, transparent);
  color: var(--accent-ink);
}

/* ---------- footer ---------- */

.foot {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-faint);
}

.foot a { color: var(--ink-dim); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ---------- light mode ---------- */

@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf9f7;
    --bg-raised: #ffffff;
    --bg-hover: #ffffff;
    --line: #ded9d1;
    --line-soft: #e8e4dc;
    --ink: #1a1a19;
    --ink-dim: #55565a;
    --ink-faint: #707176;
  }

  * { --accent-ink: var(--accent-light, #1a1a19); }

  body::before {
    background: radial-gradient(60rem 30rem at 50% -12rem, #efece5 0%, transparent 70%);
  }

  .card { box-shadow: 0 1px 2px rgba(20, 18, 14, 0.04); }
  .card:hover { box-shadow: 0 6px 20px rgba(20, 18, 14, 0.07); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .card:hover { transform: none; }
}

/* Inline code: a shade smaller than the prose it sits in, so a monospace
   face at the same nominal size does not look oversized next to it. */
code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.12em 0.38em;
  border-radius: 5px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  border: 1px solid var(--line-soft);
}

.facts code { font-size: 0.82em; word-break: break-all; }
