/* ==========================================================================
   Malcolm Zartman — portfolio stylesheet
   One scrolling page with a YouTube-familiar system: Roboto, neutral grays,
   pill buttons, rounded 16:9 thumbnails, filter chips.
   Dark by default; light when the visitor's system prefers it.
   ========================================================================== */

:root {
  --bg: #0f0f0f;
  --bg-raised: #181818;
  --surface: #272727;
  --surface-hover: #3f3f3f;
  --line: #303030;
  --text: #f1f1f1;
  --text-2: #aaaaaa;
  --link: #3ea6ff;
  --pill-bg: #f1f1f1;
  --pill-text: #0f0f0f;
  --badge-bg: rgba(0, 0, 0, 0.8);
  --badge-text: #ffffff;
  --scrim: rgba(0, 0, 0, 0.7);
  --masthead-bg: rgba(15, 15, 15, 0.92);

  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --page: 80rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --radius-thumb: 12px;
  --radius-card: 16px;

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
   {
    --bg: #ffffff;
    --bg-raised: #f9f9f9;
    --surface: #f2f2f2;
    --surface-hover: #e5e5e5;
    --line: #e5e5e5;
    --text: #0f0f0f;
    --text-2: #606060;
    --link: #065fd4;
    --pill-bg: #0f0f0f;
    --pill-text: #ffffff;
    --scrim: rgba(0, 0, 0, 0.55);
    --masthead-bg: rgba(255, 255, 255, 0.92);
    color-scheme: light;
  }
}

/* --- Reset ------------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html:has(dialog[open]) {
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
}

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

button {
  font: inherit;
  color: inherit;
}

a {
  color: var(--link);
}

h1,
h2,
h3 {
  line-height: 1.25;
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-text);
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

/* --- Pills, chips, tags -------------------------------------------------- */

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0 1.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.pill:hover {
  background: var(--surface-hover);
}

.pill-primary,
.pill-primary:hover {
  background: var(--pill-bg);
  color: var(--pill-text);
}

.pill-primary:hover {
  opacity: 0.88;
}

.pill svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.chips {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0 0 0.25rem;
  list-style: none;
  scrollbar-width: none;
}

.chip {
  min-height: 32px;
  padding: 0 0.8rem;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.chip:hover {
  background: var(--surface-hover);
}

.chip[aria-pressed="true"] {
  background: var(--pill-bg);
  color: var(--pill-text);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 500;
}

/* --- Masthead ------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--masthead-bg);
  backdrop-filter: blur(12px);
}

.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  min-height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.site-nav ul {
  display: flex;
  gap: 0.25rem;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="true"] {
  background: var(--surface);
  color: var(--text);
}

@media (max-width: 760px) {
  .masthead .wrap {
    flex-wrap: wrap;
    padding-block: 0.5rem;
  }

  .site-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav a {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
  }

  html {
    scroll-padding-top: 7rem;
  }
}

/* --- Sections ------------------------------------------------------------- */

.section {
  padding-block: clamp(3rem, 7vw, 5rem);
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 2rem;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-sub {
  margin-top: 0.35rem;
  color: var(--text-2);
}

/* --- Hero ----------------------------------------------------------------- */

.hero .wrap {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding-block: clamp(2.5rem, 7vw, 5rem);
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1fr auto;
    gap: 4rem;
  }
}

.hero h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.hero .lede {
  max-width: 48ch;
  margin-bottom: 1.25rem;
  color: var(--text-2);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
}

.hero .lede strong {
  color: var(--text);
  font-weight: 500;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.75rem;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 0.925rem;
}

.facts strong {
  color: var(--text);
  font-weight: 500;
}

.hero-photo {
  width: clamp(180px, 26vw, 280px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
}

@media (max-width: 899px) {
  .hero-photo {
    order: -1;
    width: 140px;
  }
}

/* --- Experience ----------------------------------------------------------- */

.employers {
  display: grid;
  gap: 1.25rem;
  padding: 0;
  list-style: none;
}

.employer {
  display: grid;
  gap: 1rem 1.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-raised);
}

@media (min-width: 700px) {
  .employer {
    grid-template-columns: 64px 1fr;
  }
}

.logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--logo-bg, #2f4f6f);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  background: #ffffff;
}

.employer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.employer-head h3 {
  font-size: 1.35rem;
  font-weight: 700;
}

.employer-about {
  margin-top: 0.15rem;
  color: var(--text-2);
}

.employer-place {
  color: var(--text-2);
  font-size: 0.9rem;
}

.roles {
  margin-top: 1.5rem;
  padding: 0;
  list-style: none;
}

.role {
  position: relative;
  padding-left: 1.75rem;
  padding-bottom: 1.75rem;
}

.role:last-child {
  padding-bottom: 0;
}

.role::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
}

.role:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1.25rem;
  bottom: 0.1rem;
  width: 2px;
  background: var(--line);
}

.role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.15rem 1rem;
  margin-bottom: 0.6rem;
}

.role-head h4 {
  font-size: 1.15rem;
  font-weight: 500;
}

.role-dates {
  color: var(--text-2);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.role-points {
  display: grid;
  gap: 0.5rem;
  max-width: 75ch;
  padding-left: 1.1rem;
}

.role-points strong {
  font-weight: 500;
}

.role .tags {
  margin-top: 0.85rem;
}

.more {
  margin-top: 0.6rem;
}

.more summary {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

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

.more summary:hover {
  color: var(--text);
}

.more .role-points {
  margin-top: 0.25rem;
}

.credentials {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

@media (min-width: 800px) {
  .credentials {
    grid-template-columns: 1fr 1fr;
  }
}

.credential {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-raised);
}

.credential h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.credential p {
  color: var(--text-2);
  font-size: 0.925rem;
}

.credential p.strong {
  color: var(--text);
  font-weight: 500;
}

/* --- Skills --------------------------------------------------------------- */

.skill-groups {
  display: grid;
  gap: 1.25rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 800px) {
  .skill-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1150px) {
  .skill-groups {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.skill-group {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-raised);
}

.skill-group h3 {
  margin-bottom: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.skill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 34px;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 500;
}

.skill-icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: currentColor;
}

/* --- Projects grid -------------------------------------------------------- */

.grid {
  display: grid;
  gap: 2.25rem 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  padding: 0;
  list-style: none;
}

.card[hidden] {
  display: none;
}

.card-link {
  all: unset;
  display: block;
  width: 100%;
  cursor: pointer;
  border-radius: var(--radius-thumb);
}

.card-link:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 4px;
}

.thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-thumb);
  background: var(--surface);
}

.thumb-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  padding: 7%;
  color: #ffffff;
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  font-weight: 700;
  line-height: 1.15;
}

.thumb-art.ml { background: linear-gradient(135deg, #1d3b63, #0f2440); }
.thumb-art.data { background: linear-gradient(135deg, #17493c, #0c2c24); }
.thumb-art.software { background: linear-gradient(135deg, #3c2d63, #241a40); }
.thumb-art.games { background: linear-gradient(135deg, #5c2b2b, #3a1717); }

.thumb img,
.thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-badge,
.thumb-count {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.75rem;
  font-weight: 500;
}

.thumb-badge {
  right: 8px;
  bottom: 8px;
}

.thumb-count {
  right: 8px;
  top: 8px;
}

.thumb-badge svg,
.thumb-count svg {
  width: 12px;
  height: 12px;
}

.card-link:hover .thumb img,
.card-link:hover .thumb-art {
  filter: brightness(1.08);
}

.card-body {
  display: block;
  padding-top: 0.9rem;
}

.card-body h3 {
  margin-bottom: 0.2rem;
  font-size: 1rem;
  font-weight: 500;
}

.meta {
  color: var(--text-2);
  font-size: 0.85rem;
}

.summary {
  display: -webkit-box;
  margin-top: 0.35rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--text-2);
  font-size: 0.875rem;
}

/* --- Project dialog ------------------------------------------------------- */

.project-dialog {
  margin: auto;
  width: min(1200px, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
}

.project-dialog::backdrop {
  background: var(--scrim);
}

@media (prefers-reduced-motion: no-preference) {
  .project-dialog[open] {
    animation: dialog-in 0.18s ease-out;
  }

  @keyframes dialog-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
  }
}

@media (max-width: 640px) {
  .project-dialog {
    width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .dialog-scroll {
    max-height: 100dvh;
  }
}

.dialog-scroll {
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog-close {
  position: sticky;
  top: 0.75rem;
  z-index: 5;
  float: right;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0.75rem 0.75rem -52px 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.dialog-close:hover {
  background: var(--surface-hover);
}

.dialog-close svg {
  width: 22px;
  height: 22px;
}

.dialog-layout {
  display: grid;
  gap: 2rem;
  padding: 4rem clamp(1rem, 3vw, 1.75rem) clamp(1rem, 3vw, 1.75rem);
}

@media (min-width: 1000px) {
  .dialog-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    padding-top: 1.75rem;
  }

  .dialog-side {
    padding-top: 3.25rem;
  }
}

/* carousel */
.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  aspect-ratio: 16 / 9;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: 12px;
  background: #000000;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.slide {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.slide > img,
.slide iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.slide .thumb-art {
  padding: 6%;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.play-button {
  all: unset;
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.play-button img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 68px;
  height: 48px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.75);
  transform: translate(-50%, -50%);
}

.play-button:hover .play-icon,
.play-button:focus-visible .play-icon {
  background: #cc0000;
}

.play-button:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: -3px;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  transform: translateY(-50%);
  cursor: pointer;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.85);
}

.carousel-btn[hidden] {
  display: none;
}

.carousel-btn svg {
  width: 24px;
  height: 24px;
}

.carousel-prev {
  left: 0.75rem;
}

.carousel-next {
  right: 0.75rem;
}

.carousel-strip {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
  overflow-x: auto;
  padding: 3px 3px 5px;
  list-style: none;
  scrollbar-width: thin;
}

.carousel-strip[hidden] {
  display: none;
}

.carousel-strip button {
  all: unset;
  position: relative;
  display: block;
  width: 96px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex: none;
  border-radius: 6px;
  background: var(--surface);
  opacity: 0.6;
  cursor: pointer;
}

.carousel-strip button[aria-current="true"] {
  opacity: 1;
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

.carousel-strip button:focus-visible {
  opacity: 1;
  outline: 2px solid var(--link);
  outline-offset: 1px;
}

.carousel-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-strip .strip-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
}

.carousel-strip .strip-play svg {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

/* details */
.project-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 1.25rem;
}

.project-title-row h2:focus {
  outline: none;
}

.project-title-row h2 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 700;
}

.result {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-text);
  font-size: 0.875rem;
  font-weight: 500;
}

.project-meta {
  margin-top: 0.3rem;
  color: var(--text-2);
}

.project-links {
  margin-top: 1rem;
}

.project-desc {
  margin-top: 1.25rem;
  padding: 1.1rem 1.25rem;
  border-radius: 12px;
  background: var(--surface);
}

.project-desc > p {
  max-width: 75ch;
}

.project-desc h3 {
  margin: 1.1rem 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
}

.project-desc ul:not(.tags) {
  display: grid;
  gap: 0.4rem;
  max-width: 75ch;
  padding-left: 1.1rem;
}

.project-desc .tags li {
  background: var(--bg);
}

.project-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.dialog-side h3 {
  margin-bottom: 0.9rem;
  font-size: 1rem;
  font-weight: 700;
}

.compact-list {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  list-style: none;
}

.compact {
  all: unset;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0.6rem;
  width: 100%;
  cursor: pointer;
  border-radius: 8px;
}

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

.compact .thumb {
  --radius-thumb: 8px;
}

.compact .thumb-art {
  padding: 7%;
  font-size: 0.8rem;
}

.compact .thumb-badge {
  display: none;
}

.compact h4 {
  margin-bottom: 0.15rem;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
}

.compact .meta {
  font-size: 0.78rem;
}

.compact:hover h4 {
  text-decoration: underline;
}

/* --- About ---------------------------------------------------------------- */

.about-layout {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 960px) {
  .about-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 4rem;
  }
}

.about-text p {
  max-width: 62ch;
  color: var(--text-2);
  font-size: 1.05rem;
}

.about-text p + p {
  margin-top: 1rem;
}

.about-text strong {
  color: var(--text);
  font-weight: 500;
}

.beyond {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  padding: 0;
  list-style: none;
}

.beyond-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-raised);
}

.beyond-photo {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
}

.beyond-text {
  padding: 1rem 1.1rem 1.1rem;
}

.beyond-text h3 {
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
}

.beyond-text p {
  color: var(--text-2);
  font-size: 0.9rem;
}

/* --- Contact footer --------------------------------------------------------- */

.contact {
  padding-block: clamp(3rem, 7vw, 5rem) 2rem;
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
}

.contact h2 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
}

.contact .lede {
  max-width: 55ch;
  margin-bottom: 1.25rem;
  color: var(--text-2);
}

.contact-email {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--text);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 500;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.85rem;
}

.footer-bottom a {
  color: var(--text-2);
}

/* --- Redirect stubs ------------------------------------------------------- */

.redirect {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem;
  text-align: center;
}

/* --- Motion preferences ----------------------------------------------------- */

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

.more .when-open,
.more[open] .when-closed {
  display: none;
}

.more[open] .when-open {
  display: inline;
}

/* --- Headshot ring ------------------------------------------------------- */

:root {
  --ring: #1f6fd6;
  --ring-glow: rgba(31, 111, 214, 0.35);
}

@media (prefers-color-scheme: light) {
  :root {
    --ring-glow: rgba(31, 111, 214, 0.35);
  }
}

.hero-photo {
  box-shadow:
    0 0 0 4px var(--bg),
    0 0 0 7px var(--ring),
    0 0 48px 8px var(--ring-glow);
}

/* --- Additional experience ---------------------------------------------- */

.additional {
  margin-top: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-raised);
}

.additional summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--radius-card);
  cursor: pointer;
  list-style: none;
}

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

.additional summary:hover {
  background: var(--surface);
}

.additional[open] summary {
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.additional-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
}

.additional-sub {
  display: block;
  color: var(--text-2);
  font-size: 0.9rem;
}

.additional-chevron {
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--text-2);
}

@media (prefers-reduced-motion: no-preference) {
  .additional-chevron {
    transition: transform 0.2s ease;
  }
}

.additional[open] .additional-chevron {
  transform: rotate(180deg);
}

.additional-body {
  display: grid;
  gap: 2rem;
  padding: 1.5rem clamp(1.25rem, 3vw, 2rem) 2rem;
}

@media (min-width: 1000px) {
  .additional-body {
    grid-template-columns: 1.2fr 1fr;
  }

  .additional-body .extra-group:first-child {
    grid-row: span 2;
  }
}

.extra-group h3 {
  margin-bottom: 1rem;
  color: var(--text-2);
  font-size: 0.95rem;
  font-weight: 500;
}

.extra-list {
  display: grid;
  gap: 1.25rem;
  padding: 0;
  list-style: none;
}

.extra {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 1rem;
  align-items: start;
}

.extra-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.1rem 1rem;
}

.extra-head h4 {
  font-size: 1.02rem;
  font-weight: 500;
}

.extra-org {
  color: var(--text-2);
  font-size: 0.9rem;
}

.extra p:not(.extra-org) {
  max-width: 65ch;
  margin-top: 0.25rem;
  font-size: 0.925rem;
}

.logo-sm {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 0.8rem;
}

.logo-sm img {
  padding: 5px;
}

.logo-award {
  background: #b8860b;
  color: #ffffff;
}
