/* ============================================================
   GOOGLE FONTS
   ============================================================ */
/* Loaded with <link> tags in overrides/main.html (an @import here would wait for this file first) */

/* ============================================================
   COLORS
   The theme sets its own light palette on [data-md-color-scheme="default"],
   so ours must be declared there too to win.
   ============================================================ */
:root,
[data-md-color-scheme="default"] {
  --md-primary-fg-color:        #0E7A60;
  --md-primary-fg-color--light: #E0F5EF;
  --md-primary-fg-color--dark:  #095440;

  /* Deep enough to read on the cream page (5:1 on the nav tint); dark mode has its own */
  --md-accent-fg-color:              #0A6650;
  --md-accent-fg-color--transparent: rgba(10, 102, 80, 0.12);

  /* Warm paper, to sit with the library photo */
  --md-default-bg-color:        #F5EFE4;
  --md-default-bg-color--light: #ECE4D5;

  --md-default-fg-color:          #132218;
  --md-default-fg-color--light:   #3D5C48;
  --md-default-fg-color--lighter: #6B8C78;

  --md-code-bg-color: #EDE5D6;
  --md-code-fg-color: #1B3D28;
  /* Syntax colors darkened from the theme's so they pass 4.5:1 on the paper code background */
  --md-code-hl-constant-color: #5640C2;
  --md-code-hl-function-color: #87368F;
  --md-code-hl-keyword-color:  #2C55A0;
  --md-code-hl-number-color:   #AE1F1F;
  --md-code-hl-special-color:  #B0104A;
  --md-code-hl-string-color:   #166539;

  /* Our own tokens (not theme variables) */
  --md-border-color: #E2D6C2;
  --header-height:   96px;

  /* Shared background image: header, hero and footer use the same values so they line up.
     Light mode: library or sunlit desk by date (below). Dark mode: late-night desk.
     No image until extra.js picks one, so only that photo is downloaded. */
  --book-image:   none;
  /* Horizontal crop of the photo; shifted toward the laptop on portrait screens (below) */
  --book-x:       50%;
  --book-tint:    rgba(0, 0, 0, 0.25);
  /* Extra shade behind the tabs (bright window) and behind the title (open book) */
  --shade-top:    rgba(0, 0, 0, 0.45);
  --shade-header: rgba(0, 0, 0, 0.3);
  --shade-title:  rgba(0, 0, 0, 0.75);
  --shade-corner: transparent;
  --corner-x:     82%;
  /* Light mode: clean edge where the footer starts */
  --footer-top:   rgba(0, 0, 0, 0.88);
  --footer-pad-top: 1.75rem;
}

[data-md-color-scheme="slate"] {
  /* The deep primary green disappears on black, so links use a brighter one */
  --md-typeset-a-color: #34D399;
  --md-accent-fg-color: #6EE7B7;
  --md-accent-fg-color--transparent: rgba(11, 196, 160, 0.12);

  /* Deep blue-slate from the desk photo's night tones, lifted off pure black */
  --md-default-bg-color:        #161C24;
  --md-default-bg-color--light: #1D242E;
  --md-code-bg-color:           #1D242E;

  --book-image:   url('/assets/book-desk.webp');
  --book-tint:    rgba(0, 0, 0, 0.15);
  --shade-top:    transparent;
  --shade-header: transparent;
  --shade-title:  rgba(0, 0, 0, 0.6);
  /* The lamp glows behind the repo badge in the top-right corner */
  --shade-corner: rgba(0, 0, 0, 0.6);
  /* Dark mode: the footer fades in from the page color, no hard edge */
  --footer-top:   #161C24;
  /* Room for the fade to finish before the columns start */
  --footer-pad-top: 4rem;
}

/* Light-mode photo of the day (extra.js sets data-light-photo by date) */
html[data-light-photo="desk"],
html[data-light-photo="desk"] [data-md-color-scheme="default"] {
  --book-image: url('/assets/desk-light.webp');
}

html[data-light-photo="library"],
html[data-light-photo="library"] [data-md-color-scheme="default"] {
  --book-image: url('/assets/book-library.webp');
}

/* Portrait screens see only the middle third of these landscape photos.
   Shift the crop toward each photo's laptop (keep in sync with PHOTOS in extra.js). */
@media (orientation: portrait) {
  :root,
  [data-md-color-scheme="default"] {
    --book-x: 88%;
  }

  html[data-light-photo="library"],
  html[data-light-photo="library"] [data-md-color-scheme="default"] {
    --book-x: 78%;
  }

  [data-md-color-scheme="slate"] {
    --book-x: 100%;
    /* The lamp moves toward the middle with the crop */
    --corner-x: 45%;
  }
}

/* ============================================================
   FONTS & TYPOGRAPHY
   ============================================================ */
body,
input,
button,
select,
textarea {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif !important;
}

code,
pre,
code span {
  font-family: 'JetBrains Mono', 'Courier New', monospace !important;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6,
.md-tabs__link,
.md-header__title,
.md-source__repository {
  font-family: 'Space Grotesk', sans-serif !important;
}

.md-typeset h4,
.md-typeset h5,
.md-typeset h6,
.md-header__title,
.md-source__repository {
  font-weight: 700 !important;
}

/* Ragged-right article paragraphs: even word gaps, no mid-word breaks */
.md-content .md-typeset p {
  text-align: left;
}

/* The home page keeps justified blocks; hyphenation evens out the word gaps */
body:has(#hero-title) .md-content .md-typeset p,
.hero-desc {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* Phone lines are too short to justify without wide word gaps */
@media (max-width: 600px) {
  .md-content .md-typeset p {
    text-align: left;
  }
}

.md-typeset h1 { font-size: 2rem; letter-spacing: -0.02em; }
.md-typeset h2 { font-size: 1.4rem; margin-top: 0.8em; }
.md-typeset h3 { font-size: 1rem; }
.md-typeset    { font-size: 0.75rem; line-height: 1.6; }

/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */
/* Sidebars use Zensical's own styling; only the phone drawer font is customized */

/* Below the tabs breakpoint the drawer replaces the tabs, so match their typeface */
@media screen and (max-width: 76.234375em) {
  .md-nav--primary .md-nav__title,
  .md-nav--primary .md-nav__link {
    font-family: 'Space Grotesk', sans-serif !important;
    font-weight: 600;
  }
}

/* ============================================================
   HEADER & TABS: same on every page and in both modes.
   The image is pinned to the viewport, so it lines up with the home hero.
   ============================================================ */
.md-header {
  background:
    radial-gradient(40% 35% at var(--corner-x) 0%, var(--shade-corner), transparent) fixed,
    linear-gradient(var(--shade-top), var(--shade-header)),
    linear-gradient(to right, var(--shade-title) 0%, transparent 55%),
    linear-gradient(var(--book-tint), var(--book-tint)),
    var(--book-image) var(--book-x) 60% / cover no-repeat fixed !important;
  color: #fff !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* iOS ignores background-attachment: fixed. On upright touch screens the photo is
   height-bound, so sizing it to the viewport height from the top gives the same strip. */
@media (hover: none) and (orientation: portrait) {
  .md-header {
    background-attachment: scroll !important;
    /* Layers: corner shade, top shade, left shade, tint, photo */
    background-size: 100vw 100vh, auto, auto, auto, auto 100vh !important;
    background-position: 0 0, 0 0, 0 0, 0 0, var(--book-x) top !important;
  }
}

.md-header__inner,
.md-tabs,
.md-tabs .md-grid {
  background: transparent !important;
}

.md-tabs {
  border-bottom: 1px solid rgba(255, 255, 255, 0.18) !important;
}

.md-header__title,
.md-header__topic,
.md-header__button,
.md-header .md-source {
  color: #fff !important;
}

.md-tabs__link {
  color: rgba(255, 255, 255, 0.75) !important;
  font-weight: 600 !important;
}

.md-tabs__link:hover,
.md-tabs__item--active .md-tabs__link {
  color: #fff !important;
  opacity: 1 !important;
}

.md-tabs__item--active {
  border-bottom-color: #fff !important;
}

/* Search button; ::before is the icon, ::after the ⌘K badge */
.md-header .md-search__button {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.md-header .md-search__button::before {
  background-color: #fff !important;
}

.md-header .md-search__button::after {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* ============================================================
   BACK TO TOP: small rounded square, arrow only
   ============================================================ */
/* Bottom-right corner of the screen instead of centered; the theme centers it with margin + translate */
[dir=ltr] .md-top {
  margin-left: 0;
  left: auto;
  right: max(1rem, env(safe-area-inset-right, 0px));
  transform: none;
}

[dir=ltr] .md-top[hidden] {
  transform: translateY(0.2rem);
}

/* Below 60em the table of contents becomes a floating button in the same corner; sit above it */
@media screen and (max-width: 59.984375em) {
  [dir=ltr] .md-top {
    right: calc(0.8rem + 1px);
    bottom: calc(1.6rem + 38px + 0.6rem);
  }
}

.md-top {
  /* The "Back to top" text stays for screen readers but takes no space */
  font-size: 0 !important;
  gap: 0 !important;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0 !important;
  justify-content: center;
  align-items: center;
  border-radius: 0.5rem !important;
  background-color: var(--md-primary-fg-color--light) !important;
  color: var(--md-primary-fg-color--dark) !important;
  border: 1px solid rgba(9, 84, 64, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
}

/* The arrow only fills the middle third of the icon once the circle is gone, so size the icon up */
.md-top svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke-width: 2.5;
}

/* Plain arrow, without the circle around it */
.md-top svg circle {
  display: none;
}

[data-md-color-scheme="slate"] .md-top {
  background-color: var(--md-default-bg-color--light) !important;
  color: var(--md-typeset-a-color) !important;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4) !important;
}

/* ============================================================
   CODE BLOCKS
   ============================================================ */
.md-typeset pre code {
  line-height: 1.6;
}

.md-typeset pre {
  scrollbar-width: thin;
  scrollbar-color: var(--md-border-color) transparent;
}

.md-typeset pre::-webkit-scrollbar {
  height: 4px;
}

.md-typeset pre::-webkit-scrollbar-track {
  background: transparent;
}

.md-typeset pre::-webkit-scrollbar-thumb {
  background: var(--md-border-color);
  border-radius: 4px;
}

/* ============================================================
   BLOCKQUOTES
   ============================================================ */
blockquote {
  /* Same warm tint as the home cards, so quotes belong to the page */
  background-color: var(--card-bg);
  border-left: 8px solid #00645A;
  margin: 1.8em 10px;
  font-style: italic;
  padding: 1em 10px;
  quotes: "\201C" "\201D" "\2018" "\2019";
}

blockquote:before {
  color: #00645A;
  content: open-quote;
  font-size: 2.5em;
  line-height: 0.1em;
  margin-right: 0.25em;
  vertical-align: -0.3em;
}

blockquote p {
  display: inline;
}

body[data-md-color-scheme="slate"] blockquote {
  background-color: #00645A;
  border-left: 8px solid #e1e1e1 !important;
  color: #e1e1e1;
  padding: 1em;
  margin: 1.5em 0;
  box-shadow: 0 1px 5px rgba(97, 97, 97, 0.1);
}

body[data-md-color-scheme="slate"] blockquote:before {
  color: #e1e1e1;
}

/* ============================================================
   POST COVER IMAGE (the same 1200x630 image used on the home card)
   ============================================================ */
/* A wide 2:1 crop, capped in height, so the first paragraph shows without scrolling */
.md-typeset img.post-cover {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  max-height: 340px;
  object-fit: cover;
  object-position: center 65%;
  margin: 1rem 0 1.5rem;
  border-radius: 0;
}

/* Keep the author line close to the title it belongs to */
.md-typeset h1:has(+ .blog-meta) {
  margin-bottom: 0.4em;
}

.md-typeset h1 + .blog-meta {
  margin-top: 0;
}

/* ============================================================
   ADMONITIONS
   ============================================================ */
.md-typeset .admonition.tip {
  border-left: 5px solid #2dd4bf;
}

.md-typeset details.info p {
  font-size: .65rem !important;
}

/* ============================================================
   BLOG META
   ============================================================ */
.blog-meta {
  font-size: 0.72rem;
  color: #666;
  margin-top: 0.5rem;
  text-align: center;
}

.blog-meta-container {
  display: flex;
  align-items: center;
}

.meta-content {
  display: flex;
  align-items: center;
}

.meta-content a {
  text-decoration: none;
}

@media (max-width: 768px) {
  .blog-meta-container {
    display: block;
  }

  /* Wrap instead of squeezing into columns: author first, tag and read time below */
  .blog-meta {
    text-align: left;
  }

  .meta-content {
    flex-wrap: wrap;
    justify-content: flex-start;
    row-gap: 0.25rem;
  }

  .category-timer-mobile {
    flex-basis: 100%;
  }
}

/* ============================================================
   CONTENT VISIBILITY
   ============================================================ */
#categories,
#categories + ul,
.md-nav__link[href="#categories"] {
  display: none !important;
}

/* Contributors and feedback: hidden by default, shown on content pages via JS */
.md-source-file,
.md-feedback {
  display: none !important;
}

.show-contrib-feedback .md-source-file,
.show-contrib-feedback .md-feedback {
  display: block !important;
}

.md-source-file__fact img {
  border: 2px solid var(--md-primary-fg-color--light);
  border-radius: 50%;
}

/* ============================================================
   FOOTER
   ============================================================ */
/* Bottom of the book, pinned to the viewport like the header.
   Darkest behind the links, lighter toward the book's cover at the bottom. */
.md-footer {
  background:
    linear-gradient(to bottom, var(--footer-top) 0%, rgba(0, 0, 0, 0.85) 25%, rgba(0, 0, 0, 0.6) 60%, rgba(0, 0, 0, 0.4) 100%),
    var(--book-image) var(--book-x) 60% / cover no-repeat fixed;
  /* The theme's 1px top border sits outside the fade, so the raw photo showed through it */
  border-top: none !important;
  padding: var(--footer-pad-top) 1rem 1.25rem;
  font-size: 0.9rem;
}

.md-footer,
.md-footer-meta,
.md-footer-meta__inner,
.md-copyright,
.md-copyright__highlight,
.md-social,
.md-footer a {
  color: rgba(255, 255, 255, 0.75) !important;
}

.md-footer-meta,
.md-footer__inner {
  background: transparent !important;
}

.md-footer a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.md-footer a:hover {
  color: var(--md-accent-fg-color) !important;
}

/* Line the copyright and social icons up with the columns above */
.md-footer-meta__inner {
  padding-inline: 0 !important;
}

.md-footer-meta .md-copyright,
.md-footer-meta .md-social {
  margin-inline: 0 !important;
}

.footer-resources {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 1.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand__name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f0fdf4;
}

.footer-brand__line {
  margin: 0.4rem 0 0;
  font-size: 0.7rem;
  font-style: italic;
  color: #86efac !important;
}

.footer-col__title {
  margin: 0 0 0.7rem;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #4ade80 !important;
}

.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.footer-col a {
  font-size: 0.7rem;
}

/* Medium screens: brand on its own row, the three link columns below */
@media (max-width: 1100px) {
  .footer-resources {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* Small screens: link columns two by two */
@media (max-width: 600px) {
  .footer-resources {
    grid-template-columns: 1fr 1fr;
    row-gap: 1.75rem;
  }
}

/* iOS ignores background-attachment: fixed. When the footer reaches the bottom of the
   screen, a viewport-height photo aligned to the bottom shows the same strip. */
@media (hover: none) and (orientation: portrait) {
  .md-footer {
    background-attachment: scroll !important;
    background-size: auto, auto 100vh !important;
    background-position: 0 0, var(--book-x) bottom !important;
  }
}

/* ============================================================
   HOME PAGE HERO
   ============================================================ */
/* Part of the page: fills the first screen, then scrolls away with everything else */
#hero-fixed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  background: var(--book-image) var(--book-x) 60% / cover no-repeat;
}

#hero-overlay,
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Top shade continues the header's below it; left shade keeps the title readable */
/* The corner shade is pinned to the viewport (fixed) so it lines up with the header's */
#hero-overlay {
  background:
    radial-gradient(40% 35% at var(--corner-x) 0%, var(--shade-corner), transparent) fixed,
    linear-gradient(to bottom, var(--shade-top) 0, var(--shade-header) var(--header-height), transparent 260px),
    linear-gradient(to right, var(--shade-title) 0%, transparent 55%),
    linear-gradient(var(--book-tint), var(--book-tint));
}

/* Its own layer above .md-main so the buttons are clickable; scrolls with the hero.
   Lines up with the first nav tab (grid edge + 1rem); below that, the 16px gutter. */
#hero-title {
  position: absolute;
  top: 0;
  left: max(16px, calc((100% - 61rem) / 2 + 1rem));
  right: max(16px, env(safe-area-inset-right, 0px));
  height: 100vh;
  /* Spans the first screen; the text sits at the bottom of it */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding-bottom: 10vh;
  z-index: 3;
  pointer-events: none;
}

.hero-site-name {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 3.8vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #f0fdf4;
  line-height: 1;
  text-shadow: 0 0 40px rgba(34, 197, 94, 0.4), 0 2px 12px rgba(0, 0, 0, 0.6);
}

.hero-desc,
.hero-credit {
  display: block;
  font-size: clamp(0.65rem, 1vw, 0.82rem);
}

.hero-desc {
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  margin-top: 0.9rem;
  max-width: 38ch;
}

/* The description matches the photo: daytime library in light mode, late-night desk in dark */
.hero-desc--night,
[data-md-color-scheme="slate"] .hero-desc--day {
  display: none;
}

[data-md-color-scheme="slate"] .hero-desc--night {
  display: inline;
}

.hero-credit {
  color: rgba(134, 239, 172, 0.7);
  margin-top: 0.6rem;
}

.hero-cta {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS: dark green primary with an arrow, plain white secondary
   ============================================================ */
:root {
  --btn-dark-bg:   #0E7A60;
  --btn-dark-hover: #0B624D;
  --btn-dark-fg:   #FFFFFF;
  --btn-light-bg:  #FFFFFF;
  --btn-light-fg:  #161616;
  --btn-light-line: #D6D6D6;
}

.hero-btn,
.md-typeset a.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.8em 1.35em;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: 6px;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.hero-btn {
  font-size: clamp(0.72rem, 1.1vw, 0.88rem);
  pointer-events: auto;
}

.md-typeset a.home-btn {
  font-size: 0.78rem;
}

/* Primary */
.hero-btn--primary,
.md-typeset a.home-btn {
  color: var(--btn-dark-fg) !important;
  background: var(--btn-dark-bg);
  border-color: var(--btn-dark-bg);
}

.hero-btn--primary::after,
.md-typeset a.home-btn:not(.home-btn--light)::after {
  content: "→";
  font-size: 1.25em;
  line-height: 1;
  transition: transform 0.2s;
}

.hero-btn--primary:hover,
.md-typeset a.home-btn:not(.home-btn--light):hover {
  background: var(--btn-dark-hover);
  border-color: var(--btn-dark-hover);
}

.hero-btn--primary:hover::after,
.md-typeset a.home-btn:not(.home-btn--light):hover::after {
  transform: translateX(3px);
}

/* Secondary */
.hero-btn--secondary,
.md-typeset a.home-btn--light {
  color: var(--btn-light-fg) !important;
  background: var(--btn-light-bg);
  border-color: var(--btn-light-line);
}

.hero-btn--secondary:hover,
.md-typeset a.home-btn--light:hover {
  background: #F1F1F1;
  border-color: #BDBDBD;
}

.hero-tagline {
  display: block;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: clamp(0.55rem, 1.2vw, 0.78rem);
  color: #86efac;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 1.2rem;
  text-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

/* Phones: let the description use the full width so both margins match */
@media (max-width: 600px) {
  .hero-desc {
    max-width: none;
  }
}

/* Short screens (phones held sideways): keep the hero below the header */
@media (max-height: 540px) {
  #hero-title {
    padding-bottom: 1.25rem;
  }

  .hero-desc,
  .hero-tagline {
    display: none;
  }

  .hero-cta {
    margin-top: 0.9rem;
  }
}

/* ============================================================
   HOME PAGE CONTENT (slides up over the fixed hero)
   ============================================================ */

/* On wide screens the sidebar would sit over the hero; below this width it is the menu drawer */
@media screen and (min-width: 76.25em) {
  body:has(#hero-title) .md-sidebar--primary {
    display: none;
  }
}

/* Layer the article and footer (not .md-main) above the fixed hero, or the menu drawer
   gets trapped under the overlay */
body:has(#hero-title) .md-content,
body:has(#hero-title) .md-footer {
  position: relative;
  z-index: 1;
}

/* The content panel starts just below the hero; its background bleeds to both screen edges */
body:has(#hero-title) .md-content__inner {
  margin-top: calc(100vh - var(--header-height));
  /* Padding, not the theme's bottom margin, so the hero can't show through above the footer */
  margin-bottom: 0;
  padding-top: 1rem !important;
  padding-bottom: 1.5rem;
  background: var(--md-default-bg-color);
  box-shadow: 0 0 0 100vmax var(--md-default-bg-color);
  clip-path: inset(0 -100vmax);
}

/* The full-bleed band and background extend past the grid; clip so the page never scrolls sideways
   (clip, unlike hidden, doesn't create a scroll container that would break the sticky header) */
body:has(#hero-title) .md-main {
  overflow-x: clip;
}

/* No page title on home; the hero is the title */
body:has(#hero-title) .md-content__inner > h1 {
  display: none;
}

:root,
[data-md-color-scheme="default"] {
  --art-bg:     #E3EFE7;
  --art-ink:    var(--md-primary-fg-color);
  --art-string: #B45309;
  --card-bg:    rgba(255, 255, 255, 0.45);
  --card-hover: #E9F2EC;
  --card-line:  #DCD0BC;
}

[data-md-color-scheme="slate"] {
  --art-bg:     #1D242E;
  --art-ink:    #34D399;
  --art-string: #FBBF24;
  --card-bg:    var(--md-default-bg-color--light);
  --card-hover: rgba(52, 211, 153, 0.07);
  --card-line:  rgba(255, 255, 255, 0.1);
}

.home-section {
  padding-block: 5rem;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

.home-section + .home-section {
  border-top: 1px solid var(--md-default-fg-color--lightest);
}

.md-typeset .home-section__title {
  margin: 0 0 0.5rem;
  font-size: 1.7rem;
  line-height: 1.2;
}

/* Two-tone heading: the second phrase in the accent color (Percona-style) */
.md-typeset .home-section__title em,
.md-typeset .home-cta__title em {
  font-style: normal;
  color: var(--art-ink);
}

/* Small code-style label above each section heading */
.home-eyebrow {
  display: block;
  margin-bottom: 0.5rem;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--art-ink);
  text-decoration: none !important;
}

/* Linked eyebrows (article headers) keep the eyebrow color, not the theme's link color */
.md-typeset a.home-eyebrow {
  color: var(--art-ink);
}

/* Underlined only on section heroes */
.section-hero .home-eyebrow {
  text-decoration: underline !important;
  text-decoration-thickness: 1px !important;
  text-underline-offset: 0.45em;
}

.md-typeset .home-section__lead {
  margin: 0 0 1.6rem;
  max-width: 60ch;
  color: var(--md-default-fg-color--light);
  text-align: left;
}

/* Section index intro block */

.section-coming-soon {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--md-default-fg-color--lighter);
}

/* Section hero band (Option D) */
.section-hero {
  padding: 4rem 1rem 3.5rem;
}

body:has(.section-hero) .md-main__inner {
  margin-top: 0;
}

/* Breadcrumbs belong to articles; hero pages are one level deep and start with their band */
body:has(.section-hero) .md-path {
  display: none;
}

body:has(.section-hero) .md-content__inner {
  padding-top: 0;
}

body:has(.section-hero) .md-content__inner::before {
  display: none !important;
}

/* Wiley-style category nav below section hero */
.project-category-nav {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  gap: 0;
  background: var(--md-default-bg-color);
  border-bottom: 1px solid var(--card-line);
  padding: 0 1rem;
  scrollbar-width: none;
}

.project-category-nav::-webkit-scrollbar {
  display: none;
}

.md-typeset .project-category-nav a {
  flex-shrink: 0;
  padding: 0.85rem 1.2rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--md-default-fg-color--light);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.md-typeset .project-category-nav a:hover {
  color: var(--md-default-fg-color);
  border-bottom-color: var(--md-primary-fg-color);
}

.section-hero__title {
  margin: 0.4rem 0 1rem;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-hero__lead {
  max-width: 60ch;
  font-size: 0.9rem;
  line-height: 1.7;
  opacity: 0.8;
}

/* Short laptop screens (e.g. 1366x768): half the padding, so content starts on the first screen */
@media (min-width: 600.02px) and (max-height: 800px) {
  .section-hero {
    padding: 2.2rem 1rem 2rem;
  }

  .section-hero__title {
    margin: 0.3rem 0 0.7rem;
  }
}

/* Phones: two-line title, tighter band */
@media (max-width: 600px) {
  .section-hero {
    padding: 2.5rem 1rem 2rem;
  }

  /* .md-typeset h1 sets 2rem; match its specificity to shrink it here */
  .md-typeset .section-hero__title {
    margin: 0.3rem 0 0.7rem;
    font-size: 1.5rem;
  }

  .section-hero__lead {
    font-size: 0.8rem;
    line-height: 1.6;
  }
}

/* ============================================================
   ARTICLE LAYOUT (overrides/main.html): header, quotes, footer
   ============================================================ */
.md-typeset .article-hero {
  margin: 0 0 2rem;
  padding: 2rem 2rem 1.6rem;
  background: var(--band-bg);
  border-radius: 8px;
}

/* Optional cover picture across the top of the header panel */
.md-typeset .article-hero__cover {
  display: block;
  width: calc(100% + 4rem);
  max-width: none;
  height: 12rem;
  margin: -2rem -2rem 1.6rem;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
}

/* Framed cover (cover_ratio set): the photo's chosen portion, centered over a blurred copy */
.md-typeset .article-hero__cover--framed {
  position: relative;
  height: 9.5rem;
  overflow: hidden;
}

.md-typeset .article-hero__cover--framed::before {
  content: "";
  position: absolute;
  inset: -20px;
  background: var(--cover) center / cover no-repeat;
  filter: blur(18px) brightness(0.8);
}

.md-typeset .article-hero__cover--framed img {
  position: relative;
  display: block;
  height: 100%;
  max-width: 100%;
  margin: 0 auto;
  object-fit: cover;
  /* Fade the photo's sides into the blurred copy so there's no hard seam */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

@media (max-width: 600px) {
  .md-typeset .article-hero__cover {
    width: calc(100% + 2.4rem);
    height: 9rem;
    margin: -1.5rem -1.2rem 1.3rem;
  }

  /* Too narrow to frame: the chosen portion fills the width at its own shape */
  .md-typeset .article-hero__cover--framed {
    height: auto;
  }

  .md-typeset .article-hero__cover--framed img {
    width: 100%;
    height: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.md-typeset .article-hero__title {
  margin: 0.4rem 0 0.7rem;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--md-default-fg-color);
}

.md-typeset .article-hero__lead {
  max-width: 60ch;
  margin: 0 0 1.2rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--md-default-fg-color--light);
}

/* Justified, unlike article paragraphs (which stay ragged-right) */
.md-content .md-typeset p.article-hero__lead {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.md-typeset .article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
}

.md-typeset .article-meta__avatar {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
}

.md-typeset ul.article-tags:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.md-typeset ul.article-tags li {
  margin: 0;
  padding: 0.2rem 0.6rem;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.58rem;
  color: var(--art-ink);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 999px;
}

/* The post header already shows author, date, categories and reading time;
   the blog sidebar keeps only its "Back to index" link */
.md-sidebar--post .md-post__authors,
.md-sidebar--post .md-post__meta {
  display: none;
}

/* Blog post: breadcrumbs and article stacked in the column beside the post sidebar */
.md-post__column {
  flex-grow: 1;
  min-width: 0;
}

/* Blog posts keep their `#` title (the blog list builds card titles from it);
   on the post page the generated header already shows it */
.md-typeset .article-hero + h1 {
  display: none;
}

.md-typeset .article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.3rem;
}

.md-typeset .article-actions a.home-btn {
  padding: 0.6em 1em;
  font-size: 0.66rem;
}

/* Quiet quotes on articles: italic with a thin accent line, not the green block */
body:has(.article-hero) .md-content .md-typeset blockquote {
  padding: 0.1rem 0 0.1rem 1rem;
  background: none;
  box-shadow: none;
  border: 0 !important;
  border-left: 2px solid var(--md-accent-fg-color) !important;
  font-style: italic;
  color: var(--md-default-fg-color--light);
}

body:has(.article-hero) .md-content .md-typeset blockquote::before {
  display: none;
}

.md-typeset .article-end {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--card-line);
}

.md-typeset .article-author {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1.2rem;
  align-items: center;
}

.md-typeset .article-author__photo {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
}

.md-typeset .article-author .home-eyebrow {
  margin-bottom: 0.2rem;
}

.md-typeset .article-author__name {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.md-typeset .article-author__bio {
  margin: 0.2rem 0 0.4rem;
  font-size: 0.75rem;
  color: var(--md-default-fg-color--light);
}

.md-typeset .article-author__link {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

.md-typeset .article-author__link::after {
  content: " ›";
}

@media (max-width: 600px) {
  .md-typeset .article-hero {
    padding: 1.5rem 1.2rem 1.3rem;
  }
}

/* Short laptop screens: a slimmer header and cover */
@media (min-width: 600.02px) and (max-height: 800px) {
  .md-typeset .article-hero {
    margin-bottom: 1.2rem;
    padding: 1.2rem 1.6rem 1.1rem;
  }

  .md-typeset .article-hero__cover {
    width: calc(100% + 3.2rem);
    height: 6.5rem;
    margin: -1.2rem -1.6rem 1rem;
  }

  .md-typeset .article-hero__cover--framed {
    height: 6.5rem;
  }

  .md-typeset .article-hero__title {
    margin: 0.3rem 0 0.5rem;
    font-size: 1.5rem;
  }

  .md-typeset .article-hero__lead {
    margin-bottom: 0.9rem;
  }
}

/* ============================================================
   BLOG INDEX: the plugin's post excerpts styled as cards
   ============================================================ */
.md-typeset .blog-list__label {
  margin: 3rem 0 1rem;
}

.md-content article.md-post--excerpt {
  max-width: 46rem;
  margin: 0 0 1.25rem;
  padding: 1.5rem 1.6rem 1.4rem;
  background: var(--card-bg);
  border: 1px solid var(--card-line);
  border-radius: 6px;
  transition: background-color 0.2s, border-color 0.2s;
}

.md-content article.md-post--excerpt:hover {
  background: var(--card-hover);
  border-color: var(--md-primary-fg-color);
}

.md-post--excerpt .md-post__header {
  margin-bottom: 0.4rem;
}

.md-post--excerpt .md-meta__list {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.md-typeset.md-post__content h2 {
  margin: 0 0 0.7rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.md-typeset.md-post__content h2 a.toclink {
  color: inherit;
}

.md-typeset.md-post__content h2 a.toclink:hover {
  color: var(--md-typeset-a-color, var(--md-primary-fg-color));
}

.md-typeset.md-post__content > p {
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--md-default-fg-color--light);
}

/* A quiet quote in the card, not the article's full green block */
.md-typeset.md-post__content blockquote {
  margin: 0 0 0.8rem;
  padding: 0 0 0 0.8rem;
  background: none;
  box-shadow: none;
  /* !important to beat the article quote's dark-mode border */
  border: 0 !important;
  border-left: 2px solid var(--md-accent-fg-color) !important;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--md-default-fg-color--light);
}

.md-typeset.md-post__content blockquote::before {
  display: none;
}

.md-typeset.md-post__content blockquote p {
  margin: 0;
}

.md-typeset .md-post__action {
  margin-top: 0.6rem;
}

.md-typeset .md-post__action a {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--md-typeset-a-color, var(--md-primary-fg-color));
}

.md-typeset .md-post__action a::after {
  content: " ›";
}

/* Project grid */
.project-sections {
  padding: 2rem 0;
}

.project-section {
  margin-bottom: 3rem;
}

.project-section .home-eyebrow {
  margin-bottom: 1rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.md-typeset .project-card__body {
  flex: 1;
  padding: 1.6rem 1.6rem 0;
}

.md-typeset .project-card__title {
  margin: 0 0 0.8rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}

.md-typeset .project-card__desc {
  margin: 0 0 1.4rem;
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--md-default-fg-color--light);
}

.md-typeset .project-card__footer {
  padding: 0 1.6rem 1.5rem;
}

.md-typeset .project-card__cta {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--md-primary-fg-color);
}

.md-typeset .project-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.project-tag--java    { background: rgba(234,106,56,0.12); color: #ea6a38; border-color: rgba(234,106,56,0.25); }
.project-tag--spring  { background: rgba(109,179,63,0.12); color: #6db33f; border-color: rgba(109,179,63,0.25); }
.project-tag--jee     { background: rgba(234,106,56,0.12); color: #ea6a38; border-color: rgba(234,106,56,0.25); }
.project-tag--go      { background: rgba(0,173,216,0.12); color: #00add8; border-color: rgba(0,173,216,0.25); }
.project-tag--fabric  { background: rgba(0,100,180,0.12); color: #0064b4; border-color: rgba(0,100,180,0.25); }
.project-tag--python  { background: rgba(55,118,171,0.12); color: #3776ab; border-color: rgba(55,118,171,0.25); }
.project-tag--flask   { background: rgba(150,150,150,0.12); color: var(--md-default-fg-color--light); border-color: rgba(150,150,150,0.25); }
.project-tag--js      { background: rgba(247,223,30,0.12); color: #b8960c; border-color: rgba(247,223,30,0.3); }
.project-tag--node    { background: rgba(68,136,62,0.12); color: #44883e; border-color: rgba(68,136,62,0.25); }
.project-tag--react   { background: rgba(97,218,251,0.12); color: #087ea4; border-color: rgba(97,218,251,0.3); }
.project-tag--html    { background: rgba(227,76,38,0.12); color: #e34c26; border-color: rgba(227,76,38,0.25); }
.project-tag--css     { background: rgba(38,77,228,0.12); color: #264de4; border-color: rgba(38,77,228,0.25); }
.project-tag--mkdocs  { background: rgba(79,166,155,0.12); color: #4fa69b; border-color: rgba(79,166,155,0.25); }
.project-tag--powerbi { background: rgba(243,151,0,0.12); color: #f39700; border-color: rgba(243,151,0,0.25); }

/* Section 2: text-only cards, Wiley-style */
.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.2rem;
}

.md-typeset a.home-card,
.md-typeset a.home-mini-card,
.md-typeset a.project-card {
  display: flex;
  flex-direction: column;
  color: var(--md-default-fg-color);
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--card-line);
  border-radius: 6px;
  transition: background-color 0.2s, border-color 0.2s;
}

.md-typeset a.home-card:hover,
.md-typeset a.home-mini-card:hover,
.md-typeset a.project-card:hover {
  background: var(--card-hover);
  border-color: var(--md-primary-fg-color);
}

.home-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.6rem 1.6rem 1.5rem;
}

.md-typeset .home-card__body h3 {
  margin: 0 0 0.8rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}

.md-typeset .home-card__body p {
  margin: 0 0 1.2rem;
  font-size: 0.75rem;
  line-height: 1.65;
  text-align: left;
}

/* Per-card accent: icon, underline and link (Percona-style) */
.home-card--cs  { --card-accent: #0E7A60; }
.home-card--c   { --card-accent: #2563EB; }
.home-card--lab { --card-accent: #C2410C; }

[data-md-color-scheme="slate"] .home-card--cs  { --card-accent: #34D399; }
[data-md-color-scheme="slate"] .home-card--c   { --card-accent: #60A5FA; }
[data-md-color-scheme="slate"] .home-card--lab { --card-accent: #FB923C; }

.home-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 1.1rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--card-accent) 12%, transparent);
}

.home-card__icon svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: var(--card-accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The accent line sits on the link (which is pinned to the card bottom), so lines and
   links align across cards whatever the text length */
.md-typeset .home-card[class*="home-card--"] .home-card__link::before {
  content: "";
  display: block;
  width: 55%;
  height: 2px;
  margin: 0 0 1.4rem;
  background: var(--card-accent);
  opacity: 0.7;
}

.home-card[class*="home-card--"] .home-card__link {
  color: var(--card-accent);
}

.md-typeset a.home-card[class*="home-card--"]:hover {
  border-color: var(--card-line);
  box-shadow: inset 0 3px 0 var(--card-accent), 0 8px 28px rgba(0, 0, 0, 0.12);
}

[data-md-color-scheme="slate"] .md-typeset a.home-card[class*="home-card--"]:hover {
  border-color: var(--card-line);
  box-shadow: inset 0 3px 0 var(--card-accent), 0 8px 28px rgba(0, 0, 0, 0.4);
}

.home-card__link {
  display: block;
  margin-top: auto;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--art-ink);
}

.home-card__link::after {
  content: " ›";
}

/* Section 3: intro + art, then the latest notes */
.home-journey {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1rem 2.5rem;
  align-items: center;
}

.md-typeset .home-journey__quote {
  margin: 0.9rem 0 1.1rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--md-accent-fg-color);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.5;
  text-align: left;
  color: var(--md-default-fg-color);
}

.home-journey__art svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ============================================================
   ABOUT: home band and /about/ page
   ============================================================ */
.home-about {
  display: grid;
  grid-template-columns: minmax(0, 15rem) 1fr;
  gap: 1.5rem 3rem;
  align-items: center;
}

.home-about__photo,
.about__photo {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--card-line);
  border-radius: 6px;
}

/* Lift the shaded waterfall photo so it doesn't sink into the dark band */
.home-about__photo {
  filter: brightness(1.1) contrast(1.05) saturate(1.05);
}

.md-typeset .home-about__text .home-section__lead {
  margin-bottom: 1.6rem;
}

.about {
  display: grid;
  grid-template-columns: minmax(0, 20rem) 1fr;
  gap: 2rem 3.5rem;
  align-items: start;
  padding-block: 3.5rem 4rem;
}

.about__photo {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
  /* Fit the viewport, or a tall photo scrolls out from under the header */
  max-height: calc(100vh - var(--header-height) - 3rem);
  object-fit: cover;
  object-position: center 60%;
}

.md-typeset .about__text {
  max-width: 62ch;
}

.md-typeset .about__text .home-eyebrow {
  margin-top: 2.2rem;
}

.md-typeset .about__text .home-eyebrow:first-child {
  margin-top: 0;
}

.md-typeset .about__text p {
  font-size: 0.85rem;
  line-height: 1.75;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.about__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

@media (max-width: 760px) {
  .home-about,
  .about {
    grid-template-columns: 1fr;
  }

  .home-about__photo,
  .about__photo {
    position: static;
    max-width: 18rem;
  }
}

.home-journey__art {
  padding: 1rem;
  background: var(--art-bg);
  border-radius: 14px;
}

.home-mini-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
}

.md-typeset a.home-mini-card {
  overflow: hidden;
}

/* Section pages: a few mini-cards under a hero, not stretched edge to edge */
.home-mini-cards--section {
  margin-top: 2.5rem;
  max-width: 420px;
}

/* Social-card image band. A card with its own post image sets --card-image
   (1200x630 in docs/assets/posts/); otherwise it shows a still, zoomed crop of the
   mode's photo, positioned with --card-pos / --card-pos-dark. */
.home-mini-card__image {
  display: block;
  height: 4.5rem;
  background: var(--book-image) var(--card-pos, center) / 260% auto no-repeat;
  border-bottom: 1px solid var(--card-line);
}

.home-mini-card__image[style*="--card-image"],
[data-md-color-scheme="slate"] .home-mini-card__image[style*="--card-image"] {
  /* --card-focus picks which part of the image the short band shows */
  background: var(--card-image) var(--card-focus, center) / cover no-repeat;
}

/* Each photo is laid out differently, so a card can pick its own crop per photo */
html[data-light-photo="library"] [data-md-color-scheme="default"] .home-mini-card__image:not([style*="--card-image"]) {
  background-position: var(--card-pos-library, var(--card-pos, center));
}

[data-md-color-scheme="slate"] .home-mini-card__image {
  background-position: var(--card-pos-dark, var(--card-pos, center));
}

.home-mini-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.3rem 1.2rem;
}

.home-mini-card__text {
  margin-bottom: 0.6rem;
  font-size: 0.7rem;
  line-height: 1.55;
  color: var(--md-default-fg-color--light);
}

.home-mini-card__kicker {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--art-ink);
}

.home-mini-card__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
}

@media (max-width: 760px) {
  .home-journey {
    grid-template-columns: 1fr;
  }
}

/* Code-styled card art */
.art-line path {
  fill: none;
  stroke: var(--art-ink);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.art-node circle,
.art-box rect {
  fill: var(--md-default-bg-color);
  stroke: var(--art-ink);
  stroke-width: 2;
}

.art-dots circle {
  fill: var(--art-ink);
  opacity: 0.35;
}

.art-text text,
.art-caption text,
.art-code text {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.art-text text {
  fill: var(--md-default-fg-color);
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
}

.art-caption text {
  fill: var(--md-default-fg-color--light);
  font-size: 9px;
  text-anchor: middle;
}

.art-code text {
  fill: var(--md-default-fg-color);
  font-size: 10px;
}

.art-code--lg text {
  font-size: 13px;
}

.art-accent {
  fill: var(--art-ink);
  font-weight: 700;
}

.art-string {
  fill: var(--art-string);
}

.art-cursor {
  fill: var(--art-ink);
  animation: art-blink 1.1s steps(2, start) infinite;
}

@keyframes art-blink {
  to { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .art-cursor {
    animation: none;
  }
}

/* ============================================================
   HOME BANDS: alternating full-width backgrounds, like chapters
   ============================================================ */
.home-band {
  position: relative;
  background: var(--band-bg);
  /* Bleed the background to both screen edges */
  box-shadow: 0 0 0 100vmax var(--band-bg);
  clip-path: inset(0 -100vmax);
}

/* Bands don't need the divider line between sections */
.home-band,
.home-band + .home-section {
  border-top: none !important;
}

/* Dark band: the same night tones in both modes, so it always reads as a chapter break */
.home-band--dark {
  --band-bg: #11161D;
  --md-default-bg-color: #161C24;
  --md-default-fg-color: #E6EDF3;
  --md-default-fg-color--light: rgba(230, 237, 243, 0.68);
  --md-default-fg-color--lightest: rgba(230, 237, 243, 0.12);
  /* Dark bands use the bright accent in both modes; the deep light-mode one vanishes here */
  --md-accent-fg-color: #6EE7B7;
  --art-bg: #1A212B;
  --art-ink: #34D399;
  --art-string: #FBBF24;
  color: var(--md-default-fg-color);
}

[data-md-color-scheme="slate"] .home-band--dark {
  --band-bg: #0D1117;
}

/* Closing band: deep green, edge to edge, right before the photo footer */
.home-cta {
  isolation: isolate;
  padding-block: 6rem;
  text-align: center;
  background: none;
  box-shadow: none;
  clip-path: none;
  --art-ink: #86EFAC;
}

/* A solid brand-green band (the footer below owns the photo), reaching both screen edges */
.home-cta::before {
  content: "";
  position: absolute;
  inset: 0 -100vmax;
  z-index: -1;
  background:
    radial-gradient(60% 120% at 50% 0%, rgba(52, 211, 153, 0.18), transparent 70%),
    #063F31;
}

.md-typeset .home-cta__title {
  margin: 0 0 1.6rem;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.1;
  color: #F8FAF9;
}

/* The closing band sits flush on the footer */
body:has(#hero-title) .md-content__inner {
  padding-bottom: 0 !important;
}

/* About: one line per country, the flag stands in for the bullet */
.md-typeset ul.about__dishes {
  list-style: none;
  margin-left: 1.25rem;
  font-size: 0.75rem;
  line-height: 1.75;
}

.md-typeset ul.about__dishes li {
  margin-left: 0;
}

/* SVG flags: Windows has no flag emoji and shows "KM", "MA"… instead */
.md-typeset .about__flag {
  display: inline-block;
  width: 23px;
  height: 14px;
  object-fit: contain;
  object-position: left center;
  margin-right: 0.35em;
  vertical-align: -0.2em;
}
