:root {
  --bg: #15110d;
  --bg-soft: #1d1712;
  --panel: #261b13;
  --panel-2: #302116;
  --text: #f5e7d0;
  --muted: #b99a75;
  --faint: #6f5136;
  --accent: #d98938;
  --accent-2: #c95724;
  --line: #5b3a24;
  --shadow: #070504;
  --radius: 8px;
  --font-pixel: 'Press Start 2P', monospace;
  --font-mono: 'IBM Plex Mono', monospace;
  --sprite-owlet-idle: url("spirte resources/craftpix-net-622999-free-pixel-art-tiny-hero-sprites/2 Owlet_Monster/Owlet_Monster_Idle_4.png");
}

body.profile-film {
  --accent: #df765b;
  --accent-2: #a9434e;
  --muted: #c6a29b;
  --faint: #70474a;
  --line: #633238;
  --panel: #26171a;
  --panel-2: #342025;
  background:
    radial-gradient(circle at 78% 12%, rgba(169, 67, 78, 0.2), transparent 26rem),
    radial-gradient(circle at 10% 0%, rgba(223, 118, 91, 0.14), transparent 24rem),
    linear-gradient(180deg, #18100f 0%, #150e0e 44%, #100a0b 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 78% 12%, rgba(201, 87, 36, 0.18), transparent 26rem),
    radial-gradient(circle at 10% 0%, rgba(217, 137, 56, 0.16), transparent 24rem),
    linear-gradient(180deg, #18120e 0%, #15110d 44%, #110d0a 100%);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background:
    radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.34)),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 4px);
}

::selection {
  background: var(--accent);
  color: #1a1009;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(18px, 5vw, 64px);
  background: rgba(21, 17, 13, 0.88);
  border-bottom: 1px solid rgba(217, 137, 56, 0.22);
  backdrop-filter: blur(10px);
}

.brand,
.section-label,
h1,
h2,
h3,
.btn,
.header-link {
  font-family: var(--font-pixel);
}

.brand {
  color: var(--accent);
  font-size: 14px;
  margin-right: 8px;
}

.site-nav {
  display: flex;
  gap: 20px;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  white-space: nowrap;
}

.site-nav a,
.header-link {
  color: var(--muted);
  font-size: 12px;
}

.site-nav a {
  font-family: var(--font-mono);
  font-weight: 600;
}

.site-nav a.active,
.site-nav a:hover,
.header-link:hover {
  color: var(--accent);
}

.header-link {
  border: 1px solid var(--line);
  padding: 8px 11px;
  background: rgba(38, 27, 19, 0.6);
}

/* Mobile menu: the toggle only shows under 900px (see the media query below). */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 11px;
  color: var(--muted);
  background: rgba(38, 27, 19, 0.6);
  border: 1px solid var(--line);
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
  cursor: pointer;
}

.menu-toggle:hover,
.menu-toggle[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

.site-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: calc(100vh - 68px);
  max-height: calc(100dvh - 68px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-soft);
  border-top: 1px solid rgba(217, 137, 56, 0.22);
  border-bottom: 2px solid var(--line);
  box-shadow: 0 8px 0 rgba(7, 5, 4, 0.72);
  animation: menu-drop 160ms steps(4);
}

body.profile-film .site-menu {
  background: #1d1213;
}

.site-menu-nav {
  display: flex;
  flex-direction: column;
  padding: 6px 0 10px;
}

.site-menu-nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 clamp(18px, 5vw, 64px);
  color: var(--text);
  border-left: 4px solid transparent;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
}

.site-menu-nav a + a {
  border-top: 1px solid rgba(217, 137, 56, 0.12);
}

.site-menu-nav a:hover,
.site-menu-nav a:focus-visible {
  color: var(--accent);
  background: rgba(48, 33, 22, 0.9);
}

.site-menu-nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

@keyframes menu-drop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.site-menu-nav a:focus-visible {
  outline-offset: -4px;
}

.profile-switcher {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 2px;
  background: rgba(38, 27, 19, 0.72);
  border: 1px solid var(--line);
}

.profile-tab {
  padding: 7px 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-family: var(--font-pixel);
  font-size: 8px;
  cursor: pointer;
}

.profile-tab.is-active,
.profile-tab:hover {
  color: #170f09;
  background: var(--accent);
}

[hidden] {
  display: none !important;
}

.profile-panel {
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto;
}

.profile-panel:not(.is-active) {
  display: none;
}

.profile-anchor {
  display: block;
  height: 0;
}

main {
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto;
}

.section {
  padding: clamp(72px, 10vw, 118px) 0;
}

.narrow {
  max-width: 820px;
}

.hero {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: clamp(34px, 7vw, 86px);
  align-items: center;
}

.eyebrow,
.section-label {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 18px;
}

h1 {
  margin: 0 0 24px;
  font-size: clamp(34px, 6vw, 70px);
  line-height: 1.18;
  color: #ffe6bd;
  text-shadow: 5px 5px 0 rgba(87, 48, 23, 0.9);
}

h2 {
  margin: 0 0 24px;
  font-size: clamp(21px, 3vw, 34px);
  line-height: 1.45;
  color: #ffe6bd;
}

h3 {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.7;
  color: #ffe0af;
}

.hero-lead,
.contact-copy,
.prose {
  max-width: 660px;
  color: var(--text);
  font-size: clamp(17px, 2vw, 20px);
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 16px;
  color: var(--text);
  background: rgba(48, 33, 22, 0.88);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 var(--shadow);
  font-size: 9px;
  cursor: pointer;
}

.btn.primary {
  color: #170f09;
  background: var(--accent);
  border-color: var(--accent);
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--shadow);
}

.profile-card {
  margin: 0;
  border: 2px solid rgba(217, 137, 56, 0.34);
  background: var(--panel);
  box-shadow: 12px 12px 0 var(--shadow);
  overflow: hidden;
}

.profile-card img {
  width: 100%;
  aspect-ratio: 1 / 1.15;
  object-fit: cover;
  object-position: 50% 36%;
  image-rendering: pixelated;
}

.prose p {
  margin: 0 0 18px;
}

.section-intro-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}

.section-intro-row h2 {
  margin-bottom: 14px;
}

.section-intro-row .prose {
  margin: 0;
  font-size: 16px;
}

.video-grid,
.research-links {
  display: grid;
  gap: 18px;
}

.video-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.video-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  color: inherit;
}

.video-card:hover {
  color: inherit;
  border-color: rgba(217, 137, 56, 0.7);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  background: #100c09;
  border-bottom: 1px solid rgba(217, 137, 56, 0.26);
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms steps(4);
}

.video-card:hover .video-thumb img {
  transform: scale(1.04);
}

.video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #170f09;
  background: var(--accent);
  border: 2px solid #ffe0af;
  box-shadow: 4px 4px 0 rgba(7, 5, 4, 0.8);
  transform: translate(-50%, -50%);
}

.video-play svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.video-body {
  padding: 18px 20px 20px;
}

.video-body h3 {
  margin: 0;
  color: #ffe0af;
}

.video-meta {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.research-links {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.research-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 110px;
  color: inherit;
}

.research-link:hover {
  color: inherit;
  border-color: rgba(217, 137, 56, 0.7);
}

.research-mark {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #170f09;
  background: var(--accent);
  font-family: var(--font-pixel);
  font-size: 8px;
  line-height: 1;
}

.research-copy {
  min-width: 0;
  flex: 1;
}

.research-copy h3 {
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}

.research-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.research-arrow {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2;
}

.film-hero .hero-lead {
  max-width: 700px;
}

.film-profile-card figcaption {
  padding: 13px 16px 15px;
  color: var(--muted);
  background: var(--panel-2);
  border-top: 1px solid rgba(223, 118, 91, 0.28);
  font-size: 12px;
  line-height: 1.5;
}

.film-credit-grid,
.film-archive-grid,
.film-process-grid {
  display: grid;
  gap: 18px;
}

.film-credit-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.film-credit {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.film-credit-thumb {
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  background: #100a0b;
  border: 1px solid rgba(223, 118, 91, 0.24);
}

.film-credit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film-credit h3 {
  margin-bottom: 12px;
}

.film-credit p:not(.video-meta) {
  margin: 0;
  color: var(--text);
}

.film-archive-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.film-process-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 30px 0;
}

.film-process-step {
  display: grid;
  gap: 7px;
  padding: 18px;
  background: rgba(52, 32, 37, 0.72);
  border-left: 4px solid var(--accent);
}

.film-process-step strong {
  color: #ffe0af;
  font-family: var(--font-pixel);
  font-size: 10px;
}

.film-process-step span {
  color: var(--muted);
  font-size: 14px;
}

.film-technical-note {
  margin-top: 24px;
}

.timeline,
.project-grid,
.skills-list {
  display: grid;
  gap: 18px;
}

.project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.skills-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  background: linear-gradient(180deg, rgba(48, 33, 22, 0.96), rgba(34, 24, 17, 0.98));
  border: 1px solid rgba(217, 137, 56, 0.26);
  box-shadow: 6px 6px 0 var(--shadow);
  padding: clamp(20px, 3vw, 28px);
}

.project {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  border-top: 3px solid var(--accent);
}

.feature-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.feature-card p:not(.feature-kicker):not(.feature-facts) {
  margin: 0 0 18px;
}

.feature-facts {
  margin: auto 0 0;
  padding-top: 14px;
  color: var(--muted);
  border-top: 1px dashed rgba(217, 137, 56, 0.32);
  font-size: 13px;
  line-height: 1.55;
}

.feature-card .panel-actions {
  margin-top: 14px;
}

.panel-summary {
  margin: 12px 0 0;
}

.contribution-log {
  margin-top: 10px;
}

.contribution-log summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: #ffd18e;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.contribution-log summary::-webkit-details-marker {
  display: none;
}

.contribution-log summary::before {
  content: '+';
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #170f09;
  background: var(--accent);
  font-family: var(--font-pixel);
  font-size: 9px;
  line-height: 1;
}

.contribution-log[open] summary::before {
  content: '-';
}

.contribution-log summary:hover {
  color: var(--accent);
}

.contribution-log ul {
  margin-top: 6px;
}

.panel code {
  overflow-wrap: anywhere;
}

.publications {
  margin-bottom: 18px;
}

.pub-list li {
  margin-bottom: 12px;
}

.item-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  column-gap: 18px;
  align-items: baseline;
}

.item-top span,
.muted,
.tags,
.contact-note,
footer {
  color: var(--muted);
}

.panel ul {
  margin: 16px 0 0;
  padding-left: 20px;
}

.panel li {
  margin-bottom: 8px;
}

.project p,
.skills-list p {
  margin: 0;
}

.project .tags {
  margin-top: 18px;
  font-size: 13px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.project .panel-actions {
  margin-top: auto;
  padding-top: 18px;
}

.text-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  color: #ffd18e;
  border-bottom: 1px solid rgba(217, 137, 56, 0.65);
  font-weight: 700;
  line-height: 1.4;
}

.text-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.text-link.inline {
  display: inline;
}

.highlight-list {
  display: grid;
  gap: 12px;
}

.highlight {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 16px 18px;
  background: rgba(38, 27, 19, 0.78);
  border-left: 4px solid var(--accent);
}

.highlight b {
  color: #ffe0af;
}

.contact-section {
  max-width: 850px;
}

footer {
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 36px 0 100px;
  border-top: 1px solid rgba(217, 137, 56, 0.2);
  font-size: 14px;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
}

.reveal.on {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 320ms steps(4), transform 320ms steps(4);
}

.hidden {
  display: none !important;
}

/* BIT assistant */
#pet-wrap {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 880;
}

#pet-cv {
  display: block;
  width: 82px;
  height: 82px;
  image-rendering: pixelated;
  cursor: pointer;
  filter: drop-shadow(3px 3px 0 var(--shadow));
  animation: pet-bob 1.8s steps(2) infinite;
}

#pet-cv:hover {
  animation-duration: 0.6s;
}

#pet-cv.flip {
  animation-name: pet-bob-flip;
}

@keyframes pet-bob {
  50% { transform: translateY(-3px); }
}

@keyframes pet-bob-flip {
  0%, 100% { transform: scaleX(-1) translateY(0); }
  50% { transform: scaleX(-1) translateY(-3px); }
}

.pet-heart,
.pet-zzz {
  position: absolute;
  bottom: 70px;
  pointer-events: none;
}

.pet-heart {
  color: #ffad75;
  animation: fx-rise 1s steps(7) forwards;
}

.pet-zzz {
  color: var(--muted);
  font-family: var(--font-pixel);
  font-size: 9px;
  animation: fx-rise 2s steps(10) forwards;
}

@keyframes fx-rise {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-44px); }
}

#pet-bubble {
  pointer-events: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: max-content;
  max-width: 270px;
  padding: 11px 13px;
  color: var(--text);
  background: var(--panel);
  border: 2px solid var(--accent);
  box-shadow: 4px 4px 0 var(--shadow);
  font-size: 12.5px;
  line-height: 1.5;
}

#pet-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 28px;
  border: 6px solid transparent;
  border-top-color: var(--accent);
}

#pet-chat {
  position: fixed;
  right: 18px;
  bottom: 94px;
  z-index: 890;
  width: min(380px, calc(100vw - 28px));
  background: var(--panel);
  border: 2px solid var(--accent);
  box-shadow: 8px 8px 0 var(--shadow);
  display: flex;
  flex-direction: column;
}

.pet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  color: #ffe0af;
  background: var(--panel-2);
  border-bottom: 1px solid rgba(217, 137, 56, 0.28);
  font-family: var(--font-pixel);
  font-size: 8px;
}

.pet-head button {
  width: 24px;
  height: 24px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
}

#pet-log {
  height: 300px;
  max-height: 42vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  font-size: 13.5px;
  line-height: 1.55;
}

.pet-msg {
  max-width: 88%;
  padding: 9px 12px;
  border: 1px solid rgba(217, 137, 56, 0.22);
  white-space: pre-wrap;
  word-break: break-word;
}

.pet-msg.user {
  align-self: flex-end;
  color: #1a1009;
  background: var(--accent);
}

.pet-msg.bot {
  align-self: flex-start;
  background: #1a120d;
}

.pet-msg.err {
  color: #ff9c75;
  border-color: var(--accent-2);
}

.pet-msg.typing::after {
  content: '|';
  animation: blink 0.8s steps(2) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

#pet-form {
  display: flex;
  border-top: 1px solid rgba(217, 137, 56, 0.28);
}

#pet-in {
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 14px;
  caret-color: var(--accent);
}

#pet-send {
  padding: 0 18px;
  color: #1a1009;
  background: var(--accent);
  border: none;
  font-family: var(--font-pixel);
  font-size: 8px;
  cursor: pointer;
}

#pet-send:disabled {
  color: var(--muted);
  background: var(--faint);
  cursor: wait;
}

@media (max-width: 1240px) {
  .site-header {
    gap: 16px;
  }

  .site-nav {
    gap: 12px;
  }
}

@media (max-width: 900px) {
  .site-header {
    gap: 14px;
  }

  .site-nav {
    display: none;
  }

  .site-header > .header-link {
    margin-left: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .header-link,
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 82px;
  }

  .profile-card {
    max-width: 440px;
  }

  .project-grid,
  .featured-grid,
  .skills-list,
  .video-grid,
  .film-credit-grid,
  .film-archive-grid {
    grid-template-columns: 1fr;
  }

  .research-links {
    grid-template-columns: minmax(0, 1fr);
  }

  .highlight {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .section-intro-row {
    align-items: start;
    flex-direction: column;
  }

  .film-process-grid {
    grid-template-columns: 1fr;
  }

  /* Long inline code in blog posts (blog.css sets nowrap) must wrap on narrow screens. */
  .post-body :not(pre) > code {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (min-width: 901px) {
  .site-menu {
    display: none !important;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 15px;
  }

  main,
  footer {
    width: min(100vw - 28px, 1120px);
  }

  .site-header {
    height: 60px;
    padding: 0 14px;
  }

  .profile-tab {
    padding-inline: 7px;
    font-size: 7px;
  }

  .header-link,
  .menu-toggle {
    padding-inline: 9px;
    font-size: 8px;
  }

  .site-header {
    gap: 10px;
  }

  .site-menu {
    max-height: calc(100vh - 60px);
    max-height: calc(100dvh - 60px);
  }

  .site-menu-nav a {
    padding-inline: 14px;
  }

  .hero-actions,
  .contact-actions {
    display: grid;
  }

  .btn {
    width: 100%;
  }


  #pet-wrap {
    right: 8px;
    bottom: 8px;
  }

  #pet-cv {
    width: 48px;
    height: 48px;
  }

  #pet-chat {
    right: 12px;
    bottom: 68px;
  }

  #pet-bubble {
    max-width: min(250px, calc(100vw - 90px));
  }
}

@media (max-width: 360px) {
  .site-header {
    gap: 8px;
  }

  .brand {
    margin-right: 0;
  }

  .header-link,
  .menu-toggle {
    padding-inline: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

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

  .site-menu {
    animation: none;
  }
}

/* Certificates gallery: letters are portrait, so show their top. */
.cert-thumb {
  background: #f4efe6;
}

.cert-thumb img {
  object-position: top center;
}

.view-count {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.75;
}
