/* Agastya Samskrithi — website styles
   Palette and type follow docs/brand-identity-2026-10-11.md
   Marcellus (display, approved brand typeface) + Spectral (reading text) */

:root {
  --ivory: #f4ede0;
  --ivory-2: #ebe1ce;
  --ink: #2a2118;
  --ink-soft: #4f4033;
  --bronze: #74502f;
  --gold: #b8923f;
  --gold-light: #d9b96a;
  --indigo: #13173a;
  --indigo-2: #1c2252;
  --terracotta: #b3563a;
  --gold-text: #6e5218;
  --terracotta-text: #9a4128;
  --ivory-soft: #e6dfd0;

  /* Text roles (WCAG AA on their surfaces; ratios vs #f4ede0 / #13173a)
     Light surfaces:  --ink 13.6 body · --ink-soft 8.5 secondary · --bronze 6.2 headings, labels, links
                      --gold-text 6.3 eyebrows · --terracotta-text 5.7 status / errors
     Dark surfaces:   --ivory 14.9 primary · --ivory-soft 13.1 secondary · --gold-light 9.2 headings, labels
     --gold and --terracotta are for rules, borders and ornaments, not text on ivory. */

  --display: "Marcellus", "Cinzel", Georgia, serif;
  --body: "Spectral", Georgia, "Times New Roman", serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --max: 72rem;
  --header-h: 4.5rem;
}

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

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

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 400;
  font-size: clamp(1.02rem, 0.96rem + 0.3vw, 1.18rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.3  0 0 0 0 0.22  0 0 0 0 0.12  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

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

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

.skip {
  position: absolute;
  left: 1rem; top: -4rem;
  background: var(--bronze);
  color: var(--ivory);
  padding: 0.6rem 1rem;
  z-index: 200;
  font-family: var(--display);
}
.skip:focus { top: 1rem; }

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

.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
}

.brand-mini {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--bronze);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.brand-mini svg { width: 1.5rem; height: 1.5rem; color: var(--bronze); }

.nav { display: flex; gap: clamp(1rem, 2.2vw, 2.1rem); }
.nav a {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
  transition: color .25s ease, border-color .25s ease;
}
.nav a:hover { color: var(--bronze); border-color: var(--gold); }
.nav a[aria-current="page"] { color: var(--bronze); border-color: var(--bronze); }

.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--bronze);
  color: var(--bronze);
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}

@media (max-width: 980px) {
  .menu-btn { display: block; position: relative; z-index: 70; }
  .nav {
    position: fixed;
    inset: 0;
    z-index: 60;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.6rem;
    background: var(--indigo);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
  }
  .nav a { color: var(--gold-light); font-size: 1.05rem; letter-spacing: 0.14em; }
  .nav a[aria-current="page"], .nav a:hover { color: var(--ivory); border-color: var(--gold); }
  body.menu-open .nav { opacity: 1; visibility: visible; }
  body.menu-open .menu-btn { color: var(--gold-light); border-color: var(--gold); }
  body.menu-open .brand-mini { position: relative; z-index: 70; color: var(--gold-light); }
  body.menu-open .brand-mini svg { color: var(--gold-light); }
}

/* ---------- Entrance motion ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes drift {
  to { transform: rotate(360deg); }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.rise { opacity: 0; animation: rise 1s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: var(--d, 0s); }

/* ---------- Home hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: calc(var(--header-h) + 2rem) var(--gutter) 3rem;
  overflow: hidden;
}

.hero .sun {
  position: absolute;
  right: -14vmin;
  top: 50%;
  width: 78vmin;
  height: 78vmin;
  margin-top: -39vmin;
  color: var(--bronze);
  opacity: 0.08;
  animation: drift 360s linear infinite;
}
.hero .moon {
  position: absolute;
  left: clamp(1.5rem, 7vw, 6rem);
  bottom: 12vh;
  width: clamp(3.5rem, 11vmin, 8rem);
  height: auto;
  color: var(--bronze);
  opacity: 0.55;
}

@media (max-width: 640px) { .hero .moon { display: none; } }

.hero-inner { position: relative; z-index: 2; max-width: 46rem; }

.wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
  font-size: clamp(2.3rem, 9.5vw, 4.9rem);
  color: var(--bronze);
}
.wordmark span { display: block; }

.rule {
  width: 4.5rem; height: 1px;
  background: var(--gold);
  margin: 1.8rem auto;
  position: relative;
}
.rule::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 7px; height: 7px;
  background: var(--ivory);
  border: 1px solid var(--gold);
  transform: translate(-50%, -50%) rotate(45deg);
}

.descriptor {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.6vw, 1.55rem);
  letter-spacing: 0.04em;
  color: var(--ink);
}

.headline {
  margin: clamp(1.6rem, 4.5vh, 2.6rem) auto 0;
  max-width: 24ch;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.45rem, 3.6vw, 2.35rem);
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.subline {
  margin: 0.8rem auto 0;
  max-width: 34rem;
  color: var(--ink-soft);
  font-weight: 300;
}
.hero-cta {
  margin-top: clamp(1.4rem, 3.5vh, 2rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
}
.btn.solid { background: var(--bronze); color: var(--ivory); }
.btn.solid:hover { background: var(--ink); border-color: var(--ink); }

.hero-note {
  margin: clamp(1.6rem, 4vh, 2.4rem) auto 0;
  max-width: 34rem;
  font-style: italic;
  font-weight: 300;
  font-size: 0.92em;
  color: var(--ink-soft);
}
.river-lede {
  margin: -1.4rem 0 2.4rem;
  max-width: 36rem;
  color: var(--ivory-soft);
  font-weight: 300;
}

/* ---------- Indigo domain section ---------- */

.river {
  position: relative;
  background: var(--indigo);
  color: var(--ivory);
  padding: clamp(4rem, 12vh, 7rem) var(--gutter);
  overflow: hidden;
  isolation: isolate;
}
.river .strands {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  color: var(--gold);
  opacity: 0.7;
}
.river .strands path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  animation: fade 2.4s ease-out 0.4s forwards;
}
.river .strands path:nth-child(2) { animation-delay: .7s; }
.river .strands path:nth-child(3) { animation-delay: 1s; }
.river .strands path:nth-child(4) { animation-delay: 1.3s; }
.river .strands path:nth-child(5) { animation-delay: 2.4s; }

.river-inner { max-width: var(--max); margin: 0 auto; }

.eyebrow {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  color: var(--gold-text);
  margin: 0 0 1rem;
}
.river .eyebrow, .panel-dark .eyebrow { color: var(--gold-light); }

.section-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.7rem, 4.2vw, 2.7rem);
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin: 0 0 2.6rem;
  max-width: 24ch;
}

.domains {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}
@media (max-width: 960px) { .domains { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .domains { grid-template-columns: 1fr; gap: 0.8rem; } }

.domain {
  border: 1px solid rgba(184, 146, 63, 0.4);
  background: rgba(19, 23, 58, 0.72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  padding: 1.6rem 1.4rem 1.7rem;
  transition: border-color .3s ease, transform .3s ease, background .3s ease;
}
.domain:hover { border-color: var(--gold-light); transform: translateY(-3px); background: rgba(28, 34, 82, 0.85); }
.domain .num {
  font-family: var(--display);
  color: var(--gold);
  font-size: 0.9rem;
  letter-spacing: 0.2em;
}
.domain h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.25;
  margin: 0.6rem 0 0.7rem;
  color: var(--gold-light);
}
.domain p { margin: 0; font-size: 0.97rem; color: var(--ivory-soft); line-height: 1.55; }

.doors {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.8rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  text-decoration: none;
  padding: 0.95rem 1.7rem;
  border: 1px solid var(--bronze);
  color: var(--bronze);
  background: transparent;
  cursor: pointer;
  transition: background .3s ease, color .3s ease, letter-spacing .3s ease;
}
.btn:hover { background: var(--bronze); color: var(--ivory); letter-spacing: 0.17em; }
.btn .arr { display: inline-block; margin-left: 0.5rem; transition: transform .3s ease; }
.btn:hover .arr { transform: translateX(4px); }

.btn.on-dark { border-color: var(--gold); color: var(--gold-light); }
.btn.on-dark:hover { background: var(--gold); color: var(--indigo); }

/* ---------- Inner pages ---------- */

.page-head {
  position: relative;
  padding: calc(var(--header-h) + clamp(2.5rem, 8vh, 5rem)) var(--gutter) clamp(1.5rem, 4vh, 2.5rem);
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  overflow: visible;
}
.page-head .eyebrow { color: var(--gold-text); }
.page-head h1 {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.15;
  font-size: clamp(2.1rem, 6.4vw, 4rem);
  color: var(--bronze);
  margin: 0;
}
.page-head .lede {
  max-width: 38rem;
  margin: 1.4rem 0 0;
  color: var(--ink-soft);
  font-size: 1.12em;
  font-weight: 300;
}
.page-head .moon-mark {
  position: absolute;
  right: var(--gutter);
  top: calc(var(--header-h) + 1.5rem);
  width: clamp(3rem, 8vw, 5.5rem);
  color: var(--bronze);
  opacity: 0.35;
}

.content {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 1rem var(--gutter) clamp(3rem, 8vh, 5rem);
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}
.cards.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .cards.three { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }

.card {
  position: relative;
  border: 1px solid rgba(116, 80, 47, 0.35);
  background: rgba(235, 225, 206, 0.45);
  padding: 1.7rem 1.6rem 1.8rem;
  transition: border-color .3s ease, background .3s ease, transform .3s ease;
}
.card:hover { border-color: var(--bronze); background: rgba(235, 225, 206, 0.8); transform: translateY(-3px); }
.card h2, .card h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1.25;
  color: var(--bronze);
  margin: 0 0 0.7rem;
}
.card p { margin: 0 0 0.8rem; font-size: 0.99rem; line-height: 1.6; }
.card p:last-child { margin-bottom: 0; }

.tag {
  display: inline-block;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--gold);
  color: var(--bronze);
  margin-bottom: 0.9rem;
}
.tag.design { border-color: var(--terracotta); color: var(--terracotta-text); }

.note {
  margin: 1.8rem 0 0;
  max-width: 40rem;
  color: var(--ink-soft);
  font-style: italic;
  font-weight: 300;
}

.cta-row { margin-top: 2.2rem; }

/* list of roles (careers) */
.roles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 2.4rem;
}
@media (max-width: 760px) { .roles { grid-template-columns: 1fr; } }
.roles li {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(116, 80, 47, 0.25);
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
}
.roles li::before {
  content: "";
  flex: none;
  width: 7px; height: 7px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  position: relative;
  top: -1px;
}

/* two-column split */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.split h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--bronze);
  margin: 0 0 1rem;
}

/* hall panel (indigo) */
.panel-dark {
  background: var(--indigo);
  color: var(--ivory);
  padding: 2rem 1.8rem;
  position: relative;
  overflow: hidden;
}
.panel-dark h2, .panel-dark h3 { color: var(--gold-light); }
.panel-dark p, .panel-dark .note, .river .note { color: var(--ivory-soft); }
.panel-dark .tag { color: var(--gold-light); }
.panel-dark .sun-mark {
  position: absolute;
  right: -2.5rem; bottom: -2.5rem;
  width: 10rem;
  color: var(--gold);
  opacity: 0.18;
  animation: drift 240s linear infinite;
}
.facts { list-style: none; margin: 1.2rem 0 0; padding: 0; position: relative; }
.facts li { padding: 0.65rem 0; border-top: 1px solid rgba(184, 146, 63, 0.3); }
.facts b {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--gold-light);
  display: block;
}

/* ---------- Forms ---------- */

.form { display: grid; gap: 1.1rem; }
.form label {
  display: grid;
  gap: 0.4rem;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--bronze);
}
.form input, .form select, .form textarea {
  font: inherit;
  font-family: var(--body);
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
  color: var(--ink);
  background: rgba(255, 252, 244, 0.7);
  border: 1px solid rgba(116, 80, 47, 0.45);
  border-radius: 0;
  padding: 0.8rem 0.9rem;
  width: 100%;
}
.form textarea { resize: vertical; min-height: 7rem; }
.form ::placeholder { color: var(--ink-soft); opacity: 1; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--bronze);
  box-shadow: 0 0 0 3px rgba(184, 146, 63, 0.3);
}
.form .btn { justify-self: start; }
/* main.js sets an inline color of var(--terracotta) for errors; remap it here to the text-safe shade */
.form-note { --terracotta: var(--terracotta-text); margin: 0; min-height: 1.4em; font-size: 0.95rem; color: var(--terracotta-text); font-style: italic; }

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

.site-footer {
  background: var(--ivory-2);
  border-top: 1px solid rgba(116, 80, 47, 0.35);
  padding: 2.6rem var(--gutter) 2.2rem;
  text-align: center;
}
.site-footer .sun-mini { width: 2.2rem; margin: 0 auto 1rem; color: var(--bronze); }
.site-footer .foot-name {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.9rem;
  color: var(--bronze);
  margin: 0;
}
.site-footer .foot-desc { margin: 0.2rem 0 1.2rem; font-family: var(--display); font-size: 0.95rem; }
.site-footer .legal {
  max-width: 44rem;
  margin: 0 auto;
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { animation: none; opacity: 1; }
  .hero .sun, .panel-dark .sun-mark { animation: none; }
  .river .strands path { animation: none; opacity: 1; }
  .card, .domain, .btn { transition: none; }
}

@media print { body::before { display: none; } }

/* Programs grouped by domain */
.domain-group + .domain-group { margin-top: 2.6rem; }
.domain-group > .eyebrow { color: var(--gold-text); }
.card .meta {
  margin: 1rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(116, 80, 47, 0.2);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}
/* Programs not yet open: no hover lift; the "Details soon" tag carries the status
   (no opacity fade, so text keeps full contrast) */
.card.soon:hover { transform: none; border-color: rgba(116, 80, 47, 0.35); background: rgba(235, 225, 206, 0.45); }
