/* ============================================================
   Martin McCarthy — personal site
   Dark, technical, restrained.
   ============================================================ */

:root {
  --bg: #0A0A0F;
  --bg-raised: #101018;
  --bg-card: #12121C;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #E9EAF0;
  --text-muted: #9BA0B3;
  --text-faint: #6B7086;
  --accent: #22D3EE;
  --accent-soft: rgba(34, 211, 238, 0.12);
  --accent-line: rgba(34, 211, 238, 0.35);
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --measure: 68ch;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

::selection { background: var(--accent); color: #06222A; }

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

h1, h2, h3 { font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 15, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo .tld { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 26px; }

.nav-links a {
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-cta {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  color: var(--accent);
  white-space: nowrap;
}
.nav-cta:hover { background: var(--accent-soft); text-decoration: none; }

/* ---------- shared bits ---------- */

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 14px;
}
.eyebrow::before { content: "// "; color: var(--text-faint); }

section { padding: 88px 0; }
section + section { border-top: 1px solid var(--border); }

.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(26px, 4vw, 34px); }
.section-head p { color: var(--text-muted); margin-top: 12px; }

.btn {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { border-color: var(--text-faint); text-decoration: none; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06222A;
}
.btn-primary:hover { background: #4ADDF3; border-color: #4ADDF3; }

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

.hero { padding: 110px 0 90px; }

.hero-status {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 22px;
}
.hero-status .prompt { color: var(--accent); }

.hero h1 {
  font-size: clamp(34px, 6vw, 58px);
  max-width: 17ch;
}
.hero h1 .h1-line { display: block; }

.hero .lede {
  margin-top: 24px;
  max-width: 62ch;
  font-size: clamp(17px, 2.2vw, 19px);
  color: var(--text-muted);
}
.hero .lede strong { color: var(--text); font-weight: 600; }

.hero-ctas { margin-top: 36px; display: flex; gap: 14px; flex-wrap: wrap; }

.hero-facts {
  margin-top: 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
}
.hero-facts span::before { content: "▸ "; color: var(--accent); }

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 56px;
  align-items: start;
}

.about-copy p { color: var(--text-muted); max-width: var(--measure); }
.about-copy p + p { margin-top: 18px; }
.about-copy strong { color: var(--text); font-weight: 600; }

.about-aside {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 24px;
}
.about-aside h3 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.about-aside ul { list-style: none; }
.about-aside li {
  font-size: 14.5px;
  color: var(--text-muted);
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.about-aside li:last-child { border-bottom: 0; }

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

.timeline { position: relative; max-width: 780px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border-strong);
}

.tl-item { position: relative; padding: 0 0 44px 36px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--text-faint);
}
.tl-item.tl-current::before {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.10);
}

.tl-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}

.tl-item h3 { font-size: 19px; }
.tl-item .tl-org { color: var(--text-muted); font-weight: 500; }
.tl-item p { color: var(--text-muted); font-size: 15.5px; margin-top: 10px; max-width: var(--measure); }

.tl-tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.tl-tags span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 9px;
  background: var(--bg-raised);
}

.tl-compact { list-style: none; margin-top: 10px; }
.tl-compact li {
  font-size: 15px;
  color: var(--text-muted);
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  justify-content: space-between;
}
.tl-compact li:last-child { border-bottom: 0; }
.tl-compact .role { color: var(--text); font-weight: 500; }
.tl-compact .yrs { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-faint); }

.credentials {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  max-width: 780px;
}
.cred {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 20px 22px;
}
.cred .cred-what { font-weight: 600; font-size: 15.5px; }
.cred .cred-where { color: var(--text-muted); font-size: 14.5px; margin-top: 3px; }
.cred .cred-yrs { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-faint); margin-top: 8px; display: block; }

/* ---------- writing cards ---------- */

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 680px) {
  .post-grid { grid-template-columns: 1fr; }
}

.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 26px;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.post-card:hover {
  border-color: var(--accent-line);
  text-decoration: none;
  transform: translateY(-2px);
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.post-card h3 { font-size: 19px; margin-bottom: 10px; }
.post-card p { color: var(--text-muted); font-size: 15px; flex-grow: 1; }
.post-card .read-more {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.post-list { max-width: 780px; }
.post-list .post-card { margin-bottom: 18px; }

/* ---------- article pages ---------- */

.article-wrap { max-width: 760px; margin: 0 auto; padding: 72px 24px 96px; }

.article-head { margin-bottom: 48px; }
.article-head h1 { font-size: clamp(30px, 5vw, 42px); max-width: 22ch; }
.article-head .article-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 18px;
}
.article-head .article-meta .sep { margin: 0 8px; color: var(--border-strong); }

.article-body { max-width: var(--measure); }
.article-body p { color: #C6C9D4; margin-bottom: 22px; }
.article-body h2 {
  font-size: 24px;
  margin: 44px 0 16px;
}
.article-body h3 { font-size: 19px; margin: 32px 0 12px; }
.article-body strong { color: var(--text); }
.article-body ul, .article-body ol { margin: 0 0 22px 22px; color: #C6C9D4; }
.article-body li { margin-bottom: 10px; }
.article-body li::marker { color: var(--accent); }
.article-body blockquote {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 28px 0;
  color: var(--text-muted);
  font-style: italic;
}
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

.article-foot {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.article-foot .byline { color: var(--text-muted); font-size: 15px; max-width: var(--measure); }
.article-foot .byline strong { color: var(--text); }
.article-foot .foot-ctas { margin-top: 22px; display: flex; gap: 14px; flex-wrap: wrap; }

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

.contact-box {
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(600px 220px at 12% 0%, rgba(34, 211, 238, 0.07), transparent),
    var(--bg-card);
  padding: 56px 48px;
}
.contact-box h2 { font-size: clamp(24px, 4vw, 32px); max-width: 24ch; }
.contact-box p { color: var(--text-muted); margin-top: 14px; max-width: 58ch; }
.contact-actions { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.contact-alt {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
}

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

.footer { border-top: 1px solid var(--border); padding: 36px 0 48px; }
.footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-faint);
}
.footer-inner nav { display: flex; gap: 20px; }
.footer-inner a { color: var(--text-muted); }
.footer-inner a:hover { color: var(--text); }

/* ---------- reveal ---------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

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

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  section { padding: 64px 0; }
  .hero { padding: 72px 0 64px; }
  .nav-inner { padding: 0 16px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .logo { font-size: 13px; }
  .nav-cta { font-size: 12px; padding: 7px 12px; }
  .contact-box { padding: 36px 24px; }
  .article-wrap { padding: 48px 20px 72px; }
}
