/* XSI Rapture — portrait layout (phones, tablets held upright).
   engine.js sets body.portrait when the window is taller than it is wide and
   gives the stage a 720px width with a height that follows the window. Every
   chapter then reflows into one column with larger type; captions carry the
   narration, so a few secondary details are dropped to keep each chapter on
   one screen. Landscape positions are partly inline styles in index.html,
   which is why the position resets below need !important. */

/* ── Frame: HUD, captions, player ─────────────────────── */

body.portrait .hud-brand { left: 36px; top: 40px; gap: 10px; font-size: 20px; }
body.portrait .hud-brand svg { width: 28px; height: 28px; }
body.portrait .hud-brand .sep { height: 18px; }
body.portrait .hud-chapter { right: 36px; top: 36px; }
body.portrait .hud-chapter .num { font-size: 14px; }
body.portrait .hud-chapter .name { font-size: 15px; }
body.portrait .hud-segs { gap: 4px; margin-top: 8px; }
body.portrait .hud-segs i { width: 12px; }

body.portrait #caption {
  bottom: 40px;
  width: max-content;
  max-width: 648px;
  white-space: normal;
  padding: 12px 20px;
  font-size: 23px;
  line-height: 1.4;
}

/* phones: no player bar; tap the film to pause, as on the website */
@media (max-width: 760px) {
  #controls { display: none; }
}

/* ── Scenes become one column ─────────────────────────── */

body.portrait .scene { padding: 118px 36px 190px; }
body.portrait .scene.active { display: flex; flex-direction: column; gap: 22px; }
body.portrait .scene > :not(.cursor):not(.tip):not(.intro-glow) {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
}

body.portrait .head { max-width: none; }
body.portrait .eyebrow { gap: 10px; font-size: 15px; }
body.portrait .eyebrow .bar { width: 26px; }
body.portrait .title { margin-top: 12px; font-size: 46px; line-height: 1.1; }
body.portrait .lead { margin-top: 14px; font-size: 21px; }
body.portrait .chip { font-size: 16px; }

/* ── 01 Intro ─────────────────────────────────────────── */

body.portrait .intro-logo { width: 210px; height: 210px; }
body.portrait .intro-word { margin-top: 34px; gap: 18px; font-size: 64px; }
body.portrait .intro-word .sep { height: 50px; }
body.portrait .intro-tag { margin-top: 16px; padding: 0 40px; font-size: 24px; text-align: center; }
body.portrait .intro-meta { margin-top: 30px; padding: 0 40px; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ── Rapture identity on phones ───────────────────────── */

body.portrait .hud-brand { font-size: 13px; letter-spacing: 0.24em; }
body.portrait .hud-chapter .num { font-size: 20px; }
body.portrait #caption { font-size: 25px; }
body.portrait .scene[data-ord]::before { left: 24px; bottom: 150px; font-size: 220px; }
body.portrait .bg-rug { right: -440px; }
body.portrait #s-intro.active { flex-direction: column; gap: 34px; }
body.portrait .intro-loom canvas { width: 260px; height: 390px; }
body.portrait .intro-text { text-align: center; }
body.portrait .intro-by { justify-content: center; }
body.portrait .intro-name { margin-top: 12px; font-size: 104px; }
body.portrait #s-intro .intro-tag { margin-top: 14px; padding: 0; font-size: 26px; }
body.portrait #s-intro .intro-meta { margin-top: 22px; justify-content: center; padding: 0 30px; }

/* ── 02 Problem ───────────────────────────────────────── */

body.portrait .prob-copy { width: auto; }
body.portrait .prob-copy .title { font-size: 50px; }
body.portrait .prob-copy .lead { display: none; }
body.portrait .prob-strap { margin-top: 18px; font-size: 24px; }
body.portrait .order { width: auto; gap: 12px; padding: 14px 16px; }
body.portrait .order .chips { display: none; }
body.portrait .order b { font-size: 18px; }
body.portrait .order small { font-size: 14px; }
body.portrait .tries { width: auto; gap: 12px; }
body.portrait .try canvas { width: 190px; height: 190px; }
body.portrait .try h5 { margin-top: 10px; font-size: 18px; }
body.portrait .try .x { font-size: 14px; }

/* ── 03 Every shape ───────────────────────────────────── */

body.portrait .morph { width: auto; height: 540px; }
body.portrait .morph canvas { width: 100%; height: 100%; object-fit: contain; }
body.portrait .shapes { width: auto; grid-template-columns: repeat(3, 1fr); gap: 10px; }
body.portrait .shape { gap: 10px; padding: 10px 12px; font-size: 16px; }
body.portrait .shape svg { width: 30px; height: 30px; }
body.portrait .dims { width: auto; padding: 16px 20px; }
body.portrait .dims .row { padding: 6px 0; font-size: 16px; }
body.portrait .dims .row b { font-size: 15px; }

/* ── 04 What it keeps ─────────────────────────────────── */

body.portrait .keep-rug { width: 520px; height: 520px; margin: 0 auto; }
body.portrait .keep-rug canvas { width: 520px; height: 520px; }
body.portrait .kc { width: auto; padding: 14px 16px; }
body.portrait .kc h4 { font-size: 19px; }
body.portrait .kc p { margin-top: 6px; font-size: 16px; }

/* ── 05 Knot-true ─────────────────────────────────────── */

body.portrait .zoom { width: auto; height: 360px; }
body.portrait .zoom canvas { width: 100%; height: 100%; object-fit: cover; }
body.portrait .calc { width: auto; padding: 18px 20px; }
body.portrait .calc .grid { grid-template-columns: 1fr 1fr; gap: 8px; }
body.portrait .inp b { font-size: 18px; }
body.portrait .calc .eq { margin-top: 14px; }
body.portrait .calc .eq strong { font-size: 40px; }
body.portrait .calc .why { margin-top: 12px; padding-top: 12px; font-size: 17px; }
body.portrait .cmp { width: auto; gap: 10px; }
body.portrait .cmp .card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; }
body.portrait .cmp canvas { width: 100%; height: 140px; object-fit: cover; }
body.portrait .cmp b { font-size: 16px; }
body.portrait .cmp small { font-size: 13px; }

/* ── 06 Your colours ──────────────────────────────────── */

body.portrait .swatches { width: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body.portrait .sw-h { grid-column: 1 / -1; }
body.portrait .sw { grid-template-columns: 44px 1fr; padding: 10px 12px; }
body.portrait .sw i { width: 44px; height: 34px; }
body.portrait .sw b { font-size: 17px; }
body.portrait .sw code { display: none; }
body.portrait .edges { width: auto; gap: 12px; }
body.portrait .ec { padding: 12px; }
body.portrait .ec canvas { height: 320px; }
body.portrait .ec h5 { flex-direction: column; gap: 4px; font-size: 17px; }
body.portrait .ec h5 span { font-size: 14px; }

/* ── 07 The studio ────────────────────────────────────── */

body.portrait .steps { gap: 8px; }
body.portrait .st { gap: 8px; padding: 10px; font-size: 15px; }
body.portrait .st i { width: 24px; height: 24px; font-size: 11px; }
body.portrait .studio { width: auto; height: 600px; flex: none; }
body.portrait .view { padding: 20px; }
body.portrait .drop { height: 240px; font-size: 18px; }
body.portrait .file b { font-size: 17px; }
body.portrait .file .ok { display: none; }
body.portrait .cfg { grid-template-columns: 1fr; gap: 16px; }
body.portrait .fields { grid-template-columns: 1fr 1fr; }
body.portrait .pl { font-size: 18px; }
body.portrait .result { flex-direction: column; gap: 16px; text-align: center; }
body.portrait .result canvas { width: 320px; height: 320px; }
body.portrait .result h3 { margin-top: 10px; font-size: 26px; }
body.portrait .result p { font-size: 15px; }
body.portrait .side { width: auto; gap: 10px; }
body.portrait .side .card { padding: 12px 16px; }
body.portrait .side b { font-size: 17px; }
body.portrait .side p { font-size: 14px; }

/* ── 08 Checked ───────────────────────────────────────── */

body.portrait .checks { width: auto; padding: 18px 20px; }
body.portrait .ck { padding: 9px 0; font-size: 18px; }
body.portrait .ck .tick { width: 26px; height: 26px; }
body.portrait .ck .res { font-size: 13px; }
body.portrait .notes { width: auto; gap: 12px; }
body.portrait .notecard { padding: 16px 18px; }
body.portrait .notecard p { font-size: 18px; }
body.portrait .notecard small { font-size: 15px; }

/* ── 09 Production files ──────────────────────────────── */

body.portrait .files-rug { width: 420px; height: 420px; margin: 0 auto; }
body.portrait .files-rug canvas { width: 420px; height: 420px; }
body.portrait .files { width: auto; gap: 10px; }
body.portrait .fc { grid-template-columns: 48px 1fr auto; gap: 12px; padding: 12px 14px; }
body.portrait .fc .ext { width: 48px; height: 48px; font-size: 12px; }
body.portrait .fc b { font-size: 18px; }
body.portrait .fc p { font-size: 14px; }

/* ── 10 Your designs stay yours ───────────────────────── */

body.portrait .trust { grid-template-columns: 1fr 1fr; gap: 12px; }
body.portrait .tc { min-height: 0; padding: 16px; }
body.portrait .tc .ico { width: 44px; height: 44px; }
body.portrait .tc h4 { margin-top: 10px; font-size: 18px; }
body.portrait .tc p { font-size: 14.5px; }

/* ── 11 Outro ─────────────────────────────────────────── */

body.portrait .outro-rugs { zoom: 0.8; gap: 14px; }
body.portrait .outro-title { margin-top: 30px; padding: 0 36px; font-size: 50px; }
body.portrait .outro-sub { padding: 0 40px; font-size: 21px; }
body.portrait .outro-chips { flex-wrap: wrap; gap: 10px; padding: 0 40px; }
body.portrait .outro-url { margin-top: 28px; }
