/* About page — layered on case-study.css (tokens, nav, footer). A
   single full-height intro: greeting, role toggles and a sentence on
   the left, an image on the right. */

.about-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: 96px; /* clears the fixed nav */
}

/* Greeting and sentence left aligned on the left, image on the
   right, spread across the page up to 1440px wide. */
.about-intro {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
  align-content: center;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px var(--side);
}

/* Portrait: a cut-out photo on the surface colour. The box takes the
   image's own shape (1452 x 1083), so the photo fills it uncropped
   apart from the rounded corners. The fill is solid at the bottom and
   fades into the page by two thirds of the way up. */
.about-photo {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(to top, var(--surface), transparent 66.667%);
}

.about-photo img {
  display: block;
  width: 100%;
  height: auto;
}

/* Role props: same canvas as the portrait, laid exactly over it. Each
   fades and settles in while its role is on (about.js adds .is-on).
   .is-back props go under the portrait instead (the gamer headband,
   which the hair overlaps). */
.about-photo .about-portrait { position: relative; z-index: 1; }

.about-photo .about-prop {
  position: absolute;
  inset: 0;
  height: 100%;
  opacity: 0;
  transform: scale(1.03);
  transition:
    opacity 0.45s var(--ease-std),
    transform 0.6s var(--ease-out);
  z-index: 2;
  pointer-events: none;
}

.about-photo .about-prop.is-back { z-index: 0; }

.about-photo .about-prop.is-on {
  opacity: 1;
  transform: none;
}

.about-intro h1 {
  font-size: 88px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
}

/* The sentence rebuilt by about.js; fades while it swaps. */
.about-line {
  width: 100%;
  /* about.js reserves the tallest description's height here so the
     greeting never moves; this is the no-script fallback. */
  min-height: 3.2em;
  margin: 28px 0 0;
  font-size: 20px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--muted);
  transition: opacity 0.2s var(--ease-std);
}

.about-line.is-swapping { opacity: 0; }

/* New description: words start below their masks and rise in, 18ms
   apart (about.js adds .is-entering, then .is-entered). */
.about-line.is-entering .word-inner { transform: translateY(115%); }

.about-line.is-entering.is-entered .word-inner {
  transform: none;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i) * 0.018s);
}

/* Each segment sits on a low-opacity fill of its role's colour, with
   the words themselves in the normal text colour. clone gives every
   wrapped line its own padded, rounded piece of the fill. */
.about-line b {
  padding: 0.06em 0.3em;
  border-radius: 6px;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  font-weight: 500;
  color: var(--text);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- Work link ---------- */

/* A light pill like the nav's Contact button. Its space is always kept,
   so nothing moves when it appears; it fades up once every role is on,
   just after the new sentence has landed. */
.about-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 12px 22px;
  border-radius: 9999px;
  background: var(--text);
  color: var(--bg);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity 0.3s var(--ease-std),
    transform 0.3s var(--ease-std),
    visibility 0s linear 0.3s,
    background 0.2s ease;
}

.about-cta.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.6s var(--ease-std) 0.6s,
    transform 0.6s var(--ease-out) 0.6s,
    visibility 0s linear 0.6s,
    background 0.2s ease;
}

.about-cta:hover { background: #fff; }

.about-cta span { transition: transform 0.25s var(--ease-out); }
.about-cta:hover span { transform: translateX(3px); }

.about-cta:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

/* ---------- Role toggles ---------- */

/* Compact one-line chips under the greeting, each as wide as its
   label, wrapping onto a second line when the column gets narrow. */
.about-facets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

/* Undo case-study.css's spacing for list items inside a section. */
.about-facets li { margin: 0; line-height: inherit; }

/* Off: outlined and muted. On: tinted fill and outline in the facet's colour. */
.facet {
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.8px;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out),
    color 0.25s var(--ease-out),
    transform 0.25s var(--ease-out);
}

.facet:hover {
  border-color: var(--c);
  color: var(--text);
}

.facet:active { transform: scale(0.97); }

/* Until the first press, the outlines slowly glow in their colours one
   after another, a gentle cue that they're clickable. Hovered or
   selected buttons drop it so their own styles show. about.js adds
   .is-used to the list on the first press. */
.about-facets:not(.is-used) .facet {
  animation: facet-glow 4s var(--ease-std) infinite;
  animation-delay: calc(1.6s + var(--n) * 0.4s);
}

.about-facets li:nth-child(1) { --n: 0; }
.about-facets li:nth-child(2) { --n: 1; }
.about-facets li:nth-child(3) { --n: 2; }
.about-facets li:nth-child(4) { --n: 3; }
.about-facets li:nth-child(5) { --n: 4; }

.about-facets .facet:hover,
.about-facets .facet[aria-pressed="true"] { animation: none; }

@keyframes facet-glow {
  0%, 60%, 100% { border-color: var(--line); box-shadow: none; }
  30% {
    border-color: color-mix(in srgb, var(--c) 60%, var(--line));
    box-shadow: 0 0 14px -4px color-mix(in srgb, var(--c) 45%, transparent);
    color: var(--text);
  }
}

/* Same 22% fill as the description highlights, with a full-colour
   outline. */
.facet[aria-pressed="true"] {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 22%, transparent);
  color: var(--text);
}

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

/* ---------- Entrance ---------- */

/* Same intro as the homepage hero, played on every load: the greeting's
   words rise out of their masks (0.75s, 0.055s apart), the sentence
   follows with a shorter, tighter stagger, and the role toggles fade
   up between them. The portrait fades in last, as the sentence's final
   words land. about.js splits the words and arms .will-reveal; .is-in
   starts it. Without the script everything simply shows. */
.about-hero.will-reveal .word-inner { transform: translateY(115%); }

.about-hero.will-reveal.is-in .word-inner {
  transform: none;
  transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(0.05s + var(--i) * 0.055s);
}

.about-hero.will-reveal.is-in .about-line .word-inner {
  transition-duration: 0.6s;
  transition-delay: calc(0.4s + var(--i) * 0.035s);
}

.about-hero.will-reveal .about-facets {
  opacity: 0;
  transform: translateY(14px);
}

.about-hero.will-reveal.is-in .about-facets {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.9s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-hero.will-reveal.is-in .about-facets { transition-delay: 0.3s; }

.about-hero.will-reveal .about-photo { opacity: 0; }

.about-hero.will-reveal.is-in .about-photo {
  opacity: 1;
  transition: opacity 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) 1.5s;
}

@media (prefers-reduced-motion: reduce) {
  .about-line { transition: none; }
  .about-facets:not(.is-used) .facet { animation: none; }
  .about-photo .about-prop { transform: none; transition: opacity 0.2s linear; }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  /* Stack the portrait under the text. */
  .about-intro { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .about-photo { width: 100%; max-width: 560px; }
  .about-intro h1 { font-size: 64px; }
  .about-line { font-size: 18px; }
}

@media (max-width: 640px) {
  /* Phones: portrait first, full column width (page gutters only) at
     its own uncropped shape, then the greeting, roles and sentence under
     the nav pill (16px + 56px). Spacing is tight so the sentence starts
     on the first screen; the work link may sit below the fold. */
  .about-hero { padding-top: 84px; }
  .about-intro {
    align-content: start;
    gap: 16px;
    padding: 0 var(--side) 24px;
  }
  .about-photo { order: -1; max-width: none; }
  .about-intro h1 { font-size: 40px; }
  /* Smaller chips so the five roles wrap onto two rows. */
  .about-facets { gap: 6px; margin-top: 14px; }
  .facet { height: 30px; padding: 0 9px; font-size: 10.5px; letter-spacing: 0.5px; }
  .about-line { margin-top: 14px; font-size: 16px; line-height: 1.5; }
  /* Sits at the right edge, under the end of the sentence. */
  .about-cta {
    display: flex;
    width: fit-content;
    margin: 12px 0 0 auto;
    padding: 10px 20px;
  }
}

