/* About v2 — lighter page: experience as a flippable card deck, principles as four words.
   Loaded last on about.html; scoped to .about-editorial so nothing else changes. */

.about-editorial .visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Intro ---------- */
.about-editorial .ab-intro .ab-lede { font-size: clamp(22px, 2vw, 28px); line-height: 1.4; letter-spacing: -0.015em; max-width: 22ch; margin: 0 0 12px; }
.about-editorial .ab-intro .ab-muted { margin: 0 0 28px; font-size: 16px; }
.about-editorial .ab-button {
  display: inline-flex; align-items: center; height: 44px; padding: 0 22px;
  border-radius: 999px; background: #1d1f22; color: #fff;
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}
.about-editorial .ab-button:hover { background: #33363b; transform: translateY(-1px); }
.about-editorial .ab-button:focus-visible { outline: 2px solid #9eafff; outline-offset: 3px; }

/* ---------- Section headings ---------- */
.about-editorial .ab-xp .ab-section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 36px; }
.about-editorial .ab-xp .ab-section-heading .eyebrow { flex-basis: 100%; }
.about-editorial .ab-xp h2 { margin: 6px 0 0; }
.about-editorial .xp-tip { margin: 0; font-size: 14px; color: #8a8f86; }

/* ---------- Card deck: physical badges (pearl card in a bevelled frame) ---------- */
.about-editorial .xp-tools { display: flex; align-items: center; gap: 14px; }
.xp-deck {
  --card-w: 216px;
  --card-h: 300px;
  list-style: none; margin: 0; padding: 28px 0 44px;
  display: flex; justify-content: center;
}
.xp-card {
  position: relative; flex: 0 0 var(--card-w); height: var(--card-h);
  margin-left: -40px; perspective: 1000px;
  transform: translateY(var(--y, 0)) rotate(var(--r, 0deg));
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1), margin 0.5s cubic-bezier(.2,.8,.2,1);
  z-index: var(--z, 1);
}
.xp-card:first-child { margin-left: 0; }
/* Each card sits on the one to its left, so every name stays readable. */
.xp-card:nth-child(1) { --r: -7deg; --y: 20px; --z: 1; }
.xp-card:nth-child(2) { --r: -3.5deg; --y: 5px; --z: 2; }
.xp-card:nth-child(3) { --r: 0deg; --y: 0px; --z: 3; }
.xp-card:nth-child(4) { --r: 3.5deg; --y: 5px; --z: 4; }
.xp-card:nth-child(5) { --r: 7deg; --y: 20px; --z: 5; }
@media (hover: hover) and (pointer: fine) {
  .xp-deck:hover .xp-card, .xp-deck:focus-within .xp-card { margin-left: 18px; --r: 0deg; --y: 0px; }
  .xp-deck:hover .xp-card:first-child, .xp-deck:focus-within .xp-card:first-child { margin-left: 0; }
  .xp-deck .xp-card:hover { --y: -12px; z-index: 6; }
}
.xp-card.is-flipped { z-index: 7; --r: 0deg; --y: -12px; }

/* Tilt follows the pointer (--rx/--ry from about-cards.js); flipping adds 180deg. */
.xp-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) + var(--flip, 0deg)));
  transition: transform 0.7s cubic-bezier(.2,.8,.2,1);
}
.xp-card.is-tilting .xp-inner { transition: transform 0.12s ease-out; }
.xp-card.is-flipped { --flip: 180deg; }
/* iOS Safari ignores backface-visibility once a face holds blended/filtered layers,
   so the hidden face is also switched off at the flip's midpoint (edge-on, so no pop). */
.xp-inner { -webkit-transform-style: preserve-3d; }
.xp-front, .xp-back { transition: visibility 0s linear 0.09s; }
.xp-back { visibility: hidden; }
.xp-card.is-flipped .xp-front { visibility: hidden; }
.xp-card.is-flipped .xp-back { visibility: visible; }

/* The frame: a chamfered graphite tray. */
.xp-face {
  position: absolute; inset: 0;
  border-radius: 24px; padding: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  font: inherit; text-align: left; color: #eef0f3;
  background: linear-gradient(155deg, #4a4f57 0%, #2a2e34 38%, #1a1d21 70%, #2c3036 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 -1px 0 rgba(0,0,0,0.5),
    0 1px 2px rgba(0,0,0,0.25),
    0 26px 38px -20px rgba(10,12,16,0.6);
  overflow: hidden;
}
/* The card: brushed graphite metal, lit from wherever the pointer is. */
.xp-face::before {
  content: ""; position: absolute; inset: 8px; border-radius: 18px;
  background:
    radial-gradient(120% 80% at var(--mx, 30%) var(--my, 16%), rgba(255,255,255,0.20), rgba(255,255,255,0) 55%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, rgba(0,0,0,0) 1px 3px, rgba(0,0,0,0.05) 3px 4px),
    linear-gradient(160deg, #3a3f46 0%, #24272c 45%, #1b1d21 70%, #2a2e34 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.07),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -10px 22px rgba(0,0,0,0.35),
    0 0 0 1px rgba(0,0,0,0.45);
}
/* Anisotropic highlight: a soft band that slides across the metal. */
.xp-sheen {
  position: absolute; inset: 8px; border-radius: 18px; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.16) 46%, rgba(220,228,255,0.22) 50%, rgba(255,255,255,0.10) 54%, transparent 70%);
  background-size: 300% 100%;
  background-position: calc(100% - var(--mx, 30%)) 0;
  mix-blend-mode: screen; opacity: var(--sheen, 0.6);
  transition: opacity 0.3s ease;
}
.xp-card:hover .xp-sheen { --sheen: 1; }

.xp-front { cursor: pointer; }
.xp-front > *:not(.xp-sheen) { position: absolute; z-index: 1; }

/* Logo window: a light inset tile, like the photo on an ID card. */
.xp-tile {
  left: 24px; top: 24px; width: 52px; height: 52px;
  display: grid; place-items: center; overflow: hidden;
  border-radius: 13px;
  background: linear-gradient(160deg, #ffffff, #e9ebee);
  color: #2a2d32;
  font-size: 24px; font-weight: 600; line-height: 1;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 0 0 3px rgba(255,255,255,0.10), inset 0 1px 0 #fff, 0 6px 12px -4px rgba(0,0,0,0.5);
}
.xp-tile img { width: 72%; height: 72%; object-fit: contain; display: block; }
/* Wordmark logos: the window widens to fit instead of squeezing the mark. */
.xp-tile.is-wide { width: auto; padding: 0 11px; }
.xp-tile.is-wide img { width: auto; height: 17px; max-width: 84px; }
.xp-tile.has-logo { font-size: 0; }
/* Ribbon mark, debossed into the metal. */
.xp-emboss {
  right: 22px; top: 24px; width: 38px; height: auto;
  filter: grayscale(1) brightness(0.5) drop-shadow(0 1px 0 rgba(255,255,255,0.16)) drop-shadow(0 -1px 0 rgba(0,0,0,0.7));
  opacity: 0.95;
}
.xp-org {
  left: 24px; right: 22px; top: 98px;
  font-size: 26px; line-height: 1.08; font-weight: 600; letter-spacing: -0.03em;
  color: #f3f4f6; text-wrap: balance;
  text-shadow: 0 1px 0 rgba(0,0,0,0.5);
}
.xp-meta { left: 24px; right: 22px; bottom: 24px; display: grid; gap: 5px; }
.xp-role { font-size: 12.5px; line-height: 1.35; color: #b4bac2; }
.xp-when { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: #868d96; }
.xp-front:focus-visible, .xp-close:focus-visible, .xp-link:focus-visible { outline: 2px solid #9eafff; outline-offset: 3px; }

/* Back: one sentence and the next step. */
.xp-back {
  transform: rotateY(180deg);
  display: flex; flex-direction: column; gap: 18px;
  padding: 30px 24px 24px;
}
.xp-back > *:not(.xp-sheen) { position: relative; z-index: 1; }
.xp-back p { margin: 0; font-size: 16px !important; line-height: 1.5; color: #eef0f3 !important; }
.xp-soon { font-size: 13px; color: #868d96; }
.xp-actions { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Primary button: a bright pill that presses in. */
.xp-link {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px 0 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: -0.005em; text-decoration: none;
  color: #15171a;
  background: linear-gradient(180deg, #ffffff, #e4e7eb);
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.55), 0 8px 16px -8px rgba(0,0,0,0.7);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.xp-link::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #9eafff; box-shadow: 0 0 0 3px rgba(158,175,255,0.28);
  transition: transform 0.2s ease;
}
.xp-link:hover { background: linear-gradient(180deg, #ffffff, #f0f2f5); transform: translateY(-1px); }
.xp-link:hover::before { transform: scale(1.25); }
.xp-link:active { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.55); }
/* Secondary button: same shape, ghosted into the metal. */
.xp-close {
  display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 999px;
  font: inherit; font-size: 13px; color: #c3c8cf; cursor: pointer;
  background: rgba(255,255,255,0.06);
  border: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 0 0 1px rgba(255,255,255,0.12);
  transition: background 0.2s ease, color 0.2s ease;
}
.xp-close:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ---------- How I work: the guide appears only on the active row, draws a mark, and the same mark lands in the text ---------- */
.about-editorial .ab-how .ab-section-heading { margin-bottom: 20px; }
.how-list { list-style: none; margin: 0; padding: 0; display: grid; }
.how-list li {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.15fr) 200px; align-items: center; gap: 24px;
  padding: 4px 0; outline: none; cursor: default; min-height: 150px;
}
.how-word { line-height: 1.1; font-size: clamp(26px, 3vw, 40px); font-weight: 600; letter-spacing: -0.035em; color: #b5b8b2; transition: color 0.25s ease; }
.how-line { font-size: 16px; color: #686d66; opacity: 0; transform: translateX(-6px); transition: opacity 0.25s ease, transform 0.25s ease; }
.how-list li.is-on .how-word { color: #1d1f22; }
.how-list li.is-on .how-line { opacity: 1; transform: none; }
.how-list li:focus-visible { box-shadow: inset 3px 0 0 #9eafff; padding-left: 12px; }
html[data-language="zh"] .how-line { word-spacing: -0.28em; }

.how-art { width: 200px; height: auto; display: block; justify-self: end; overflow: visible;
  opacity: 0; transform: translateY(10px) scale(.94); transform-origin: 50% 90%;
  transition: opacity .2s ease, transform .2s ease; }
.how-list li.is-on .how-art { opacity: 1; transform: none; transition: opacity .3s ease, transform .5s cubic-bezier(.34,1.56,.64,1); }

.how-mark { position: relative; display: inline-block; color: #1d1f22; font-weight: 500; white-space: nowrap; }
.how-mk { position: absolute; pointer-events: none; overflow: visible; }
.how-mk-flag { width: 19px; height: 23px; right: -10px; top: -21px; }
.how-mk-scribble { left: -3px; bottom: -9px; width: calc(100% + 6px); height: 11px; }
.how-mk-circle { left: -8px; top: -7px; width: calc(100% + 18px); height: calc(100% + 14px); }
.how-mk-spark { width: 22px; height: 22px; right: -16px; top: -17px; }

/* shared mark motion: .d draws its stroke, .p pops, .drop falls into place, .hop bounces the guide */
.how-list .d { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0s .25s; }
.how-list li.is-on .d { stroke-dashoffset: 0; transition: stroke-dashoffset var(--t, .55s) cubic-bezier(.55,.1,.3,1) var(--d, 0s); }
.how-list .p { opacity: 0; transform: scale(.3); transform-box: fill-box; transform-origin: 0% 50%; transition: opacity .15s, transform 0s .25s; }
.how-list li.is-on .p { opacity: 1; transform: none; transition: opacity .2s var(--d, 0s), transform .45s cubic-bezier(.34,1.7,.64,1) var(--d, 0s); }
.how-list .drop { opacity: 0; transform: translateY(-26px); transition: opacity .15s, transform 0s .25s; }
.how-list li.is-on .drop { opacity: 1; transform: none; transition: opacity .15s var(--d), transform .45s cubic-bezier(.34,1.5,.64,1) var(--d); }
.how-list .hop { transform-box: fill-box; transform-origin: 50% 100%; }
.how-list li.is-on .hop { animation: how-hop .5s cubic-bezier(.3,0,.3,1) var(--d, 0s) both; }
@keyframes how-hop { 0%,100% { transform: none; } 40% { transform: translateY(-10px) scaleY(1.03); } 75% { transform: translateY(0) scaleY(.96); } }

/* ---------- Contact: plain underlined links, no arrows ---------- */
.about-editorial .ab-close .ab-text-link { gap: 0; }

/* ---------- Narrow screens: a swipeable row instead of a fan ---------- */
@media (max-width: 900px) {
  .xp-deck {
    justify-content: flex-start; gap: 14px; padding: 12px 4px 28px;
    overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .xp-deck::-webkit-scrollbar { display: none; }
  .xp-card { margin-left: 0 !important; --r: 0deg !important; --y: 0px !important; scroll-snap-align: start; }
  .how-list li { grid-template-columns: minmax(0, 1fr) 120px; gap: 4px 16px; padding: 8px 0; min-height: 0; }
  .how-list .how-word { grid-column: 1; }
  .how-list .how-line { grid-column: 1; grid-row: 2; }
  .how-art { width: 120px; grid-column: 2; grid-row: 1 / span 2; }
}

@media (prefers-reduced-motion: reduce) {
  .xp-card, .xp-inner, .how-line, .how-word, .xp-hint, .how-art { transition: none; }
  .how-list .d, .how-list .p, .how-list .drop, .how-list li.is-on .d, .how-list li.is-on .p, .how-list li.is-on .drop { transition: none; }
  .how-list li.is-on .hop { animation: none; }
}

/* The badges use a serif for names; the site-wide rounded face is set with !important, so match its weight. */
html#sf-rounded-site body[data-page-view] .xp-card .xp-when {
  font-family: ui-monospace, "SF Mono", Menlo, monospace !important;
}

/* Chinese headline: keep "我是 Jamie。" on one line. */
html[data-language="zh"] .about-editorial .ab-intro h1 { font-size: clamp(56px, 6.2vw, 96px); letter-spacing: -0.02em; }
