/* === Google Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@400;500&display=swap');

/* === Light mode (default) === */
:root {
  --bg: #F7F8F5;
  --surface: #FFFFFF;
  --border: #DDE3DF;
  --text: #14201F;
  --text-soft: #33413F;
  --text-muted: #4A5654;
  --accent: #0F6E56;
  --accent-hover: #0A4F3E;
  --cta-bg: #14201F;
  --tint-teal: #E1F5EE;
  --tint-purple: #EEEDFE;
  --tint-amber: #FAEEDA;
  --tint-coral: #FAECE7;
  --tint-blue: #E6F1FB;
  --tint-gray: #F1EFE8;
  --accent-link: #0F6E56;
  --accent-link-hover: #0A4F3E;
  --radius-card: 16px;
  --radius-panel: 22px;
  --radius-btn: 10px;
  --max-width: 1120px;
  --pad-x: 24px;
  --section-gap: 72px;
  --shadow-lg: 0 12px 24px rgba(20, 32, 31, 0.12);
  --nav-bg: rgba(247, 248, 245, 0.8);
  --hero-glow: #E1F5EE;
  --term-bg: #1B2422;
  --term-text: #A9B8B4;
  --term-dot-red: #FF5F56;
  --term-dot-yellow: #FFBD2E;
  --term-dot-green: #27C93F;
}

/* === Dark mode === */
[data-theme='dark'] {
  --bg: #0F1614;
  --surface: #18221F;
  --border: #2B3835;
  --text: #E8EFEC;
  --text-soft: #C9D3D0;
  --text-muted: #A9B8B4;
  --accent: #0F6E56;
  --accent-hover: #0A4F3E;
  --cta-bg: #22302C;
  --tint-teal: #12352C;
  --tint-purple: #26244A;
  --tint-amber: #3A2A10;
  --tint-coral: #3B1F17;
  --tint-blue: #1A2D40;
  --tint-gray: #2A2926;
  --accent-link: #5DCAA5;
  --accent-link-hover: #9FE1CB;
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.5);
  --nav-bg: rgba(15, 22, 20, 0.8);
  --hero-glow: #12352C;
  --term-bg: #1B2422;
  --term-text: #A9B8B4;
  --term-dot-red: #FF5F56;
  --term-dot-yellow: #FFBD2E;
  --term-dot-green: #27C93F;
}

/* === Reset === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === Skip to content link === */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
}

.skip-link:focus,
.skip-link:focus-visible {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 300;
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* === Base === */
html {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* No horizontal scroll on small viewports. overflow-x: clip keeps
   position: sticky working (unlike overflow-x: hidden). */
html,
body {
  overflow-x: clip;
}

/* Long unbreakable strings (URLs, handles) must not blow up cards. */
.post-card__body,
.card__body,
.card p,
.card h3,
.pill,
.cv-entry,
.contact-info-card a,
.social-card__handle,
.project-details dd,
.project-details dt,
.uses-card li {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Any code block must scroll inside its own box, never the page. */
pre {
  max-width: 100%;
  overflow-x: auto;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

a {
  color: var(--accent-link);
}

img {
  max-width: 100%;
  display: block;
}

/* === Layout === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.section {
  padding-block: var(--section-gap);
}

@media (max-width: 600px) {
  :root {
    --pad-x: 20px;
    --section-gap: 48px;
  }
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 {
  font-size: 56px;
  line-height: 1.05;
}

h2 {
  font-size: 36px;
}

h3 {
  font-size: 22px;
}

p {
  font-size: 17px;
  color: var(--text-soft);
}

small {
  font-size: 14px;
}

.lead {
  font-size: 19px;
  color: var(--text-soft);
  line-height: 1.6;
}

.text-muted {
  color: var(--text-muted);
  font-size: 14px;
}

@media (max-width: 600px) {
  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 28px;
  }
}

/* === Buttons === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 26px;
  border-radius: var(--radius-btn);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  min-height: 44px;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--text);
  padding: 14px 26px;
  border-radius: var(--radius-btn);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  min-height: 44px;
}

.btn-secondary:hover {
  background: var(--tint-gray);
}

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

/* === Pill tags === */
.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--tint-gray);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
}

.pill--green {
  background: var(--tint-teal);
  color: var(--accent);
}

/* === Filter chips === */
.chip {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  min-height: 44px;
  font-family: 'Inter', sans-serif;
}

.chip:hover {
  background: var(--tint-gray);
}

.chip.active,
.chip-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 600px) {
  .chip-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
}

/* === Card === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .card:hover {
    transform: none;
    transition: box-shadow 0.25s ease;
  }
}

.card__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* === Scroll reveal ===
   Hidden state is gated on the .js class that the inline head script
   adds, so content stays fully visible when JavaScript is disabled. */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js .reveal.revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js .reveal.revealed {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* === Reading progress bar (blog post) === */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 60;
  pointer-events: none;
}

/* === Thumbnail === */
.thumb {
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
}

.thumb--teal {
  background: var(--tint-teal);
  color: var(--accent);
}

.thumb--purple {
  background: var(--tint-purple);
  color: #5B56E0;
}

.thumb--amber {
  background: var(--tint-amber);
  color: #9A6400;
}

.thumb--coral {
  background: var(--tint-coral);
  color: #C0392B;
}

.thumb--blue {
  background: var(--tint-blue);
  color: #1A6FAA;
}

.thumb--gray {
  background: var(--tint-gray);
  color: var(--text-muted);
}

.thumb .bar {
  display: block;
  width: 36px;
  height: 80px;
  border-radius: 6px;
  background: currentColor;
  opacity: 0.3;
}

.thumb .bar:nth-child(2) {
  height: 56px;
}

.thumb .bar:nth-child(3) {
  height: 100px;
}

/* === Thumbnail shape modifiers (layer on top of a tint class) === */

/* Bar chart: four bars of different heights */
.thumb--chart {
  align-items: flex-end;
  padding-bottom: 28px;
}

.thumb--chart .bar {
  width: 14px;
  height: 96px;
  border-radius: 4px;
}

.thumb--chart .bar:nth-child(1) {
  height: 48px;
}

.thumb--chart .bar:nth-child(2) {
  height: 80px;
}

.thumb--chart .bar:nth-child(3) {
  height: 60px;
}

.thumb--chart .bar:nth-child(4) {
  height: 96px;
}

/* Line chart: filled area via clip-path */
.shape-graph {
  display: block;
  width: 56%;
  height: 56%;
  background: currentColor;
  opacity: 0.35;
  clip-path: polygon(0 80%, 20% 55%, 40% 68%, 60% 30%, 80% 42%, 100% 12%, 100% 100%, 0 100%);
}

/* Node network: three circles joined by lines */
.shape-nodes {
  position: relative;
  display: block;
  width: 120px;
  height: 80px;
}

.shape-nodes .node {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.shape-nodes .node:nth-child(1) {
  width: 22px;
  height: 22px;
  left: 0;
  top: 8px;
}

.shape-nodes .node:nth-child(2) {
  width: 28px;
  height: 28px;
  left: 46px;
  top: 26px;
}

.shape-nodes .node:nth-child(3) {
  width: 22px;
  height: 22px;
  right: 0;
  bottom: 8px;
}

.shape-nodes::before,
.shape-nodes::after {
  content: '';
  position: absolute;
  height: 2px;
  background: currentColor;
  opacity: 0.4;
  transform-origin: 0 0;
}

.shape-nodes::before {
  left: 11px;
  top: 19px;
  width: 54px;
  transform: rotate(23deg);
}

.shape-nodes::after {
  left: 60px;
  top: 40px;
  width: 57px;
  transform: rotate(30.6deg);
}

/* Terminal window: dark box with traffic-light dots and prompt */
.shape-term {
  background: var(--term-bg);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 150px;
}

.term-dots {
  display: flex;
  gap: 6px;
}

.term-dots span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.term-dots span:nth-child(1) { background: var(--term-dot-red); }
.term-dots span:nth-child(2) { background: var(--term-dot-yellow); }
.term-dots span:nth-child(3) { background: var(--term-dot-green); }

.term-prompt {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--term-text);
}

/* === CTA Block === */
.cta-block {
  background: var(--cta-bg);
  color: #fff;
  border-radius: var(--radius-panel);
  padding: 56px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.cta-block h2 {
  color: #fff;
}

.cta-block p {
  color: rgba(255, 255, 255, 0.8);
}

.cta-block .btn-primary {
  background: #fff;
  color: var(--cta-bg);
}

.cta-block .btn-primary:hover {
  background: rgba(255, 255, 255, 0.9);
}

@media (max-width: 600px) {
  .cta-block {
    padding: 36px 24px;
  }
}

/* === Quote card === */
.quote-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quote-card blockquote {
  font-size: 17px;
  color: var(--text-soft);
  line-height: 1.65;
  font-style: italic;
}

.quote-card figcaption {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* === Avatar === */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tint-teal);
  color: var(--accent);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar--lg {
  width: 96px;
  height: 96px;
  font-size: 40px;
}

/* === Link arrow === */
.link-arrow {
  color: var(--accent-link);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  display: inline-block;
  padding: 10px 0 6px;
}

.link-arrow:hover {
  color: var(--accent-link-hover);
  text-decoration: underline;
}

/* === Back link === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 24px;
}

.back-link:hover {
  color: var(--accent-link);
}

/* === Page header === */
.page-header {
  padding-block: 56px 32px;
}

.page-header h1 {
  margin-bottom: 12px;
}

.page-header p {
  font-size: 19px;
  color: var(--text-soft);
  max-width: 600px;
}

/* =============================================
   NAVBAR
   ============================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.nav__logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.nav__links {
  display: flex;
  gap: 4px;
  list-style: none;
  align-items: center;
}

.nav__links a {
  font-size: 15px;
  color: var(--text-soft);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.12s, background 0.12s;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav__links a:hover {
  color: var(--text);
  background: var(--tint-gray);
}

.nav-current {
  font-weight: 700 !important;
  text-decoration: underline !important;
  text-decoration-color: var(--accent) !important;
  text-underline-offset: 3px !important;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-theme {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  padding: 6px 16px;
  min-height: 44px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.12s;
  white-space: nowrap;
}

.btn-theme:hover {
  background: var(--tint-gray);
}

.nav__burger {
  display: none;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  min-height: 44px;
}

@media (max-width: 759px) {
  .nav__links {
    display: none;
  }

  .nav__actions {
    display: none;
  }

  .nav__burger {
    display: flex;
    align-items: center;
    margin-left: auto;
  }
}

/* === Mobile menu === */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu__close {
  align-self: flex-end;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  min-height: 44px;
  margin-bottom: 16px;
}

.mobile-menu__links {
  list-style: none;
  flex: 1;
}

.mobile-menu__links li {
  border-bottom: 1px solid var(--border);
}

.mobile-menu__links a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  display: block;
  padding: 20px 0;
  color: var(--text);
  text-decoration: none;
}

.mobile-menu__links a:hover {
  color: var(--accent-link);
}

.mobile-menu__footer {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  margin-top: 16px;
  border-top: 1px solid var(--border);
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  border-top: 1px solid var(--border);
  margin-top: auto;
  padding: 24px 0;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  row-gap: 12px;
}

.footer__copy {
  font-size: 14px;
  color: var(--text-muted);
}

.footer__links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  row-gap: 12px;
}

.footer__links a {
  font-size: 14px;
  color: var(--text-soft);
  text-decoration: none;
  display: inline-block;
  padding: 10px 0;
}

.footer__links a:hover {
  color: var(--accent-link);
}

/* =============================================
   HERO (index.html)
   ============================================= */
.hero {
  padding-block: 112px 96px;
  background: linear-gradient(180deg, var(--hero-glow) 0%, transparent 100%);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: center;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero__text h1 {
  margin-top: 8px;
}

.hero__text p {
  font-size: 19px;
  max-width: 52ch;
}

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

.hero__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 24px;
  text-align: center;
}

.hero__card strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

@media (max-width: 759px) {
  .hero__inner {
    grid-template-columns: 1fr;
  }
}

/* === Section headers === */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}

/* === Projects grid === */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 1023px) and (min-width: 641px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* === Post grid === */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 1023px) and (min-width: 641px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .post-grid {
    grid-template-columns: 1fr;
  }
}

/* === Related posts (Keep-reading) grid === */
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 640px) {
  .related-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   PROJECT PAGE
   ============================================= */
.project-page {
  padding-block: 32px 72px;
}

.project-page h1 {
  margin-bottom: 16px;
}

.browser-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  overflow: hidden;
  margin-block: 32px;
}

.browser-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot--red { background: #FF5F57; }
.dot--yellow { background: #FFBD2E; }
.dot--green { background: #28C840; }

.browser-url {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 8px;
  background: var(--bg);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-body {
  border-radius: 0;
  height: 240px;
}

.project-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
  margin-top: 32px;
}

@media (max-width: 759px) {
  .project-layout {
    grid-template-columns: 1fr;
  }
}

.project-story {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 720px;
}

.project-story h2 {
  margin-bottom: -16px;
}

.how-it-works {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 600px) {
  .how-it-works {
    grid-template-columns: 1fr;
  }
}

.step-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-card strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  color: var(--text);
}

.project-details {
  padding: 24px;
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project-details dl {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-details dt {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.project-details dd {
  color: var(--text-soft);
  font-size: 15px;
  margin-bottom: 8px;
}

.next-project {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  text-decoration: none;
  margin-top: 48px;
  transition: background 0.12s;
}

.next-project:hover {
  background: var(--tint-gray);
}

.next-project__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

/* =============================================
   ABOUT PAGE
   ============================================= */
.about-intro {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 600px) {
  .about-intro {
    grid-template-columns: 1fr;
  }
}

.about-intro__text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.portrait {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-panel);
  background: var(--tint-teal);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 72px;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.right-now-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 1023px) and (min-width: 641px) {
  .right-now-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .right-now-grid {
    grid-template-columns: 1fr;
  }
}

.right-now-item {
  padding: 24px;
}

.right-now-item .label {
  display: block;
  margin-bottom: 8px;
}

.right-now-item p {
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
}

.problem-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

@media (max-width: 640px) {
  .people-grid {
    grid-template-columns: 1fr;
  }
}

.people-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.people-card strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  color: var(--text);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

@media (max-width: 640px) {
  .social-grid {
    grid-template-columns: 1fr;
  }
}

.social-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  border-radius: var(--radius-card);
  transition: background 0.12s;
}

.social-card:hover {
  background: var(--tint-teal);
}

.social-card__platform {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.social-card__handle {
  font-size: 14px;
  color: var(--text-muted);
}

/* =============================================
   STUDY TOOLS
   ============================================= */
.search-input {
  width: 100%;
  max-width: 480px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 16px;
  background: var(--surface);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  margin-block: 24px;
}

.search-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-block: 32px;
}

.features-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-block: 48px;
}

@media (max-width: 600px) {
  .features-row {
    grid-template-columns: 1fr;
  }
}

.feature-item {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.feature-item strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  color: var(--text);
  margin-bottom: 8px;
}

.feature-item p {
  font-size: 15px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* =============================================
   BLOG PAGE
   ============================================= */
.featured-post {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  margin-block: 32px;
}

.featured-post__thumb {
  border-radius: var(--radius-card) 0 0 var(--radius-card);
  height: auto;
  min-height: 240px;
}

.featured-post__text {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.featured-post__text h2 {
  font-size: 28px;
}

@media (max-width: 759px) {
  .featured-post {
    grid-template-columns: 1fr;
  }

  .featured-post__thumb {
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    min-height: 180px;
  }
}

.post-card {
  display: flex;
  flex-direction: column;
}

.post-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.post-card__body h3 {
  font-size: 18px;
}

/* =============================================
   BLOG POST PAGE
   ============================================= */
.post-wrapper {
  padding-block: 32px 72px;
  max-width: 960px;
}

.cover-panel {
  height: 280px;
  border-radius: var(--radius-panel);
  margin-block: 24px;
}

.post-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 48px;
  align-items: start;
  margin-top: 32px;
}

@media (max-width: 759px) {
  .post-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    order: -1;
  }
}

.post-body {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.post-body h2 {
  font-size: 26px;
  margin-top: 16px;
}

.post-body p {
  font-size: 17px;
  line-height: 1.75;
}

.post-body ul, .post-body ol {
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-body li {
  font-size: 17px;
  color: var(--text-soft);
}

.toc {
  position: sticky;
  top: 80px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.toc strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 16px;
}

.toc ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc a {
  color: var(--accent-link);
  font-size: 14px;
  text-decoration: none;
  display: block;
  padding: 10px 2px 10px 10px;
  border-left: 2px solid transparent;
}

.toc a.toc-active {
  color: var(--accent);
  border-left-color: var(--accent);
  padding-left: 8px;
  font-weight: 500;
}

.toc a:hover {
  text-decoration: underline;
}

.code-block {
  background: #0F1614;
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-block: 8px;
}

.code-block__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #2B3835;
}

.code-block__header span {
  font-size: 13px;
  color: #A9B8B4;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  padding: 8px 12px;
  min-height: 44px;
  border: 1px solid #2B3835;
  border-radius: 6px;
  background: transparent;
  color: #A9B8B4;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.12s;
}

.btn-copy:hover {
  background: #18221F;
  color: #E8EFEC;
}

.code-block pre {
  padding: 20px;
  overflow-x: auto;
}

.code-block code {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: #E8EFEC;
  white-space: pre;
}

.tip-box {
  background: var(--tint-teal);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-btn) var(--radius-btn) 0;
  padding: 16px 20px;
  margin-block: 8px;
}

.tip-box code {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.share-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-block: 32px;
}

.author-box {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  margin-block: 32px;
}

.author-box strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 4px;
}

.keep-reading {
  margin-top: 48px;
}

.keep-reading h2 {
  margin-bottom: 24px;
}

/* =============================================
   USES PAGE
   ============================================= */
.uses-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-block: 48px;
}

@media (max-width: 640px) {
  .uses-grid {
    grid-template-columns: 1fr;
  }
}

.uses-card {
  padding: 28px;
}

.uses-card h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

.uses-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.uses-card li {
  font-size: 15px;
  color: var(--text-soft);
}

.uses-card li strong {
  color: var(--text);
}

/* =============================================
   CV PAGE
   ============================================= */
.cv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.cv-header h1 {
  font-size: 32px;
}

.cv-sheet {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  padding: 48px;
  max-width: 900px;
  margin: 0 auto 72px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.08);
  border-radius: 20px;
}

@media (max-width: 900px) {
  .cv-sheet {
    grid-template-columns: 1fr;
    padding: 28px;
  }
}

.cv-left, .cv-right {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.cv-left h2 {
  font-size: 32px;
}

.cv-left h3, .cv-right h3 {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.cv-entry {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cv-entry strong {
  font-size: 16px;
  color: var(--text);
}

.cv-entry p {
  font-size: 14px;
  margin-top: 4px;
}

.cv-projects {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cv-projects li {
  font-size: 14px;
  color: var(--text-soft);
}

.cv-projects a {
  color: var(--accent-link);
  text-decoration: none;
}

.cv-contact {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-soft);
}

.cv-contact a {
  color: var(--accent-link);
  text-decoration: none;
}

/* =============================================
   CONTACT PAGE
   ============================================= */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
  padding-block: 48px;
}

@media (max-width: 759px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

.contact-form-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-form-col h1 {
  margin-bottom: -8px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 16px;
  background: var(--surface);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  transition: border-color 0.12s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
}

.form-status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  display: none;
}

.form-status.visible {
  display: block;
}

.form-status--success {
  background: var(--tint-teal);
  color: var(--accent);
}

.form-status--error {
  background: var(--tint-coral);
  color: #c0392b;
}

.contact-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-info-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-info-card strong {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.contact-info-card a {
  color: var(--accent-link);
  font-size: 15px;
  text-decoration: none;
  display: inline-block;
  padding: 10px 0 4px;
}

.contact-info-card a:hover {
  text-decoration: underline;
}

.contact-info-card span {
  font-size: 15px;
  color: var(--text-soft);
}

.social-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.social-links a {
  color: var(--accent-link);
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
  padding: 10px 4px 10px 0;
}

.social-links a:hover {
  text-decoration: underline;
}

/* =============================================
   404 PAGE
   ============================================= */
.four-oh-four {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-block: 96px;
}

.four-oh-four__number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 120px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.error-bars {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 8px;
}

.error-bar {
  display: block;
  border-radius: 6px;
  transform-origin: bottom;
  animation: errorPulse 2.2s ease-in-out infinite;
}

.error-bar:nth-child(2) {
  animation-delay: 0.25s;
}

.error-bar:nth-child(3) {
  animation-delay: 0.5s;
}

@keyframes errorPulse {
  0%, 100% {
    opacity: 0.75;
    transform: scaleY(0.9);
  }

  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .error-bar {
    animation-play-state: paused;
  }
}

.quick-links {
  display: flex;
  gap: 24px;
  row-gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.quick-links a {
  color: var(--accent-link);
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
  padding: 10px 0;
}

.quick-links a:hover {
  text-decoration: underline;
}

/* === Focus styles for keyboard navigation === */
.nav__links a:focus-visible,
.mobile-menu__links a:focus-visible,
.chip:focus-visible,
.btn-theme:focus-visible,
.btn-copy:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.social-card:focus-visible,
.back-link:focus-visible,
.link-arrow:focus-visible,
.footer__links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =============================================
   UTILITY
   ============================================= */
[hidden] {
  display: none !important;
}

.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-32 { margin-bottom: 32px; }

/* =============================================
   PRINT STYLESHEET
   ============================================= */
@media print {
  .nav,
  .footer,
  .mobile-menu,
  .toc,
  .share-row,
  .btn-theme,
  .reading-progress,
  .cover-panel,
  .thumb,
  .back-link,
  .keep-reading,
  .author-box,
  .post-wrapper .chip-row,
  .cv-header .btn-row {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
  }

  .post-body p,
  .post-body li,
  .post-body h1,
  .post-body h2 {
    color: #000;
  }

  .post-body a,
  .post-wrapper a {
    color: #000;
    text-decoration: none;
  }

  .cv-sheet {
    box-shadow: none;
    border: none;
    max-width: 100%;
    padding: 0;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .pill {
    border: 1px solid #ccc;
  }
}
