:root {
  --bg: #fbfaf9;
  --text: #1c1917;
  --accent: #0645ad;
  --surface: #fff;
  --rule: rgba(28, 25, 23, 0.16);
  --target: rgba(6, 69, 173, 0.08);
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --measure: 40rem;
  --space: 1rem;
}

html[data-theme="dark"] {
  --bg: #141210;
  --text: #f4f1ee;
  --accent: #8eb6ff;
  --surface: #221f1c;
  --rule: rgba(244, 241, 238, 0.18);
  --target: rgba(142, 182, 255, 0.16);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  padding: 2.75rem 1.25rem 4.5rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

header,
main,
footer {
  max-width: var(--measure);
  margin-inline: auto;
}

header {
  margin-bottom: 3rem;
  text-align: center;
}

h1,
h2,
h3,
.lede {
  text-wrap: balance;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 7vw, 2.25rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

h2 {
  margin: 3rem 0 0.65rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

main > section:first-of-type h2 {
  margin-top: 0;
}

h3 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

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

a:hover {
  text-decoration-thickness: 0.14em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

a.portrait {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
  border-radius: 50%;
}

a.portrait img {
  display: block;
  width: 168px;
  height: 168px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--rule);
}

.contacts {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 0 0 1rem;
}

.contacts a {
  display: inline-flex;
  color: var(--text);
  line-height: 0;
  text-decoration: none;
}

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

.contacts svg,
.theme svg {
  width: 22px;
  height: 22px;
}

.theme {
  position: fixed;
  top: max(0.9rem, env(safe-area-inset-top));
  right: max(0.9rem, env(safe-area-inset-right));
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
  line-height: 0;
}

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

html[data-theme="dark"] .theme-moon,
html:not([data-theme="dark"]) .theme-sun {
  display: none;
}

html[data-theme="dark"] .logos img {
  filter: invert(1) hue-rotate(180deg);
}

.lede,
.looking,
.contact {
  margin-bottom: 1rem;
}

.contact {
  margin-bottom: 0;
}

ol,
ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

li {
  margin: 0 0 0.75rem;
}

li:last-child {
  margin-bottom: 0;
}

.pub-links {
  white-space: nowrap;
}

.top {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
}

main section {
  scroll-margin-top: 1.25rem;
}

main section:target {
  border-radius: 2px;
  box-shadow: 0 0 0 0.7rem var(--target);
}

main img {
  display: block;
  width: 100%;
  max-height: 18rem;
  object-fit: cover;
  margin: 0 0 1rem;
  border-radius: 6px;
  border: 1px solid var(--rule);
}

.logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin: 0 0 1.15rem;
}

.logos img {
  width: auto;
  height: 2.6rem;
  max-width: 13rem;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: contain;
}

.logos img.wordmark {
  height: 1.15rem;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0 0 1rem;
}

.pair picture {
  margin: 0;
  height: 9.5rem;
}

.pair img {
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  object-fit: cover;
}

.pair img.noborder {
  border: 0;
}

.reel {
  position: relative;
  container-type: inline-size;
  margin: 0 0 1.25rem;
}

.reel-viewport {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0.25rem 0 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.reel-viewport::-webkit-scrollbar {
  display: none;
}

.reel-viewport:focus-visible {
  outline-offset: 2px;
}

.reel-slide {
  flex: 0 0 62%;
  min-width: 0;
  scroll-snap-align: center;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.reel-slide.is-active {
  opacity: 1;
  cursor: auto;
}

.reel-slide video,
.reel-logos {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  background: #111;
}

.reel-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--rule);
}

.reel-logos img {
  width: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.reel-logos > img {
  height: clamp(2rem, 7cqw, 2.9rem);
}

.reel-isambard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: #002f5f;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.reel-isambard img {
  height: clamp(2.2rem, 8cqw, 3.2rem);
}

.reel-slide p {
  margin: 0;
  padding: 0.7rem 0.85rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.reel-arrow {
  position: absolute;
  top: calc(0.25rem + 62cqw * 9 / 32);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity 0.2s ease;
}

.reel-arrow svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reel-arrow:hover {
  color: var(--accent);
}

.reel-arrow:disabled {
  opacity: 0;
  pointer-events: none;
}

.reel-prev {
  left: -0.6rem;
}

.reel-next {
  right: -0.6rem;
}

.reel-dots {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.reel-dot {
  position: relative;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.reel-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(28, 25, 23, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, background 0.25s ease;
}

html[data-theme="dark"] .reel-dot::after {
  background: rgba(244, 241, 238, 0.35);
}

.reel-dot[aria-current="true"]::after {
  width: 1.25rem;
  background: var(--accent);
}

@media (max-width: 560px) {
  .reel-slide {
    flex-basis: 82%;
  }

  .reel-arrow {
    top: calc(0.25rem + 82cqw * 9 / 32);
  }

  .reel-prev {
    left: 0.25rem;
  }

  .reel-next {
    right: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reel-slide,
  .reel-dot::after {
    transition: none;
  }
}

img.full {
  max-height: none;
  height: auto;
  object-fit: contain;
}

img.product {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 6.5rem;
  margin-right: auto;
  margin-left: auto;
  object-fit: contain;
  border: 0;
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0 0 1rem;
}

.card,
.card:visited {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 8.5rem;
  padding: 0.8rem;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--rule);
  color: #fbfaf9;
  text-decoration: none;
}

.card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  opacity: 0.55;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(28, 25, 23, 0.84), rgba(28, 25, 23, 0.28) 62%);
}

.card.stack {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 0;
  padding: 0.4rem 0.4rem 0.7rem;
  color: var(--text);
  background: var(--surface);
}

.card.stack img {
  position: static;
  height: auto;
  opacity: 1;
  object-fit: contain;
  border-radius: 3px;
}

.card.stack::after {
  content: none;
}

.card.stack span {
  padding-top: 0.55rem;
  color: var(--text);
}

.card span {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
}

footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

@media (max-width: 40rem) {
  header .lede,
  header .looking,
  header .contact {
    text-align: left;
  }

  .pub-links {
    white-space: normal;
  }

  h2 {
    margin-top: 2.5rem;
  }
}

@media (min-width: 48rem) {
  body {
    padding: 4.5rem 2rem 5rem;
    font-size: 19px;
  }

  a.portrait img {
    width: 192px;
    height: 192px;
  }

  .lede a {
    white-space: nowrap;
  }
}
