/* Throwaway draft H, "Split": one story two ways. Sand is for listening,
   petrol is for watching, ink is where the two halves join. */

@font-face {
  font-family: 'Rozha One';
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/rozha-one-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F;
}
@font-face {
  font-family: 'Rozha One';
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/rozha-one-devanagari-400-normal.woff2') format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20B9, U+25CC, U+A8E0-A8FF;
}
@font-face {
  font-family: Mukta;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/mukta-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F;
}
@font-face {
  font-family: Mukta;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/mukta-devanagari-400-normal.woff2') format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20B9, U+25CC, U+A8E0-A8FF;
}
@font-face {
  font-family: Mukta;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/mukta-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F;
}
@font-face {
  font-family: Mukta;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/mukta-devanagari-600-normal.woff2') format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20B9, U+25CC, U+A8E0-A8FF;
}

:root {
  --sand: #eadbc4;
  --sand-ink: #1b1512;
  --petrol: #0e2f3d;
  --petrol-ink: #eaf2f2;
  --join: #1b1512;
  --join-ink: #f4e9d6;
  --accent: #f0562e; /* controls, the divider and rules only; never body text */
  --accent-ink: #1b1512;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --pill-clear: 4.75rem; /* room for the draft switcher at the bottom */
  --display: 'Rozha One', 'Noto Serif Devanagari', Georgia, serif;
  --ui: Mukta, 'Noto Sans Devanagari', system-ui, sans-serif;
}

/* Each surface names its own ink; everything inside reads those two. */
.on-sand {
  --surface: var(--sand);
  --ink: var(--sand-ink);
}
.on-petrol {
  --surface: var(--petrol);
  --ink: var(--petrol-ink);
}
.join,
.after {
  --surface: var(--join);
  --ink: var(--join-ink);
}
.on-sand,
.on-petrol,
.join,
.after {
  --soft: color-mix(in srgb, var(--ink) 76%, var(--surface));
  --rule: color-mix(in srgb, var(--ink) 28%, var(--surface));
  background: var(--surface);
  color: var(--ink);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--join);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font: 400 1.0625rem/1.55 var(--ui);
  color: var(--join-ink);
  background: var(--join);
  overflow-x: clip;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

p,
h1,
h2,
h3 {
  margin: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--ink, var(--join-ink));
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.kicker {
  font: 600 0.8125rem/1.4 var(--ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--soft);
}

/* ---- buttons -------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0 1.6rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 1.0625rem/1 var(--ui);
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease;
}
.btn svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  font: 600 1rem/1 var(--ui);
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px);
  }
  .pill:hover {
    background: var(--ink);
    color: var(--surface);
  }
}

/* ---- first screen ---------------------------------------------------- */

.stage {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.join--top {
  padding: 1rem var(--gutter) 1.5rem;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  text-decoration: none;
}
.brand__mark {
  flex: none;
  width: 2rem;
  height: 2rem;
  padding: 0.25rem;
  border-radius: 0.45rem;
  background: var(--accent);
  color: var(--accent-ink);
}
.brand__hi {
  font: 400 1.4rem/1.5 var(--display);
  white-space: nowrap;
}
.brand__en {
  display: none;
  font: 600 0.8125rem/1 var(--ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--soft);
}
.bar__app {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.1rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.pitch {
  display: grid;
  gap: 0.35rem 2rem;
  margin-top: 1.1rem;
}
.pitch__title {
  font: 400 clamp(2.1rem, 8.5vw, 3.75rem) / 1.05 var(--display);
  letter-spacing: -0.01em;
}
.pitch__line {
  color: var(--soft);
  font-size: 1.0625rem;
}
.pitch .btn {
  justify-self: start;
  margin-top: 0.85rem;
}

/* ---- the split -------------------------------------------------------- */

.split {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.panel {
  container-type: inline-size;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 1rem;
  min-width: 0;
  padding: 1.25rem var(--gutter) 1.5rem;
  overflow: hidden;
}
.panel--watch {
  padding-bottom: var(--pill-clear);
}

.panel__label {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 0.9rem;
  font: inherit;
}
.panel__switch {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 0.9rem;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.panel__hi {
  font: 400 clamp(3.25rem, 17vw, 5.5rem) / 1.3 var(--display);
}
.panel__latin {
  font: 600 0.8125rem/1.4 var(--ui);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
}

/* Listen: a player face. */
.face {
  display: grid;
  grid-template-rows: auto auto minmax(4.5rem, 1fr);
  gap: 0.25rem;
  min-height: 0;
}
.face__title {
  font: 400 clamp(1.75rem, 7cqi, 3.25rem) / 1.1 var(--display);
}
.bars {
  display: flex;
  align-items: center;
  gap: clamp(3px, 0.9cqi, 9px);
  min-height: 4.5rem;
  margin-top: 0.75rem;
}
.bars span {
  flex: 1 1 0;
  height: var(--h);
  min-height: 6px;
  border-radius: 2px;
  background: var(--ink);
  opacity: 0.4;
  transform-origin: center;
  animation: level calc(620ms + var(--i) * 23ms) ease-in-out calc(var(--i) * -173ms) infinite alternate;
  animation-play-state: paused;
  transition: opacity 0.3s ease;
}
.is-playing .bars span {
  opacity: 1;
  animation-play-state: running;
}
@keyframes level {
  from {
    transform: scaleY(0.22);
  }
  to {
    transform: scaleY(1);
  }
}

/* Watch: the frame. */
.frame {
  position: relative;
  min-height: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 4px;
  background: #06181f;
}
.frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.is-live .frame video {
  cursor: pointer;
}

/* Controls: the same row on both sides, so they line up across the divider. */
.panel__ctrl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem 1rem;
}
.play {
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.play svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}
.play__stop,
.play[aria-pressed='true'] .play__go {
  display: none;
}
.play[aria-pressed='true'] .play__stop {
  display: block;
}
@media (hover: hover) {
  .play:hover {
    transform: scale(1.06);
  }
}
.ctrl__text {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}
.time {
  font: 600 1.05rem/1.2 var(--ui);
  font-variant-numeric: tabular-nums;
}
.ctrl__note {
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--soft);
}
/* Without JS there is no shared player, so the time readout has nothing to show. */
.stage:not(.is-live) .time {
  display: none;
}
.progress {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 3px;
  background: var(--rule);
  overflow: hidden;
}
.progress__fill {
  display: block;
  height: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}
.stage:not(.is-live) .progress {
  display: none;
}

/* Phones, with JS: two stacked panels; tapping a label opens it and folds the other. */
@media (max-width: 55.99rem) {
  .stage.is-live .panel {
    transition: none;
  }
  .stage[data-open='listen'] .panel--listen,
  .stage[data-open='watch'] .panel--watch {
    flex: 1 1 auto;
  }
  .stage[data-open='watch'] .panel--listen,
  .stage[data-open='listen'] .panel--watch {
    grid-template-rows: auto;
    padding-top: 0.5rem;
  }
  .stage[data-open='watch'] .panel--listen {
    padding-bottom: 0.5rem;
  }
  .stage[data-open='watch'] .panel--listen > :not(.panel__label),
  .stage[data-open='listen'] .panel--watch > :not(.panel__label) {
    display: none;
  }
  .stage[data-open='watch'] .panel--listen .panel__hi,
  .stage[data-open='listen'] .panel--watch .panel__hi {
    font-size: 2.25rem;
  }
  /* A plus on the folded panel says it opens. */
  .stage[data-open] .panel__switch {
    width: 100%;
  }
  .stage[data-open='watch'] .panel--listen .panel__switch::after,
  .stage[data-open='listen'] .panel--watch .panel__switch::after {
    content: '+';
    margin-left: auto;
    align-self: center;
    font: 400 1.75rem/1 var(--ui);
  }
  .stage[data-open='watch'] .frame {
    aspect-ratio: auto;
    min-height: 11rem;
  }
}

.divider {
  display: none;
}

/* Wide screens: side by side, with a divider that moves. */
@media (min-width: 56rem) {
  .join--top {
    padding-bottom: 1.75rem;
  }
  .brand__en {
    display: inline;
  }
  .pitch {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    margin-top: 1.25rem;
  }
  .pitch__title {
    font-size: clamp(2.75rem, 4.6vw, 4.5rem);
  }
  .pitch__line {
    grid-column: 1;
    font-size: 1.2rem;
  }
  .pitch .btn {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: end;
    justify-self: end;
    margin-top: 0;
  }

  .split {
    display: grid;
    grid-template-columns: calc(var(--pos, 50) * 1%) minmax(0, 1fr);
    min-height: 30rem;
  }
  .panel {
    gap: 1.25rem;
    padding: 1.5rem clamp(1.25rem, 3vw, 3rem) var(--pill-clear);
  }
  .panel--listen {
    padding-left: var(--gutter);
  }
  .panel--watch {
    padding-right: var(--gutter);
  }
  .panel__hi {
    font-size: clamp(3rem, 9vw, 9rem); /* where container units are missing */
    font-size: clamp(3rem, 19cqi, 9rem);
    line-height: 1.25;
    transition: font-size 0.25s ease;
  }
  .frame {
    aspect-ratio: auto;
    min-height: 9rem;
  }

  .panel__mid,
  .panel__ctrl {
    transition:
      opacity 0.25s ease,
      visibility 0.25s;
  }
  .is-dragging .panel__hi,
  .is-dragging .panel__mid,
  .is-dragging .panel__ctrl {
    transition: none;
  }

  /* The narrow side folds to a spine: just its name. */
  .panel[data-state='slim'] {
    padding-inline: 0.75rem;
  }
  .panel[data-state='slim'] .panel__label,
  .panel[data-state='slim'] .panel__switch {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0.75rem;
  }
  .panel[data-state='slim'] .panel__hi {
    font-size: clamp(2.25rem, 30cqi, 4.5rem);
  }
  .panel[data-state='slim'] .panel__latin {
    writing-mode: vertical-rl;
  }
  .panel[data-state='slim'] .panel__mid,
  .panel[data-state='slim'] .panel__ctrl {
    opacity: 0;
    visibility: hidden;
  }

  .divider:not([hidden]) {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--pos, 50) * 1%);
    z-index: 3;
    width: 2px;
    margin-left: -1px;
    background: var(--accent);
    pointer-events: none;
  }
  .divider__handle {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    margin: -1.75rem 0 0 -1.75rem;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 0 0 5px var(--join);
    cursor: ew-resize;
    pointer-events: auto;
    touch-action: none; /* only the handle takes the drag; the page still scrolls everywhere else */
    user-select: none;
    --ink: #fff;
  }
  .divider__handle svg {
    width: 1.5rem;
    height: 1.5rem;
  }
  .is-dragging {
    cursor: ew-resize;
    user-select: none;
  }
}

/* ---- the ledger -------------------------------------------------------- */

.ledger {
  position: relative;
}
.ledger__line {
  display: none;
}

.col {
  padding: 3.5rem var(--gutter) 4rem;
  overflow: hidden;
}
.col__head {
  padding-bottom: 1.25rem;
  border-bottom: 1.5px solid var(--ink);
}
.col__hi {
  font: 400 clamp(2.25rem, 9vw, 3.5rem) / 1.3 var(--display);
}
.col__en {
  font: 600 0.8125rem/1.4 var(--ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
}

.col__list {
  display: grid;
  gap: 3.5rem;
  margin-top: 2.5rem;
}

.entry {
  position: relative;
  max-width: 30rem;
}
.entry__art {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 1.1rem;
}
.tag {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  color: var(--ink);
  letter-spacing: 0.08em;
}
.entry__title {
  margin-top: 0.4rem;
  font: 400 clamp(1.9rem, 7.5vw, 2.6rem) / 1.1 var(--display);
  text-wrap: balance;
}
.entry__title[lang='hi'] {
  line-height: 1.35;
}
.entry__latin {
  display: block;
  font: 600 0.9rem/1.4 var(--ui);
  letter-spacing: 0.06em;
  color: var(--soft);
}
.entry__tagline {
  max-width: 34ch;
  margin-top: 0.6rem;
  font-size: 1.15rem;
  line-height: 1.45;
}
.entry__meta {
  margin: 0.5rem 0 1.1rem;
  font-size: 0.95rem;
  color: var(--soft);
}

@media (min-width: 56rem) {
  .ledger {
    display: grid;
    grid-template-columns: 1fr 1fr;
    --inner: clamp(2.5rem, 5vw, 5rem); /* from the centre line to each entry */
  }
  .ledger__line {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    z-index: 2;
    width: 2px;
    margin-left: -1px;
    background: var(--accent);
    transform-origin: top;
  }
  .col {
    padding-block: 5rem 7rem;
  }
  .col--listen {
    padding-right: var(--inner);
  }
  .col--watch {
    padding-left: var(--inner);
  }
  .col--listen .col__head {
    text-align: right;
  }
  .col__list {
    gap: 6.5rem;
    margin-top: 4rem;
  }
  /* The two sides face each other across the line, half a step apart. */
  .col--listen .entry {
    margin-left: auto;
  }
  .col--watch .col__list {
    padding-top: 9rem;
  }
  .entry {
    width: min(100%, 27rem);
  }
  /* A tick from the centre line to each entry, like a ledger rule. */
  .entry::before {
    content: '';
    position: absolute;
    top: 1.75rem;
    width: calc(var(--inner) - 0.75rem);
    height: 2px;
    background: var(--accent);
  }
  .col--listen .entry::before {
    left: calc(100% + 0.75rem);
  }
  .col--watch .entry::before {
    right: calc(100% + 0.75rem);
  }
  .tag {
    display: none;
  }
  .entry__title {
    font-size: clamp(2rem, 3vw, 2.9rem);
  }
}

/* ---- where the halves join ---------------------------------------------- */

.join--end {
  display: grid;
  justify-items: start;
  gap: 2rem;
  padding: clamp(4rem, 12vh, 8rem) var(--gutter);
  border-top: 2px solid var(--accent);
}
.join__line {
  max-width: 18ch;
  font: 400 clamp(2.5rem, 8vw, 6.5rem) / 1.02 var(--display);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.after {
  padding: 3rem var(--gutter) calc(var(--pill-clear) + 2rem);
  border-top: 1px solid var(--rule);
}
.after__line {
  max-width: 46ch;
  margin-top: 0.6rem;
  font-size: 1.2rem;
  color: var(--soft);
}

@media (prefers-reduced-motion: reduce) {
  .bars span {
    animation: none;
  }
  .btn,
  .pill,
  .play,
  .panel__hi,
  .panel__mid,
  .panel__ctrl {
    transition: none;
  }
}
