/* DailyAbhyas website. Colours and type follow the app (mobile/lib/core/theme.dart, assets/branding). */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/inter-400.v4.001.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/inter-600.v4.001.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/inter-800.v4.001.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --brand: #1B4F72;
  --brand-deep: #143D5A;
  --amber: #F5B73B;
  --paper: #FFFFFF;
  --mist: #EEF4F9;
  --text: #172A3A;
  --muted: #4B6274;
  --line: #D5E1EB;
  --link: #1B4F72;
  --focus: #1B4F72;
  --band-top: #22638F;
  --band-bottom: #143D5A;
  --on-band: #FFFFFF;
  --on-band-muted: #CFE0EE;
  --gutter: clamp(16px, 4vw, 40px);
  --font: "Inter", "Noto Sans Devanagari", "Kohinoor Devanagari", "Nirmala UI", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0B1F2E;
    --mist: #102B3F;
    --text: #E3ECF3;
    --muted: #A7BBCA;
    --line: #23455F;
    --link: #8EC5EE;
    --focus: #8EC5EE;
    --band-top: #194D70;
    --band-bottom: #0D2A3E;
    --on-band-muted: #BCD2E3;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.band :focus-visible {
  outline-color: var(--amber);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--paper);
  color: var(--link);
  padding: 8px 12px;
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

.nowrap {
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header ------------------------------------------------------------------ */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand svg {
  width: 34px;
  height: 34px;
  flex: none;
}

.site-nav a {
  color: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
}

.page-header {
  border-bottom: 1px solid var(--line);
}

.page-header .brand {
  color: var(--text);
}

/* Blue band (homepage hero) -------------------------------------------------- */

.band {
  background: linear-gradient(180deg, var(--band-top), var(--band-bottom));
  color: var(--on-band);
}

.band a {
  color: var(--on-band);
}

.hero {
  display: grid;
  gap: 40px;
  padding-block: 28px 56px;
}

.hero h1 {
  margin: 0;
  max-width: 15ch;
  font-size: clamp(2.25rem, 1.45rem + 3.6vw, 3.75rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero .hi {
  margin: 14px 0 0;
  color: var(--on-band-muted);
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.55rem);
  font-weight: 600;
  line-height: 1.4;
  text-wrap: balance;
}

.hero .lead {
  margin: 22px 0 0;
  max-width: 36ch;
  color: var(--on-band-muted);
  font-size: 1.125rem;
}

.status {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 26px 0 0;
  font-weight: 600;
}

.status::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  transform: translateY(-1px);
}

/* The question navigator, drawn the way the app draws it (practice_player_screen.dart). */

.sprint {
  margin: 0;
  justify-self: start;
  width: min(100%, 340px);
  padding: 20px 20px 18px;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 20px;
  background: rgb(255 255 255 / 0.06);
}

.sprint-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9375rem;
}

.sprint-head b {
  font-weight: 600;
}

.sprint-head span {
  color: var(--on-band-muted);
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 6px;
  margin: 12px 0 20px;
  border-radius: 3px;
  background: rgb(255 255 255 / 0.18);
  overflow: hidden;
}

.bar span {
  display: block;
  width: 50%;
  height: 100%;
  border-radius: 3px;
  background: var(--on-band);
}

.q-grid {
  display: grid;
  grid-template-columns: repeat(4, 52px);
  justify-content: space-between;
  gap: 14px 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.q {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1.5px solid rgb(255 255 255 / 0.5);
  border-radius: 50%;
  color: var(--on-band);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.q.answered {
  border-color: #FFFFFF;
  background: #FFFFFF;
  color: var(--brand-deep);
}

.q.current {
  border-color: transparent;
  box-shadow: 0 0 0 3px var(--amber);
}

.flag {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  fill: var(--amber);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  color: var(--on-band-muted);
  font-size: 0.875rem;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.key {
  flex: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid rgb(255 255 255 / 0.5);
  border-radius: 50%;
}

.key.answered {
  border-color: #FFFFFF;
  background: #FFFFFF;
}

.key.flagged {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 0;
  fill: var(--amber);
}

/* One page-load moment: the sprint fills in. */
@media (prefers-reduced-motion: no-preference) {
  .q.answered {
    animation: q-fill 380ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .q-grid li:nth-child(1) { animation-delay: 150ms; }
  .q-grid li:nth-child(2) { animation-delay: 210ms; }
  .q-grid li:nth-child(3) { animation-delay: 270ms; }
  .q-grid li:nth-child(4) { animation-delay: 330ms; }
  .q-grid li:nth-child(5) { animation-delay: 390ms; }
  .q-grid li:nth-child(6) { animation-delay: 450ms; }
  .q-grid li:nth-child(8) { animation-delay: 570ms; }
  .q-grid li:nth-child(9) { animation-delay: 630ms; }
  .q.current {
    animation: q-ring 420ms ease-out 760ms both;
  }
  .q .flag {
    animation: flag-in 300ms ease-out 900ms both;
  }
  .bar span {
    animation: bar-fill 700ms cubic-bezier(0.2, 0.7, 0.2, 1) 150ms both;
  }
}

@keyframes q-fill {
  from {
    border-color: rgb(255 255 255 / 0.5);
    background: transparent;
    color: var(--on-band);
  }
}

@keyframes q-ring {
  from {
    box-shadow: 0 0 0 0 var(--amber);
  }
}

@keyframes flag-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

@keyframes bar-fill {
  from {
    width: 0;
  }
}

/* Sections ------------------------------------------------------------------ */

.section {
  padding-block: 56px;
}

.section h2 {
  margin: 0;
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.habits {
  display: grid;
  gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.habits h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.4vw, 1.5rem);
  text-wrap: balance;
}

.habits p {
  margin: 10px 0 0;
  max-width: 44ch;
  color: var(--muted);
}

/* The three amber speed lines of the app icon, one per habit. */
.line {
  display: block;
  height: 8px;
  margin-bottom: 18px;
  border-radius: 4px;
  background: var(--amber);
}

.line-1 { width: 40px; }
.line-2 { width: 56px; }
.line-3 { width: 44px; }

.promises {
  background: var(--mist);
}

.promise-list {
  display: grid;
  gap: 26px;
  margin: 28px 0 0;
}

.promise-list dt {
  font-weight: 600;
  font-size: 1.125rem;
}

.promise-list dd {
  margin: 4px 0 0;
  max-width: 52ch;
  color: var(--muted);
}

.contact p {
  margin: 12px 0 0;
  max-width: 52ch;
  color: var(--muted);
}

/* Footer ---------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 28px 40px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer p {
  margin: 0;
  max-width: 62ch;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.footer-links a {
  font-weight: 600;
}

.copyright {
  margin-top: 10px;
}

/* Long-form pages (privacy policy, 404) ---------------------------------------- */

.prose {
  max-width: 68ch;
  padding-block: 40px 64px;
}

.prose h1 {
  margin: 0;
  font-size: clamp(2rem, 1.6rem + 1.8vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.prose h2 {
  margin: 48px 0 0;
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  scroll-margin-top: 16px;
}

.prose h3 {
  margin: 28px 0 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.prose p,
.prose ul,
.prose ol {
  margin: 12px 0 0;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: 6px;
}

.updated {
  color: var(--muted);
}

.summary {
  margin: 28px 0 0;
  padding: 20px 22px 22px;
  border-radius: 14px;
  background: var(--mist);
}

.summary h2 {
  margin: 0;
  font-size: 1.125rem;
}

.toc {
  margin: 32px 0 0;
  padding: 0;
}

.toc h2 {
  margin: 0;
  font-size: 1.125rem;
}

.toc ol {
  padding-left: 1.4em;
}

/* Wider screens ---------------------------------------------------------------- */

@media (min-width: 720px) {
  /* Subgrid keeps the three paragraphs aligned when one heading wraps. */
  .habits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
    gap: 0 40px;
  }
  .habits li {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    align-content: start;
  }
  .promise-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 48px;
  }
  .section {
    padding-block: 80px;
  }
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center;
    gap: 64px;
    padding-block: 48px 96px;
  }
  .sprint {
    justify-self: end;
    width: 360px;
    padding: 26px 26px 22px;
  }
  .q-grid {
    grid-template-columns: repeat(4, 56px);
  }
  .q {
    width: 56px;
    height: 56px;
    font-size: 1.0625rem;
  }
}

@media print {
  .site-header,
  .site-footer,
  .skip {
    display: none;
  }
  body {
    background: #FFFFFF;
    color: #000000;
  }
}
