/* About me page.
   Built from the Figma "About me" frame (Desktop, 1280px wide).
   Layout: a title, a short bio next to a round portrait, then CV-style
   lists where a narrow right-aligned column holds the year (or
   "Current"/"Past") and the details sit to its right. */

.about {
  --about-gutter: clamp(20px, 4.85vw, 62px); /* 62px at 1280px wide */
  --about-width: 1156px;                     /* content width in Figma */
  font-family: var(--font-heading);
  color: var(--color-text);
}

.about > * {
  width: 100%;
  max-width: calc(var(--about-width) + 2 * var(--about-gutter));
  margin-inline: auto;
  padding-inline: var(--about-gutter);
}

/* ---------- Intro ---------- */

.about-intro {
  padding-block: 75px;
  /* the intro sits 10px further left than the lists in Figma */
  padding-inline: max(20px, calc(var(--about-gutter) - 10px));
}

.about-intro__title,
.cv--lead h2 {
  font-weight: 600;
  font-size: 32px;
  line-height: normal;
  letter-spacing: -0.01em;
}

.about-intro__title {
  padding-block: 13px;
  margin-bottom: 20px;
}

.about-intro__body {
  display: grid;
  grid-template-columns: minmax(0, 692px) minmax(0, 1fr);
  gap: 46px;
  align-items: center;
}

.about-intro__text {
  font-weight: 500;
  font-size: 24px;
  line-height: normal;
  letter-spacing: -0.03em;
}

.about-intro__text p + p {
  margin-top: 1.2em; /* one empty line, as in Figma */
}

.about-intro__portrait {
  padding-inline: 40px;
}

.about-intro__portrait img {
  display: block;
  width: 100%;
  max-width: 358px;
  height: auto;
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 50%;
  object-fit: cover;
}

/* ---------- CV sections ---------- */

.cv {
  padding-block: 20px;
  margin-block: 20px;
}

.cv--lead {
  padding-block: 40px;
  margin-top: 0;
}

.cv--last {
  padding-bottom: 200px;
}

.cv h2 {
  font-weight: 600;
  font-size: 24px;
  line-height: normal;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.cv--lead h2 {
  margin-bottom: 30px;
}

.cv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cv-list--loose {
  gap: 30px;
}

/* One row: the year on the left, the details on the right. */
.cv-row {
  display: grid;
  grid-template-columns: 101px minmax(0, 1fr);
  gap: 20px;
  font-size: 16px;
  line-height: normal;
  letter-spacing: -0.01em;
}

.cv-row__when {
  font-weight: 500;
  text-align: right;
}

.cv-row__items {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 480px; /* 435px in Figma, a little extra so lines don't wrap */
  font-weight: 400;
}

.cv-row__items--tight {
  gap: 12px;
}

.cv-row__items--wide {
  max-width: 890px;
}

.cv-row strong {
  font-weight: 700;
}

.cv-row em {
  font-style: italic;
}

.cv-highlight {
  color: var(--color-signal-text);
}

.cv-row a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cv-row a:hover {
  color: var(--color-signal-text);
}

/* One-line description under each role, slightly lighter. */
.cv-desc {
  display: inline-block;
  margin: 1px 0 8px;
  padding-left: 16px; /* indented under its job title */
  font-size: 14px;
  line-height: 1.35;
  color: var(--color-text-muted);
}

/* ---------- Contact ---------- */
.about-contact {
  margin-top: 1.2em;
}

.about-contact a {
  color: var(--color-text);
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: var(--color-signal);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.about-contact a + a {
  margin-left: 20px;
}

.about-contact a:hover {
  color: var(--color-signal-text);
}

/* ---------- Country flags ----------
   Hovering a flag shows its two-letter country code in a small black
   bubble, like the callouts on the case-study pages. Useful on Windows,
   where some flags don't render as pictures. */
.flag {
  position: relative;
  cursor: default;
}

.flag::after {
  content: attr(data-cc);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  padding: 4px 7px;
  border-radius: 8px 8px 8px 2px;
  background: #000000;
  color: #ffffff;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  letter-spacing: var(--tracking-label);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-20%, 4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.flag:hover::after,
.flag:focus-visible::after {
  opacity: 1;
  transform: translate(-20%, 0);
}

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

/* ---------- Dividers ---------- */

.about-rule {
  border: 0;
  border-top: 1px solid var(--color-text);
  max-width: calc(1180px);
  padding: 0;
  margin-block: 0;
  /* Figma: the line runs 50px in from each edge */
  width: calc(100% - 2 * clamp(20px, 3.9vw, 50px));
}

/* ---------- Bottom bar ("Back to top") ---------- */

.page-end {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px;
  border-top: 1px solid var(--color-text);
  border-bottom: 1px solid var(--color-text);
  margin-bottom: 20px;
}

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

/* ---------- Smaller screens ---------- */

@media (max-width: 900px) {
  .about-intro__body {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .about-intro__portrait {
    order: -1;          /* portrait first on phones */
    padding-inline: 0;
  }
  .about-intro__portrait img {
    max-width: 240px;
    margin-inline: 0;
  }
  .about-intro__text { font-size: 20px; }
}

@media (max-width: 640px) {
  .about-intro { padding-block: 40px; }
  .about-intro__title, .cv--lead h2 { font-size: 28px; }
  .cv-row {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 14px;
  }
  .cv--last { padding-bottom: 100px; }
}

/* Long email address: allowed to wrap on very narrow screens (320 px). */
.about-contact a { overflow-wrap: anywhere; }
