/* richardmowatt.com — Richard Mowatt
   Single stylesheet. No build step, no external dependencies. */

:root {
  --bg:        #0a0c0f;
  --bg-raised: #11151a;
  --bg-inset:  #0d1116;
  --line:      rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.05);
  --text:      #e7ecf2;
  --text-dim:  #98a3b3;
  --text-mute: #6b7686;
  --accent:    #6ee7c8;
  --accent-dim:#2f6f5e;
  --radius:    10px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1040px;
}

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

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

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

/* Subtle depth behind the top of every page. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  background: radial-gradient(70% 100% at 50% 0%, rgba(110, 231, 200, 0.07), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px; top: 12px;
  position: fixed; z-index: 50;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 6px;
}

/* ---------- header ---------- */

.site-head {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 12, 15, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  position: sticky;
  top: 0;
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 62px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand .dot { color: var(--accent); }

.nav {
  display: flex;
  gap: 22px;
  font-family: var(--mono);
  font-size: 13.5px;
}
.nav a { color: var(--text-dim); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { border-bottom: 1px solid var(--accent); padding-bottom: 2px; }

/* ---------- typography ---------- */

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: clamp(34px, 5.4vw, 52px); }
h2 { font-size: clamp(24px, 3.2vw, 31px); }
h3 { font-size: 19px; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--text-dim); max-width: 62ch; }
.muted { color: var(--text-dim); }
.small { font-size: 15px; }

/* ---------- sections ---------- */

section { border-top: 1px solid var(--line-soft); }
section:first-of-type { border-top: 0; }

/* These carry .wrap too, whose `padding: 0 24px` would otherwise win the
   cascade on specificity and flatten the gutters to zero on mobile.
   Keep the compound selectors. */
section.wrap { padding-top: 68px; padding-bottom: 68px; }

.wrap.hero { padding-top: 92px; padding-bottom: 76px; }
.hero h1 { max-width: 18ch; }
.hero .lede { margin-bottom: 28px; }

.section-head { margin-bottom: 34px; max-width: 66ch; }
.section-head p { margin-bottom: 0; }

/* ---------- availability pill ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  background: var(--bg-inset);
  border-radius: 999px;
  padding: 6px 14px 6px 11px;
  margin-bottom: 26px;
}
.status .led {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 231, 200, 0.15);
  flex: none;
}

/* ---------- buttons ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 14px;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--bg-raised);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--accent-dim); background: #151b21; }
.btn-primary {
  background: var(--accent);
  color: #06120e;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { background: #8bf0d6; border-color: #8bf0d6; color: #06120e; }

/* ---------- grids and cards ---------- */

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  border: 1px solid var(--line);
  background: var(--bg-raised);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.card h3 { margin-bottom: 10px; }
.card p:last-child { margin-bottom: 0; }
.card .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
}

a.card { color: inherit; display: block; transition: border-color 0.15s ease, background 0.15s ease; }
a.card:hover { text-decoration: none; border-color: var(--accent-dim); background: #141920; }
a.card .more { font-family: var(--mono); font-size: 13px; color: var(--accent); }

/* ---------- work list ---------- */

.case {
  border-top: 1px solid var(--line-soft);
  padding: 40px 0;
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 34px;
  scroll-margin-top: 84px;
}
.case:first-of-type { border-top: 0; padding-top: 8px; }
.case .meta { font-family: var(--mono); font-size: 13px; color: var(--text-mute); }
.case .meta .org { color: var(--text-dim); display: block; margin-bottom: 4px; }
.case h3 { font-size: 22px; }
.case dl { margin: 18px 0 0; }
.case dt {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 16px;
}
.case dd { margin: 5px 0 0; color: var(--text-dim); }

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; padding: 0; list-style: none; }
.tags li {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  background: var(--bg-inset);
  border-radius: 5px;
  padding: 3px 9px;
}

/* ---------- timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
}
.timeline li:first-child { border-top: 0; }
.timeline .when { font-family: var(--mono); font-size: 13px; color: var(--text-mute); }
.timeline .what strong { font-weight: 600; }
.timeline .what span { color: var(--text-dim); }

/* ---------- skills ---------- */

.skills { list-style: none; margin: 0; padding: 0; }
.skills > li { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.skills > li:first-child { border-top: 0; }
.skills h3 {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.skills p { margin: 0; color: var(--text-dim); }

/* ---------- notes ---------- */

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-top: 1px solid var(--line-soft); }
.post-list li:first-child { border-top: 0; }
.post-list a {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  padding: 22px 0;
  color: inherit;
  align-items: baseline;
}
.post-list a:hover { text-decoration: none; }
.post-list a:hover h3 { color: var(--accent); }
.post-list time { font-family: var(--mono); font-size: 13px; color: var(--text-mute); }
.post-list h3 { margin: 0 0 6px; transition: color 0.15s ease; }
.post-list p { margin: 0; color: var(--text-dim); font-size: 16px; }

.prose { max-width: 68ch; }
.prose h2 { margin-top: 2em; font-size: 24px; }
.prose ul, .prose ol { color: var(--text-dim); padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--accent-dim);
  color: var(--text-dim);
  font-style: normal;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}
.wrap.post-head { padding-top: 56px; padding-bottom: 8px; }
.post-head time { font-family: var(--mono); font-size: 13px; color: var(--text-mute); }

.draft-flag {
  border: 1px dashed var(--accent-dim);
  background: rgba(110, 231, 200, 0.05);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 32px;
}

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

.contact-box {
  border: 1px solid var(--line);
  background: var(--bg-raised);
  border-radius: var(--radius);
  padding: 40px 36px;
  text-align: center;
}
.contact-box h2 { margin-bottom: 12px; }
.contact-box .lede { margin: 0 auto 26px; }
.mail {
  font-family: var(--mono);
  font-size: clamp(17px, 2.6vw, 22px);
  word-break: break-all;
}

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

.site-foot {
  border-top: 1px solid var(--line-soft);
  padding: 34px 0 44px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-mute);
}
.site-foot .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-foot a { color: var(--text-dim); }
.site-foot a:hover { color: var(--accent); }
.site-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .case { grid-template-columns: 1fr; gap: 14px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .wrap.hero { padding-top: 60px; padding-bottom: 52px; }
  section.wrap { padding-top: 52px; padding-bottom: 52px; }
  .site-head { position: static; }
  .site-head .wrap { min-height: 0; padding-top: 12px; padding-bottom: 12px; }
  .nav { gap: 16px; width: 100%; }
  .post-list a { grid-template-columns: 1fr; gap: 6px; }
  .contact-box { padding: 30px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  body::before, .site-head, .site-foot { display: none; }
  body { background: #fff; color: #000; }
}
