/* Micham site. Palette and type come from the app's brand sheet.
   Fonts are self-hosted: a privacy product should not call a third-party font CDN. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Albert Sans";
  src: url("fonts/albert-sans-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif Tamil";
  src: url("fonts/noto-serif-tamil.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  /* Tamil script (shown once, in the hero) plus the rupee sign, which Fraunces lacks. */
  unicode-range: U+0964-0965, U+0B82-0BFA, U+200C-200D, U+20B9, U+25CC;
}

:root {
  --ink: #17150f;
  --ink-raised: #26211a;
  --ink-track: #3d342a;
  --cream: #f7f2e8;
  --paper: #fffbf5;
  --clay: #b4552d;
  --clay-text: #98421f;      /* clay for small text on cream: 5.6:1 */
  --amber: #f2b824;
  --over: #ff9a78;
  --muted: #5e5446;          /* secondary text on cream: 6.6:1 */
  --muted-on-ink: #d3c6b2;   /* secondary text on ink: 10:1 */
  --hairline: #d9ccb9;

  --font-display: "Fraunces", "Noto Serif Tamil", Georgia, serif;
  --font-body: "Albert Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(20px, 5vw, 48px);
  --measure: 62ch;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;
  --space-9: clamp(72px, 10vw, 136px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--clay) var(--cream);
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  caret-color: var(--clay);
  text-rendering: optimizeLegibility;
}

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

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

a {
  color: var(--clay-text);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  padding-bottom: 0.12em;
  transition: background-size 220ms var(--ease-out);
}
a:hover { background-size: 100% 2px; }
.brand, a.store { background-image: none; padding-bottom: 0; }

:focus-visible {
  outline: 3px solid var(--clay);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-ink :focus-visible { outline-color: var(--amber); }

.skip {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  background: var(--ink);
  color: var(--cream);
  padding: var(--space-3) var(--space-4);
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: var(--space-4); }

.wrap { width: min(1120px, 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- header ---------- */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-5);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}
.brand svg { width: 40px; height: 40px; }
.site-head nav a { font-weight: 500; }

/* ---------- opening: the hero and its meter share the first screen ---------- */
.opening { display: flex; flex-direction: column; min-height: calc(100svh - 88px); }
.hero { flex: 1; padding-block: var(--space-4) var(--space-6); }
.hero h1 { margin: 0; font-weight: 700; text-wrap: balance; }
.hero .word {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.5rem, 11vw, 6rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--clay);
}
.hero .en {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 6vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin-top: var(--space-2);
}
.hero .lede {
  max-width: 52ch;
  margin: var(--space-5) 0 0;
  font-size: 1.1875rem;
  text-wrap: pretty;
}
.hero .en + .lede { margin-top: var(--space-6); }
.hero .lede .tamil { font-family: "Noto Serif Tamil", "Nirmala UI", serif; font-weight: 800; color: var(--clay-text); }
.hero .lede em { font-style: normal; font-weight: 600; color: var(--clay-text); }

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}
.store {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 56px;
  padding: var(--space-2) var(--space-5);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.25;
}
.store .name { font-weight: 600; }
.store .state { font-size: 0.875rem; color: var(--muted); }
.store.soon { border-style: dashed; border-color: #8a7d6a; }
a.store { background: var(--ink); color: var(--cream); }
a.store .state { color: var(--muted-on-ink); }
a.store { transition: background-color 160ms, transform 160ms var(--ease-out); }
a.store:hover { background: var(--clay); border-color: var(--clay); transform: translateY(-2px); }
a.store:active { transform: translateY(1px); }

/* ---------- the what's-left meter (the page's one working part) ---------- */
.meter { background: var(--ink); color: var(--cream); padding-block: var(--space-6) var(--space-7); }
.meter .grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
  gap: var(--space-7);
  align-items: end;
}
.meter .left {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.meter .left .tl {
  font-size: 0.34em;
  font-weight: 700;
  letter-spacing: 0;
  margin-left: 0.45em;
  color: var(--amber);
}
.meter .of { margin: var(--space-3) 0 0; color: var(--muted-on-ink); }
.meter label { display: flex; justify-content: space-between; font-weight: 500; margin-bottom: var(--space-3); }
.meter output { font-weight: 600; }
.meter .hint { margin: var(--space-4) 0 0; color: var(--muted-on-ink); font-size: 0.9375rem; max-width: 40ch; }

.meter input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  background: transparent;
  cursor: grab;
}
.meter input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--ink-track); }
.meter input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--ink-track); }
.meter input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px; height: 28px; margin-top: -11px;
  border-radius: 50%;
  background: var(--cream);
  border: 4px solid var(--amber);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}
.meter input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--cream);
  border: 4px solid var(--amber);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}
.meter input[type="range"]:active { cursor: grabbing; }

.bar {
  height: 16px;
  margin-top: var(--space-5);
  border-radius: 8px;
  background: var(--ink-track);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 8px;
  background: var(--amber);
  transition: width 900ms var(--ease-out), background-color 200ms;
}
.meter.is-over .bar > i { background: var(--over); }
.meter.is-over .left { color: var(--over); }

/* ---------- feature rows ---------- */
.feature { padding-block: var(--space-9) 0; }
.feature .inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(32px, 7vw, 112px);
  align-items: center;
}
.feature.flip .inner { grid-template-columns: auto minmax(0, 1fr); }
.feature.flip .copy { order: 2; }
.feature h2 {
  margin: 0 0 var(--space-5);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.feature p { max-width: var(--measure); margin: 0 0 var(--space-4); text-wrap: pretty; }
.feature .ways { margin: var(--space-5) 0 0; padding: 0; }
.feature .ways dt { font-weight: 600; margin-top: var(--space-4); }
.feature .ways dd { margin: var(--space-1) 0 0; max-width: var(--measure); color: var(--muted); }

.phones { display: flex; align-items: flex-start; gap: var(--space-5); }
.phones figure { margin: 0; }
.phones .phone:nth-child(2) { margin-top: var(--space-8); }
.phone {
  width: 248px;
  padding: 8px;
  border-radius: 34px;
  background: var(--ink);
  box-shadow: 0 22px 40px -20px rgba(23, 21, 15, 0.5), 0 3px 8px rgba(23, 21, 15, 0.16);
}
.phone img { border-radius: 27px; background: var(--cream); }
.phones.single .phone { width: 272px; }

/* ---------- privacy band ---------- */
.privacy { margin-top: var(--space-9); background: var(--ink); color: var(--cream); padding-block: var(--space-9); }
.privacy a { color: var(--amber); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.privacy .inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(32px, 7vw, 112px);
  align-items: center;
}
.privacy h2 {
  margin: 0 0 var(--space-5);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.privacy p { max-width: var(--measure); margin: 0 0 var(--space-4); text-wrap: pretty; }
.privacy .note { margin-top: var(--space-6); }
.privacy .asks {
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink-track);
}
.privacy .asks li {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--ink-track);
}
.privacy .asks b { font-weight: 600; }
.privacy .asks span { color: var(--muted-on-ink); }
code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.9em;
  background: var(--ink-raised);
  color: var(--cream);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  overflow-wrap: anywhere;
}
.phone.on-ink { box-shadow: 0 0 0 1px var(--ink-track), 0 22px 40px -20px rgba(0, 0, 0, 0.7); background: #000; }

/* ---------- get the app ---------- */
.get { padding-block: var(--space-9); }
.get h2 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.get p { max-width: 52ch; margin: 0; text-wrap: pretty; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--hairline); padding-block: var(--space-6) var(--space-7); color: var(--muted); font-size: 0.9375rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3) var(--space-6); }
.site-foot p { margin: 0; }
.site-foot .credit { margin-top: var(--space-1); color: var(--ink); font-weight: 500; }

/* ---------- document pages (privacy, 404) ---------- */
.doc { padding-block: var(--space-7) var(--space-9); }
.doc h1 {
  margin: 0 0 var(--space-5);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.doc h2 { margin: var(--space-8) 0 var(--space-3); font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1.2; }
.doc p, .doc li { max-width: var(--measure); text-wrap: pretty; }
.doc ul { padding-left: 1.25rem; }
.doc li + li { margin-top: var(--space-2); }
.doc .updated { color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .meter .grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .feature .inner,
  .feature.flip .inner,
  .privacy .inner { grid-template-columns: 1fr; }
  .feature.flip .copy { order: 0; }
  .phones { justify-content: center; }
  .phones .phone { width: min(248px, calc((100% - var(--space-5)) / 2)); }
  .phones .phone:nth-child(2) { margin-top: var(--space-6); }
  .phones.single .phone { width: min(272px, 80%); }
  .privacy .phones { order: 2; }
  .privacy .asks li { grid-template-columns: 1fr; gap: var(--space-1); }
}

@media (max-width: 420px) {
  .stores { flex-direction: column; }
  .store { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bar > i { transition: none; }
}
