/* =========================================================================
   Pall home — the scroll story (10 Kas 2026).
   Each chapter (.ch) carries one number, --p (0 → 1), written by story.js as
   the page scrolls. Every drawn part takes its own window of that number
   (--a start, --b end) and turns it into a stroke, a fade or a move.
   No JS, or "Reduce Motion" on: --p stays 1, every drawing shows finished.
   Ink is black; blue marks only what Pall itself does.
   ========================================================================= */

.ch { --p: 1; position: relative; }
.ch__stage { display: grid; align-items: center; padding-block: clamp(40px, 7vw, 88px); }
.ch__in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 5vw, 72px); align-items: center;
  padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.ch--rev .ch__in { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.ch--rev .ch__copy { order: 2; }
.ch__copy { max-width: 30rem; }
.ch__copy .h2 { font-size: clamp(1.9rem, 1.15rem + 2.7vw, 3.05rem); line-height: 1.06; margin-top: var(--s-4); text-wrap: balance; }
.ch__copy .lede { margin-top: var(--s-4); max-width: 26em; text-wrap: pretty; }
.ch__art { min-width: 0; display: grid; align-items: center; justify-items: stretch; }

/* Pinned mode: story.js adds .story-on when motion is allowed. */
.story-on .ch { --p: 0; height: 200vh; height: 200svh; }
.story-on .ch--short { height: 170vh; height: 170svh; }
.story-on .ch__stage { position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); height: calc(100svh - var(--nav-h)); padding-block: 0; }

/* progress line under the chapter label */
.ch__bar { display: block; width: 72px; height: 2px; margin-top: var(--s-5); background: var(--line-2); border-radius: 2px; overflow: hidden; }
.ch__bar i { display: block; height: 100%; background: var(--ink); transform-origin: 0 50%; transform: scaleX(var(--p)); }

/* steps: short words that light up as the drawing reaches them */
.ch__steps { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: var(--s-5); }
/* plain words with a dot — they are not buttons, so they must not look like buttons */
.ch__steps li { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-body); font-weight: 600; color: var(--ink);
  opacity: calc(.28 + .72 * var(--e)); transform: translateY(calc((1 - var(--e)) * 6px)); }
.ch__steps li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---- the one rule that turns --p into each part's own progress ---- */
.ch [style*="--a"] {
  --t: clamp(0, calc((var(--p) - var(--a)) / (var(--b) - var(--a))), 1);
  --e: calc(var(--t) * var(--t) * (3 - 2 * var(--t)));
}
.ch .lin[style*="--a"] { --e: var(--t); }

/* ---- drawing vocabulary ---- */
.sc { display: block; width: 100%; height: auto; max-height: min(68vh, 520px); max-height: min(68svh, 520px); overflow: visible; }
.sc .ink { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.sc .thin { stroke-width: 2; }
.sc .fw { fill: #fff; }
.sc .blk { fill: var(--ink); }
.sc .soft { fill: none; stroke: var(--line); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 9; }
.sc .ghost { fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 5 7; }
.sc .pl { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.sc .plf { fill: var(--accent); }
.sc .wh { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.sc text { font-family: var(--font-sans); font-size: 16px; font-weight: 600; fill: var(--muted); }

/* draw a stroke on (path needs pathLength="1") */
.sc .d { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--e)); opacity: clamp(0, calc(var(--t) * 40), 1); }
/* fade + rise */
.f { opacity: var(--e); transform: translateY(calc((1 - var(--e)) * 14px)); }
/* pop from its own centre */
.sc .pop { opacity: var(--e); transform: scale(calc(.55 + .45 * var(--e))); transform-box: fill-box; transform-origin: 50% 50%; }
/* grow up from the baseline */
.sc .grow { transform: scaleY(var(--e)); transform-box: fill-box; transform-origin: 50% 100%; opacity: clamp(0, calc(var(--t) * 40), 1); }
/* fade out */
.sc .out { opacity: calc(1 - var(--e)); }

/* scene: the leak */
.sc .fall { transform: translate(calc(var(--e) * 8px), calc(var(--e) * 84px)) rotate(calc(var(--e) * 24deg)); transform-box: fill-box; transform-origin: 50% 100%; opacity: calc(1 - .5 * var(--e)); }
.sc .hand { transform: rotate(calc(var(--p) * 330deg)); transform-box: view-box; transform-origin: 404px 78px; }
/* scene: the whole picture */
.sc .gather { opacity: calc(.3 + .7 * var(--e)); transform: translate(calc((1 - var(--e)) * var(--dx)), calc((1 - var(--e)) * var(--dy))) rotate(calc((1 - var(--e)) * var(--r))); transform-box: fill-box; transform-origin: 50% 50%; }
/* scene: quality */
.sc .lens { transform: translateX(calc(var(--e) * 336px)); }
.sc .drop { transform: translateY(calc(var(--e) * 122px)); }
/* scene: the day */
.sc .sweep { transform: rotate(calc(var(--e) * 360deg)); transform-box: view-box; transform-origin: 240px 180px; }

/* small always-on life, only when motion is welcome */
@media (prefers-reduced-motion: no-preference) {
  .sc .belt { stroke-dasharray: 10 12; animation: st-belt 1.4s linear infinite; }
  .sc .puff { animation: st-puff 4.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
  .sc .puff2 { animation-delay: -1.4s; } .sc .puff3 { animation-delay: -2.8s; }
  .sc .rays { animation: st-turn 26s linear infinite; transform-box: fill-box; transform-origin: 50% 50%; }
  .sc .beat { animation: st-beat 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 50%; }
  .cue svg { animation: st-nod 1.8s ease-in-out infinite; }
}
@keyframes st-belt { to { stroke-dashoffset: -22; } }
@keyframes st-puff { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-7px) scale(1.07); } }
@keyframes st-turn { to { transform: rotate(360deg); } }
@keyframes st-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes st-nod { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* hand-drawn wobble: desktop pointers only (filters are costly on phones) */
@media (hover: hover) and (pointer: fine) { .sc .rough { filter: url(#st-rough); } }

/* ---- hero scroll cue ---- */
.cue { display: inline-flex; align-items: center; gap: 8px; margin-top: var(--s-5); font-size: var(--t-small); font-weight: 600; color: var(--ink); }
.cue svg { width: 18px; height: 18px; }

/* ---- every screen ---- */
.devs { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(18px, 4vw, 44px); list-style: none; padding: 0; margin-top: var(--s-7); }
.devs li { display: grid; justify-items: center; gap: 10px; font-size: var(--t-small); font-weight: 600; color: var(--ink); min-width: 64px; }
.devs svg { width: 40px; height: 40px; }

/* ---- closing ---- */
.fin__mark { width: 84px; height: 84px; margin: 0 auto var(--s-5); }
.fin__trust { display: inline-flex; align-items: center; gap: 8px; margin-top: var(--s-6); font-size: var(--t-small); color: var(--muted); }
.fin__trust svg { width: 16px; height: 16px; color: var(--ink); flex: none; }
.fin__trust a { color: var(--accent); display: inline-block; padding-block: 12px; }
.fin__more { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; margin-top: var(--s-6); }
.fin__more a { color: var(--accent); font-size: var(--t-small); font-weight: 500; padding: 12px 10px; min-height: 44px; display: inline-flex; align-items: center; }
.fin__more a:hover { text-decoration: underline; }

/* ---- compact width (phones): drawing on top, words under it, left aligned ---- */
@media (max-width: 743px) {
  .ch__in, .ch--rev .ch__in { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); align-content: center; }
  .ch--rev .ch__copy { order: 0; }
  .ch__art { order: -1; justify-items: start; }
  .sc { max-height: 40vh; max-height: 40svh; width: auto; max-width: 100%; aspect-ratio: 4 / 3; }
  .ch__copy .h2 { font-size: 2rem; line-height: 1.1; }
  .ch__bar { margin-top: var(--s-4); }
  .ch__steps { margin-top: var(--s-4); }
  .devs { justify-content: flex-start; }
  .fin__mark { margin-left: 0; }
  .fin__more { justify-content: flex-start; margin-left: -10px; }
}
/* compact height (phone on its side, small windows): no pinning, side by side */
@media (max-height: 540px) {
  .story-on .ch, .story-on .ch--short { height: auto; }
  .story-on .ch__stage { position: static; height: auto; padding-block: 36px; }
  .sc { max-height: 78vh; max-height: 78svh; }
}
@media (max-height: 540px) and (min-width: 560px) {
  .ch__in, .ch--rev .ch__in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ch__art { order: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ch__stage { padding-block: clamp(36px, 6vw, 72px); }
}
@media print { .ch { --p: 1 !important; height: auto !important; } .ch__stage { position: static !important; height: auto !important; } }

/* =========================================================================
   One table (10 Kas, 2. sürüm): the whole story plays on a single 3D table.
   No words beside it — the only text is printed on the table top.
   story.js moves the "camera" (the SVG viewBox) from tile to tile; the box
   is fitted with "meet", so a phone sees one tile and a desktop sees its
   neighbours too — same drawing, no separate layouts.
   ========================================================================= */
.story-on .ch--table { height: 820vh; height: var(--tb-h, 820svh); }
.tb { position: relative; display: block; padding: 0; }
.tb__scroll { width: 100%; height: 100%; }
.tb__svg { width: 100%; height: 100%; max-height: none; overflow: hidden; }
.story-on .tb { height: calc(100vh - var(--nav-h)); height: calc(100svh - var(--nav-h)); }
.tb__bar { position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); width: 96px; margin: 0 0 0 -48px; }
/* 11 Kas — Notion çizgisi: düz beyaz, çok açık gri yanlar, ekranda hep aynı ince kalem (yakınlaşınca kalınlaşmaz) */
.sc .t-top { fill: #fff; } .sc .t-lf { fill: #fff; } .sc .t-rt { fill: #f1f1ef; }
.sc .t-dt { fill: #3a3a3c; } .sc .t-dl { fill: #1d1d1f; } .sc .t-dr { fill: #2c2c2e; }
.tb__svg .ink:not(.d) { stroke-width: 1.9; vector-effect: non-scaling-stroke; }
.tb__svg .ink.thin { stroke-width: 1.4; }
.tb__svg .pl { stroke-width: 2.4; }
.sc .t-lab { font-family: var(--font-sans); font-size: 27px; font-weight: 600; letter-spacing: -.01em; fill: var(--ink); }
.sc .rise { opacity: var(--e); transform: translateY(calc((1 - var(--e)) * 46px)); }
.sc .tmove { transform: translate(calc(var(--e) * var(--dx)), calc(var(--e) * var(--dy))); }
.sc .tfall { transform: translate(calc(var(--e) * 78px), calc(var(--e) * 200px)); opacity: calc(1 - var(--e) * var(--e)); }
/* the far-away recap view would shrink the words below a readable size, so they bow out first */
.story-on .sc .lab-out { opacity: calc(1 - var(--e)); }
/* no pinning (Reduce Motion or no JS): the finished table, big enough to read, pans sideways by hand */
html:not(.story-on) .tb { padding-block: clamp(24px, 5vw, 56px); }
html:not(.story-on) .tb__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; height: auto; }
html:not(.story-on) .tb__svg { width: 100%; min-width: 980px; height: auto; aspect-ratio: var(--tb-ar, 1445.6 / 1056); }
html:not(.story-on) .tb__bar { display: none; }
@media (max-height: 540px) {
  .story-on .ch--table { height: 820vh; height: var(--tb-h, 820svh); }
  .story-on .tb { position: sticky; height: calc(100vh - var(--nav-h)); height: calc(100svh - var(--nav-h)); padding-block: 0; }
  .tb__svg { max-height: none; }
}
@media (max-width: 743px) { .tb__svg { max-height: none; width: 100%; aspect-ratio: auto; } }

/* Text that sits on the hero film: the film is not white, so grey and blue text fell under 4.5:1.
   Darker grey for the small lines, ink for the plain links (the filled blue button stays the one blue action). */
.hero--film .hero__lede, .hero--film .eyebrow { color: #48484a; }
.hero--film .btn--ghost, .hero--film .btn--ghost:hover, .nav .btn--ghost, .nav .btn--ghost:hover { color: var(--ink); }


/* ---- sub-pages (What it does, Integrations, The app): short page head + their own table ---- */
.ph { padding-top: clamp(36px, 6vw, 80px); padding-bottom: clamp(4px, 1.5vw, 20px); }
.ph .display { margin-top: var(--s-4); }
.ph .lede { margin-top: var(--s-4); max-width: 32ch; color: #48484a; }
.sc .t-word { font-family: var(--font-sans); font-size: 15px; font-weight: 600; fill: var(--ink); opacity: var(--e); }
.tb__svg a { cursor: pointer; }
.tb__svg a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tb__svg a:hover image { transform: translateY(-3px); transition: transform .15s ease; }

/* ---- the site's own hand drawings, drawing themselves as the page scrolls (tools/cizim.py) ---- */
.il { display: block; width: 100%; height: auto; overflow: visible; }
.il .dr { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--e)); opacity: clamp(0, calc(var(--t) * 40), 1); fill-opacity: var(--e); }
.il .fi { opacity: var(--e); }
.story-on .ch--il { height: 250vh; height: 250svh; }
.ch--il .ch__art { gap: clamp(12px, 2.4vw, 28px); justify-items: center; }
.il--big { max-height: min(40vh, 340px); max-height: min(40svh, 340px); max-width: 520px; }
.minis { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 2vw, 24px); width: 100%; max-width: 520px; }
.minis li { display: grid; justify-items: center; align-content: end; gap: 6px; }
.minis .il { height: clamp(64px, 12vh, 104px); height: clamp(64px, 12svh, 104px); width: auto; max-width: 100%; }
.minis span { font-size: var(--t-small); font-weight: 600; color: var(--ink); }
.ch--il .ch__copy .lede { color: #48484a; }
@media (max-width: 743px) { .ch--il .ch__art { justify-items: center; } .il--big { max-height: 32vh; max-height: 32svh; } }
@media (max-height: 540px) { .il--big { max-height: 46vh; } .minis .il { height: 56px; } }

/* ---- The app page: real screens that arrive as the page scrolls (no pinning, sections keep their own height) ---- */
.story-on .ch--flow { height: auto; }
.story-on .ch--flow .mv { opacity: var(--e); transform: translate(calc((1 - var(--e)) * var(--dx, 0px)), calc((1 - var(--e)) * var(--dy, 48px))) scale(calc(var(--s0, 1) + (1 - var(--s0, 1)) * var(--e))); will-change: transform, opacity; }
.story-on .ch--flow .par { transform: translateY(calc((.5 - var(--p)) * var(--py, 60px))); }

/* ---- Integrations: every app once more as a thumb-sized button ---- */
.apps { padding-block: clamp(8px, 3vw, 32px) clamp(40px, 7vw, 88px); }
.apps__list { list-style: none; margin: 0 auto; padding: 0; max-width: 860px; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.apps__list a { display: grid; justify-items: center; gap: 8px; min-height: 88px; padding: 12px 4px; border-radius: 16px; color: var(--ink); text-decoration: none; font-size: var(--t-small); font-weight: 600; text-align: center; }
.apps__list img { width: 48px; height: 48px; border-radius: 11px; }
.apps__list a:active { background: #f2f2f4; }
.apps__list a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .apps__list a:hover { background: #f5f5f7; } }
@media (max-width: 743px) { .tb__svg a { pointer-events: none; } }

/* ---- Integrations (11 Kas): masa yok. Notion çizimi + uygulama kutuları sırayla belirir. ---- */
.cx { display: grid; justify-items: center; gap: clamp(12px, 2vw, 24px); width: 100%; }
.cx__ill { width: min(74%, 300px); height: auto; max-height: 34vh; object-fit: contain; opacity: var(--e); transform: translateY(calc((1 - var(--e)) * 18px)); }
.cx__apps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 520px; }
.cx__apps li { opacity: var(--e); transform: scale(calc(.72 + .28 * var(--e))); }
.cx__apps a { display: grid; justify-items: center; align-content: start; gap: 6px; width: 92px; min-height: 92px; padding: 12px 4px 8px; border: 1px solid var(--line-2); border-radius: 16px;
  background: #fff; color: var(--ink); font-size: 13px; line-height: 1.2; font-weight: 500; text-align: center; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.cx__apps img { width: 44px; height: 44px; border-radius: 10px; }
.cx__apps a:active { background: #f5f5f7; }
.cx__apps a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 743px) { .ch--cx .ch__art { justify-items: center; } .cx__ill { max-height: 24vh; } .cx__apps a { width: 84px; min-height: 86px; } }
