/* Shared stylesheet for Arthur Trapp subpages (writeups + projects) */
:root {
  --bg: #181a1e;
  --bg-elevated: #1f2227;
  --bg-code: #14161a;
  --fg: #e8eaec;
  --muted: #9aa1a8;
  --faint: #6b727a;
  --accent: #f79c42;
  --accent-bright: #ffb66b;
  --accent-dim: #c97a2e;
  --blue: #7aa2f7;
  --green: #28c840;
  --red: #ff5f57;
  --border: #2a2e34;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: #14161a; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 28px; }

/* Header */
header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-brand { font-family: var(--mono); font-size: 15px; font-weight: 500; }
.nav-brand .at { color: var(--accent); }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { font-family: var(--mono); font-size: 13px; color: var(--muted); transition: color .15s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

/* Page hero */
.page-hero { padding: 72px 0 40px; border-bottom: 1px solid var(--border); }
.crumb { font-family: var(--mono); font-size: 13px; color: var(--faint); margin-bottom: 20px; }
.crumb a:hover { color: var(--accent); }
.page-hero h1 {
  font-family: var(--mono);
  font-size: clamp(34px, 6vw, 54px);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.08;
}
.page-hero .sub { margin-top: 12px; color: var(--muted); font-size: 17px; }
.page-hero .sub .accent { color: var(--accent); font-family: var(--mono); }
.meta-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.meta-tags span {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px; padding: 5px 10px;
}
.meta-tags span.accent { color: var(--accent); border-color: var(--accent-dim); }
.meta-tags span.green { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }

/* Body content */
.content { padding: 48px 0 64px; }
.content h2 {
  font-family: var(--mono);
  font-size: 22px; font-weight: 700; color: var(--accent);
  margin: 44px 0 18px;
}
.content h2:first-child { margin-top: 0; }
.content h3 {
  font-family: var(--mono);
  font-size: 17px; font-weight: 600; color: var(--fg);
  margin: 30px 0 12px;
}
.content p { color: var(--fg); margin-bottom: 16px; }
.content p strong { color: var(--accent-bright); font-weight: 600; }
.content a { color: var(--blue); }
.content a:hover { color: var(--accent-bright); }
.content ul, .content ol { margin: 0 0 16px 24px; }
.content li { color: var(--muted); margin-bottom: 7px; }
.content li strong { color: var(--fg); }
.content blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-elevated);
  padding: 12px 18px; margin: 16px 0; border-radius: 0 6px 6px 0;
  color: var(--muted); font-style: italic;
}
.content blockquote p { margin: 0; }

/* Tables */
.table-scroll { overflow-x: auto; }
.content table { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: 14.5px; }
.content table th {
  font-family: var(--mono); font-size: 13px; text-align: left; color: var(--accent);
  border-bottom: 2px solid var(--accent-dim); padding: 10px 14px;
}
.content table td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--muted); }
.content table td code { color: var(--fg); }
.content table tr:hover td { background: color-mix(in srgb, var(--bg-elevated) 60%, transparent); }

/* Code blocks */
.content pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 18px 0 24px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--fg);
}
.content pre code { font-family: var(--mono); font-size: 13px; color: var(--fg); white-space: pre; }
.content :not(pre) > code {
  font-family: var(--mono); font-size: 13px;
  background: var(--bg-code); color: var(--accent-bright);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 6px;
}

/* Back link */
.back-link { display: inline-block; margin-top: 40px; font-family: var(--mono); font-size: 14px; color: var(--accent); }
.back-link:hover { color: var(--accent-bright); }

/* Inline note + profile link */
.note { color: var(--muted); max-width: 680px; margin-bottom: 28px; }
.note .note-link { color: var(--blue); font-family: var(--mono); font-size: 14px; }
.note .note-link:hover { color: var(--accent-bright); }

/* Footer */
footer { padding: 32px 0 44px; border-top: 1px solid var(--border); }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.footer-row .clearance { color: var(--accent); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Writeup index cards */
.writeup-grid { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 40px 0 64px; }
.writeup-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px;
  padding: 22px 24px; transition: border-color .15s ease, transform .15s ease;
}
.writeup-card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.writeup-card .name { font-size: 17px; font-weight: 600; }
.writeup-card .meta { font-family: var(--mono); font-size: 12.5px; color: var(--faint); margin-top: 4px; }
.writeup-card .meta .diff { color: var(--green); }
.writeup-card .arrow { font-family: var(--mono); color: var(--accent); font-size: 20px; }

/* Project page body */
.project-body { max-width: 860px; }
.project-body .section-label {
  font-family: var(--mono); font-size: 13px; color: var(--faint);
  text-transform: uppercase; letter-spacing: .08em; margin: 34px 0 12px;
}
.project-links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 28px; }
.project-links a { font-family: var(--mono); font-size: 15px; color: var(--fg); transition: color .15s ease; }
.project-links a:hover { color: var(--accent); }
.project-links a .arr { color: var(--accent); margin-right: 6px; }

@media (max-width: 700px) {
  .nav-links a:not(.nav-brand) { display: none; }
  .footer-row { flex-direction: column; align-items: flex-start; }
  .writeup-card { flex-direction: column; align-items: flex-start; }
}
