/*
 * "Me" page (about-me.html, built by scripts/build-about-me.py).
 * One centred column: intro, toolkit, experience accordion, life, contacts.
 * Surfaces match the cases grid (site.css .section_cases).
 */

body.page-me {
  --me-col: 35rem;
  --me-text: var(--_colors---primary--black, #eceae4);
  --me-muted: rgba(236, 234, 228, 0.62);
  --me-card: #141412;
  --me-card-hover: #1a1a18;
  --me-inner: #1e1e1c;
  --me-line: rgba(236, 234, 228, 0.07);
  --me-tile: #1e1e1c;
  --me-on-text: #0c0c0b;
  --me-photo-frame: #262624;
  --me-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

html[data-theme="light"] body.page-me {
  --me-muted: rgba(27, 27, 25, 0.6);
  --me-card: #f5f4f0;
  --me-card-hover: #efeee9;
  --me-inner: #ffffff;
  --me-line: rgba(27, 27, 25, 0.06);
  --me-tile: #ffffff;
  --me-on-text: #ffffff;
  --me-photo-frame: #ffffff;
  --me-shadow: 0 10px 30px rgba(27, 27, 25, 0.12);
}

.me-page {
  width: 100%;
  max-width: calc(var(--me-col) + 2rem);
  margin: 0 auto;
  padding: calc(var(--navbar-float-top, 32px) + var(--navbar-float-pill-height, 3.25rem) + 3rem) 1rem 7rem;
  color: var(--me-text);
}

/* Zero specificity, so component margins below always win. */
:where(.me-page) :where(p, h1, h2, ul, dl, dd, figure) {
  margin: 0;
}

/* Intro */
.me-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.me-hero__avatar {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--me-shadow);
}

.me-hero__hello {
  margin-top: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.011em;
}

.me-hero__title {
  margin-top: 2rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 1.875rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.me-hero__lead {
  max-width: 28rem;
  margin-top: 1rem;
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: -0.011em;
  color: var(--me-muted);
  text-wrap: pretty;
}

.me-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
}

body.page-me .me-page a.me-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--me-card);
  color: var(--me-text);
  -webkit-text-fill-color: currentColor;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.011em;
  text-decoration: none;
  transition: background-color 0.18s ease, opacity 0.18s ease;
}

body.page-me .me-page a.me-btn:hover {
  background: var(--me-card-hover);
}

body.page-me .me-page a.me-btn--primary,
body.page-me .me-page a.me-btn--primary:hover {
  background: var(--me-text);
  color: var(--me-on-text);
}

body.page-me .me-page a.me-btn--primary:hover {
  opacity: 0.86;
}

body.page-me .me-page a.me-btn:focus-visible {
  outline: 2px solid var(--me-text);
  outline-offset: 2px;
}

/* Sections */
.me-section {
  margin-top: 5rem;
  scroll-margin-top: calc(var(--navbar-float-top, 32px) + var(--navbar-float-pill-height, 3.25rem) + 1.5rem);
}

.me-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.006em;
  color: var(--me-muted);
  text-align: center;
}

.me-pill {
  padding: 0.1875rem 0.5rem;
  border-radius: 999px;
  background: var(--me-card);
  color: var(--me-text);
  font-size: 0.75rem;
  line-height: 1.2;
}

.me-card {
  border-radius: 1.5rem;
  background: var(--me-card);
  outline: 1px solid var(--me-line);
  outline-offset: -1px;
}

/* Toolkit */
.me-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.me-tool {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem;
  background: var(--me-tile);
  outline: 1px solid var(--me-line);
  outline-offset: -1px;
  color: var(--me-text);
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.me-tool__icon,
.me-tool__icon svg {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
}

.me-tool__icon svg[viewBox="0 0 38 57"] {
  width: auto;
}

.me-tool__tip {
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  padding: 0.3125rem 0.5625rem;
  border-radius: 0.5rem;
  background: var(--me-text);
  color: var(--me-on-text);
  font-size: 0.8125rem;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.25rem);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.me-tool:hover,
.me-tool:focus-visible {
  transform: translateY(-2px);
}

.me-tool:hover .me-tool__tip,
.me-tool:focus .me-tool__tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.me-tool:focus-visible {
  outline: 2px solid var(--me-text);
  outline-offset: 2px;
}

/* Experience */
.me-jobs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.me-job {
  border-radius: 1.25rem;
  background: var(--me-card);
  outline: 1px solid var(--me-line);
  outline-offset: -1px;
  interpolate-size: allow-keywords;
}

.me-job::details-content {
  height: 0;
  overflow: clip;
  transition: height 0.3s cubic-bezier(0.2, 0, 0, 1), content-visibility 0.3s allow-discrete;
}

.me-job[open]::details-content {
  height: auto;
}

.me-job__head {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
  border-radius: 1.25rem;
  list-style: none;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.me-job__head::-webkit-details-marker {
  display: none;
}

.me-job__head:hover {
  background: var(--me-card-hover);
}

.me-job__head:focus-visible {
  outline: 2px solid var(--me-text);
  outline-offset: -2px;
}

.me-job__logo {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: var(--me-inner);
  outline: 1px solid var(--me-line);
  outline-offset: -1px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.me-job__titles {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.1875rem;
  min-width: 0;
}

.me-job__role {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.011em;
}

.me-job__period {
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--me-muted);
}

.me-job__chevron {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--me-muted);
  transition: transform 0.24s cubic-bezier(0.2, 0, 0, 1);
}

.me-job[open] .me-job__chevron {
  transform: rotate(180deg);
}

.me-job__body {
  padding: 0.25rem 0.75rem 0.75rem;
}

.me-job__desc {
  padding: 0 0.25rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  letter-spacing: -0.011em;
}

.me-job__wins {
  margin-top: 0.875rem;
  padding: 0.75rem;
  border-radius: 1rem;
  background: var(--me-inner);
}

.me-job__wins-title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: var(--me-muted);
}

.me-job__wins-title svg {
  width: 1rem;
  height: 1rem;
}

.me-job__wins ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.625rem;
  padding: 0 0 0 1.25rem;
}

.me-job__wins li {
  padding-left: 0.125rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  letter-spacing: -0.011em;
}

.me-job__wins li::marker {
  color: var(--me-muted);
}

body.page-me .me-page a.me-job__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0.75rem 0 0 0.25rem;
  color: var(--me-text);
  -webkit-text-fill-color: currentColor;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

body.page-me .me-page a.me-job__link:hover {
  opacity: 0.72;
}

.me-job__link .me-contact__arrow {
  width: 1rem;
  height: 1rem;
}

/* About */
.me-photos {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 0.75rem;
}

.me-photo {
  position: relative;
  flex: 0 0 auto;
  width: 9.5rem;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 4px solid var(--me-photo-frame);
  border-radius: 1.125rem;
  background: var(--me-inner);
  box-shadow: var(--me-shadow);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.me-photo + .me-photo {
  margin-left: -0.75rem;
}

.me-photo--1 { transform: rotate(-5deg) translateY(0.5rem); }
.me-photo--2 { z-index: 1; transform: rotate(2deg); }
.me-photo--3 { transform: rotate(6deg) translateY(0.625rem); }

.me-photo:hover {
  z-index: 2;
  transform: rotate(0deg) translateY(-0.25rem) scale(1.03);
}

.me-photo video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.me-photo__place {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(12, 12, 11, 0.62);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.2;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.me-about__title {
  margin-top: 2.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 3vw, 1.625rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.022em;
  text-align: center;
  text-wrap: balance;
}

.me-about__text {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-top: 1.5rem;
  padding: 1.5rem;
}

.me-about__text p {
  font-size: 1rem;
  line-height: 1.55;
  letter-spacing: -0.011em;
  text-wrap: pretty;
}

.me-facts {
  display: flex;
  flex-direction: column;
  margin-top: 0.5rem;
  border-top: 1px solid var(--me-line);
}

.me-facts__row {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.75rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.me-facts dt {
  color: var(--me-muted);
}

/* Contacts */
.me-contacts {
  display: flex;
  flex-direction: column;
  padding: 0.375rem;
}

body.page-me .me-page a.me-contact {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.25rem;
  padding: 0.75rem 0.875rem;
  border-radius: 1.125rem;
  color: var(--me-text);
  -webkit-text-fill-color: currentColor;
  text-decoration: none;
  transition: background-color 0.18s ease;
}

body.page-me .me-page a.me-contact:hover {
  background: var(--me-card-hover);
}

body.page-me .me-page a.me-contact:focus-visible {
  outline: 2px solid var(--me-text);
  outline-offset: -2px;
}

.me-contact + .me-contact {
  position: relative;
}

.me-contact__label {
  flex: 0 0 7rem;
  font-size: 0.9375rem;
  color: var(--me-muted);
}

.me-contact__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 0.9375rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-contact__arrow {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  color: var(--me-muted);
}

/* Colophon */
.me-colophon {
  text-align: center;
}

.me-colophon__title {
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.014em;
}

.me-colophon__text {
  max-width: 24rem;
  margin: 0.5rem auto 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--me-muted);
  text-wrap: balance;
}

@media (max-width: 479px) {
  .me-page {
    padding-top: calc(var(--navbar-float-top, 16px) + var(--navbar-float-pill-height, 3.5rem) + 2rem);
  }

  .me-section {
    margin-top: 4rem;
  }

  .me-photo {
    width: 7.25rem;
  }

  .me-photo + .me-photo {
    margin-left: -1rem;
  }

  .me-about__text {
    padding: 1.25rem;
  }

  .me-facts__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.125rem;
  }

  .me-page {
    padding-bottom: 9rem;
  }

  /* Label above the value, so a long email is never cut. */
  body.page-me .me-page a.me-contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.75rem;
    row-gap: 0.125rem;
  }

  .me-contact__label {
    grid-column: 1;
    font-size: 0.8125rem;
  }

  .me-contact__value {
    grid-column: 1;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .me-contact__arrow {
    grid-column: 2;
    grid-row: 1 / 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .me-job::details-content,
  .me-job__chevron,
  .me-tool,
  .me-tool__tip,
  .me-photo {
    transition: none;
  }
}
