/* Throwaway draft F, "Sentence": the catalogue as one piece of writing.
   Typography is the whole design: one clay ground, one ink, one accent. */

@font-face {
  font-family: Tiro;
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('assets/fonts/tiro-devanagari-hindi-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: Tiro;
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url('assets/fonts/tiro-devanagari-hindi-latin-400-italic.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: Tiro;
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('assets/fonts/tiro-devanagari-hindi-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: Rozha;
  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;
  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: 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 {
  --ground: #ebd9c8; /* soft clay */
  --ink: #1d1a16;
  --accent: #d4401e; /* large type only: 3.4:1 on the ground */
  --accent-deep: #a52e12; /* small type: 5:1 on the ground */
  --hair: color-mix(in srgb, var(--ink) 22%, transparent);

  --gutter: clamp(1.5rem, 6.5vw, 6.5rem);
  --text: Tiro, 'Noto Serif Devanagari', Georgia, serif;
  --display: Rozha, Tiro, Georgia, serif;
  --ui: Mukta, 'Noto Sans Devanagari', system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  font: 400 1.125rem/1.55 var(--text);
  color: var(--ink);
  background: var(--ground);
  overflow-x: clip;
}

a {
  color: inherit;
}

::selection {
  background: var(--ink);
  color: var(--ground);
}

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

/* ---- small labels ---------------------------------------------------- */

.label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
  margin: 0;
  font: 600 0.8125rem/1.4 var(--ui);
  color: var(--accent-deep);
}
.label [lang='hi'] {
  font-size: 1rem; /* Devanagari: no tracking, no caps, a touch larger */
}
.label__latin {
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  text-decoration: none;
}
.brand__mark {
  width: 1.75rem;
  height: 1.75rem;
}
.brand__name {
  font: 400 1.3rem/1 var(--display);
  white-space: nowrap;
}
.bar__app {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font: 600 0.9375rem/1 var(--ui);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
  white-space: nowrap;
}

/* ---- the passage ------------------------------------------------------ */

.passage {
  padding: clamp(2rem, 9vh, 6rem) var(--gutter) 0;
}

.passage__text {
  margin: clamp(1.25rem, 3vh, 2.25rem) 0 0;
  font-size: clamp(2rem, 5.4vw, 5.5rem);
  line-height: 1.3; /* loose enough for the Devanagari line it carries */
  letter-spacing: -0.012em;
  text-wrap: pretty;
  hanging-punctuation: first;
}

.passage__brand {
  font: 400 1em/1 var(--display);
  letter-spacing: -0.01em;
}

/* Story names: the only italics on the page, and the only links in the text. */
.story {
  padding: 0.08em 0;
  font-style: italic;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.045em;
  text-underline-offset: 0.16em;
  transition: color 0.3s ease;
}
.story[lang='hi'],
.aside {
  font-style: normal;
  letter-spacing: 0;
}
.story.is-current {
  color: var(--accent);
}
@media (hover: hover) {
  .story:hover {
    color: var(--accent);
  }
}

/* A lozenge of the story's art, set in the line like a word. */
.pill {
  display: inline-block;
  width: 2em;
  height: 1.05em;
  margin: 0 0.1em;
  border-radius: 999px;
  object-fit: cover;
  vertical-align: -0.2em;
  background: var(--ink);
}

/* ---- reading mode (JS adds .passage--reading when motion is allowed) --- */

.passage--reading .w {
  opacity: 0.16;
  transition: opacity 0.25s linear;
}
.passage--reading .pill {
  /* opens in place: no width change, so the text never reflows mid-read */
  clip-path: inset(0 100% 0 0 round 999px);
  transition: clip-path 0.7s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.passage--reading .pill.is-open {
  clip-path: inset(0 0 0 0 round 999px);
}
/* A name you point at or tab to is always fully legible, wherever you are
   in the reading. Beats the inline opacity the scrub writes. */
.passage--reading .story:hover .w,
.passage--reading .story:focus-visible .w {
  opacity: 1 !important;
}

/* Progress through the passage: a hairline in the margin, a notch per story. */
.rail {
  position: fixed;
  left: calc(var(--gutter) / 2);
  top: 22vh;
  bottom: 22vh;
  z-index: 2;
  width: 1px;
  background: var(--hair);
  pointer-events: none;
}
.rail__fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
}
.rail__notch {
  position: absolute;
  left: -3px;
  width: 7px;
  height: 1px;
  background: var(--ink);
  opacity: 0.45;
  transition:
    opacity 0.3s ease,
    background-color 0.3s ease;
}
.rail__notch.is-passed {
  background: var(--accent);
  opacity: 1;
}

/* Enlarged art beside the name you point at (wide screens, fine pointer). */
.plate {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 6;
  width: 21rem;
  margin: 0;
  padding: 0.5rem 0.5rem 0.8rem;
  border-radius: 10px;
  background: var(--ink);
  color: var(--ground);
  visibility: hidden;
  pointer-events: none;
}
.plate img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  object-fit: cover;
}
.plate figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.3rem 0;
  font: 600 0.75rem/1.3 var(--ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.plate figcaption span:last-child {
  opacity: 0.75;
  text-align: right;
}

/* ---- the offer --------------------------------------------------------- */

.offer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
  margin: clamp(2rem, 6vh, 4rem) 0 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.75rem;
  padding: 0 2rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ground);
  font: 600 1.125rem/1 var(--ui);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s ease;
}
.btn svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}
@media (hover: hover) {
  .btn:hover {
    background: var(--accent-deep);
  }
}
.quiet {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font: 600 1rem/1 var(--ui);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
}

/* ---- the plain index --------------------------------------------------- */

.index {
  margin-top: clamp(5rem, 16vh, 10rem);
  padding: 0 var(--gutter);
}
.index__list {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: clamp(2rem, 6vw, 6rem);
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}
.index__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.1rem 1.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--hair);
}
.index__list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: 1.35rem;
  line-height: 1.3;
  text-decoration: none;
}
.index__list a[lang='hi'] {
  line-height: 1.5;
}
@media (hover: hover) {
  .index__list a:hover {
    color: var(--accent-deep);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.25em;
  }
}
.index__list span {
  font: 600 0.8125rem/1.4 var(--ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 78%, var(--ground));
}
@media (min-width: 48rem) {
  .index__list {
    grid-template-columns: 1fr 1fr;
  }
}

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

.after {
  padding: clamp(4rem, 12vh, 7rem) var(--gutter) 7.5rem; /* clears the draft switcher */
}
.after__line {
  max-width: 40ch;
  margin: 0.75rem 0 0;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  line-height: 1.35;
}

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