/* Hand-maintained stylesheet. There is no sass build: edit this file directly.
   The look: the house style (sand paper, ink, phthalo green, Newsreader + Libre Franklin, ruled cards) over the
   blurred beach of the 2022 site, with its illustrated tab icons, grain bar and custom cursor. Light only.
   Bootstrap still does the tabs, carousels and dialogs; this file overrides its look. */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("../fonts/libre-franklin-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------- tokens (house-style/tokens.json) */
:root {
  --ground: #e8e1cf;
  --panel: #f1ebda;
  --panel-2: #dcd4bf;
  --field: #f5f0e2;
  --paper-light: #faf6ea;
  --reverse: #f5f0e2;
  --ink: #2b3129;
  --ink-2: #4e5346;
  --ink-3: #565b4b;
  --line: #a9a88c;
  --line-soft: #cac6ac;
  --accent: #14453a;
  --accent-soft: #cfdbd0;
  --accent-ink: #0f3b31;
  --warn: #6f5416;
  --warn-soft: #e9ddbb;
  --terracotta: #b5654d;
  --moss-soft: #e1e5d4;
  --mineral: #d5e2df;
  --moss-line: #798b77;
  --gold: #edc767;               /* contact icons on the green, brighter than the 2022 gold */
  --nav: #14453a;
  --nav-edge: #0f3b31;
  --nav-shadow: 0 8px 20px rgba(15, 30, 25, 0.28);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --r: 5px;
  --r-sm: 3px;
  --ctl: 44px;
  --gap: 20px;
  --head-h: 6rem;                /* every card head is this tall: the rules under the titles line up */
  /* card tints: sage, sand, sea, paper */
  --t-sage: var(--moss-soft);
  --e-sage: var(--moss-line);
  --t-sand: var(--warn-soft);
  --e-sand: color-mix(in srgb, var(--warn) 45%, var(--warn-soft));
  --t-sea: var(--mineral);
  --e-sea: var(--moss-line);
  --t-paper: var(--panel);
  --e-paper: var(--line);
  color-scheme: light;
}

/* ---------------------------------------------------------------- base */
/* the scrollbar's room is always kept, so a long tab (Projects) never shifts the page sideways */
html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--serif);
  cursor: url("../images/cursor.png"), default;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent-ink);
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  color: var(--ink);
}
p {
  margin: 0 0 0.75em;
}
code {
  font-family: var(--sans);
  font-size: 0.9375em;
  color: var(--accent-ink);
}
li::marker {
  color: var(--terracotta);
}
.eyebrow {
  font: 600 0.8125rem/1.3 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 4px;
}

/* the beach: the 2022 video, blurred (it looked pixelated sharp), under a thin sand veil */
#myVideo {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  filter: blur(8px) saturate(1.05);
  transform: scale(1.06);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(232, 225, 207, 0.2);
  pointer-events: none;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--gap) 28px;
}

/* ---------------------------------------------------------------- name banner */
.nameplate {
  display: inline-block;
  margin: 20px 0 16px;
  padding: 18px 26px 16px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--r);
}
.nameplate h1 {
  font-size: 2.75rem;
}
.nameplate .lede {
  margin: 4px 0 0;
  max-width: 30rem;
  color: var(--ink-2);
  font-size: 1rem;
}

/* ---------------------------------------------------------------- the green bar (2022 grain) */
.bar {
  position: sticky;
  top: 8px;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px;
  background: var(--nav);
  border: 1px solid var(--nav-edge);
  border-radius: var(--r);
  box-shadow: var(--nav-shadow);
}
.bar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: url("../images/grain.png");
  opacity: 0.22;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.tabs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tabs > li {
  display: flex;
}
.tabs .tab {
  width: 100%;
}
.bar .tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  margin: 0;
  padding: 6px 16px 6px 8px;
  font: 600 0.9375rem/1.2 var(--sans);
  color: var(--ink);
  text-decoration: none;
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  touch-action: manipulation;
}
.bar .tab img {
  width: 40px;
  height: 40px;
}
.bar .tab:hover {
  background: var(--field);
  color: var(--ink);
}
.bar .tab.active {
  background: var(--ground);
  border-color: var(--terracotta);
  box-shadow: inset 0 -3px 0 var(--terracotta);
}
.tab .short,
.tab .ext {
  display: none;
}
.tab .nt {
  font-weight: 400;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- panes and cards */
.tab-content > .tab-pane.active {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
  gap: var(--gap);
  align-items: stretch;
}
.card {
  --t: var(--t-paper);
  --e: var(--e-paper);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0;
  color: var(--ink);
  background: var(--t);
  border: 2px solid var(--e);
  border-radius: var(--r);
  font-size: 1rem;
  line-height: 1.55;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.card.sage { --t: var(--t-sage); --e: var(--e-sage); }
.card.sand { --t: var(--t-sand); --e: var(--e-sand); }
.card.sea { --t: var(--t-sea); --e: var(--e-sea); }
.card-head {
  min-height: var(--head-h);     /* taller only when the text is set bigger (a phone's font size, zoom) */
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  border-bottom: 2px solid var(--e);
}
.card-head h3 {
  font-size: 1.375rem;
}
.card-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 16px 20px 18px;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.card-content ul {
  margin: 0 0 12px;
  padding-left: 1.2em;
}
.card-content li {
  margin-bottom: 4px;
}
.card .sub {
  color: var(--ink-2);
}
.arrows {
  display: flex;
  gap: 8px;
}
.arrow {
  display: grid;
  place-items: center;
  width: var(--ctl);
  height: var(--ctl);
  padding: 0;
  color: var(--reverse);
  background: var(--nav);
  border: 1px solid var(--nav-edge);
  border-radius: var(--r-sm);
  cursor: pointer;
  touch-action: manipulation;
}
.arrow svg {
  width: 22px;
  height: 22px;
}
.arrow:hover {
  background: var(--accent-ink);
}

/* a card's own link (the live site, a write-up, GitHub): an outlined button */
.card-link {
  align-self: center;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--ctl);
  margin: 8px auto 0;
  padding: 0 18px;
  font: 600 0.9375rem var(--sans);
  color: var(--accent);
  text-decoration: none;
  background: transparent;
  border: 2px solid var(--accent);
  border-radius: var(--r-sm);
  cursor: pointer;
  touch-action: manipulation;
}
.card-link:hover {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.card-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
}
.card-links .card-link {
  margin: 8px 0 0;
}

/* hover: a card notices the pointer (a ring); one whose carousel moves on by itself also grows a little and
   stands still meanwhile (main.js). No enlargement with reduced motion or while its viewer is open. */
@media (hover: hover) {
  .card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
  }
  .card.has-motion:hover {
    transform: scale(1.01);
  }
}
.card.has-motion:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
body.modal-open .card.has-motion,
.card.has-motion:has(.modal.show) {
  transform: none;
}

/* ---------------------------------------------------------------- Personal: a bento */
.card .bio p:last-child {
  margin-bottom: 0;
}
@media (min-width: 1200px) {
  .tab-content > #personal.active {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto;
  }
  #personal .bio-card { grid-row: 1 / 3; }
  #personal .skills-card { grid-column: 2 / 4; }
}
@media (min-width: 761px) and (max-width: 1199px) {
  .tab-content > #personal.active {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #personal .bio-card,
  #personal .skills-card { grid-column: 1 / -1; }
}

/* skills: each slide is a small bento of category panels; familiarity sets the form, one form per row:
   Daily = square tiles, Solid = logo chips, Familiar = small dashed chips. Every chip links to the tool's site. */
.slides {
  display: grid;
}
.slide {
  grid-area: 1 / 1;
  visibility: hidden;            /* stacked: the card is as tall as its tallest slide and never jumps */
}
.slide.on {
  visibility: visible;
}
.skills-card {
  container-type: inline-size;
}
.cluster {
  display: grid;
  grid-template-columns: var(--cols, 1fr 1fr);
  gap: 10px;
  align-content: start;
}
@container (max-width: 740px) {
  .cluster {
    grid-template-columns: minmax(0, 1fr);
  }
}
.group {
  min-width: 0;
  padding: 10px 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.group h4 {
  margin: 0 0 8px;
  font: 600 0.9375rem var(--sans);
  color: var(--ink-2);
}
.card-content ul.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}
.card-content ul.skills:last-child {
  margin-bottom: 0;
}
.skills > li {
  display: flex;
  margin: 0;
}
.skill {
  display: flex;
  align-items: center;
  margin: 0;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--r-sm);
  font: 600 0.875rem/1.15 var(--sans);
  white-space: nowrap;
}
a.skill:hover {
  color: var(--ink);
  background: var(--field);
  border-color: var(--accent);
  border-style: solid;
}
.skill .ico {
  flex: none;
  background: var(--brand);
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
}
.skill img.ico {
  background: none;
  -webkit-mask: none;
  mask: none;
  object-fit: contain;
}
.skill img.flag {
  width: 24px;
  height: 15px;
  object-fit: cover;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
}
.skills.k3 {
  gap: 5px;
}
.k3 .skill {
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 5.75rem;
  height: 5.5rem;
  padding: 4px 2px;
  background: var(--paper-light);
  border: 1px solid var(--line);
  line-height: 1.1;
  white-space: normal;
  text-align: center;
}
.k3 .ico {
  width: 40px;
  height: 40px;
}
.k2 .skill {
  gap: 7px;
  min-height: 2.25rem;
  padding: 0 11px 0 9px;
  background: var(--paper-light);
  border: 1px solid var(--line-soft);
}
.k2 .ico {
  width: 20px;
  height: 20px;
}
.k1 .skill {
  gap: 5px;
  min-height: 1.75rem;
  padding: 0 8px;
  font-weight: 400;
  color: var(--ink-2);
  border: 1px dashed var(--line);
}
.k1 .ico {
  width: 14px;
  height: 14px;
}
/* links inside the skills card stay 44 px tall to the touch (house rule) without looking taller */
@media (pointer: coarse), (max-width: 760px) {
  .k2 .skill, .k1 .skill { min-height: var(--ctl); }
}
.group .cert {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.45;
}
.group .cert:last-child {
  margin: 0;
}
.skills-foot {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font: 400 0.875rem var(--sans);
  color: var(--ink-3);
}
.skills-foot p {
  margin: 0;
}
.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  display: inline-block;
  border-radius: 2px;
}
.legend .s3 { width: 16px; height: 15px; background: var(--paper-light); border: 1px solid var(--line); }
.legend .s2 { width: 18px; height: 9px; background: var(--paper-light); border: 1px solid var(--line-soft); }
.legend .s1 { width: 14px; height: 7px; border: 1px dashed var(--line); }

/* contact: deep green with the grain, gold icons */
.card.contact-card {
  --e: var(--nav-edge);
  position: relative;
  background: var(--nav);
}
.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: url("../images/grain.png");
  opacity: 0.22;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.contact-card .card-head {
  position: relative;
  border-bottom-color: rgba(237, 199, 103, 0.35);
}
.contact-card h3 {
  color: var(--reverse);
}
.contact-card .eyebrow {
  color: var(--gold);
}
@media (hover: hover) {
  .card.contact-card:hover {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold);
  }
}
.contact {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: auto 0;
}
.contact a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 12px;
  color: var(--reverse);
  text-decoration: none;
  font: 600 0.9375rem var(--sans);
  background: rgba(245, 240, 226, 0.06);
  border: 1px solid rgba(237, 199, 103, 0.45);
  border-radius: var(--r);
}
.contact a:hover {
  color: var(--reverse);
  border-color: var(--gold);
  background: rgba(237, 199, 103, 0.12);
}
.contact svg,
.contact .gh {
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--gold);
}
.contact .gh {
  background: var(--gold);
  -webkit-mask: url("../images/github.svg") center / contain no-repeat;
  mask: url("../images/github.svg") center / contain no-repeat;
}

/* ---------------------------------------------------------------- Work and Projects: tall, capped cards */
@media (min-width: 761px) {
  .tab-content > #work-experience.active {
    grid-auto-rows: clamp(24rem, calc(100vh - var(--chrome, 300px) - 24px), 34rem);
    grid-auto-rows: clamp(24rem, calc(100svh - var(--chrome, 300px) - 24px), 34rem);
  }
  .tab-content > #projects.active {
    grid-auto-rows: clamp(26rem, calc(100vh - var(--chrome, 300px) - 24px), 32rem);
    grid-auto-rows: clamp(26rem, calc(100svh - var(--chrome, 300px) - 24px), 32rem);
  }
}
.tab-content > #cv.active {
  grid-template-columns: minmax(0, 1fr);
}
.card.resume .card-head {
  grid-template-columns: minmax(0, 1fr) auto;
}
.resume-actions {
  display: flex;
  gap: 8px;
}
.resume-actions .card-link {
  margin: 0;
}
#cv-iframe {
  width: 100%;
  min-height: 85vh;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
}

/* ---------------------------------------------------------------- carousels inside cards */
.carousel-inner {
  display: grid;
}
.carousel-item {
  display: block;
  grid-area: 1 / 1;
  float: none;
  margin-right: 0;
  visibility: hidden;
}
.carousel-item.active,
.carousel-item-next,
.carousel-item-prev {
  visibility: visible;
}
/* a slide shorter than the tallest one sits in the middle of the space */
.carousel-inner > .carousel-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* screenshots: picture buttons that open the full-screen viewer */
.carousel-item > button {
  display: block;
  margin: 0 0 10px;
  padding: 0;
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: zoom-in;
}
.carousel-item > button:hover,
.carousel-item > button:focus-visible {
  border-color: var(--accent);
}
.carousel-item > button img {
  display: block;
  width: 100%;
  height: auto;
}
/* several screenshots: two across */
.carousel-inner > .carousel-item:has(> button + button) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  align-content: center;
}
.carousel-inner > .carousel-item:has(> button + button) > button {
  margin: 0;
}
/* phone screenshots (portrait, whole screens) side by side at a phone-like width */
.carousel-inner > .carousel-item.phone-shots:has(> button + button) {
  grid-template-columns: repeat(2, minmax(0, 8.5rem));
  justify-content: center;
}
/* fitted by main.js: the column count and width that show the pictures largest in the card's room */
.card .carousel-inner > .carousel-item.fit {
  display: grid;
  grid-template-columns: var(--fit-cols);
  justify-content: center;
  align-content: center;
  gap: 10px;
}
.card .carousel-inner > .carousel-item.fit > button {
  margin: 0;
}
.skills-card .card-content {
  touch-action: pan-y;      /* a sideways swipe is ours (main.js), up and down still scroll the page */
}
/* videos: 16:9, the card's width */
.card iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
/* changing slide: the old one fades out, then the new one fades in (never one over the other) */
.carousel-fade .carousel-item {
  transition: opacity 0.3s ease;
}
.carousel-fade .active.carousel-item-start,
.carousel-fade .active.carousel-item-end {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.carousel-fade .carousel-item-next.carousel-item-start,
.carousel-fade .carousel-item-prev.carousel-item-end {
  transition: opacity 0.3s ease 0.3s;
}

/* ---------------------------------------------------------------- full-screen picture viewer
   Edge to edge on paper: the picture takes all the room above a green bar (the site's own bar) that holds
   previous | title, "3 of 8" and the zoom hint | next; the close square floats in the top corner. */
.modal.fullscreen-image-modal .modal-dialog {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
}
.modal.fullscreen-image-modal .modal-content {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "picture" "bar";
  color: var(--ink);
  background: var(--ground);
  border: 0;
  border-radius: 0;
  touch-action: manipulation;
}
.modal.fullscreen-image-modal .modal-body {
  grid-area: picture;
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  /* the top strip keeps the close square off the picture */
  padding: calc(max(10px, env(safe-area-inset-top)) + 54px) max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
  touch-action: none;
}
.modal.fullscreen-image-modal .modal-body img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  user-select: none;
  -webkit-user-drag: none;
}
.modal.fullscreen-image-modal .modal-body img {
  cursor: zoom-in;
}
.modal.fullscreen-image-modal .modal-body.zoomed img {
  cursor: grab;
}
.modal.fullscreen-image-modal .modal-body.zoomed img:active {
  cursor: grabbing;
}
.modal.fullscreen-image-modal .modal-header {
  grid-area: bar;
  position: static;
  display: grid;
  grid-template-columns: var(--ctl) minmax(0, 1fr) var(--ctl);
  align-items: center;
  gap: 10px;
  padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: var(--nav);
  border: 0;
  border-top: 1px solid var(--nav-edge);
  border-radius: 0;
}
.viewer-text {
  grid-column: 2;
  min-width: 0;
  text-align: center;
}
.modal.fullscreen-image-modal .modal-title {
  margin: 0;
  color: var(--reverse);
  font: 500 1.125rem/1.25 var(--serif);
}
.viewer-sub {
  margin: 2px 0 0;
  color: var(--accent-soft);
  font: 400 0.875rem/1.3 var(--sans);
}
.gallery-count {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gallery-count::after {
  content: "  ·  ";
  white-space: pre;
}
.touch-only { display: none; }
@media (hover: none) {
  .touch-only { display: inline; }
  .mouse-only { display: none; }
}
.gallery-nav {
  display: grid;
  place-items: center;
  width: var(--ctl);
  height: var(--ctl);
  padding: 0;
  color: var(--ink);
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  touch-action: manipulation;
  cursor: pointer;
}
.gallery-nav svg {
  width: 22px;
  height: 22px;
}
.gallery-nav:hover {
  background: var(--field);
}
.gallery-prev { grid-column: 1; grid-row: 1; }
.gallery-next { grid-column: 3; grid-row: 1; }
.modal.fullscreen-image-modal .btn-close {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 3;
  width: var(--ctl);
  height: var(--ctl);
  min-width: var(--ctl);
  min-height: var(--ctl);
  margin: 0;
  padding: 0;
  background-color: var(--panel);
  background-size: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  opacity: 1;
  box-shadow: 0 4px 12px rgba(15, 30, 25, 0.25);
  touch-action: manipulation;
}
.modal.fullscreen-image-modal .btn-close:hover {
  background-color: var(--field);
}
.modal.fullscreen-image-modal .btn-close:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 2px;
  box-shadow: none;
}
/* phones: the picture runs edge to edge; the title may take two lines */
@media (max-width: 760px) {
  .modal.fullscreen-image-modal .modal-body {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 8px;
  }
  .modal.fullscreen-image-modal .modal-body img {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }
  .modal.fullscreen-image-modal .modal-title {
    font-size: 1rem;
  }
}

/* ---------------------------------------------------------------- accessibility */
/* fixed: it shows where the reader is, also when Tab wraps round from the bottom of a long page */
.skip-link {
  position: fixed;
  left: 12px;
  top: -10rem;
  z-index: 2000;
  min-height: var(--ctl);
  padding: 10px 14px;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: var(--r-sm);
  font: 600 0.9375rem var(--sans);
}
.skip-link:focus {
  top: 12px;
}
#main:focus {
  outline: none;
}
a:focus-visible, button:focus-visible, [tabindex]:focus-visible, iframe:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 2px;
  box-shadow: none;
}
/* the sticky bar must not cover what a link or Tab moves to */
main section, main li, main a, main button {
  scroll-margin-top: 7rem;
}
@media (forced-colors: active) {
  .bar .tab.active { outline: 3px solid CanvasText; outline-offset: -3px; }
  .card { border-color: CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .card.has-motion:hover { transform: none; }
}

/* tablets and small laptops: compact tiles, all five on one row */
@media (min-width: 761px) and (max-width: 1099px) {
  .tabs {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .bar {
    gap: 8px;
  }
  .bar .tab {
    gap: 8px;
    padding: 6px 12px 6px 6px;
  }
  .bar .tab img {
    width: 32px;
    height: 32px;
  }
}

/* ---------------------------------------------------------------- phones (and phones on their side):
   banner on top, the tab bar at the bottom, five equal tiles; the Blog tile carries a corner badge */
@media (max-width: 760px), (max-height: 500px) and (orientation: landscape) {
  body {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }
  .bar {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    gap: 4px;
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-width: 1px 0 0;
    border-radius: 0;
    box-shadow: 0 -6px 16px rgba(15, 30, 25, 0.25);
  }
  .tabs {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }
  .bar > .tab {
    flex: 0 0 calc((100% - 16px) / 5);    /* the same width as each of the four tabs */
  }
  .bar .tab {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 64px;
    padding: 6px 2px;
    font-size: 0.875rem;
    text-align: center;
  }
  .bar .tab img {
    width: 30px;
    height: 30px;
  }
  .tab .long,
  .tab .nt {
    display: none;
  }
  .tab .short {
    display: inline;
  }
  .tab .ext {
    position: absolute;
    top: 3px;
    right: 3px;
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
    color: var(--reverse);
    background: var(--accent);
    border-radius: var(--r-sm);
  }
  .tab .ext svg {
    width: 11px;
    height: 11px;
  }
  main section, main li, main a, main button {
    scroll-margin-top: 1rem;
    scroll-margin-bottom: 6rem;
  }
}
@media (max-width: 760px) {
  :root {
    --head-h: 5.25rem;
    --gap: 14px;
  }
  .shell {
    padding: 14px 14px 20px;
  }
  .nameplate {
    display: block;
    margin: 0 0 14px;
    padding: 10px 14px;
  }
  .nameplate h1 {
    font-size: 1.75rem;
  }
  .nameplate .lede {
    display: none;
  }
  .tab-content > .tab-pane.active {
    grid-template-columns: minmax(0, 1fr);
  }
  .card-content {
    overflow: visible;
  }
  .card-head {
    padding: 8px 14px;
  }
  .card-content {
    padding: 12px 14px 16px;
  }
  .card-head h3 {
    font-size: 1.25rem;
  }
  .cluster {
    grid-template-columns: minmax(0, 1fr);
  }
  .card.resume .card-head {
    height: auto;
    padding: 12px 14px;
    grid-template-columns: minmax(0, 1fr);
  }
}
/* 400 % zoom (320 px): the tab words fit without the pictures */
@media (max-width: 359px) {
  .bar .tab img {
    display: none;
  }
  .bar .tab {
    min-height: 48px;
  }
}
/* a phone on its side: one low row (the bar stays under 15 % of the height) */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }
  .bar .tab {
    flex-direction: row;
    gap: 6px;
    min-height: var(--ctl);
    padding: 2px 6px;
  }
  .bar .tab img {
    width: 24px;
    height: 24px;
  }
  .bar {
    padding-top: 4px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
  }
}
