/* Port B case page layer.
   The page underneath is the live yuwen25.com Bybit case page, copied as is (site/, see SOURCES.md):
   same sections, same words, same images, same interactions. This file only swaps its type for Port B's
   (the homepage d-index-plates/index.html): Geist, the same few sizes and weights, and the same three inks.
   The contents list on the left and Back to Home follow Jessica Hsu's case pages (jessicahsu.design/uber). Mock app screens keep their own Bybit type. */

/* project-colors.css sets the project inks on this exact selector; repeating it here (loaded later) wins */
:root, html.project-detail:has(.project-case-page):not(:has(.easydiet-page, .slic-page)) {
  --pb-ink: #1a1a1a;
  --pb-ink-2: #737373;
  --pb-ink-3: #a1a1a1;
  --pb-sans: "Geist", "Helvetica Neue", -apple-system, sans-serif;

  /* the original design-system tokens, mapped onto Port B's scale */
  --font-primary: var(--pb-sans);
  --font-intro: var(--pb-sans);
  --weight-heading: 500;
  /* every size here is one the homepage (d-index-plates/index.html) already uses:
     22 hero title · 19 section title · 15 card title · 14 body · 13 small · 12 label */
  --text-page: 22px;
  --text-section: 19px;
  --text-card: 15px;
  --text-title: 15px;
  --text-lead: 14px;
  --text-body: 14px;
  --text-secondary: 13px;
  --text-meta: 12px;
  --text-control: 13px;
  --leading-heading: 1.4;
  --leading-title: 1.4;
  --leading-body: 1.6;
  --ink: var(--pb-ink);
  /* the original tones snapped to Port B's three inks: black → ink, grey #6b6b6b → ink-2;
     only the running paragraphs (below) drop to ink-2, like the homepage */
  --body-text: var(--pb-ink);
  --muted: var(--pb-ink-2);
  --toc-inactive: var(--pb-ink-3);
}

/* hide the scrollbars, keep scrolling (Yuwen's rule for the whole site) */
html { scrollbar-width: none; scroll-behavior: smooth; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

body { font-family: var(--pb-sans); -webkit-font-smoothing: antialiased; color: var(--pb-ink); }
/* everything written in the page's own voice is Geist; the mock Bybit screens set their own font on
   their own classes, which wins over this zero-specificity rule */
:where(.case-content, .case-directory, .next-xp, footer) :where(h1, h2, h3, h4, h5, h6, p, li, dt, dd, figcaption, a, button, span, small, b, strong, em, summary, label, td, th) { font-family: var(--pb-sans); }

/* ---------- the opening ---------- */
/* = homepage .hero h1 (22/500) with its grey second half like .hero .sub */
.bs-open h1 { font-size: 22px; font-weight: 500; line-height: 1.4; letter-spacing: -0.015em; color: var(--pb-ink); }
.bs-open h1 em { font-style: normal; }  /* keeps the project colour (Bybit orange) */
/* = homepage body text (.about-text p): 14/1.6 ink-2 */
.bs-open .bs-lede { font-size: 14px; line-height: 1.6; color: var(--pb-ink-2); letter-spacing: 0; }
.bs-grid dt { font-size: 12px; color: var(--pb-ink-3); font-weight: 400; }
.bs-grid dd { font-size: 14px; color: var(--pb-ink); font-weight: 400; }
/* one rule between the opening and Context, not two: the section's own top rule stays, the grid's bottom one goes */
html.project-detail .bs-open .bs-grid { border-bottom: 0; }

/* ---------- section heads: the homepage's small label + a quiet medium title ---------- */
/* the homepage's eyebrow (uppercase, tracked, lightest ink); Jessica Hsu labels her sections the same way */
html.project-detail .case-content .story-section > p.bs-eye, html.project-detail .bs-eye { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--pb-ink-3); font-weight: 400; }
/* = homepage .h2 (19/400) */
.bs-sec h2 { font-size: 19px; font-weight: 400; line-height: 1.4; letter-spacing: -0.01em; color: var(--pb-ink); }
.bs-sec h2 em { font-style: normal; color: var(--pb-ink-2); }
/* = homepage card title (.card .cap h3, 15/400) */
.bs-sec h3 { font-size: 15px; font-weight: 400; letter-spacing: -0.005em; color: var(--pb-ink); }
/* the one big line on the page: the homepage's largest heading (footer "Thanks for stopping by.", 24/500) */
html.project-detail #principle[class] h2.bm-word { font-family: var(--pb-sans) !important; font-size: 24px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.3; }

/* ---------- running text ---------- */
/* (written out long to outrank bybit-mentor.css's .bs .story-section > p:not(…):not(…):not(…)) */
html.project-detail .case-content .bs-sec.story-section > p:not(.bs-eye):not(.bs-cap), html.project-detail .case-content .bs-sec.story-section > ul > li, html.project-detail .case-content .bs-sec.story-section > ol > li { font-size: 14px; line-height: 1.6; color: var(--pb-ink-2); }
/* inside cards, charts and diagrams the original colours stay; they already run on the inks mapped above */
.case-content b, .case-content strong { color: var(--pb-ink); font-weight: 500; }
.case-content figcaption { font-size: 13px; color: var(--pb-ink-2); font-weight: 400; }  /* = homepage small text (13) */
.bs-chips li { font-size: 13px; color: var(--pb-ink); }

/* ---------- contents + Back to Home, after Jessica Hsu (jessicahsu.design/uber) ----------
   Small type, compact like hers; a thin light rail, and a short ink bar that slides to the
   current section as you scroll (.32s). Back to Home sits above the list, as on yuwen25.com.
   Sizes and inks from the homepage: 13 (its small text), ink-3 for the rest, ink for the current one. */
.case-directory { top: 120px; }
:is(html.project-detail, html.pb-xp) .case-directory .toc-home {
  display: inline-flex; align-items: center; gap: 7px; margin: 0 0 32px; padding: 0 0 0 24px;
  font: 400 13px/1.2 var(--pb-sans); letter-spacing: 0; text-transform: none; color: var(--pb-ink-3);
  background: none; border: 0; box-shadow: none; white-space: nowrap; transition: color .25s;
}
:is(html.project-detail, html.pb-xp) .case-directory .toc-home::before, :is(html.project-detail, html.pb-xp) .case-directory .toc-home::after { content: none; }
/* the arrow hangs in the gutter left of the text, so "Back" starts on the same line as "Overview" */
:is(html.project-detail, html.pb-xp) .case-directory .toc-home svg { width: 14px; height: 14px; flex: none; margin-left: -21px; transition: transform .25s cubic-bezier(.4, 0, .2, 1); }
:is(html.project-detail, html.pb-xp) .case-directory .toc-home:hover { color: var(--pb-ink); }
:is(html.project-detail, html.pb-xp) .case-directory .toc-home:hover svg { transform: translateX(-3px); }
:is(html.project-detail, html.pb-xp) .toc-links { gap: 15px; padding-left: 24px; }
:is(html.project-detail, html.pb-xp) .toc-links::before { content: ""; display: block; left: 0; top: 0; bottom: 0; width: 2px; border-radius: 0; background: #e8e8e5; }
:is(html.project-detail, html.pb-xp) .toc-indicator { display: block; left: 0; width: 2px; border-radius: 0; background: var(--pb-ink); transition: top .32s cubic-bezier(.4, 0, .2, 1), height .32s cubic-bezier(.4, 0, .2, 1); }
:is(html.project-detail, html.pb-xp) .toc-links a { font: 400 13px/1.2 var(--pb-sans); color: var(--pb-ink-3); padding-left: 0; transition: color .25s; }
:is(html.project-detail, html.pb-xp) .toc-links a[aria-current] { color: var(--pb-ink); font-weight: 500; padding-left: 0; }
:is(html.project-detail, html.pb-xp) .toc-links a:hover { color: var(--pb-ink); }
/* no Back on phones: it sat under the cover with a rule and took a whole row; swipe back instead (Yuwen, 2026-11-26) */
html.project-detail .mobile-project-return { display: none !important; }

/* ---------- SafeDrive (safedrive.html): same rules, its own class names ---------- */
/* title = homepage hero h1; the highlighted word keeps the project colour (SafeDrive blue), as on Bybit */
html.project-detail .sd-intro h1 { font-size: 22px; font-weight: 500; line-height: 1.4; letter-spacing: -0.015em; color: var(--pb-ink); }
html.project-detail .sd-intro .sd-lede { font-size: 14px; line-height: 1.6; color: var(--pb-ink-2); letter-spacing: 0; font-weight: 400; }
html.project-detail .sd-facts-row dt { font-size: 12px; color: var(--pb-ink-3); font-weight: 400; }
html.project-detail .sd-facts-row dd { font-size: 14px; color: var(--pb-ink); font-weight: 400; }
html.project-detail .sd-part #part-title { font-size: 14px; line-height: 1.6; color: var(--pb-ink-2); }
html.project-detail .sd-part-map a { font-size: 13px; }
/* section labels = homepage eyebrow */
html.project-detail .case-content .sd-sec p.eyebrow, html.project-detail .sd-sec .chapter-label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--pb-ink-3); font-weight: 400; }
/* section titles = homepage .h2 */
html.project-detail .sd-sec h2 { font-size: 19px; font-weight: 400; line-height: 1.4; letter-spacing: -0.01em; color: var(--pb-ink); }
/* "Have you ever sat in a car…" is the page's one big line: the homepage's largest heading, 24/500 */
html.project-detail .sd-sec .sds-hook { font-size: 24px; font-weight: 500; line-height: 1.3; letter-spacing: -0.02em; }
/* running paragraphs = homepage body text */
html.project-detail .case-content .sd-sec.story-section > p:not(.eyebrow):not(.chapter-label):not(.sds-hook),
html.project-detail .case-content .sd-sec .sds-wide { font-size: 14px; line-height: 1.6; color: var(--pb-ink-2); }
/* the lede is 14px now, not 20: keep it right under the title instead of floating level with the phone */
/* and "Try the prototype" stands beside the whole opening (title, lede and the facts), so there is no empty
   band next to it (Yuwen, 2026-11-26: keep it this way) */
@media (min-width: 761px) {
  html.project-detail .sd-intro { grid-template-rows: auto auto 1fr; }
  html.project-detail .sd-intro .sd-lede { align-self: start; margin-top: 0; }
  html.project-detail .sd-intro > .sd-facts-row { grid-column: 1; grid-row: 3; align-self: start; }
  html.project-detail .sd-intro .sa-try-phone { grid-row: 1 / 4; align-self: center; }
}

/* ---------- dividers: lighter than the original #eaebec so they separate without catching the eye (both pages) ---------- */
html.project-detail .story-section:not(.overview),
html.project-detail .bs-open .bs-grid,
html.project-detail .sd-intro .sd-facts-row { border-top-color: #f2f2f0; }
html.project-detail .sd-more, html.project-detail .sds-faq-list, html.project-detail .sds-faq-list details { border-color: #f2f2f0; }
html.project-detail footer, html.project-detail footer * { border-color: #f2f2f0; }

/* SafeDrive: no rule above "Why I built it"; the project map right before it already closes the opening */
html.project-detail #goal.story-section { border-top: 0; }

/* ---------- Experience pages: every piece of writing is marked with its role by xp-type.js ----------
   Sizes and weights are the homepage's; neutral text (data-pb-ink) takes the homepage inks, project colours stay.
   !important because each of these pages sets type on many of its own classes. */
html.pb-xp [data-pbt="h1"] { font-size: 22px !important; font-weight: 500 !important; line-height: 1.4 !important; letter-spacing: -0.015em !important; }
html.pb-xp [data-pbt="h2"] { font-size: 19px !important; font-weight: 400 !important; line-height: 1.4 !important; letter-spacing: -0.01em !important; }
html.pb-xp [data-pbt="h3"] { font-size: 15px !important; font-weight: 400 !important; line-height: 1.45 !important; letter-spacing: -0.005em !important; }
html.pb-xp [data-pbt="h4"] { font-size: 14px !important; font-weight: 500 !important; line-height: 1.5 !important; letter-spacing: 0 !important; }
html.pb-xp [data-pbt="body"] { font-size: 14px !important; font-weight: 400 !important; line-height: 1.6 !important; letter-spacing: 0 !important; }
html.pb-xp [data-pbt="quote"] { font-size: 19px !important; font-weight: 400 !important; line-height: 1.45 !important; letter-spacing: -0.01em !important; }
html.pb-xp [data-pbt="dt"], html.pb-xp [data-pbt="eye"] { font-size: 12px !important; font-weight: 400 !important; letter-spacing: .06em !important; text-transform: uppercase !important; line-height: 1.5 !important; }
html.pb-xp [data-pbt="dd"] { font-size: 14px !important; font-weight: 400 !important; line-height: 1.5 !important; letter-spacing: 0 !important; }
html.pb-xp [data-pbt="cap"] { font-size: 13px !important; font-weight: 400 !important; line-height: 1.5 !important; letter-spacing: 0 !important; }
html.pb-xp:not(.pb-xp-dark) [data-pb-ink]:is([data-pbt="h1"], [data-pbt="h2"], [data-pbt="h3"], [data-pbt="h4"], [data-pbt="dd"], [data-pbt="quote"]) { color: var(--pb-ink) !important; }
html.pb-xp:not(.pb-xp-dark) [data-pb-ink]:is([data-pbt="body"], [data-pbt="cap"]) { color: var(--pb-ink-2) !important; }
html.pb-xp:not(.pb-xp-dark) [data-pb-ink]:is([data-pbt="dt"], [data-pbt="eye"]) { color: var(--pb-ink-3) !important; }

/* the contents list may still scroll when it is taller than the window, but never shows a scrollbar
   (some Experience pages gave it a visible thin one) */
:is(html.project-detail, html.pb-xp) .case-directory, :is(html.project-detail, html.pb-xp) .case-directory * { scrollbar-width: none !important; }
:is(html.project-detail, html.pb-xp) .case-directory::-webkit-scrollbar, :is(html.project-detail, html.pb-xp) .case-directory *::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }

/* phones: no contents bar at all (HeartByte still showed the old "In this case study" fold with its rules);
   every case page reads top to bottom there and you swipe back (Yuwen, 2026-11-26) */
@media (max-width: 900px) { .case-directory { display: none !important; } }

/* no scrollbars anywhere on the page, inner scrolling boxes included (Yuwen's rule); scrolling still works */
*, *::before, *::after { scrollbar-width: none !important; }
*::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }

/* HeartByte's own "← Back to Play" link: replaced by Back to Home above its contents, like every other case page */
html.pb-xp .hb-back { display: none !important; }

/* ---------- every case page's contents column sits like Bybit's (Yuwen, 2026-11-26) ----------
   Bybit: column 208px at the page's 1248px reading width, 48px gap, sticks 120px from the top, Back to Home
   then 32px, then the list. Reset & Restart and Easy Diet used the old wide "original-reading" layout
   (190px column at the very left, sticking 28px from the top); they now use the same measure. */
@media (min-width: 901px) {
  :is(html.project-detail, html.pb-xp) .case-layout.original-reading {
    width: min(1248px, calc(100% - 64px)); max-width: 1248px; margin-inline: auto;
    grid-template-columns: 208px minmax(0, 1fr); column-gap: 48px;
  }
  :is(html.project-detail, html.pb-xp) .case-directory { position: sticky !important; top: 120px !important; }
  :is(html.project-detail, html.pb-xp) .case-directory .toc-home { height: 16px; margin: 0 0 32px !important; padding-left: 24px !important; }
}

/* ---------- The Handmaiden, laid out like the other case pages (hm-layout.js builds the frame and contents) ----------
   Cover in Bybit's rounded frame, contents on the left, sections in the reading column; the page keeps its
   navy and pink, so the contents use the page's pink instead of the Port B greys. */
html.pb-xp-dark .hm-cover-return { display: none !important; }
html.pb-xp-dark .pb-hm-cover { position: relative; isolation: isolate; overflow: hidden; width: min(1248px, calc(100% - 64px)); height: min(720px, calc(100svh - 48px)); margin: 24px auto 0; border-radius: 28px; box-shadow: 0 0 0 1px rgb(205 171 178 / .08); }
html.pb-xp-dark .pb-hm-cover .hm-screen { height: 100% !important; }
html.pb-xp-dark .pb-hm-layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); column-gap: 48px; align-items: start; width: min(1248px, calc(100% - 64px)); margin: 48px auto 0; }
html.pb-xp-dark .pb-hm-layout .case-directory { display: block; }
html.pb-xp-dark .pb-hm-layout .toc-links { position: relative; display: flex; flex-direction: column; align-items: flex-start; }
html.pb-xp-dark .pb-hm-layout .toc-indicator { position: absolute; left: 0; }
html.pb-xp-dark .pb-hm-layout .case-content { min-width: 0; }
html.pb-xp-dark .pb-hm-layout .hm-section { padding-block: 48px; }
html.pb-xp-dark .pb-hm-layout .hm-section:first-child { padding-top: 0; }
html.pb-xp-dark .pb-hm-layout .shell.hm-content { width: 100%; margin: 0; }
/* the lilac sections were full-width bands; inside the reading column they become rounded panels */
html.pb-xp-dark .pb-hm-layout .hm-muted { border-radius: 24px; padding: 40px 36px; margin-block: 16px; }
html.pb-xp-dark .pb-hm-layout .case-directory .toc-home { color: rgb(205 171 178 / .62) !important; }
html.pb-xp-dark .pb-hm-layout .case-directory .toc-home:hover { color: #f6e4e8 !important; }
html.pb-xp-dark .pb-hm-layout .toc-links a { color: rgb(205 171 178 / .5) !important; }
html.pb-xp-dark .pb-hm-layout .toc-links a[aria-current], html.pb-xp-dark .pb-hm-layout .toc-links a:hover { color: #f6e4e8 !important; }
html.pb-xp-dark .pb-hm-layout .toc-links::before { background: rgb(205 171 178 / .18) !important; }
html.pb-xp-dark .pb-hm-layout .toc-indicator { background: #fe6b80 !important; }
@media (max-width: 900px) {
  html.pb-xp-dark .pb-hm-cover { width: calc(100% - 32px); height: min(560px, 72svh); margin-top: 16px; border-radius: 20px; }
  html.pb-xp-dark .pb-hm-layout { display: block; width: calc(100% - 40px); margin-top: 32px; }
  html.pb-xp-dark .pb-hm-layout .hm-muted { padding: 28px 20px; border-radius: 18px; }
}
/* the cover's pink glow is the same CSS as yuwen25, but in the smaller framed box, with navy all round it,
   it reads much stronger than on the full-screen original; turn it down so it feels like the original */
html.pb-xp-dark .pb-hm-cover .hm-cover-glow { opacity: .55; }

/* ---------- Reset & Restart / Easy Diet on phones: their own Figma-built mobile layouts ----------
   The text in them now draws in Geist (the diagram fonts point at Geist, see fonts/ and font-backup/),
   and the headings come down to the homepage's sizes: section titles 19/400, sub-heads 15/500,
   statements 15/400, the slogan 19/500. Numbers inside the charts and the brand wordmarks are left alone. */
html.pb-xp .fsx-phone.rrn h2.rrn-h2 { font-size: 19px !important; font-weight: 400 !important; line-height: 1.4 !important; letter-spacing: -0.01em !important; color: var(--pb-ink) !important; }
html.pb-xp .fsx-phone.rrn h3 { font-size: 15px !important; font-weight: 500 !important; line-height: 1.45 !important; letter-spacing: -0.005em !important; color: var(--pb-ink) !important; }
html.pb-xp .fsx-phone.rrn .rrn-take { font-size: 15px !important; font-weight: 500 !important; line-height: 1.5 !important; color: var(--pb-ink) !important; }
html.pb-xp .fsx-phone.rrn .rrn-goal-text { font-size: 15px !important; font-weight: 400 !important; line-height: 1.55 !important; }
html.pb-xp .fsx-phone.rrn .rrn-slogan { font-size: 19px !important; font-weight: 500 !important; letter-spacing: -0.01em !important; }
html.pb-xp .edn-tagline { font-size: 19px !important; font-weight: 500 !important; letter-spacing: -0.01em !important; }
/* its facts card: same as every other page's facts (label 12 uppercase ink-3, value 14/400 ink) */
html.pb-xp .rrn-fact dt { font-size: 12px !important; font-weight: 400 !important; letter-spacing: .06em !important; color: var(--pb-ink-3) !important; }
html.pb-xp .rrn-fact dd { font-size: 14px !important; font-weight: 400 !important; color: var(--pb-ink) !important; }
