/* Purushottam School of Yoga — site styles
   Design tokens are documented in docs/architecture-and-design.md */

:root {
  --ivory: #F7F3EA;
  --ivory-2: #EFE9DC;
  --sage: #DCE3D4;
  --olive: #5C6B4E;
  --forest: #23301F;
  --forest-2: #2E3D29;
  --terracotta: #B3552D;
  --terracotta-dark: #8F4222;
  --line: rgba(35, 48, 31, 0.14);
  --line-light: rgba(247, 243, 234, 0.18);

  --font-serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-sans: "Source Sans 3", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;

  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 9vw, 8rem);
  --radius: 6px;
  --header-h: 72px;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--forest);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, svg { display: block; max-width: 100%; }
img { height: auto; }
figure { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 500; line-height: 1.12; margin: 0 0 0.6em; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.6rem, 5.4vw, 4.4rem); }
h2 { font-size: clamp(2rem, 3.6vw, 3rem); }
h3 { font-size: clamp(1.35rem, 2vw, 1.6rem); font-weight: 600; }
p { margin: 0 0 1.1em; }
a { color: var(--terracotta); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; transition: color 0.2s ease; }
a:hover { color: var(--terracotta-dark); }
:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 3px; border-radius: 2px; }
ul, ol { margin: 0; padding: 0; }
address { font-style: normal; }
blockquote { margin: 0; }
small { font-size: 0.9em; }
[id] { scroll-margin-top: calc(var(--header-h) + 1.5rem); }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--forest); color: var(--ivory); padding: 0.6rem 1rem; z-index: 100; border-radius: 2px; }
.skip-link:focus { top: 1rem; }

.eyebrow {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: 1.1rem;
}
.prose p { max-width: 62ch; }
.section { padding-block: var(--section-y); }
.band { background: var(--ivory-2); }
.band-dark { background: var(--forest); color: var(--ivory); }
.band-dark .eyebrow { color: var(--sage); }
.band-dark a { color: var(--ivory); }
.band-dark a:hover { color: #fff; }
.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-intro { font-size: 1.125rem; color: var(--olive); }
.band-dark .section-intro { color: var(--sage); }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0.7rem 1.5rem;
  font-family: var(--font-sans); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em;
  text-decoration: none; border-radius: 2px; border: 1px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.button-primary { background: var(--terracotta); color: var(--ivory); border-color: var(--terracotta); }
.button-primary:hover { background: var(--terracotta-dark); border-color: var(--terracotta-dark); color: var(--ivory); }
.button-secondary { background: transparent; color: var(--forest); border-color: var(--forest); }
.button-secondary:hover { background: var(--forest); color: var(--ivory); }
.button-outline-light { background: transparent; color: var(--ivory); border-color: rgba(247,243,234,0.55); }
.button-outline-light:hover { border-color: var(--ivory); background: rgba(247,243,234,0.08); color: #fff; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; margin-top: 1.6rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 243, 234, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--forest); min-height: 44px; }
.brand:hover { color: var(--forest); }
.brand img { border-radius: 50%; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; }
.brand-sub { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--olive); }

.site-nav ul { list-style: none; display: flex; gap: clamp(1rem, 2.2vw, 2rem); }
.site-nav a:not(.button) { color: var(--forest); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 0.5rem 0; position: relative; }
.site-nav a:not(.button)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.1rem; height: 1px; background: var(--terracotta); transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease; }
.site-nav a:not(.button):hover::after, .site-nav a:not(.button):focus-visible::after { transform: scaleX(1); }
.site-nav { display: flex; align-items: center; gap: clamp(1.25rem, 3vw, 2.5rem); }
.header-cta { min-height: 40px; padding: 0.5rem 1.1rem; font-size: 0.9rem; }

.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer;
  position: relative; border-radius: 2px;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  content: ""; position: absolute; left: 10px; width: 24px; height: 2px; background: var(--forest); transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ivory); border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1.25rem;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li { border-bottom: 1px solid var(--line); }
  .site-nav a:not(.button) { display: block; padding: 0.9rem 0; font-size: 1.05rem; }
  .site-nav a:not(.button)::after { display: none; }
  .header-cta { margin-top: 1rem; align-self: flex-start; }
  .brand-sub { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem); }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: center; }
.hero-copy .eyebrow { margin-bottom: 1.4rem; }
.hero h1 { max-width: 14ch; margin-bottom: 1.2rem; }
.lede { font-size: clamp(1.125rem, 1.6vw, 1.3rem); line-height: 1.55; color: var(--forest-2); max-width: 46ch; }
.hero-note { margin-top: 1.4rem; font-size: 0.95rem; color: var(--olive); }
.hero-figure img { border-radius: var(--radius); aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 40%; width: 100%; }
.hero-figure figcaption, .classes-figure figcaption, .gallery-grid figcaption { font-size: 0.85rem; color: var(--olive); margin-top: 0.6rem; }

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 0.95fr 1.05fr; gap: clamp(2.5rem, 5vw, 5rem); }
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 2rem; margin: 0; align-self: start; padding-top: 0.5rem; }
.facts div { border-top: 1px solid var(--line); padding-top: 1rem; }
.facts dt { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--olive); font-weight: 600; margin-bottom: 0.35rem; }
.facts dd { margin: 0; font-family: var(--font-serif); font-size: 1.35rem; line-height: 1.3; }
@media (min-width: 900px) {
  .about-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(3rem, 7vw, 7rem); align-items: start; }
  .facts { grid-template-columns: 1fr; gap: 1.6rem; margin-top: 4.2rem; }
}

/* ---------- Classes ---------- */
.classes-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; }
.offerings { list-style: none; counter-reset: offering; }
.offerings li { position: relative; padding: 1.75rem 0 1.75rem 3.25rem; border-top: 1px solid var(--line); counter-increment: offering; }
.offerings li:last-child { border-bottom: 1px solid var(--line); }
.offerings li::before {
  content: counter(offering, decimal-leading-zero);
  position: absolute; left: 0; top: 1.95rem;
  font-family: var(--font-serif); font-size: 1.1rem; color: var(--terracotta); letter-spacing: 0.04em;
}
.offerings h3 { margin-bottom: 0.4rem; }
.offerings p { margin: 0; max-width: 56ch; color: var(--forest-2); }
.classes-figure img { border-radius: var(--radius); aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }
@media (min-width: 960px) {
  .classes-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr); gap: clamp(3rem, 6vw, 6rem); align-items: start; }
  .classes-figure { position: sticky; top: calc(var(--header-h) + 2rem); }
}

/* ---------- Teacher ---------- */
.teacher-grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: start; }
.teacher-portrait img { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; object-position: 50% 45%; border: 6px solid var(--ivory-2); }
.role { font-family: var(--font-serif); font-size: 1.25rem; font-style: italic; color: var(--olive); margin-top: -0.4rem; margin-bottom: 1.4rem; }
.pull { border-left: 2px solid var(--terracotta); padding: 0.25rem 0 0.25rem 1.4rem; margin: 1.6rem 0; max-width: 60ch; }
.pull p { font-family: var(--font-serif); font-size: clamp(1.25rem, 1.9vw, 1.5rem); line-height: 1.4; margin-bottom: 0.5rem; }
.pull footer { font-size: 0.9rem; color: var(--olive); }
.pull-motto { border-left-color: var(--olive); }
.motto-line { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--olive); font-weight: 600; margin: -0.4rem 0 1.8rem; }
html:lang(hi) .motto-line { letter-spacing: 0.04em; text-transform: none; font-size: 0.95rem; }
@media (min-width: 700px) {
  .teacher-grid { grid-template-columns: 280px minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 5rem); }
  .teacher-portrait img { width: 280px; height: 280px; }
  .teacher-portrait { padding-top: 3.4rem; }
}

/* ---------- Reviews ---------- */
.rating-line { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; color: var(--forest); }
.stars { color: var(--terracotta); letter-spacing: 0.1em; font-size: 1rem; }
.review-list { list-style: none; display: grid; grid-template-columns: 1fr; gap: 0; }
.review { padding: 2rem 0; border-top: 1px solid var(--line); display: grid; gap: 0.6rem; }
.review:last-child { border-bottom: 1px solid var(--line); }
.review-stars { color: var(--terracotta); letter-spacing: 0.1em; font-size: 0.9rem; margin: 0; }
.star-off { color: var(--line); }
.review blockquote p { font-family: var(--font-serif); font-size: clamp(1.2rem, 1.8vw, 1.4rem); line-height: 1.45; margin: 0; max-width: 60ch; }
.review-meta { font-size: 0.9rem; color: var(--olive); margin: 0; }
.review-name { font-weight: 600; color: var(--forest); }
.review-footnote { font-size: 0.85rem; color: var(--olive); margin-top: 1.5rem; max-width: 62ch; }
@media (min-width: 900px) {
  .review-list { grid-template-columns: 1fr 1fr; column-gap: clamp(2.5rem, 5vw, 5rem); }
  .review:nth-child(1) { grid-column: 1 / -1; }
  .review:nth-child(1) blockquote p { font-size: clamp(1.4rem, 2.2vw, 1.75rem); max-width: 48ch; }
  .review:nth-child(2), .review:nth-child(3) { border-top: 1px solid var(--line); }
  .review:nth-child(4), .review:nth-child(5) { border-bottom: 1px solid var(--line); }
}

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: 1fr; gap: 2rem 1.75rem; }
.gallery-grid img { width: 100%; border-radius: var(--radius); object-fit: cover; }
.g-wide img { aspect-ratio: 16 / 9; }
.g-tall img { aspect-ratio: 3 / 4; }
.g-mid img { aspect-ratio: 4 / 3; }
.g-half img { aspect-ratio: 4 / 3; }
.g-full img { aspect-ratio: 16 / 9; }
@media (min-width: 700px) {
  .gallery-grid { grid-template-columns: repeat(6, 1fr); }
  .g-wide { grid-column: span 6; }
  .g-tall { grid-column: span 3; }
  .g-mid { grid-column: span 3; }
  .g-half { grid-column: span 3; }
  .g-full { grid-column: span 6; }
}
@media (min-width: 960px) {
  .g-wide { grid-column: span 4; }
  .g-wide img { aspect-ratio: 16 / 10; }
  .g-tall { grid-column: span 2; }
  .g-mid { grid-column: span 4; }
  .g-mid img { aspect-ratio: 16 / 10; }
  .g-half { grid-column: span 3; }
  .g-full { grid-column: span 6; }
  .g-full img { aspect-ratio: 21 / 9; object-position: 50% 45%; }
  .g-last { grid-column: 2 / span 4; }
  .g-last img { aspect-ratio: 3 / 2; }
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; }
.contact-details { display: grid; gap: 1.25rem; margin: 2rem 0 0.5rem; }
.contact-item { display: grid; gap: 0.2rem; border-top: 1px solid var(--line-light); padding-top: 1rem; }
.contact-label { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sage); font-weight: 600; }
.contact-item a { text-decoration: none; font-family: var(--font-serif); font-size: 1.35rem; overflow-wrap: anywhere; }
.contact-item a:hover { text-decoration: underline; }
.contact-item small { color: var(--sage); display: block; margin-top: 0.25rem; }
.map-wrap { border-radius: var(--radius); overflow: hidden; background: var(--forest-2); min-height: 320px; }
.map-wrap iframe { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; filter: saturate(0.85) contrast(0.98); }
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(3rem, 6vw, 6rem); align-items: stretch; }
  .contact-details { grid-template-columns: 1fr 1fr; gap: 1.5rem 2rem; }
  .contact-item.is-full { grid-column: 1 / -1; }
  .map-wrap { min-height: 100%; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--forest); color: var(--sage); border-top: 1px solid var(--line-light); padding-block: 3rem 2rem; font-size: 0.95rem; }
.site-footer a { color: var(--ivory); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.footer-name { font-family: var(--font-serif); font-size: 1.4rem; color: var(--ivory); margin-bottom: 0.1rem; }
.footer-tagline { font-family: var(--font-serif); font-style: italic; margin-bottom: 1rem; }
.footer-nav ul, .footer-social ul { list-style: none; display: grid; gap: 0.5rem; }
.footer-label { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; margin-bottom: 0.75rem; }
.footer-bottom { border-top: 1px solid var(--line-light); margin-top: 2.5rem; padding-top: 1.25rem; font-size: 0.85rem; }
.footer-bottom p { margin: 0; }
@media (min-width: 700px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: 3rem; }
}

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Language switch ---------- */
.lang-switch { color: var(--forest); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 0.45rem 0.7rem; border: 1px solid var(--line); border-radius: 2px; line-height: 1.2; min-height: 40px; display: inline-flex; align-items: center; }
.lang-switch:hover { border-color: var(--forest); color: var(--forest); }
.lang-switch-mobile { display: none; }
@media (max-width: 860px) {
  .site-nav .lang-switch { display: none; }
  .lang-switch-mobile { display: inline-flex; margin-left: auto; margin-right: 0.25rem; }
  .header-inner { gap: 0.5rem; }
}

/* ---------- Hindi page: Devanagari typefaces ---------- */
html:lang(hi) {
  --font-serif: "Tiro Devanagari Hindi", "Kohinoor Devanagari", "Devanagari MT", serif;
  --font-sans: "Noto Sans Devanagari", "Hind", "Kohinoor Devanagari", "Devanagari Sangam MN", sans-serif;
}
html:lang(hi) body { line-height: 1.8; }
html:lang(hi) h1, html:lang(hi) h2, html:lang(hi) h3 { line-height: 1.3; font-weight: 400; }
html:lang(hi) h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); }
html:lang(hi) .eyebrow, html:lang(hi) .facts dt, html:lang(hi) .contact-label, html:lang(hi) .footer-label { letter-spacing: 0.04em; text-transform: none; font-size: 0.85rem; }
html:lang(hi) .lang-switch, html:lang(hi) .review blockquote p, html:lang(hi) .pull p { font-family: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif; }
html:lang(hi) .lang-switch { font-family: "Source Sans 3", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif; }
@media (max-width: 480px) {
  .brand-name { font-size: 1.1rem; line-height: 1.1; }
  .brand { gap: 0.6rem; }
  .lang-switch-mobile { padding-inline: 0.55rem; font-size: 0.9rem; }
}
