/* About (Figma "Wireframe - 13", node 375:847)
   Lives on the home page as a second state: html.is-about swaps the works sheet for the About layout.
   The sidebar (avatar, bio, nav) stays put; the bio is the shared sentence that grows into the About paragraph.
   Layout is the 1440 x 800 frame, scaled down with --u between 900px and 1440px; below 900px it stacks. */

:root {
  --u: min(1px, calc(100vw / 1440));
  --a-top: max(148px, calc(164 * var(--u)));
  --a-grey: #8f8f8f;
}

/* ---------- Shared sentence (the sidebar bio) ---------- */
.bio .more { display: none; }

@media (min-width: 901px) {
  html.is-about .bio {
    top: var(--a-top);
    left: 33px;
    width: calc(386 * var(--u));
    font-size: calc(24 * var(--u));
    line-height: 1.3;
    font-weight: 451;
    text-wrap: balance; /* inherited by .lead and .sub; about.js animates it while the box resizes */
  }
  html.is-about .bio .more { display: inline; }
  html.is-about .bio .home-br { display: none; }
  html.is-about .bio .lead { display: block; }
  html.is-about .bio .sub { display: block; margin-top: 8px; }
}

/* ---------- Page chrome while About is open ---------- */
.about { display: none; }
/* a page opened on About to glide out of it (about.js) holds its text back until the fonts are in */
html.about-exit .bio, html.about-exit .about { visibility: hidden; }
html.is-about .about { display: block; }
html.is-about:not(.is-animating) .sheet { visibility: hidden; }

.about {
  position: fixed;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
  font-weight: 451;
  font-variation-settings: "wdth" 75;
  letter-spacing: -0.02em;
}
.about p, .about h2 { margin: 0; }

.a-outside {
  position: absolute;
  top: var(--a-top);
  left: calc(474 * var(--u));
  width: calc(319 * var(--u));
  font-size: calc(24 * var(--u));
  line-height: 1.3;
  text-transform: lowercase;
  text-wrap: balance;
  color: var(--a-grey);
  pointer-events: auto;
}
.a-lead-m { display: none; }
.a-net { display: none; } /* the desktop copy lives in the sidebar bio (.net) */

/* ---------- Figure ---------- */
.a-figure {
  position: absolute;
  right: calc(-57 * var(--u));
  bottom: calc(-31 * var(--u));
  width: calc(717 * var(--u));
  height: calc(862 * var(--u));
  overflow: hidden;
  pointer-events: none;
}
.a-figure img {
  position: absolute;
  left: -33.47%;
  top: -0.03%;
  width: 171.55%;
  height: 107.02%;
  max-width: none;
}

/* ---------- Timelines ---------- */
.a-timeline {
  position: absolute;
  top: calc(var(--a-top) + 242 * var(--u));
  left: 33px;
  display: flex;
  align-items: flex-start;
  gap: calc(44 * var(--u));
  pointer-events: auto;
}
.tl { display: flex; flex-direction: column; gap: calc(12 * var(--u)); }
.tl-edu { width: calc(152 * var(--u)); }
.tl-work { width: calc(519 * var(--u)); }
.tl h2 {
  font-size: calc(30 * var(--u));
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  color: #fff;
  white-space: nowrap;
}
.tl-track { position: relative; list-style: none; margin: 0; padding: 0; }
.tl-edu .tl-track { width: calc(196 * var(--u)); }
.tl-work .tl-track { display: grid; grid-template-columns: repeat(3, calc(132 * var(--u))); column-gap: calc(62 * var(--u)); }

.tl-line {
  position: absolute;
  top: calc(6 * var(--u));
  height: 1px;
  background: no-repeat 0 0 / 100% 100%;
}
.tl-edu .tl-line { left: calc(7.42 * var(--u)); width: calc(78.7 * var(--u)); background-image: url("about/line-edu.svg"); }
.tl-work .tl-line.solid { left: calc(5 * var(--u)); width: calc(390 * var(--u)); background-image: url("about/line-work-solid.svg"); }
.tl-work .tl-line.dash { left: calc(392 * var(--u)); width: calc(118 * var(--u)); background-image: url("about/line-work-dash.svg"); }

.tl-item { position: relative; display: flex; flex-direction: column; gap: calc(10 * var(--u)); min-width: 0; }
.tl-item .dot {
  width: calc(14 * var(--u));
  height: calc(14 * var(--u));
  background: url("about/dot.svg") center / 100% 100% no-repeat;
}
.tl-year {
  font-size: calc(16 * var(--u));
  line-height: 1.4;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.5;
}
.tl-name {
  display: block;
  font-size: calc(24 * var(--u));
  line-height: 1.4;
  text-transform: uppercase;
  color: #fff;
}
.tl-role {
  display: block;
  font-size: calc(20 * var(--u));
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  color: var(--a-grey);
}
.tl-edu .tl-role { line-height: 1.2; }
.tl-text { display: flex; flex-direction: column; }

/* ---------- Mobile: stacked, no scaling ----------
   The About text is set exactly like the sentence on the works sheet (.mobile-bio in site.css) and starts at the same
   spot, so about.js can keep it still while the page changes around it. */
@media (max-width: 900px) {
  html.is-about:not(.is-animating) .sheet { display: none; }
  .about {
    position: static;
    overflow: visible;
    display: none;
    flex-direction: column;
    padding: 24px 16px 0;
    pointer-events: auto;
  }
  html.is-about .about { display: flex; }
  .a-lead-m, .a-outside, .a-net { font-size: 32px; line-height: 1.1; font-weight: 400; letter-spacing: -0.02em; text-transform: lowercase; color: var(--a-grey); }
  .a-lead-m { display: flex; flex-direction: column; gap: 8px; }
  .a-lead-m b { font-weight: 600; color: #fff; }
  .a-outside { position: static; width: auto; margin-top: 8px; }
  .a-net { display: block; margin-top: 8px; }

  /* Timeline (mockup from the 25 Oct review): newest first, marker · year · name on one row, roles under the name,
     one line through the markers with a dashed lead-in above the first */
  .a-timeline { position: static; flex-direction: column; gap: 24px; margin-top: 44px; }
  .tl-edu, .tl-work { width: auto; }
  .tl { gap: 0; }
  .tl h2 { font-size: 32px; line-height: 1.3; }
  .tl-line { display: none; }
  .tl-edu .tl-track, .tl-work .tl-track { width: auto; display: flex; flex-direction: column; gap: 52px; padding-top: 24px; }
  .tl-work .tl-track { flex-direction: column-reverse; }
  .tl-item {
    display: grid;
    grid-template-columns: 14px 64px minmax(0, 1fr);
    column-gap: 10px;
    align-items: start;
  }
  .tl-item .dot { position: relative; z-index: 1; width: 14px; height: 14px; margin-top: 9.8px; } /* centred on the name's first line */
  .tl-year { margin-top: 5.6px; font-size: 16px; white-space: nowrap; }
  .tl-name { font-size: 24px; }
  .tl-role { font-size: 20px; }
  .tl-item::before, .tl-item::after { content: ""; position: absolute; left: 6.5px; width: 1px; background: #d9d9d9; }
  .tl-item::before { display: none; }
  /* solid: from this marker to the next one down (the oldest job, first in the markup, has none) */
  .tl-work .tl-item::after { top: 16.8px; bottom: calc(-52px - 16.8px); }
  .tl-work .tl-line.dash + .tl-item::after { display: none; }
  /* dashed lead-in above the newest job and above education */
  .tl-work .tl-item:last-child::before, .tl-edu .tl-item::before {
    display: block;
    top: -24px;
    height: calc(24px + 9.8px);
    background: repeating-linear-gradient(to bottom, #d9d9d9 0 5px, transparent 5px 10px);
  }
  .tl-edu .tl-item::before { top: -12px; height: calc(12px + 9.8px); }
  .tl-edu .tl-item::after { top: 16.8px; height: 36px; }
  .a-figure { position: relative; right: auto; bottom: auto; width: min(100%, 420px); height: auto; aspect-ratio: 717 / 862; margin: 28px -16px 0 auto; }
}
}

@media (prefers-reduced-motion: reduce) {
  .about *, .bio * { animation: none !important; }
}

/* =====================================================================
   Version 2 (Figma "Wireframe - 15", node 379:1533) — the default.
   One 36px paragraph (the home sentence, just wider) with the new copy continuing inline, "outside of work" under it,
   the timeline top right with square markers and a smaller illustration bottom right. ?about=1 keeps version 1.
   ===================================================================== */
.bio .v2only, .bio .out, .bio .net { display: none; }
html.about-v2 { --a-top: max(140px, calc(148 * var(--u))); }

@media (min-width: 901px) {
  html.about-v2.is-about .bio {
    top: var(--a-top);
    left: 33px;
    width: calc(679 * var(--u));
    font-size: calc(36 * var(--u));
    line-height: 1.3;
    font-weight: 451;
    text-wrap: wrap;
  }
  html.about-v2.is-about .bio .lead { display: block; }
  html.about-v2.is-about .bio .v2only { display: inline; }
  html.about-v2.is-about .bio .out, html.about-v2.is-about .bio .net { display: block; margin-top: 8px; }
  html.about-v2.is-about .bio .v1only { display: none; }
  html.about-v2 .a-outside { display: none; }

  /* Figma "Wireframe - 17" (node 382:1675): work experience on top, education under it, both in the right column */
  html.about-v2 .a-timeline {
    top: calc(var(--a-top) - 2 * var(--u));
    left: calc(50% + 84 * var(--u));
    width: calc(604 * var(--u));
    flex-direction: column;
    gap: calc(20 * var(--u));
  }
  html.about-v2 .tl-work { width: 100%; }
  html.about-v2 .tl h2 { font-size: calc(36 * var(--u)); line-height: 1.3; }
  html.about-v2 .tl-name { font-size: calc(24 * var(--u)); }
  html.about-v2 .tl-role { font-size: calc(20 * var(--u)); }
  html.about-v2 .tl-work .tl-track { grid-template-columns: repeat(3, calc(153.6 * var(--u))); column-gap: calc(72.17 * var(--u)); }
  html.about-v2 .tl-work .tl-line.solid { left: calc(5.8 * var(--u)); width: calc(453.87 * var(--u)); background-image: url("about/v3-line-work-solid.svg"); }
  html.about-v2 .tl-work .tl-line.dash { left: calc(456.2 * var(--u)); width: calc(137.33 * var(--u)); background-image: url("about/v3-line-work-dash.svg"); }

  html.about-v2 .a-figure { right: calc(-19 * var(--u)); bottom: calc(-145 * var(--u)); width: calc(517 * var(--u)); height: calc(606 * var(--u)); }
  html.about-v2 .a-figure img { left: -31.79%; top: -0.03%; width: 162.91%; height: 104.32%; }
}
html.about-v2 .tl-item .dot { background: var(--cyan); }
html.about-v2 .tl-work { order: -1; } /* work experience first (the markup keeps education first for version 1) */
html.about-v2 .tl-name { font-weight: 600; text-transform: lowercase; }

@media (max-width: 900px) {
  html.about-v2 .a-figure { aspect-ratio: 517 / 606; width: min(100%, 360px); }
  html.about-v2 .a-figure img { left: -31.79%; top: -0.03%; width: 162.91%; height: 104.32%; }
  html.about-v2 .v1only { display: none; }
  html.about-v1 .v2only { display: none; }
}
.a-lead-m b { font-weight: 600; color: #fff; }
/* The social links close the About text: bold white, underlined (Figma node 424:1901) */
.bio .net a, .a-net a { font-weight: 600; color: #fff; text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.12em; pointer-events: auto; transition: color 160ms ease; }
/* The custom cursor hides the native pointer, so the links themselves say they are clickable */
.bio .net a:hover, .bio .net a:focus-visible, .a-net a:hover, .a-net a:focus-visible { color: var(--cyan); }
.tl-work .tl-role { white-space: nowrap; } /* "sr visual designer" is wider than its column in the Figma frame too */

/* Letter-by-letter reveal (about.js animates --p on .bio; each letter has its own --i). Letters are fully visible when --p is unset. */
@property --p { syntax: '<number>'; inherits: true; initial-value: 9999; }
.bio .ltr { opacity: clamp(0, calc((var(--p) - var(--i)) / var(--w, 8)), 1); } /* --w: how many letters the soft edge spans */

/* Letter-by-letter wrap: letters of the shared paragraph are offset with left/top while they travel (inline, so kerning stays). */
.bio .cl { position: relative; }

/* Word glide (about.js, default): while the sentence moves it is drawn by this layer of word clones, each placed where it
   lands on About; the real paragraph is hidden until they arrive. */
.bio-ghost {
  position: absolute; /* placed in page coordinates, so it scrolls with the page on phones */
  top: 0;
  left: 0;
  z-index: 5;
  pointer-events: none;
  font-family: var(--display);
  font-variation-settings: "wdth" 75;
  text-transform: lowercase;
}
/* letter-spacing is set on each word: an em value resolves against the element that declares it */
.bio-ghost span { position: absolute; white-space: pre; letter-spacing: -0.02em; transform-origin: 0 0; }
