/* About (Version 2). Shared parts live in site.css; this is only what the About page adds.
   A type-led page: an oversized title, a paragraph that lights up word by word, the four
   kinds of things shown with real screens (each composed for itself), the three principles
   as a sticky sequence, and a closing line as big as the title. */

/* ── Hero ───────────────────────────────────────────────────────── */
.ab-hero { padding-top: clamp(48px, 8vw, 120px); padding-bottom: clamp(72px, 10vw, 152px); overflow: clip; }
.ab-hero-in {
    --ts: clamp(54px, 11vw, 168px);
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
    /* as the hero leaves, it lags behind the scroll and fades */
    transform: translate3d(0, calc(var(--p, 0) * 14vh), 0);
    opacity: calc(1 - var(--p, 0) * 0.85);
}
.ab-hero-in > * { grid-column: 1 / -1; }
.ab-title {
    margin-top: 2px;
    font-size: var(--ts); line-height: 0.95; letter-spacing: -0.052em; font-weight: 600;
    text-wrap: initial;
}
.ab-l1, .ab-l2 { display: block; }
.ab-l2 { font-style: normal; color: var(--accent); }
.ab-lead { margin-top: 28px; max-width: 30ch; }
@media (min-width: 900px) {
    /* the lead sits beside "tried." on the title's second line */
    .ab-lead { grid-column: 7 / 13; margin-top: calc(var(--ts) * -0.82); max-width: 25ch; }
}
.ab-in { animation: ab-rise 1.1s var(--ease-out) var(--d, 0s) both; }
@keyframes ab-rise { from { opacity: 0; transform: translateY(28px); } }

/* ── The idea: one question set large, then two quieter paragraphs ── */
.ab-words { color: var(--fg); }
.ab-words p:first-child {
    max-width: 22em;
    font-size: clamp(28px, 3.3vw, 44px); line-height: 1.18; letter-spacing: -0.026em; font-weight: 600;
}
.ab-words p + p {
    max-width: 27em; margin-top: 1.15em;
    font-size: clamp(21px, 2.3vw, 31px); line-height: 1.3; letter-spacing: -0.018em; font-weight: 500;
}

/* ── Four kinds of things ───────────────────────────────────────── */
.ab-work-head { max-width: 760px; }
.ab-kinds {
    display: grid; gap: 64px; list-style: none;
    margin-top: clamp(48px, 6vw, 88px);
}
@media (min-width: 900px) {
    .ab-kinds { grid-template-columns: 1fr 1fr; gap: clamp(64px, 7vw, 104px) clamp(40px, 5vw, 80px); padding-bottom: 24px; }
    /* the right column sits lower and climbs faster than the page as it scrolls by */
    .ab-kinds > li:nth-child(even) { transform: translate3d(0, calc(150px - var(--p, 0.5) * 190px), 0); }
}
.ab-kind { display: block; color: var(--fg); }
.ab-kind:hover { text-decoration: none; }
.ab-kind:hover .more::after { transform: translateX(2px) rotate(45deg); }
.ab-kind .t-2 { margin-top: 30px; }
.ab-kind p { margin-top: 10px; max-width: 34ch; font-size: 19px; line-height: 1.42; color: var(--fg-2); }
.ab-kind .more { margin-top: 16px; }

/* each tile is composed for what it shows; the media fills 85 to 90% of its width */
.ab-art {
    position: relative; display: block; overflow: hidden; isolation: isolate;
    aspect-ratio: 5 / 4;
    border-radius: var(--radius-lg);
    background: var(--bg-2);
}
.ab-art img, .ab-art .phone { position: absolute; transition: transform .9s var(--ease-out); }

/* Experiments: the podium large, running off the right and bottom, the log plot peeking behind */
.ab-art--exp .ab-main {
    left: 12%; top: 24%; width: 104%;
    border-radius: 12px 0 0 0;
    box-shadow: 0 0 0 1px var(--line), var(--shadow);
    z-index: 1;
}
.ab-art--exp .ab-peek {
    left: 5%; top: 6%; width: 58%;
    border-radius: 10px;
    box-shadow: 0 0 0 1px var(--line);
    opacity: 0.9;
}
.ab-kind:hover .ab-art--exp .ab-main { transform: translate3d(-6px, -6px, 0); }

/* Apps: two phones rising out of the bottom edge */
.ab-art--apps .phone {
    width: 36%; --phone-w: 100%;
    padding: 7px; border-radius: clamp(26px, 3vw, 40px);
}
.ab-art--apps .phone img { position: static; border-radius: clamp(20px, 2.4vw, 33px); object-position: top; }
.ab-art--apps .phone:first-child { left: 11%; top: 16%; }
.ab-art--apps .phone:last-child { right: 11%; top: 24%; }
.ab-kind:hover .ab-art--apps .phone:first-child { transform: translate3d(0, -10px, 0); }
.ab-kind:hover .ab-art--apps .phone:last-child { transform: translate3d(0, -16px, 0); }

/* Play: the quiz card rising from the tile's bottom edge, which crops its second row of flags.
   The screenshot carries its own page margin (about 7% each side, 6% on top); clip-path trims
   it away so only the card shows, with the card's own top corners. */
.ab-art--play .ab-main {
    left: -2.5%; top: 20%; width: 105%;
    clip-path: inset(5.8% 6.9% 0 6.9% round 16px 16px 0 0);
}
.ab-kind:hover .ab-art--play .ab-main { transform: translate3d(0, -8px, 0); }

/* Chill: the Sukoon scene large, the breathing guide as a small card over its corner */
.ab-art--chill .ab-main {
    left: 6%; top: 8%; width: 88%;
    border-radius: 12px;
    box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
}
.ab-art--chill .ab-inset {
    right: 4%; bottom: 6%; width: 38%; z-index: 1;
    border-radius: 10px;
    box-shadow: 0 0 0 1px var(--line-2), var(--shadow);
}
.ab-kind:hover .ab-art--chill .ab-inset { transform: translate3d(-6px, -8px, 0); }

/* ── Principles: a sticky sequence ──────────────────────────────── */
.ab-pr { padding-bottom: clamp(72px, 8vw, 120px); }
.ab-pr-grid { display: grid; gap: 48px; }
.ab-pr-side .t-lead { margin-top: 18px; max-width: 22ch; }
.ab-steps { list-style: none; display: grid; gap: 32px; }
.ab-step .t-lead { margin-top: 14px; max-width: 30ch; }
.ab-rail { display: none; }
@media (max-width: 899px) {
    .ab-step { padding-top: 24px; border-top: 1px solid var(--line); }
    .ab-step .t-1 { font-size: 28px; line-height: 1.12; letter-spacing: -0.02em; }
}
@media (min-width: 900px) {
    .ab-pr-grid { grid-template-columns: 5fr 7fr; gap: clamp(48px, 7vw, 120px); }
    .ab-pr-side { position: sticky; top: calc(50vh - 170px); align-self: start; }
    .ab-steps { gap: 0; padding-bottom: 6vh; }
    .ab-step { min-height: 40vh; display: flex; flex-direction: column; justify-content: center; }
    .js .ab-step { opacity: 0.2; transition: opacity .6s var(--ease); }
    .js .ab-step.is-on { opacity: 1; }
    /* the rail: one bar per rule, the current one stretched */
    .ab-rail { display: flex; gap: 8px; list-style: none; margin-top: 44px; }
    .ab-rail li {
        width: 32px; height: 4px; border-radius: 2px; background: var(--line-2);
        transition: width .7s var(--ease-out), background-color .4s var(--ease);
    }
    .ab-rail li.is-on { width: 120px; background: var(--fg); }
}

/* ── Say hello ──────────────────────────────────────────────────── */
.ab-hello-in { display: grid; gap: 28px; }
@media (min-width: 900px) { .ab-hello-in { grid-template-columns: 7fr 5fr; align-items: end; gap: 64px; } }
.ab-hello-title {
    /* arrives from a short way to the right and is fully there by the time it is a third up the screen */
    --q: min(1, calc(var(--p, 1) * 1.6));
    transform: translate3d(calc((1 - var(--q)) * 4%), 0, 0);
    opacity: calc(0.5 + 0.5 * var(--q));
}
.ab-hello-h { font-size: clamp(54px, 9.4vw, 140px); line-height: 0.96; letter-spacing: -0.05em; }
.ab-hello-copy .t-lead { max-width: 30ch; }
.ab-hello-copy .btns { margin-top: 28px; }
@media (min-width: 900px) { .ab-hello-copy { padding-bottom: 14px; } }

@media (prefers-reduced-motion: reduce) {
    .ab-in { animation: none; }
    .ab-hero-in { transform: none; opacity: 1; }
    .ab-kinds > li:nth-child(even) { transform: none; }
    .ab-hello-title { transform: none; opacity: 1; }
    .js .ab-step { opacity: 1; }
}
