/* merakam.in: the Milestone system (see DESIGN.md) on one public page. */
@font-face { font-family: Hind; font-weight: 400; font-display: swap; src: url(/fonts/hind-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20B9; }
@font-face { font-family: Hind; font-weight: 500; font-display: swap; src: url(/fonts/hind-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20B9; }
@font-face { font-family: Hind; font-weight: 600; font-display: swap; src: url(/fonts/hind-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20B9; }
@font-face { font-family: Hind; font-weight: 400; font-display: swap; src: url(/fonts/hind-devanagari-400-normal.woff2) format("woff2"); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: Hind; font-weight: 500; font-display: swap; src: url(/fonts/hind-devanagari-500-normal.woff2) format("woff2"); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: Hind; font-weight: 600; font-display: swap; src: url(/fonts/hind-devanagari-600-normal.woff2) format("woff2"); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url(/fonts/barlow-semi-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-display: swap; src: url(/fonts/barlow-semi-condensed-latin-700-normal.woff2) format("woff2"); }

:root {
  --stone: #f3f1eb; --stone-deep: #e9e6dd; --card: #fffefb; --face: #ffffff;
  --rule: #dcd8cc; --rule-strong: #c9c4b6;
  --ink: #1c1d1b; --ink-soft: #4a4b46; --mute: #6a6a63;
  --asphalt: #2a2d31; --asphalt-raised: #363a3f; --asphalt-ink: #e9e7e1; --asphalt-mute: #9a9993;
  --cap-tehsil: #2f7a4d; --cap-district: #2c5d8f;
  --words: Hind, system-ui, sans-serif;
  --numbers: "Barlow Semi Condensed", Hind, sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { background: var(--stone); color: var(--ink); -webkit-text-size-adjust: 100%; scrollbar-color: var(--rule-strong) var(--stone); }
body { margin: 0; font: 400 17px/1.5 var(--words); font-variant-numeric: tabular-nums; }
::selection { background: var(--ink); color: var(--face); }
.road ::selection { background: var(--asphalt-ink); color: var(--asphalt); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.road :focus-visible { outline-color: var(--asphalt-ink); }
h1, h2, h3, p { margin: 0; }
[lang="hi"] { font-family: var(--words); }

/* Top: the name and one plain line. */
.top { padding: clamp(24px, 4vh, 40px) var(--gutter) 60px; text-align: center; }
.mark { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.mark-stone { width: 24px; height: 31px; border: 1.5px solid var(--rule-strong); border-radius: 12px 12px 3px 3px; background: linear-gradient(var(--cap-tehsil) 0 40%, var(--face) 40%); }
.mark-word { font: 700 26px/1 var(--numbers); letter-spacing: 0.06em; }
.mark-hi { font: 500 17px/1 var(--words); color: var(--mute); }
h1 { margin: clamp(18px, 3vh, 30px) auto 0; max-width: 44ch; font: 600 clamp(32px, 3.3vw, 48px)/1.08 var(--words); letter-spacing: -0.015em; text-wrap: balance; }
.h1-hi { margin-top: 8px; font: 500 clamp(17px, 1.7vw, 21px)/1.4 var(--words); color: var(--mute); }
.lede { margin: 12px auto 0; max-width: 92ch; font-size: clamp(17px, 1.5vw, 19px); color: var(--ink-soft); text-wrap: pretty; }

/* The road: the phone stands on it, two stones switch between the apps. */
.road {
  /* Life-size phone, its foot and the lane line all inside a laptop first screen (the top is about 285px). */
  --h: clamp(460px, calc(100svh - 345px), 700px);
  position: relative; background: var(--asphalt); color: var(--asphalt-ink); padding: 0 var(--gutter) 48px;
}
.road-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: clamp(24px, 4vw, 72px); max-width: 1180px; margin: 0 auto; }
.phone {
  margin: -36px 0 0; height: var(--h); /* rises into the top, short of the text above */ aspect-ratio: 406 / 860;
  padding: 8px; border-radius: 40px; background: #121314; box-shadow: 0 0 0 1px #4a4d52, 0 18px 40px rgb(0 0 0 / 0.35);
}
.screen { position: relative; height: 100%; border-radius: 32px; overflow: hidden; background: var(--stone); }
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.45s var(--ease); }
.screen video.is-active { opacity: 1; }
/* Under the phone, so nothing covers the app on screen. */
.stage { display: flex; flex-direction: column; align-items: center; }
.phone-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.sample { padding: 1px 10px; border-radius: 11px; background: var(--asphalt-raised); color: var(--asphalt-ink); font: 600 13px/24px var(--words); }
.play { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #5a5e64; border-radius: 50%; background: var(--asphalt-raised); color: var(--asphalt-ink); cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.play:hover { background: #42464c; border-color: var(--asphalt-mute); }
.play svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.play .i-play { fill: currentColor; stroke: none; display: none; }
.stage.is-paused .i-play { display: block; }
.stage.is-paused .i-pause { display: none; }

.stone { display: flex; flex-direction: column; align-items: center; gap: 22px; max-width: 260px; justify-self: center; margin-top: calc(var(--h) * 0.3); padding: 8px; border: 0; background: none; color: inherit; font: inherit; text-align: center; cursor: pointer; transition: opacity 0.3s var(--ease); }
.stone[aria-pressed="false"] .stone-line { color: var(--asphalt-mute); }
.stone[aria-pressed="false"]:hover .stone-line { color: var(--asphalt-ink); }
.stone .ms { width: 168px; transition: transform 0.45s var(--ease), outline-color 0.3s; outline: 3px solid transparent; outline-offset: 7px; }
.stone[aria-pressed="true"] .ms { outline-color: var(--asphalt-ink); transform: translateY(-6px); }
.stone-line { font: 500 17px/1.45 var(--words); color: var(--asphalt-ink); max-width: 22ch; }

/* The lane line doubles as the demo's progress. */
.lane { position: absolute; left: 0; right: 0; bottom: 18px; height: 4px; background: repeating-linear-gradient(90deg, var(--asphalt-mute) 0 28px, transparent 28px 52px); opacity: 0.55; }
.lane-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--asphalt-ink); transition: width 0.3s linear; }

/* Milestone chip (DESIGN.md: rounded crown, square foot, coloured cap, condensed lettering). */
.ms { display: inline-flex; flex-direction: column; overflow: hidden; border: 2px solid var(--rule-strong); border-radius: 34px 34px 6px 6px; background: var(--face); color: var(--ink); text-align: center; }
/* Fixed cap height, so Latin and Devanagari caps make stones of one height. */
.ms-cap { height: 50px; display: flex; align-items: flex-end; justify-content: center; padding: 0 6px 10px; background: var(--asphalt); color: var(--face); font: 700 15px/1 var(--numbers); letter-spacing: 0.08em; }
.ms-cap[lang="hi"] { font: 600 17px/1 var(--words); letter-spacing: 0; padding-bottom: 9px; }
.ms-district .ms-cap { background: var(--cap-district); }
.ms-tehsil .ms-cap { background: var(--cap-tehsil); }
.ms-body { padding: 12px 6px 2px; font: 600 24px/1.1 var(--numbers); }
.ms-note { padding: 0 6px 12px; font: 500 15px/1.4 var(--words); color: var(--mute); }

/* How it works: three stones along a road edge. */
.how { max-width: 1180px; margin: 0 auto; padding: clamp(64px, 10vh, 112px) var(--gutter) clamp(56px, 8vh, 96px); }
h2 { font: 600 clamp(26px, 2.6vw, 32px)/1.2 var(--words); }
h2 span, h3 span { display: block; margin-top: 4px; font-weight: 500; color: var(--mute); }
h2 span { font-size: clamp(16px, 1.5vw, 19px); }
.stops { --stop-h: 90px; list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 clamp(24px, 4vw, 56px); position: relative; }
/* The road edge the stones stand on: its top meets the foot of every stone (all are one height). */
.stops::before { content: ""; position: absolute; left: 0; right: 0; top: calc(var(--stop-h) - 1px); border-top: 2px solid var(--rule-strong); }
.stop { position: relative; }
.stop .ms { width: 112px; height: var(--stop-h); position: relative; z-index: 1; margin-bottom: 26px; }
.stop .ms-cap { height: 40px; padding: 0 6px 8px; font-size: 13px; }
.stop .ms-cap[lang="hi"] { font-size: 15px; }
.stop .ms-body { flex: 1; display: grid; place-items: center; padding: 0 6px; font: 700 30px/1 var(--numbers); }
h3 { font: 600 20px/1.3 var(--words); max-width: 26ch; }
h3 span { font-size: 16px; }
.stop p { margin-top: 12px; color: var(--ink-soft); max-width: 36ch; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; width: min(calc(100% - 2 * var(--gutter)), calc(1180px - 2 * var(--gutter))); margin: 0 auto; padding: 22px 0 32px; border-top: 1px solid var(--rule); font-size: 14.5px; color: var(--mute); }

/* Narrow screens: stones become a two-way switch above the phone; the steps stack along a vertical edge. */
@media (max-width: 860px) {
  .road { padding-bottom: 64px; }
  .road-inner { grid-template-columns: 1fr 1fr; gap: 20px 12px; padding-top: 28px; }
  .stage { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .phone { margin: 4px 0 0; }
  .road { --h: min(640px, calc(100svh - 190px), calc((100vw - 32px) * 860 / 406)); }
  .stone { gap: 10px; width: 100%; max-width: none; padding: 4px; }
  .stone .ms { width: min(150px, 100%); }
  .stone .ms-cap { font-size: 13px; letter-spacing: 0.06em; }
  /* Devanagari never takes letter-spacing: it breaks the headline stroke. */
  .stone .ms-cap[lang="hi"] { font-size: 15px; letter-spacing: 0; }
  .stone[aria-pressed="true"] .ms { transform: none; }
  .stone .ms-cap { height: 42px; }
  .stone .ms-body { font-size: 20px; }
  .stone { margin-top: 0; }
  .stone-line { font-size: 14px; max-width: 20ch; }
  .stops { grid-template-columns: 1fr; gap: 36px; padding-left: 0; }
  .stops::before { top: 0; bottom: 0; left: 55px; right: auto; border-top: 0; border-left: 2px solid var(--rule-strong); }
  .stop { display: grid; grid-template-columns: 112px 1fr; gap: 0 20px; align-items: start; }
  .stop .ms { grid-row: span 2; margin: 0; }
  .stop p { margin-top: 8px; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
