/* Colors and fonts live here once. Change them here and every page updates. */
:root {
  --navy: #14213D;
  --amber: #F59E0B;
  --bg: #F4F5F7;
  --text: #3A4250;
  --muted: #5B6472;
  --rule: #D7DCE3;
  --placeholder: #E3E6EB;
  --code: #E8EBF1;
  --font-sans: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --navy: #E8EAF0;
  --bg: #12141A;
  --text: #C5CAD3;
  --muted: #9AA3B2;
  --rule: #2C3340;
  --placeholder: #1C212B;
  --code: #1C212B;
  color-scheme: dark;
}

/* Make width include padding, so layouts do what you expect. */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--navy);
  line-height: 1.6;
}

a { color: var(--navy); }
a:hover { color: var(--muted); }
img { max-width: 100%; height: auto; display: block; }

/* Centers content and caps its width on wide screens. */
.container { max-width: 1040px; margin: 0 auto; padding: 0 32px; }

/* Header and navigation */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .container {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 12px;
  padding-top: 14px; padding-bottom: 14px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; font-size: 18px; font-weight: 600;
}
.header-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.theme-toggle {
  width: 44px; height: 44px; padding: 0; border: 0; background: none;
  color: var(--navy); cursor: pointer; display: grid; place-items: center;
}
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .brand img { box-shadow: 0 0 0 1px var(--rule); border-radius: 8px; }
.nav a { padding: 12px 14px; text-decoration: none; }
.nav a[aria-current="page"] {
  font-weight: 600; text-decoration: underline;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 3px; text-underline-offset: 6px;
}

/* Text */
h1 { font-size: 44px; line-height: 1.15; letter-spacing: -1px; font-weight: 600; margin: 0 0 24px; }
h2 { font-size: 24px; font-weight: 600; margin: 0 0 12px; }
.lead { font-size: 19px; color: var(--text); max-width: 620px; margin: 0 0 28px; }
.label { font-family: var(--font-mono); font-size: 14px; color: var(--muted); margin: 0 0 10px; }

/* The amber-underlined link style used for calls to action */
.link-accent {
  font-weight: 600; text-decoration: underline;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 3px; text-underline-offset: 5px;
}

/* Page sections */
.hero { padding: 96px 0 72px; }
.hero h1 { max-width: 760px; }
.section { border-top: 2px solid var(--navy); padding-top: 28px; margin-bottom: 72px; }

/* Project block: text on one side, screenshot on the other, stacks on phones */
.project { display: flex; flex-wrap: wrap; gap: 48px; }
.project > * { flex: 1 1 400px; min-width: 0; }
.placeholder {
  background: var(--placeholder); min-height: 280px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 14px; color: var(--muted);
}

/* Writing list */
.post-list { list-style: none; padding: 0; margin: 0; counter-reset: posts; }
.post-list li { counter-increment: posts; }
.post-list a {
  display: flex; align-items: baseline; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--rule);
  text-decoration: none; font-size: 18px;
}
.post-list a::before {
  content: counter(posts, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 14px; color: var(--muted);
}
.post-list a span { flex: 1; }
.post-list time { font-family: var(--font-mono); font-size: 14px; color: var(--muted); margin-left: auto; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); margin-top: 96px; }
.site-footer .container {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  padding-top: 28px; padding-bottom: 28px; font-size: 15px; color: var(--text);
}
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 20px; margin: 0; padding: 0; }

/* Inner pages (Projects, About) */
.page { padding: 88px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 24px; margin: 0 0 48px; font-size: 17px; }
.placeholder.tall { min-height: 360px; }
.caption { font-size: 14px; color: var(--muted); margin: 12px 0 56px; }

/* Main text on the left, small sidebar on the right; stacks on phones */
.columns { display: flex; flex-wrap: wrap; gap: 56px; }
.columns > .main { flex: 2 1 460px; min-width: 0; }
.columns > aside { flex: 1 1 260px; min-width: 0; }

/* Long-form text */
.prose p { font-size: 17px; line-height: 1.7; color: var(--text); margin: 0 0 16px; }
.prose h2 { margin-top: 40px; }
.prose h2:first-child { margin-top: 0; }

/* Label/value list, used for the tech stack */
.stack { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 0; }
.stack dt { color: var(--muted); }
.stack dd { margin: 0; font-family: var(--font-mono); font-size: 15px; }

/* About page sidebar */
.placeholder.portrait, img.portrait { aspect-ratio: 4 / 5; min-height: 0; margin-bottom: 28px; object-fit: cover; object-position: center 20%; width: 100%; }
.contact { list-style: none; margin: 0; padding: 0; font-size: 17px; }
.contact li { margin: 0 0 8px; }
.contact li:first-child { margin-bottom: 14px; }

/* Writing */
.post { max-width: 680px; }
.post-meta { font-family: var(--font-mono); font-size: 14px; color: var(--muted); margin: 0 0 28px; }
.post h2 { margin-top: 40px; }
.post p, .post li { font-size: 18px; line-height: 1.7; color: var(--text); }
.post p { margin: 0 0 18px; }
.post ul, .post ol { padding-left: 22px; }
.post img { margin: 28px 0; }
.post pre { background: var(--code); padding: 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 14px; line-height: 1.5; }
.post code { font-family: var(--font-mono); font-size: 0.9em; }

/* Videos */
.video-grid {
  list-style: none; margin: 0 0 56px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px;
}
.video-play {
  display: block; width: 100%; padding: 0; border: 0;
  margin: 0 0 12px; background: var(--placeholder); cursor: pointer;
}
.video-play img, .video-card iframe {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border: 0; margin: 0; display: block; background: var(--placeholder);
}
.video-card iframe { margin: 0 0 12px; }
.video-card h3 { font-size: 18px; line-height: 1.35; font-weight: 600; margin: 0 0 6px; }
.video-card h3 a { text-decoration: none; }
.video-card h3 a:hover {
  text-decoration: underline; text-decoration-color: var(--amber);
  text-decoration-thickness: 3px; text-underline-offset: 4px;
}
.video-card p { font-size: 15px; color: var(--muted); margin: 0; }

/* Real screenshots */
.screenshot { width: 100%; height: auto; border: 1px solid var(--rule); }


/* Smaller screens */
@media (max-width: 600px) {
  .container { padding: 0 20px; }
  h1 { font-size: 30px; }
  .hero { padding: 48px 0 40px; }
}
