/* balatat.com — Story page. Loads after shared/theme.css and ../material/common.css. */

/* ───────── hero: the logo lockup and the title line ───────── */
.s-hero { display: grid; gap: 26px; padding-block: 20px 36px; }
.s-logo { display: grid; place-items: center; border-radius: 24px; background: #fff; box-shadow: inset 0 0 0 1px rgba(21, 23, 28, .05); padding: 40px 24px; }
.s-logo img { width: min(100%, 300px); height: auto; }
.s-copy { display: grid; gap: 10px; min-width: 0; }
.s-intro { margin-block-start: 4px; color: var(--ink-2); }
.s-title { font-size: clamp(27px, 7.6vw, 34px); line-height: 1.16; }
.s-title span { display: block; }
.s-title span:last-child { font-weight: 300; }
:lang(ar) .s-title { line-height: 1.5; }
@media (min-width: 700px) {
  .s-hero { gap: 36px; padding-block: 36px 48px; }
  .s-logo { border-radius: 28px; padding: 72px 40px; }
  .s-logo img { width: min(100%, 440px); }
  .s-title { font-size: 46px; }
}
@media (min-width: 900px) {
  .s-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 56px; min-height: min(100vh - var(--bar-h), 800px); padding-block: 32px 64px; }
  @supports (height: 100svh) { .s-hero { min-height: min(100svh - var(--bar-h), 800px); } }
  .s-logo { align-self: stretch; max-height: 600px; margin-block: auto; height: 100%; padding: 48px; }
  .s-logo img { width: min(78%, 520px); }
  .s-copy { gap: 16px; }
  .s-title { font-size: clamp(34px, 3.3vw, 47px); line-height: 1.14; }
  :lang(ar) .s-title { line-height: 1.45; }
}

/* ───────── chapters: the whole story, in the owner's words ───────── */
.chapters { padding-block: 8px 12px; }
/* slim progress rail: 01–06, the chapter being read is marked; sticks to the top while the chapters scroll */
.rail { position: -webkit-sticky; position: sticky; top: 8px; z-index: 5; display: flex; justify-content: center; margin-block-end: 14px; pointer-events: none; }
.rail ol { pointer-events: auto; display: flex; padding-inline: 4px; border-radius: 999px; background: rgba(255, 255, 255, .97); box-shadow: 0 0 0 1px var(--line), 0 8px 22px -8px rgba(21, 23, 28, .18); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
.rail a { display: flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; font-size: 12.5px; line-height: 1; color: var(--ink-2); white-space: nowrap; border-radius: 999px; }
.rail-n { flex: none; width: 30px; height: 30px; border-radius: 50%; text-align: center; line-height: 30px; font-size: 11.5px; font-weight: 500; letter-spacing: .02em; font-variant-numeric: tabular-nums; transition: background-color .3s, color .3s; }
.rail a[aria-current] .rail-n { background: var(--ink); color: #fff; }
.rail-l { display: none; }
@media (min-width: 700px) {
  .rail { top: 12px; margin-block-end: 18px; }
  .rail a[aria-current] .rail-l { display: block; padding-inline: 7px 14px; color: var(--ink); font-weight: 500; }
}
@media (min-width: 1180px) {
  .rail a .rail-l, .rail a[aria-current] .rail-l { display: block; padding-inline: 4px 14px; }
  .rail a:hover { color: var(--ink); }
}

.ch-list { display: grid; gap: 12px; }
.ch { display: grid; gap: 28px; padding: 24px 20px 28px; scroll-margin-top: 64px; }
.ch-txt { display: grid; gap: 14px; align-content: start; justify-items: start; min-width: 0; }
.ch-meta { display: flex; align-items: baseline; gap: 10px; font-size: var(--fs-s); line-height: 1.5; font-weight: 500; color: var(--ink-2); }
:lang(ar) .ch-meta { font-size: 14px; }
.ch-q { font-size: clamp(23px, 6.5vw, 27px); line-height: 1.24; font-weight: 300; letter-spacing: -.02em; text-wrap: balance; }
:lang(ar) .ch-q { font-size: clamp(22px, 6vw, 25px); line-height: 1.7; }
.ch-q.mid::before { content: "… "; color: var(--ink-3); }
.ch-body { margin-block-start: 4px; }
.ch-v { display: grid; place-items: center; min-width: 0; }
.v { width: 100%; margin: 0; }
/* caption under a visual: what it shows, in a few words */
.v-cap { display: grid; gap: 10px; justify-items: center; text-align: center; margin-block-start: 18px; }
.v-note { font-size: var(--fs-s); line-height: 1.5; color: var(--ink-2); max-width: 26em; }
:lang(ar) .v-note { font-size: 13.5px; line-height: 1.7; }
.kq-anim .ch .ch-txt > * { opacity: 0; transform: translateY(16px); transition: opacity .7s, transform 1s var(--ease); }
.kq-anim .ch .ch-txt > :nth-child(2) { transition-delay: .08s; }
.kq-anim .ch .ch-txt > :nth-child(n+3) { transition-delay: .16s; }
.kq-anim .ch.in .ch-txt > * { opacity: 1; transform: none; }
.kq-anim .v-cap { opacity: 0; transition: opacity .8s linear .9s; }
.kq-anim .in .v-cap { opacity: 1; }
@media (min-width: 700px) {
  .chapters { padding-block: 12px 16px; }
  .ch-list { gap: 16px; }
  .ch { gap: 36px; padding: 40px 40px 44px; border-radius: 28px; scroll-margin-top: 76px; }
  .ch-txt { gap: 16px; }
  .ch-q { font-size: 30px; max-width: 20em; }
  :lang(ar) .ch-q { font-size: 27px; }
}
@media (min-width: 900px) {
  .ch { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 56px; padding: 56px 56px 60px; }
  .ch.alt { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .ch.alt .ch-v { order: -1; }
  .ch-q { font-size: clamp(27px, 2.5vw, 35px); line-height: 1.2; }
  :lang(ar) .ch-q { font-size: clamp(25px, 2.25vw, 31px); line-height: 1.65; }
}
@media (min-width: 1180px) { .ch { gap: 72px; padding: 64px 72px 68px; } }

/* 1 · the green: the real disc and its cut face */
.v-green { display: grid; gap: 14px; justify-items: center; max-width: 380px; margin-inline: auto; }
.v-green .v-cap { margin-block-start: 2px; }
.g-disc { position: relative; width: min(62%, 220px); aspect-ratio: 1; }
.g-disc::before { content: ""; position: absolute; inset: -6%; border-radius: 50%; background: radial-gradient(closest-side, rgba(21, 23, 28, .15) 89%, rgba(21, 23, 28, .05) 92.5%, rgba(21, 23, 28, 0) 97%); }
.g-disc img { position: relative; width: 100%; height: 100%; }
.g-edge { width: 100%; }
.g-edge img { width: 100%; height: auto; }
.kq-anim .g-disc { opacity: 0; transform: scale(.92); transition: opacity .6s linear .2s, transform 1.2s var(--ease) .2s; }
.kq-anim .g-edge { opacity: 0; transition: opacity .8s linear .6s; }
.kq-anim .in .g-disc { opacity: 1; transform: none; }
.kq-anim .in .g-edge { opacity: 1; }

/* 2 · a century → today */
.v-span { max-width: 380px; margin-inline: auto; }
.span-line { display: flex; align-items: center; gap: 6px; }
.span-line i { flex: none; width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink); }
.span-line i:last-child { background: var(--deep); box-shadow: none; }
.span-line b { flex: 1; height: 1px; background: var(--ink-3); transform-origin: left; }
[dir="rtl"] .span-line b { transform-origin: right; }
.span-l { display: flex; justify-content: space-between; gap: 12px; margin-block-start: 12px; font-size: var(--fs-s); color: var(--ink-2); }
.span-l span:last-child { color: var(--ink); font-weight: 500; }
.kq-anim .span-line b { transform: scaleX(0); transition: transform 1.8s var(--ease) .4s; }
.kq-anim .span-line i:last-child, .kq-anim .span-l span:last-child { opacity: 0; transition: opacity .6s linear 1.5s; }
.kq-anim .in .span-line b { transform: none; }
.kq-anim .in .span-line i:last-child, .kq-anim .in .span-l span:last-child { opacity: 1; }

/* 3 · the market against this balata: share of real amber */
.cmp { display: grid; gap: 30px; width: min(100%, 400px); margin-inline: auto; text-align: start; }
.cmp-row { display: grid; gap: 9px; min-width: 0; }
.cmp-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.cmp-t { font-size: 14px; line-height: 1.35; font-weight: 500; max-width: 11em; padding-block-end: 5px; }
.cmp-n { display: grid; justify-items: end; flex: none; }
.cmp-n b { font-size: 60px; line-height: .95; font-weight: 300; letter-spacing: -.035em; }
.cmp-n em { font-style: normal; font-size: var(--fs-xs); color: var(--ink-2); }
.cmp-bar { position: relative; height: 12px; border-radius: 999px; background: rgba(21, 23, 28, .07); overflow: hidden; }
.cmp-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--w); border-radius: 999px; background: var(--ink); }
.cmp-0 .cmp-bar { background: none; box-shadow: inset 0 0 0 1.2px var(--ink-3); background-image: repeating-linear-gradient(135deg, rgba(21, 23, 28, .1) 0 1.5px, transparent 1.5px 7px); }
.cmp-0 .cmp-n b { color: var(--maroon); }
.cmp-row small { font-size: var(--fs-xs); line-height: 1.5; color: var(--ink-2); }
:lang(ar) .cmp-t { font-size: 15px; line-height: 1.6; } :lang(ar) .cmp-row small, :lang(ar) .cmp-n em { font-size: 12.5px; line-height: 1.7; }
.kq-anim .cmp-row { opacity: 0; transform: translateY(8px); transition: opacity .7s linear .2s, transform .9s var(--ease) .2s; }
.kq-anim .cmp-99 { transition-delay: .9s; }
.kq-anim .in .cmp-row { opacity: 1; transform: none; }
.kq-anim .cmp-99 .cmp-bar i { width: 0; transition: width 1.5s cubic-bezier(.3, 0, .2, 1) 1.3s; }
.kq-anim .in .cmp-99 .cmp-bar i { width: var(--w); }
@media (min-width: 900px) { .cmp { gap: 38px; } .cmp-n b { font-size: 72px; } .cmp-t { font-size: 15px; } .cmp-bar { height: 14px; } }

/* 4 · failures struck out */
.v-strike { max-width: 380px; margin-inline: auto; }
.v-strike ul { display: grid; gap: 6px; justify-items: center; }
.v-strike li { font-size: 20px; line-height: 1.4; font-weight: 300; color: var(--ink-2); }
:lang(ar) .v-strike li { line-height: 1.8; }
.v-strike li span { position: relative; display: inline-block; }
.v-strike li span::after { content: ""; position: absolute; inset-inline: -4px; top: 54%; height: 1px; background: var(--ink); transform-origin: left; }
[dir="rtl"] .v-strike li span::after { transform-origin: right; }
.kq-anim .v-strike li { opacity: 0; transition: opacity .6s linear calc(.3s + var(--i) * .45s); }
.kq-anim .in .v-strike li { opacity: 1; }
.kq-anim .v-strike li span::after { transform: scaleX(0); transition: transform .7s var(--ease) calc(.7s + var(--i) * .45s); }
.kq-anim .in .v-strike li span::after { transform: none; }

/* 5 · cannot tell them apart: two discs of the same green glide together and become one (.go, replayed on re-entry) */
.v-twin { max-width: 340px; margin-inline: auto; }
.twin { position: relative; width: 100%; aspect-ratio: 100 / 44; }
.tw { position: absolute; top: 0; left: 28%; width: 44%; aspect-ratio: 1; }
.tw-shadow { position: absolute; inset: -6%; border-radius: 50%; background: radial-gradient(closest-side, rgba(21, 23, 28, .15) 89%, rgba(21, 23, 28, .05) 92.5%, rgba(21, 23, 28, 0) 97%); }
.tw img { position: relative; width: 100%; height: 100%; border-radius: 50%; }
.twin-l { display: flex; justify-content: center; gap: 8px 18px; flex-wrap: wrap; margin-block-start: 16px; font-size: var(--fs-s); line-height: 1.5; color: var(--ink); font-weight: 500; text-align: center; }
.twin-l span + span::before { content: "·"; margin-inline-end: 18px; color: var(--ink-3); }
.v-twin .v-cap { margin-block-start: 8px; }
.v-twin.go .tw-b .tw-shadow { opacity: 0; }      /* merged: one disc, one shadow */
.kq-anim .tw-b .tw-shadow { transition: opacity .4s linear; }
.kq-anim .v-twin.go .tw-b .tw-shadow { transition-delay: 2.5s; }
.kq-anim .v-twin { --sx: 1; }
[dir="rtl"].kq-anim .v-twin { --sx: -1; }
.kq-anim .tw { transition: transform 2.2s cubic-bezier(.6, 0, .2, 1) .5s; }
.kq-anim .tw-a { transform: translateX(calc(var(--sx) * -64%)); }
.kq-anim .tw-b { transform: translateX(calc(var(--sx) * 64%)); }
.kq-anim .twin-l span { transition: transform 2.2s cubic-bezier(.6, 0, .2, 1) .5s; }
.kq-anim .twin-l span:first-child { transform: translateX(calc(var(--sx) * -22px)); }
.kq-anim .twin-l span:last-child { transform: translateX(calc(var(--sx) * 22px)); }
.kq-anim .twin-l span + span::before { opacity: 0; transition: opacity .5s linear; }
.kq-anim .v-twin .v-cap, .kq-anim .in .v-twin .v-cap { opacity: 0; transition: opacity .5s linear; }
.kq-anim .v-twin.go .tw, .kq-anim .v-twin.go .twin-l span { transform: none; }
.kq-anim .v-twin.go .twin-l span + span::before { opacity: 1; transition-delay: 2.5s; }
.kq-anim .in .v-twin.go .v-cap, .kq-anim .v-twin.go .v-cap { opacity: 1; transition: opacity .8s linear 2.6s; }

/* 6 · sixteen bloom from the one green */
.v-bloom { max-width: 440px; margin-inline: auto; }
.v-bloom ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; --g: 10px; }
.v-bloom li { position: relative; }
.v-bloom li a { display: block; border-radius: 50%; transition: transform .5s var(--ease); }
.v-bloom li a:hover { transform: scale(1.05); }
.v-bloom img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 50%; filter: drop-shadow(0 2px 3px rgba(21, 23, 28, .18)); }
.v-bloom .seed { z-index: 1; }
.kq-anim .v-bloom li { --sx: 1; opacity: 0; transform: translate(calc(var(--x) * var(--sx) * (100% + var(--g))), calc(var(--y) * (100% + var(--g)))) scale(.5); transition: opacity .5s linear calc(.7s + var(--bd)), transform 1.3s var(--ease) calc(.7s + var(--bd)); }
[dir="rtl"].kq-anim .v-bloom li { --sx: -1; }
.kq-anim .v-bloom li.seed { opacity: 0; transform: scale(1.4); transition: opacity .6s linear .15s, transform 1.3s var(--ease) .7s; }
.kq-anim .in .v-bloom li, .kq-anim .in .v-bloom li.seed { opacity: 1; transform: none; }
@media (min-width: 900px) { .v-bloom ul { gap: 14px; --g: 14px; } }

/* ───────── signature ───────── */
.sign { padding-block: 44px 56px; display: grid; gap: 18px; }
.sign-q { margin: 0; }
.sign-q p { font-size: clamp(24px, 6.7vw, 30px); line-height: 1.22; font-weight: 300; letter-spacing: -.02em; max-width: 22em; text-wrap: balance; }
:lang(ar) .sign-q p { font-size: clamp(23px, 6.2vw, 28px); line-height: 1.7; }
.sign-by { font-size: 11.5px; line-height: 1.5; font-weight: 500; letter-spacing: .3em; color: var(--maroon); }
[dir="rtl"] .sign-by { text-align: end; }
@media (min-width: 700px) { .sign { padding-block: 72px 80px; gap: 24px; } .sign-q p { font-size: 36px; } :lang(ar) .sign-q p { font-size: 32px; } }
@media (min-width: 900px) {
  .sign { padding-block: 96px 110px; }
  .sign-q p { font-size: clamp(38px, 3.6vw, 52px); line-height: 1.16; }
  :lang(ar) .sign-q p { font-size: clamp(34px, 3.1vw, 44px); line-height: 1.6; }
}
