/* Coding Blind Tech design system.
   One typeface (Atkinson Hyperlegible), one action color (blue), one attention color (red).
   Structure comes from type scale, spacing rhythm, and rules, not from boxes. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-regular.6a368e1db903.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-bold.ac53eaf573ad.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0f172a;
  --slate: #56657b;
  --paper: #ffffff;
  --mist: #f6f8fb;
  --line: #d9e1ec;
  --blue: #005fcc;
  --blue-dark: #003d7a;
  --blue-tint: #e8f2ff;
  --red: #d92d20;
  --code-bg: #101828;
  --code-ink: #f8fbff;

  --font: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
  --text-sm: 0.9375rem;
  --text-base: 1.125rem;
  --text-lg: 1.25rem;
  --text-h4: 1.125rem;
  --text-h3: 1.4rem;
  --text-h2: 1.75rem;
  --text-h1: 2.6rem;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;

  --rail: 1120px;
  --measure: 40rem;
  --radius: 8px;
  --target: 3rem;
}

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.65;
  overflow-wrap: break-word;
}

/* Type scale */

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-2);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.15;
}
h1 {
  font-size: var(--text-h1);
  letter-spacing: -0.01em;
}
h2 {
  font-size: var(--text-h2);
}
h3 {
  font-size: var(--text-h3);
}
h4 {
  font-size: var(--text-h4);
}
p,
ul,
ol {
  margin: 0 0 var(--space-2);
}
ul,
ol {
  padding-left: 1.4rem;
}
a {
  color: var(--blue);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--blue-dark);
}
img {
  max-width: 100%;
  height: auto;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--space-4) 0;
}

/* Focus is the one loud thing on the page: keyboard users always know where they are. */
:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Skip link: hidden above the viewport until it receives focus. */
.skip-link {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 30;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  background: var(--blue);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(calc(-100% - 2rem));
}
.skip-link:focus {
  transform: translateY(0);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: min(var(--rail), calc(100% - 2rem));
  min-height: 4.5rem;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: var(--target);
  margin-right: auto;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.brand img {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.site-nav-links {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.site-nav-links a:hover {
  background: var(--blue-tint);
  color: var(--blue-dark);
}
.site-nav-links a[aria-current="page"] {
  background: var(--blue);
  color: var(--paper);
}

/* Social links: icon plus label in the footer, icon only on small screens in the header. */
.social-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: var(--target);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.social-link:hover {
  color: var(--blue-dark);
}
.social-link-youtube svg {
  color: var(--red);
}
.social-links-header .social-link {
  min-width: var(--target);
  justify-content: center;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--text-sm);
}
.social-links-footer {
  flex-wrap: wrap;
}
.social-links-footer .social-link {
  margin-right: var(--space-2);
}

/* Main column */

main {
  width: min(var(--rail), calc(100% - 2rem));
  margin: 0 auto;
  padding: var(--space-6) 0 var(--space-8);
}
main:focus {
  outline: none;
}
.page-intro {
  max-width: 48rem;
  margin-bottom: var(--space-6);
}
.page-intro h1 {
  margin-bottom: var(--space-2);
}
.page-intro p {
  color: var(--slate);
  font-size: var(--text-lg);
}

/* Prose: the reading column for articles and standard pages. */
.prose {
  max-width: var(--measure);
}
.prose p,
.prose ul,
.prose ol {
  margin-bottom: var(--space-3);
}
.prose h2,
.prose h3,
.prose h4 {
  margin-top: var(--space-6);
}
.prose h2 + h3,
.prose h3 + h4 {
  margin-top: var(--space-2);
}
.prose li + li {
  margin-top: 0.35rem;
}
.prose a {
  font-weight: 700;
}
.prose blockquote {
  margin: var(--space-4) 0;
  padding: 0.25rem 0 0.25rem var(--space-3);
  border-left: 4px solid var(--blue);
  font-size: var(--text-lg);
}
.prose .content-image {
  display: block;
  margin: var(--space-4) 0;
  border-radius: var(--radius);
}

/* Code */
code {
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--mist);
  font-size: 0.92em;
}
pre {
  margin: var(--space-3) 0;
  padding: var(--space-3);
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-ink);
  overflow-x: auto;
  line-height: 1.5;
}
pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: 0.95em;
}
/* Pygments token colors, tuned for contrast on the dark block. */
pre .c,
pre .c1,
pre .cm {
  color: #a0aec0;
}
pre .k,
pre .kn,
pre .kd,
pre .nb {
  color: #93c5fd;
}
pre .s,
pre .s1,
pre .s2,
pre .sb {
  color: #fcd9a1;
}
pre .mi,
pre .mf {
  color: #c4b5fd;
}
pre .nf,
pre .nc {
  color: #86efac;
}

/* Video embeds: horizontal by default; Shorts stay vertical and capped so they do not tower. */
.youtube-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: var(--space-3) 0 var(--space-4);
}
.youtube-embed.is-short {
  aspect-ratio: 9 / 16;
  max-width: 380px;
  margin-inline: auto;
}
.youtube-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius);
}

/* Home */
.hero {
  max-width: 52rem;
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--line);
}
.hero-lede {
  max-width: 40rem;
  margin-bottom: var(--space-3);
  color: var(--slate);
  font-size: var(--text-lg);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.topic-list li {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 700;
}
.focus-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--line);
}
.focus-point {
  padding-top: var(--space-2);
  border-top: 3px solid var(--blue);
}
.focus-point h2 {
  font-size: var(--text-h3);
}
.focus-point p {
  margin: 0;
  color: var(--slate);
}
.latest-posts {
  padding-top: var(--space-6);
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.section-heading h2 {
  margin: 0;
}

/* Article */
.article-header {
  max-width: 48rem;
  margin-bottom: var(--space-4);
}
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  font-weight: 700;
  text-decoration: none;
}
.back-link:hover {
  text-decoration: underline;
}
.article-dates {
  margin-bottom: var(--space-1);
  color: var(--slate);
  font-size: var(--text-sm);
  font-weight: 700;
}
.article-updated {
  margin-left: var(--space-2);
  font-weight: 400;
  font-style: italic;
}
.article-lede {
  max-width: 40rem;
  color: var(--slate);
  font-size: var(--text-lg);
}

/* Post lists: ruled rows, not cards. */
.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.post-row {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
}
.post-row:last-child {
  border-bottom: 1px solid var(--line);
}
.post-row h3,
.post-row h2 {
  margin-bottom: 0.35rem;
}
.post-row a {
  color: var(--ink);
  text-decoration: none;
}
.post-row a:hover {
  color: var(--blue-dark);
  text-decoration: underline;
}
.post-row p {
  margin: 0;
  color: var(--slate);
}
.post-row time {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--slate);
  font-size: var(--text-sm);
  font-weight: 700;
}

/* Resource groups */
.resource-group + .resource-group {
  margin-top: var(--space-6);
}
.resource-group > h2 {
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--line);
}
.resource-list {
  display: grid;
  gap: var(--space-3);
  max-width: var(--measure);
  margin: 0;
  padding: 0;
  list-style: none;
}
.resource-card h3 {
  margin-bottom: 0.3rem;
}
.resource-card p {
  margin: 0;
  color: var(--slate);
}

/* Buttons and forms */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target);
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button:hover {
  border-color: var(--blue);
  color: var(--blue-dark);
}
.button-primary {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--paper);
}
.button-primary:hover {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  color: var(--paper);
}
label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}
input,
textarea,
select {
  width: 100%;
  max-width: var(--measure);
  min-height: var(--target);
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--slate);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
textarea {
  min-height: 10rem;
}
.contact-form {
  display: grid;
  gap: var(--space-3);
  max-width: var(--measure);
}
.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.field-error,
.form-errors {
  color: var(--red);
  font-weight: 700;
}
.field-error ul,
.form-errors ul {
  margin: 0 0 var(--space-1);
  padding: 0;
  list-style: none;
}
.search-form {
  display: grid;
  gap: var(--space-2);
  max-width: var(--measure);
  margin-bottom: var(--space-6);
}
.pagination {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--mist);
  color: var(--slate);
}
.site-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: var(--space-4);
  width: min(var(--rail), calc(100% - 2rem));
  margin: 0 auto;
  padding: var(--space-6) 0 var(--space-3);
}
.site-footer-brand p {
  max-width: 30rem;
  margin: var(--space-2) 0 0;
}
.site-footer nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.site-footer nav a:hover {
  color: var(--blue-dark);
  text-decoration: underline;
}
.site-footer-copyright {
  width: min(var(--rail), calc(100% - 2rem));
  margin: 0 auto;
  padding: var(--space-2) 0 var(--space-4);
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 900px) {
  .social-links-header .social-link span[aria-hidden] {
    display: none;
  }
  .focus-points {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .site-footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}

@media (max-width: 720px) {
  :root {
    --text-base: 1.0625rem;
    --text-h1: 2.1rem;
    --text-h2: 1.5rem;
  }
  main,
  .site-nav,
  .site-footer-inner,
  .site-footer-copyright {
    width: min(var(--rail), calc(100% - 1rem));
  }
  main {
    padding: var(--space-4) 0 var(--space-6);
  }
  .site-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-1);
    padding: var(--space-1) 0;
  }
  .site-nav-links {
    grid-column: 1 / -1;
    overflow-x: auto;
  }
}
