/* Throwaway draft: Kahani Rang landing, hero + colour shelf.
   Its own palette: unprinted paper first, then one pigment per story. */

@font-face {
  font-family: Eczar;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/eczar-latin-700.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: Eczar;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/eczar-devanagari-700.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: Hind;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/hind-latin-400.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: Hind;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/hind-devanagari-400.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: Hind;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/hind-latin-600.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: Hind;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/hind-devanagari-600.woff2') format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20B9, U+25CC, U+A8E0-A8FF;
}

:root {
  /* Paper and ink. The page starts unprinted. */
  --paper: #f3eadb;
  --ink: #1a1220;
  --cream: #fbf3e4;

  /* The four colours JS moves as the stories pass. Without JS the page
     stays paper and ink with a sindoor red. */
  --bg: var(--paper);
  --on: var(--ink);
  --pop: #c5281c;
  --pop-on: var(--cream);

  --soft: color-mix(in srgb, var(--on) 76%, var(--bg));

  --gutter: clamp(1.25rem, 5vw, 5rem);
  --offset: 0.9rem;
  --display: Eczar, 'Noto Serif Devanagari', Georgia, serif;
  --ui: Hind, 'Noto Sans Devanagari', system-ui, sans-serif;
}

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

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

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

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

a {
  color: inherit;
}

::selection {
  background: var(--pop);
  color: var(--pop-on);
}

:focus-visible {
  outline: 2px solid var(--on);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Paper tooth: a fixed grain over everything, like ink on uncoated stock. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  opacity: 0.14;
  pointer-events: none;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- shared pieces -------------------------------------------------- */

.eyebrow {
  margin: 0;
  font: 600 0.8125rem/1.3 var(--ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* The arch from the logo: a window into the story's night. */
.arch {
  position: relative;
  overflow: hidden;
  border-radius: 999px 999px 6px 6px;
  background: var(--ink);
}
.arch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* A second plate printed slightly off-register behind the window. */
.plate {
  position: relative;
}
.plate::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px 999px 6px 6px;
  background: var(--pop);
  transform: translate(var(--offset), var(--offset));
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3.4rem;
  padding: 0 1.7rem;
  border-radius: 999px;
  font: 600 1.0625rem/1 var(--ui);
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
.btn svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}
.btn--fill {
  background: var(--pop);
  color: var(--pop-on);
  box-shadow: 0.25rem 0.25rem 0 var(--on);
}
.btn--line {
  box-shadow: inset 0 0 0 1.5px var(--on);
}
@media (hover: hover) {
  .btn--fill:hover {
    transform: translate(-2px, -2px);
    box-shadow: calc(0.25rem + 2px) calc(0.25rem + 2px) 0 var(--on);
  }
  .btn--line:hover {
    background: var(--on);
    color: var(--bg);
  }
}

/* ---- top bar -------------------------------------------------------- */

.bar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}
.brand__mark {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.3rem;
  border-radius: 0.5rem;
  background: var(--on);
  color: var(--bg);
}
.brand__name {
  font: 700 1.35rem/1 var(--display);
  white-space: nowrap;
}
.bar__nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-weight: 600;
}
.bar__nav a {
  text-decoration: none;
  white-space: nowrap;
}
.bar__app {
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--on);
}
@media (max-width: 30rem) {
  .bar__nav a:first-child {
    display: none;
  }
}

/* ---- hero ----------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr;
  align-content: end;
  padding: 5.5rem var(--gutter) 1.5rem;
}

.hero__arch {
  order: -1; /* phones: the arch sits above the title */
  margin: 0 var(--offset) 0 auto;
  width: min(54vw, 20rem);
}
.hero__arch .arch {
  aspect-ratio: 3 / 4;
}
.hero__arch figcaption {
  display: none;
}

.hero__copy {
  position: relative;
  margin-top: -3.25rem; /* the title steps onto the foot of the arch */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.hero__copy .eyebrow {
  order: 1; /* phones: under the title, clear of the artwork */
  margin-top: 0.75rem;
}
.hero__lede,
.hero__actions {
  order: 2;
}

.hero__title {
  margin: 0;
  font: 700 clamp(4.5rem, 23vw, 9rem) / 1.02 var(--display);
  letter-spacing: -0.01em;
  /* a paper-coloured edge keeps the letters readable where they cross the art */
  paint-order: stroke fill;
  -webkit-text-stroke: 0.09em var(--bg);
}
.mask {
  display: block;
  overflow: hidden;
  padding: 0.22em 0.1em 0; /* room for the matras above the headline */
  margin: -0.22em -0.1em 0;
}
.hero__word {
  display: block;
}
.hero__word--rang {
  color: var(--pop);
}

.hero__lede {
  max-width: 34ch;
  margin: 1rem 0 0;
  font-size: 1.125rem;
  color: var(--soft);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.hero__facts {
  display: none;
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    grid-template-rows: 1fr auto;
    align-items: end;
    column-gap: clamp(2rem, 6vw, 7rem);
    row-gap: clamp(1.5rem, 4vh, 3rem);
  }
  .hero__copy {
    grid-column: 1;
    grid-row: 1;
    margin-top: 0;
  }
  .hero__copy .eyebrow {
    order: 0;
    margin-top: 0;
  }
  .hero__arch {
    order: 0;
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    max-width: 25rem;
    align-self: end;
  }
  .hero__arch .arch {
    aspect-ratio: auto;
    height: min(60svh, 36rem);
  }
  .hero__arch figcaption {
    display: grid;
    gap: 0.2rem;
    margin-top: 1.9rem;
    font: 700 1.2rem/1.2 var(--display);
  }
  .hero__title {
    font-size: clamp(7rem, 15vw, 16rem);
    line-height: 0.98;
    -webkit-text-stroke: 0;
  }
  .hero__lede {
    font-size: 1.25rem;
    max-width: 40ch;
  }
  .hero__facts {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin: 0;
    padding: 1rem 0 0;
    list-style: none;
    border-top: 1.5px solid var(--on);
    font: 600 0.8125rem/1.3 var(--ui);
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }
}

/* ---- shelf: stacked by default (phones, no JS, reduced motion) ------ */

.shelf {
  padding: 4rem 0 0;
}
.shelf__title {
  margin: 0 var(--gutter) 1rem;
  padding-top: 1rem;
  border-top: 1.5px solid var(--on);
  font: 600 0.8125rem/1.3 var(--ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.show {
  display: grid;
  gap: 2.4rem;
  padding: 2.5rem var(--gutter) 4rem;
}
.show__art {
  margin: 0;
  width: min(74vw, 22rem);
  aspect-ratio: 4 / 5;
}
.show__art .arch {
  height: 100%;
}
.show:nth-child(even) .show__art {
  margin-left: auto;
  margin-right: var(--offset);
}
.show__title {
  margin: 0.6rem 0 0;
  font: 700 clamp(2.4rem, 10vw, 3.5rem) / 1.05 var(--display);
  text-wrap: balance;
}
.show__title[lang='hi'] {
  line-height: 1.25;
}
.show__latin {
  display: block;
  margin-top: 0.25rem;
  font: 600 1rem/1.3 var(--ui);
  letter-spacing: 0.04em;
}
.show__tagline {
  max-width: 30ch;
  margin: 0.9rem 0 0;
  font-size: 1.2rem;
  line-height: 1.45;
}
.show__meta {
  margin: 0.75rem 0 1.6rem;
  font-size: 0.95rem;
  color: var(--soft);
}

/* ---- shelf: pinned stage (JS adds .shelf--pinned on wide screens) ---- */

.shelf--pinned {
  padding-top: 0;
}
.shelf--pinned .shelf__title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
}
.shelf--pinned .shelf__stage {
  position: relative;
  height: 100vh;
  display: grid;
}
.shelf--pinned .show {
  grid-area: 1 / 1;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  align-items: center;
  column-gap: clamp(2rem, 6vw, 7rem);
  padding: 5rem var(--gutter) 6.5rem;
}
.shelf--pinned .show__body {
  grid-column: 1;
  grid-row: 1;
}
.shelf--pinned .show__art,
.shelf--pinned .show:nth-child(even) .show__art {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  max-width: 29rem;
  height: min(72vh, 43rem);
  aspect-ratio: auto;
  margin: 0 var(--offset) 0 auto;
}
/* The stories share one window: only the first keeps the backing and the
   offset plate, the rest are clear so their art can pass through it. */
.shelf--pinned .show:not(:first-child) .show__art::before {
  display: none;
}
.shelf--pinned .show:not(:first-child) .arch {
  background: none;
}
.shelf--pinned .show__title {
  font-size: clamp(3.25rem, 6.4vw, 6.75rem);
  line-height: 0.98;
}
.shelf--pinned .show__title[lang='hi'] {
  line-height: 1.2;
}
.shelf--pinned .show__tagline {
  max-width: 30ch;
  margin-top: 1.25rem;
  font-size: clamp(1.25rem, 1.75vw, 1.65rem);
}

.shelf__index {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 1.5rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1.5px solid var(--on);
}
.shelf__count {
  margin: 0;
  font: 700 1.15rem/1 var(--display);
  font-variant-numeric: tabular-nums;
  min-width: 5rem;
}
.shelf__count span {
  opacity: 0.6;
}
.shelf__ticks {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shelf__tick {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.shelf__tick::before {
  content: '';
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--on);
  transition: transform 0.3s ease;
}
.shelf__tick[aria-current='true']::before {
  background: var(--on);
  transform: scale(1.35);
}

/* ---- end of draft --------------------------------------------------- */

.after {
  padding: 6rem var(--gutter) 5rem;
}
.after__line {
  max-width: 44ch;
  margin: 0.75rem 0 0;
  font: 700 clamp(1.4rem, 3vw, 2rem) / 1.25 var(--display);
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .shelf__tick::before {
    transition: none;
  }
}
