/* Janma Patrika: base styles. Tokens first, then layout, components, pages. */

:root {
  --parchment: #FBF3E0;
  --parchment-deep: #F3E6C4;
  --paper: #FFFCF4;
  --saffron: #E07B1F;
  --saffron-dark: #A24A05;
  --maroon: #6B1426;
  --maroon-dark: #46091A;
  --gold: #A9781F;
  --gold-soft: #E2C27A;
  --navy: #0F1A33;
  --navy-soft: #1B2A4F;
  --ink: #2A1B1E;
  --ink-soft: #5A4549;
  --error: #A3131B;
  --ok: #1F6B3A;

  --font-display: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", "Iowan Old Style", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", Helvetica, Arial, sans-serif;

  --step--1: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-0: 1rem;
  --step-1: clamp(1.125rem, 1.08rem + 0.2vw, 1.25rem);
  --step-2: clamp(1.4rem, 1.25rem + 0.7vw, 1.8rem);
  --step-3: clamp(1.8rem, 1.5rem + 1.4vw, 2.5rem);
  --step-4: clamp(2.2rem, 1.6rem + 3vw, 3.6rem);

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font: var(--step-0) / 1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; }
a { color: var(--maroon); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--maroon-dark); }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }

h1, h2, h3 { font-family: var(--font-display); color: var(--maroon-dark); line-height: 1.15; margin: 0 0 0.6em; font-weight: 700; letter-spacing: -0.005em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
p { margin: 0 0 1em; }

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

.skip-link { position: absolute; left: -999px; top: 0; background: var(--navy); color: var(--parchment); padding: 0.6rem 1rem; z-index: 100; }
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  background: var(--saffron);
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 4px;
  font: 700 var(--step-0) / 1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s;
}
.btn:hover { background: #F18A2C; color: var(--navy); }
.btn-outline { background: transparent; color: var(--maroon-dark); border-color: var(--maroon); }
.btn-outline:hover { background: var(--maroon); color: var(--parchment); }
.btn-small { padding: 0.5rem 1rem; font-size: var(--step--1); }

/* ---------- header ---------- */
.site-header { background: var(--parchment); border-bottom: 4px double var(--gold); position: relative; z-index: 10; }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.8rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--maroon-dark); text-decoration: none; }
.brand-mark { color: var(--gold); flex: none; }
.brand-name { font: 700 1.45rem / 1 var(--font-display); }
.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav ul { display: flex; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.site-nav ul a { color: var(--ink); text-decoration: none; padding-block: 0.3rem; border-bottom: 2px solid transparent; }
.site-nav ul a:hover { border-bottom-color: var(--gold); }
.site-nav ul a[aria-current="page"] { border-bottom-color: var(--saffron); font-weight: 600; }
.menu-btn { display: none; }

@media (max-width: 52rem) {
  .site-header .bar { flex-wrap: wrap; }
  .menu-btn {
    display: none;
    background: transparent; color: var(--maroon-dark);
    border: 2px solid var(--maroon); border-radius: 4px;
    padding: 0.4rem 0.9rem; font: 600 var(--step--1) var(--font-body); cursor: pointer;
  }
  .js .menu-btn { display: inline-block; }
  .site-nav { flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0.8rem; padding-block: 0.5rem 0.3rem; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { display: block; padding-block: 0.7rem; border-bottom: 1px solid var(--parchment-deep); }
  .site-nav .btn { text-align: center; }
  .js .site-nav { display: none; }
  .js .site-nav.open { display: flex; }
}

/* ---------- breadcrumbs, notices ---------- */
.breadcrumbs { padding-top: 1.2rem; font-size: var(--step--1); color: var(--ink-soft); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--gold); }
.breadcrumbs a { color: var(--ink-soft); }
.notice { margin-block: 1.2rem; padding: 0.8rem 1rem; border-left: 5px solid; background: var(--paper); }
.notice-ok { border-color: var(--ok); }
.notice-error { border-color: var(--error); }

/* ---------- sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-tint { background: var(--parchment-deep); }
.section-intro { max-width: 62ch; color: var(--ink-soft); font-size: var(--step-1); }

/* ---------- hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero-copy h1 { max-width: 18ch; margin-bottom: 0.5em; }
.lead { font-size: var(--step-1); max-width: 54ch; color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-block: 1.6rem 1.2rem; }
.hint { max-width: 54ch; font-size: var(--step--1); color: var(--ink-soft); border-left: 3px solid var(--gold-soft); padding-left: 0.9rem; }

.chart-panel { margin: 0; background: var(--navy); padding: clamp(1rem, 3vw, 1.6rem); border: 1px solid var(--gold); outline: 1px solid var(--gold-soft); outline-offset: 5px; }
.house-diagram { display: block; width: 100%; height: auto; }
.hd-num { font: 600 22px var(--font-display); fill: var(--gold-soft); }
.hd-num-1 { fill: #FFD28A; font-size: 26px; }
.hd-label { font: italic 14px var(--font-display); fill: #FFD28A; }
.chart-panel figcaption { margin-top: 1rem; color: #E9DDBE; font-size: var(--step--1); line-height: 1.5; }

@media (max-width: 52rem) {
  .hero-grid { grid-template-columns: 1fr; }
  .chart-panel { max-width: 30rem; }
}

/* ---------- how it works ---------- */
.steps { list-style: none; counter-reset: step; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.steps li { counter-increment: step; border-top: 3px solid var(--gold); padding-top: 1rem; }
.steps li::before { content: counter(step); display: block; font: 700 var(--step-3) / 1 var(--font-display); color: var(--saffron-dark); margin-bottom: 0.6rem; }
.steps h3 { font-size: var(--step-1); margin-bottom: 0.4em; }
.steps p { color: var(--ink-soft); margin: 0; }
@media (max-width: 52rem) { .steps { grid-template-columns: 1fr; } }

/* ---------- report coverage ---------- */
.coverage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.8rem clamp(1.5rem, 4vw, 3.5rem); margin: 2.2rem 0 0; }
.coverage > div { border-left: 3px solid var(--maroon); padding-left: 1.1rem; }
.coverage dt { font: 700 var(--step-1) / 1.3 var(--font-display); color: var(--maroon-dark); margin-bottom: 0.3rem; }
.coverage dd { margin: 0; color: var(--ink-soft); max-width: 52ch; }
@media (max-width: 52rem) { .coverage { grid-template-columns: 1fr; } }

/* ---------- method band ---------- */
.method { background: var(--navy); color: #EFE4C8; }
.method h2 { color: var(--parchment); }
.method-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.method-list { list-style: none; margin: 0; padding: 0; }
.method-list li { position: relative; padding: 0.55rem 0 0.55rem 1.7rem; border-bottom: 1px solid var(--navy-soft); }
.method-list li::before { content: ""; position: absolute; left: 0.2rem; top: 1.05rem; width: 0.5rem; height: 0.5rem; background: var(--gold-soft); transform: rotate(45deg); }
@media (max-width: 52rem) { .method-grid { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq { max-width: 50rem; }
.faq details { border-bottom: 1px solid var(--gold-soft); padding-block: 0.2rem; }
.faq summary { cursor: pointer; padding-block: 0.9rem; font: 700 var(--step-1) / 1.3 var(--font-display); color: var(--maroon-dark); }
.faq details p { color: var(--ink-soft); max-width: 62ch; padding-bottom: 0.6rem; }

/* ---------- closing call to action ---------- */
.cta-band { background: var(--maroon); color: var(--parchment); padding-block: clamp(3rem, 6vw, 4.5rem); }
.cta-band h2 { color: var(--parchment); }
.cta-band p { max-width: 52ch; }
.cta-band .btn { border-color: var(--parchment); }

/* ---------- long-form text pages ---------- */
.prose { max-width: 46rem; }
.prose h1 { font-size: var(--step-3); }
.prose h2 { font-size: var(--step-2); margin-top: 2em; }
.prose p, .prose li { line-height: 1.75; }
.prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.4em; }
.prose .meta { color: var(--ink-soft); font-size: var(--step--1); }

/* ---------- forms ---------- */
.form { max-width: 36rem; margin-top: 1.5rem; }
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: 0.7rem 0.8rem; font: inherit; color: var(--ink);
  background: var(--paper); border: 2px solid #CDB982; border-radius: 4px;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--maroon); outline: 3px solid var(--saffron); outline-offset: 1px; }
.field.has-error input, .field.has-error textarea { border-color: var(--error); }
.field-error { color: var(--error); font-weight: 600; font-size: var(--step--1); margin: 0.3rem 0 0; }
.help { color: var(--ink-soft); font-size: var(--step--1); margin: 0.3rem 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy); color: #D9CDAE; padding-block: 3rem 1.5rem; border-top: 4px double var(--gold); font-size: var(--step--1); }
.site-footer a { color: #F3E6C4; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; }
.footer-brand { font: 700 var(--step-2) / 1.1 var(--font-display); color: var(--parchment); margin-bottom: 0.5rem; }
.footer-about p:last-child { max-width: 38ch; }
.site-footer h2 { font: 700 var(--step-0) var(--font-body); color: var(--gold-soft); margin-bottom: 0.7rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.45rem; }
.footer-base { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--navy-soft); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.footer-base p { margin: 0; }
@media (max-width: 52rem) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }
@media (max-width: 30rem) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- installer ---------- */
.installer-main { padding-block: 2.5rem; }
.req-table { width: 100%; border-collapse: collapse; font-size: var(--step--1); margin-bottom: 1.5rem; }
.req-table th, .req-table td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--parchment-deep); vertical-align: top; }
.req-table .ok td:nth-child(2) { color: var(--ok); font-weight: 600; }
.req-table .bad td:nth-child(2) { color: var(--error); font-weight: 700; }
.req-table .warn td:nth-child(2) { color: var(--saffron-dark); font-weight: 600; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; background: var(--parchment-deep); padding: 0.08em 0.3em; border-radius: 3px; }

@media print { .site-header, .site-footer, .skip-link { display: none; } body { background: #fff; } }
