:root {
  color-scheme: light;
  --bg: #f7f7f2;
  --surface: #ffffff;
  --surface-soft: #eef3ec;
  --text: #15231c;
  --muted: #5d6b63;
  --green: #0f5132;
  --green-strong: #0b3d27;
  --green-soft: #dfece3;
  --border: #d7dfd7;
  --gold: #b77918;
  --footer: #0b2f20;
  --on-dark: #edf5ef;
  --on-dark-muted: #afc0b5;
  --on-dark-faint: #97aa9f;
  --focus: #e7a52c;
  --font-body: "Noto Sans Devanagari", system-ui, sans-serif;
  --font-label: "Space Grotesk", "Noto Sans Devanagari", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111111;
  --surface: #1f1f1f;
  --surface-soft: #181818;
  --text: #f3f0e9;
  --muted: #c9c3b8;
  --green: #d2aa6a;
  --green-strong: #efd7aa;
  --green-soft: #302a21;
  --border: #3b3935;
  --gold: #d2aa6a;
  --footer: #141414;
  --on-dark: #f3f0e9;
  --on-dark-muted: #c9c3b8;
  --on-dark-faint: #aaa49a;
  --focus: #e3b565;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 82px;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  transform: translateY(-150%);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 999;
  height: 3px;
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--gold);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(247, 249, 246, .97);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

:root[data-theme="dark"] .site-header {
  background: rgba(20, 20, 20, .985);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .24);
}

.site-header.is-scrolled {
  border-color: var(--border);
  box-shadow: 0 8px 24px rgb(9 37 24 / 7%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 64px;
  margin: 0 auto;
  padding: 8px 18px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.site-brand img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(12, 28, 23, .18));
}

.brand-name {
  overflow: hidden;
  font-size: .94rem;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(17, 39, 32, .07);
  cursor: pointer;
}

.home-theme-toggle:hover,
.home-theme-toggle:focus-visible {
  color: var(--green);
  border-color: var(--green);
  background: var(--surface-soft);
  outline: none;
}

.home-theme-icon,
.home-theme-icon svg {
  display: block;
  width: 21px;
  height: 21px;
}

.theme-icon-sun {
  display: none !important;
}

:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: block !important;
}

.home-hero {
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  align-items: center;
  gap: clamp(40px, 6vw, 72px);
  width: min(1180px, calc(100% - 40px));
  min-height: 0;
  margin: 0 auto;
  padding: 40px 0 44px;
}

.hero-kicker,
.section-kicker,
.test-kicker {
  margin: 0 0 14px;
  color: var(--green);
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.hero-title {
  max-width: 680px;
  margin: 0;
  font-size: clamp(40px, 4.4vw, 60px);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.1;
}

.hero-title span {
  color: var(--green);
}

.hero-sub {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.35vw, 18px);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button--primary {
  border-color: var(--green-strong);
  background: var(--green-strong);
  color: #fff;
}

:root[data-theme="dark"] .button--primary {
  color: #111111;
}

.button--quiet {
  background: var(--surface);
}

.button--quiet:hover {
  border-color: var(--green);
}

.hero-visual {
  min-width: 0;
}

.hero-visual-photo {
  aspect-ratio: 3 / 2;
  max-height: 360px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: url("brand/pahadi-pathshala-cover-v2.webp") center / cover no-repeat;
  box-shadow: 12px 12px 0 var(--green-soft);
}

.section {
  padding: 80px 0;
}

.section-inner,
.test-series-inner,
.footer-inner,
.footer-bottom {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.section-heading {
  margin-bottom: 32px;
}

.section-heading--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  max-width: 780px;
}

.section-heading h2,
.trust-intro h2,
.test-copy h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 50px);
  letter-spacing: -.035em;
  line-height: 1.18;
}

.section-heading > p,
.section-heading--split > p,
.trust-intro > p,
.test-copy > p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.library-section {
  padding: 58px 0 64px;
  background: var(--surface);
}

.library-section .section-heading {
  margin-bottom: 24px;
}

.library-section .section-heading h2 {
  font-size: clamp(32px, 3.5vw, 44px);
}

.library-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  min-height: 62px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
}

.library-search:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 16%, transparent);
}

.search-icon {
  padding-left: 20px;
  color: var(--green);
  font-family: var(--font-label);
  font-size: 23px;
}

.library-search input {
  width: 100%;
  min-height: 60px;
  border: 0;
  outline: 0;
  padding: 0 16px;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.library-search input::placeholder {
  color: var(--muted);
  opacity: .8;
}

.search-clear,
.search-submit {
  min-height: 44px;
  margin: 8px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.search-clear {
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
}

.search-submit {
  padding: 0 22px;
  background: var(--green-strong);
  color: #fff;
}

:root[data-theme="dark"] .search-submit {
  color: #111111;
}

.search-status {
  min-height: 0;
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 14px;
}

.search-status:empty {
  display: none;
}

.search-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.search-result {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 210px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.search-result:hover {
  border-color: var(--green);
}

.search-result small {
  color: var(--green);
  font-weight: 700;
}

.search-result strong {
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.35;
}

.search-result-description {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.search-result-action {
  margin-top: auto;
  padding-top: 14px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.search-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
}

.search-empty p {
  margin: 8px 0 14px;
  color: var(--muted);
}

.search-empty button {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.resume-box {
  margin-top: 20px;
}

.resume-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--green-soft);
}

.resume-link > span:first-child {
  display: grid;
}

.resume-link small {
  color: var(--muted);
}

.resume-link > span:last-child {
  color: var(--green);
  font-weight: 700;
}

.directory-heading {
  display: grid;
  gap: 5px;
  margin: 0 0 16px;
}

.directory-heading h2 {
  margin: 0;
  font-size: clamp(30px, 3.5vw, 42px);
  letter-spacing: -.03em;
  line-height: 1.2;
}

.directory-heading p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}

.subject-directory {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.subject-entry {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 184px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 160ms ease, transform 160ms ease;
}

a.subject-entry:hover {
  transform: translateY(-3px);
  border-color: var(--green);
}

.subject-entry--coming-soon {
  background: var(--surface-soft);
}

.subject-name {
  margin: 0;
  font-size: 21px;
  line-height: 1.35;
}

.subject-desc {
  display: -webkit-box;
  margin: 8px 0 16px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.subject-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.subject-link-label {
  color: var(--green);
  font-weight: 700;
}

.subject-state {
  color: var(--gold);
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
}

.latest-section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.latest-layout {
  display: block;
}

.latest-layout > .section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  grid-template-areas:
    "kicker description"
    "title description";
  align-items: end;
  gap: 2px 48px;
  margin-bottom: 28px;
}

.latest-layout > .section-heading .section-kicker {
  grid-area: kicker;
  color: var(--green);
}

.latest-layout > .section-heading h2 {
  grid-area: title;
}

.latest-layout > .section-heading > p:last-child {
  grid-area: description;
  align-self: end;
  padding-bottom: 6px;
}

.latest-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.latest-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 16px;
  min-height: 154px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.latest-item:hover {
  transform: translateY(-2px);
  border-color: var(--green);
  background: var(--surface-soft);
}

.latest-item:hover .latest-name,
.latest-item:hover .latest-action {
  color: var(--green);
}

.latest-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
  height: 100%;
}

.latest-name {
  font-size: 18px;
  line-height: 1.4;
}

.latest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 12px;
  margin-top: auto;
  padding-top: 18px;
}

.latest-action {
  align-self: end;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.test-series-section {
  padding: 72px 0;
  background: var(--footer);
  color: var(--on-dark);
}

.test-series-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .7fr);
  align-items: center;
  gap: 60px;
}

.test-kicker {
  color: #e3b65b;
}

.test-copy > p {
  max-width: 660px;
  margin-top: 16px;
  color: var(--on-dark-muted);
}

.test-features {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgb(255 255 255 / 18%);
}

.test-features li {
  padding: 14px 0;
  border-bottom: 1px solid rgb(255 255 255 / 18%);
  color: var(--on-dark);
}

.test-features li::before {
  content: "—";
  margin-right: 12px;
  color: #e3b65b;
}

.trust-section {
  padding-top: 68px;
  padding-bottom: 68px;
}

.trust-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
  align-items: center;
  gap: 60px;
}

.trust-intro > p:last-child {
  max-width: 760px;
  margin-top: 14px;
}

.trust-links {
  display: grid;
  border-top: 1px solid var(--border);
}

.trust-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.trust-links a::after {
  content: "→";
  color: var(--green);
}

.trust-links a:hover {
  color: var(--green);
}

.site-footer {
  padding: 58px 0 0;
  background: var(--footer);
  color: var(--on-dark);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.35fr .65fr .65fr 1fr;
  gap: 44px;
  padding-bottom: 46px;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.footer-brand img {
  border-radius: 50%;
}

.footer-brand strong {
  font-family: var(--font-label);
  font-size: 19px;
}

.footer-brand p,
.footer-note p {
  margin: 8px 0 0;
  color: var(--on-dark-muted);
  font-size: 13px;
}

.footer-column {
  display: grid;
  align-content: start;
  gap: 9px;
}

.footer-column strong,
.footer-note strong {
  margin-bottom: 4px;
  color: #e2b456;
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.footer-column a {
  color: var(--on-dark-muted);
  font-size: 13px;
}

.footer-column a:hover {
  color: var(--on-dark);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 22px;
  border-top: 1px solid rgb(255 255 255 / 13%);
  color: var(--on-dark-faint);
  font-size: 12px;
}

.no-script-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.no-script-links > * {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.hero-enter {
  animation: hero-in 500ms ease both;
}

.hero-enter:nth-child(2) {
  animation-delay: 70ms;
}

.hero-enter:nth-child(3) {
  animation-delay: 120ms;
}

.hero-enter:nth-child(4) {
  animation-delay: 170ms;
}

.motion-ready .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.motion-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1040px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
    gap: 44px;
  }

  .hero-title {
    font-size: clamp(38px, 5.4vw, 56px);
  }

  .subject-directory,
  .search-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-inner {
    grid-template-columns: 1.3fr .7fr .7fr;
  }

  .footer-note {
    grid-column: 1 / -1;
    max-width: 700px;
  }
}

@media (max-width: 820px) {
  html {
    scroll-padding-top: 70px;
  }

  .header-inner {
    min-height: 64px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 42px 0 50px;
  }

  .hero-copy {
    max-width: 700px;
  }

  .hero-title {
    font-size: clamp(38px, 8vw, 52px);
  }

  .hero-visual {
    max-width: 600px;
  }

  .hero-visual-photo {
    aspect-ratio: 16 / 10;
    max-height: 320px;
    box-shadow: 12px 12px 0 var(--green-soft);
  }

  .section {
    padding: 64px 0;
  }

  .section-heading--split,
  .test-series-inner,
  .trust-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .section-heading--split {
    align-items: start;
  }

  .latest-layout > .section-heading {
    grid-template-columns: 1fr;
    grid-template-areas:
      "kicker"
      "title"
      "description";
    gap: 4px;
  }

  .latest-layout > .section-heading > p:last-child {
    margin-top: 7px;
    padding-bottom: 0;
  }

  .latest-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .directory-heading {
    display: block;
  }

  .directory-heading p {
    margin-top: 6px;
    text-align: left;
  }

  .test-series-inner {
    gap: 34px;
  }

  .footer-inner {
    grid-template-columns: 1.3fr .7fr .7fr;
    gap: 32px;
  }
}

@media (max-width: 560px) {
  .hero-inner,
  .section-inner,
  .test-series-inner,
  .footer-inner,
  .footer-bottom {
    width: min(100% - 28px, 1180px);
  }

  .site-brand img {
    width: 42px;
    height: 42px;
  }

  .brand-name {
    font-size: 15px;
  }

  .hero-inner {
    gap: 28px;
    padding: 36px 0 44px;
  }

  .hero-kicker,
  .section-kicker,
  .test-kicker {
    font-size: 11px;
  }

  .hero-title {
    font-size: clamp(34px, 10.5vw, 44px);
    letter-spacing: -.035em;
  }

  .hero-sub {
    margin-top: 18px;
    font-size: 16px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .button {
    width: 100%;
  }

  .hero-visual-photo {
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    box-shadow: 8px 8px 0 var(--green-soft);
  }

  .section {
    padding: 52px 0;
  }

  .section-heading {
    margin-bottom: 24px;
  }

  .section-heading h2,
  .trust-intro h2,
  .test-copy h2 {
    font-size: 32px;
  }

  .library-search {
    grid-template-columns: auto minmax(0, 1fr) auto;
    overflow: visible;
  }

  .search-clear {
    grid-column: 3;
    grid-row: 1;
  }

  .search-submit {
    grid-column: 1 / -1;
    grid-row: 2;
    width: calc(100% + 2px);
    min-height: 48px;
    margin: 8px -1px -1px;
    border-radius: 0 0 11px 11px;
  }

  .search-results,
  .subject-directory {
    grid-template-columns: 1fr;
  }

  .subject-entry {
    min-height: 190px;
  }

  .resume-link {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .latest-list {
    grid-template-columns: 1fr;
  }

  .latest-item {
    align-items: stretch;
    min-height: 132px;
  }

  .test-series-section {
    padding: 54px 0;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand,
  .footer-note {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 360px) {
  .brand-name {
    font-size: 14px;
  }

  .hero-title {
    font-size: 34px;
  }

  .subject-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }

  .hero-enter,
  .motion-ready .reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-header,
  .scroll-progress,
  .test-series-section,
  .site-footer {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
