html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ---- Portfolio theme ------------------------------------------------ */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  background-image: url('/img/hero-collage.jpg');
  background-size: cover;
  background-position: center;
  color: #eef2f7;
  border-radius: 16px;
  overflow: hidden;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11,17,26,.92) 0%, rgba(11,17,26,.80) 45%, rgba(11,17,26,.62) 100%);
}
.hero-inner { position: relative; z-index: 1; padding: 4rem 2rem; width: 100%; }
.hero .text-muted { color: #c4ccda !important; }
.hero .hero-role { color: #9db0c4; }
.hero .hero-pitch { max-width: 40ch; }
.btn-hero-primary { background: #56a0e3; color: #0b111a; font-weight: 600; }
.btn-hero-primary:hover, .btn-hero-primary:focus { background: #6fb0ea; color: #0b111a; }
.btn-hero-ghost { border: 1px solid rgba(238,242,247,.45); color: #eef2f7; font-weight: 600; }
.btn-hero-ghost:hover, .btn-hero-ghost:focus { border-color: #eef2f7; color: #eef2f7; }
@media (max-width: 600px) {
  .hero-scrim { background: rgba(11,17,26,.86); }
}

.experience-item {
  border-left: 3px solid #2b3242;
  padding: .25rem 0 .25rem 1rem;
  margin-bottom: 1.25rem;
}

.closing-cta {
  background: linear-gradient(160deg, #1f2430 0%, #2b3242 100%);
  color: #f3f5f9;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
}
.closing-cta .text-muted { color: #c4ccda !important; }
.closing-cta a:not(.btn) { color: #e7ebf2; }

.project-card {
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  padding: 1.25rem;
  background: #fff;
  transition: box-shadow .12s ease, transform .12s ease;
}
.project-card:hover { box-shadow: 0 6px 18px rgba(31,36,48,.12); transform: translateY(-2px); }

.project-card-link { cursor: pointer; }

.badge {
  background: #2b3242;
  color: #fff;
  font-weight: 500;
  margin: 0 .15rem .3rem 0;
}

.footer { background: #f7f8fa; }

/* ---- Project detail page -------------------------------------------- */
.project-hero {
  background: linear-gradient(160deg, #1f2430 0%, #2b3242 100%);
  color: #f3f5f9;
  border-radius: 16px;
  padding: 2.5rem 2rem;
}
.project-hero .text-muted { color: #c4ccda !important; }
.project-hero .lead { color: #e7ebf2; }

.feature-card {
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: #fff;
}

.project-aside {
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  background: #f7f8fa;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.screenshot { margin: 0; }
.screenshot img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid #e6e8ec;
  display: block;
}
.screenshot figcaption { margin-top: .35rem; }

/* ---- Screenshot carousel -------------------------------------------- */
.project-carousel {
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  overflow: hidden;
  background: #12151c;
}
.project-carousel img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
/* Bootstrap's control icons are white on white here; give them a scrim so they
   stay visible over a bright frame and stay unobtrusive over a dark one. */
.project-carousel .carousel-control-prev,
.project-carousel .carousel-control-next { width: 12%; opacity: 0; transition: opacity .15s ease; }
.project-carousel:hover .carousel-control-prev,
.project-carousel:hover .carousel-control-next,
.project-carousel .carousel-control-prev:focus-visible,
.project-carousel .carousel-control-next:focus-visible { opacity: 1; }
.project-carousel .carousel-control-prev-icon,
.project-carousel .carousel-control-next-icon {
  background-color: rgba(11,17,26,.65);
  border-radius: 50%;
  padding: 1.1rem;
  background-size: 45%;
}

/* Only the active caption is shown; site.js swaps the class on slide. */
.carousel-captions { margin-top: .6rem; min-height: 3.2em; }
.carousel-caption-item { display: none; font-size: .9rem; color: #6b7280; margin: 0; }
.carousel-caption-item.active { display: block; }
.carousel-counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-size: .78rem;
  font-weight: 600;
  color: #9aa3b1;
  margin-right: .5rem;
}
.carousel-fullsize { margin-left: .4rem; white-space: nowrap; font-size: .82rem; }

/* Indicators below the frame rather than floating over the image. */
.carousel-indicators-below {
  display: flex;
  gap: .4rem;
  justify-content: center;
  margin-top: .7rem;
}
.carousel-indicators-below button {
  width: 28px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: #cfd4dc;
  cursor: pointer;
  transition: background .15s ease;
}
.carousel-indicators-below button:hover { background: #9aa3b1; }
.carousel-indicators-below button.active { background: #2b3242; }

.screenshot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  border: 2px dashed #cfd4dc;
  border-radius: 10px;
  color: #9aa3b1;
  background: repeating-linear-gradient(
    45deg, #f7f8fa, #f7f8fa 12px, #f1f3f6 12px, #f1f3f6 24px);
  font-size: .85rem;
}

/* ---- Technical diary ------------------------------------------------ */
/* Cards on the project page. Same plate as .feature-card, plus the hover
   affordance of .project-card, because these ones go somewhere. */
.tech-card {
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: #fff;
  cursor: pointer;
  transition: box-shadow .12s ease, transform .12s ease, border-color .12s ease;
}
.tech-card:hover {
  border-color: #cfd8e6;
  box-shadow: 0 6px 18px rgba(31,36,48,.12);
  transform: translateY(-2px);
}

.tech-hero {
  background: linear-gradient(160deg, #1f2430 0%, #2b3242 100%);
  color: #f3f5f9;
  border-radius: 16px;
  padding: 2.5rem 2rem;
}
.tech-hero .lead { color: #e7ebf2; }
.tech-eyebrow {
  color: #9db0c4;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* The entry body. Everything below is generated by Markdig, so it is styled by
   element rather than by class. */
/* Prose is capped at a comfortable measure, but figures are NOT — a diagram or a
   dense console shot squeezed into 68ch scales its labels below legibility, so
   they get the full column.

   Headings are left uncapped on purpose: their rule spans the full column and
   reads as a section divider. (Capping them in `ch` would not have done what it
   looks like anyway — `ch` resolves against the element's OWN font size, so 68ch
   on an h2 is half again as wide as 68ch on a paragraph.) */
.tech-article { max-width: none; }
.tech-article > p,
.tech-article > ul,
.tech-article > ol,
.tech-article > blockquote,
.tech-article > table { max-width: 68ch; }
.tech-article h2 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
  margin-bottom: .75rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid #e6e8ec;
}
.tech-article h3 {
  font-size: 1.1rem;
  margin-top: 1.75rem;
  margin-bottom: .6rem;
}
.tech-article p, .tech-article li { line-height: 1.7; }
.tech-article > p:first-child { font-size: 1.05rem; }
.tech-article ul, .tech-article ol { margin-bottom: 1.1rem; }
.tech-article li { margin-bottom: .35rem; }

/* A pulled-out claim — the one-line statement of a decision, or the rule a
   section generalises to. */
.tech-article blockquote {
  border-left: 3px solid #56a0e3;
  background: #f7f9fc;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
  padding: .9rem 1.1rem;
}
.tech-article blockquote p:last-child { margin-bottom: 0; }

.tech-article code {
  background: #f1f3f6;
  border-radius: 4px;
  padding: .1rem .3rem;
  font-size: .875em;
  color: #1f2430;
}
.tech-article pre {
  background: #1f2430;
  color: #e7ebf2;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}
.tech-article pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: .85rem;
}

/* Tables can be wider than the measure, so they scroll inside their own box
   rather than pushing the page sideways. */
.tech-article table {
  width: 100%;
  margin: 1.25rem 0;
  border-collapse: collapse;
  font-size: .9rem;
  display: block;
  overflow-x: auto;
}
.tech-article th, .tech-article td {
  border-bottom: 1px solid #e6e8ec;
  padding: .5rem .7rem;
  text-align: left;
  vertical-align: top;
}
.tech-article th {
  background: #f7f8fa;
  font-weight: 600;
  white-space: nowrap;
}

/* Diagrams are inline SVG committed with the entry: no runtime dependency, and
   they stay sharp at any zoom. The figure caption is the alt text's neighbour,
   not its replacement — the SVG carries its own <title>. */
.tech-article figure {
  margin: 1.75rem 0;
}
.tech-article figure svg,
.tech-article .tech-diagram svg {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #e6e8ec;
  border-radius: 10px;
  background: #fff;
}
.tech-article figcaption {
  margin-top: .5rem;
  font-size: .85rem;
  color: #6b7280;
}

/* Screenshots of the dev console are wide and dense — full-bleed to the column,
   and clickable through to the original. */
.tech-article figure.tech-shot img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #e6e8ec;
  border-radius: 10px;
  background: #12151c;
}

/* A diagram or a dense screenshot scaled to a phone puts its labels below
   legibility, so below the measure it keeps a readable width and scrolls inside
   its own box instead — the page itself must never scroll sideways. */
@media (max-width: 640px) {
  .tech-diagram,
  .tech-shot {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tech-diagram svg { min-width: 560px; }
  .tech-shot img { min-width: 640px; }
  .tech-diagram figcaption,
  .tech-shot figcaption { position: sticky; left: 0; }
}
.tech-article figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #e6e8ec;
  border-radius: 10px;
}
.tech-article > p > img {
  max-width: 100%;
  height: auto;
  border: 1px solid #e6e8ec;
  border-radius: 10px;
}

/* Placeholder for a diagram or shot that is specified but not yet drawn, so a
   gap in the assets reads as deliberate instead of broken. */
.tech-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 150px;
  padding: 1rem;
  border: 2px dashed #cfd4dc;
  border-radius: 10px;
  color: #9aa3b1;
  background: repeating-linear-gradient(
    45deg, #f7f8fa, #f7f8fa 12px, #f1f3f6 12px, #f1f3f6 24px);
  font-size: .85rem;
}

.tech-stub {
  border: 1px solid #e6e8ec;
  border-left: 3px solid #cfd4dc;
  border-radius: 0 10px 10px 0;
  background: #f7f8fa;
  padding: 1.1rem 1.25rem;
  color: #6b7280;
}

.tech-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e6e8ec;
}
.tech-nav > div { flex: 1 1 0; min-width: 0; }
.tech-nav a { text-decoration: none; display: block; }
.tech-nav a:hover .tech-nav-title { text-decoration: underline; }
.tech-nav-dir {
  display: block;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b7280;
}
.tech-nav-title { font-weight: 600; }