/* Dr. Nirmala Swami Charitable Trust — single-page site. No framework, no JS. */

/* ---------- Tokens (light default, dark via prefers-color-scheme) ---------- */
:root {
  color-scheme: light dark;
  --teal: #00cdd0;          /* brand teal from the original nct mark */
  --teal-ink: #0a6f75;      /* text/links on light surfaces */
  --teal-deep: #08484c;     /* hero + contact bands */
  --button: #0a6f75;
  --button-hover: #08484c;
  --ink: #1d2427;
  --body: #33403f;
  --muted: #5a6569;
  --paper: #ffffff;
  --tint: #f2f8f8;
  --card: #ffffff;
  --line: #d9e6e6;
  --shadow: 0 18px 40px -24px rgba(8, 72, 76, 0.45);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 3.5rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --teal-ink: #5fd8db;
    --teal-deep: #06393c;
    --button: #0b7a80;
    --button-hover: #0a8f96;
    --ink: #e8f0f0;
    --body: #c9d6d6;
    --muted: #98abad;
    --paper: #0e1516;
    --tint: #131e20;
    --card: #162325;
    --line: #26393b;
    --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  }
}

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

html {
  scroll-behavior: smooth;
  /* Remembers scroll direction for the hide-on-scroll header (progressive enhancement). */
  container-type: scroll-state;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font: 1.0625rem/1.65 var(--sans);
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--teal-ink); text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.15; color: var(--ink); margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: clamp(2.4rem, 6vw, 4.25rem); letter-spacing: -0.015em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.wrap { width: min(72rem, 100% - 2rem); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; z-index: 10;
}
.skip:focus { left: 1rem; }

/* ---------- Header / nav ---------- */
.top-bar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: transform 0.25s ease;
}
@container scroll-state((scrolled: bottom) and (scrollable: top)) {
  .top-bar { transform: translateY(-100%); }
}
.top-bar:focus-within { transform: none; }

.nav {
  display: flex; align-items: center; gap: 1rem;
  width: min(72rem, 100% - 2rem); margin-inline: auto;
  min-height: var(--nav-h);
}
.brand {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
  color: #fff; background: var(--button);
  padding: 0 0.5rem; text-decoration: none; line-height: 1.5; border-radius: 3px;
  flex: none;
}
.brand:hover { color: #fff; background: var(--button-hover); }
.nav ul {
  display: flex; gap: 0.25rem; list-style: none; margin: 0 0 0 auto; padding: 0;
  overflow-x: auto; scrollbar-width: none;
  /* soft fade hints that the row scrolls on narrow screens */
  mask-image: linear-gradient(to right, #000 85%, transparent);
}
@media (min-width: 760px) { .nav ul { mask-image: none; } }
.nav ul::-webkit-scrollbar { display: none; }
.nav li a {
  display: block; padding: 0.4rem 0.7rem; white-space: nowrap;
  color: var(--ink); text-decoration: none; font-size: 0.95rem; border-radius: 999px;
}
.nav li a:hover { background: var(--tint); color: var(--teal-ink); }

section[id] { scroll-margin-top: calc(var(--nav-h) + 0.5rem); }

/* ---------- Shared ---------- */
.section { padding: clamp(3.5rem, 9vw, 7rem) 0; }
.tint { background: var(--tint); }
.eyebrow {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--teal-ink); font-weight: 600; margin-bottom: 0.75rem;
}
.eyebrow .num {
  font-family: var(--serif); font-size: 1rem; letter-spacing: 0;
  padding-right: 0.75rem; border-right: 2px solid var(--teal);
}
.subhead { font-size: 1.2rem; color: var(--muted); max-width: 46rem; }
.prose { max-width: 40rem; }

.two-col { display: grid; gap: 2.5rem; margin-top: 1.5rem; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1.15fr 0.85fr; gap: 3.5rem; } }

.button {
  display: inline-block; padding: 0.8rem 1.5rem; border-radius: 999px;
  background: var(--button); color: #fff; text-decoration: none; font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}
.button:hover { background: var(--button-hover); color: #fff; transform: translateY(-1px); }
.button.light { background: #fff; color: #08484c; }
.button.light:hover { background: #dff7f7; color: #08484c; }
.text-link { margin-left: 1rem; font-weight: 600; }

blockquote {
  margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 4px solid var(--teal);
  font-family: var(--serif); font-size: 1.2rem; font-style: italic; color: var(--ink);
}
blockquote p { margin-bottom: 0.5em; }
blockquote footer { font-family: var(--sans); font-style: normal; font-size: 0.9rem; color: var(--muted); }
blockquote footer::before { content: "\2014\00a0"; }

/* ---------- Duotone archival photos ---------- */
/* Teal-tinted monochrome via filters only, so captions stay untouched. */
.duotone img {
  border-radius: 6px;
  filter: grayscale(1) sepia(0.35) hue-rotate(130deg) saturate(0.9) contrast(1.05);
  transition: filter 0.5s ease;
}


/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(60rem 30rem at 85% 10%, rgba(0, 205, 208, 0.25), transparent 60%),
    #08484c;
  color: #d8f1f1;
  padding: clamp(3rem, 8vw, 6.5rem) 0;
}
.hero h1 { color: #fff; }
.hero .eyebrow { color: #7fe6e8; }
.hero strong { color: #fff; }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 860px) { .hero-grid { grid-template-columns: 1.1fr 0.9fr; gap: 4rem; } }
.lede { font-size: clamp(1.15rem, 2vw, 1.4rem); max-width: 36rem; }
.hero-cta { margin-top: 2rem; }
.hero .button { background: var(--teal); color: #062f32; }
.hero .button:hover { background: #5fe3e5; color: #062f32; }
.hero .text-link { color: #bff3f4; }
.hero .text-link:hover { color: #fff; }
.hero-photo { margin: 0; }
.hero-photo img { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7); }

/* ---------- Numbers band ---------- */
.numbers { background: var(--tint); border-bottom: 1px solid var(--line); padding: 2.5rem 0; }
.numbers ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.5rem 2rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}
.numbers li { border-left: 3px solid var(--teal); padding-left: 1rem; }
.numbers strong {
  display: block; font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.8rem, 3.2vw, 2.4rem); line-height: 1.1; color: var(--teal-ink);
}
.numbers span { display: block; font-size: 0.9rem; color: var(--muted); margin-top: 0.35rem; line-height: 1.4; }

/* ---------- Legacy: testimonial + archive mosaic ---------- */
.legacy-intro { align-items: center; }
.testimonial {
  position: relative; margin: 0;
  background: var(--tint); border: 0; border-radius: 10px;
  padding: 3.5rem 2rem 2rem;
  font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.45;
}
.testimonial::before {
  content: "\201C"; position: absolute; top: -0.5rem; left: 1.5rem;
  font-family: var(--serif); font-style: normal; font-size: 6rem; line-height: 1;
  color: var(--teal);
}
.testimonial footer { margin-top: 1rem; }

.archive-title { margin-top: clamp(3rem, 6vw, 4.5rem); }
.mosaic { display: grid; gap: 1rem; margin-top: 1.25rem; }
.tile { margin: 0; position: relative; overflow: hidden; border-radius: 8px; background: var(--teal-deep); }
.tile a { display: block; height: 100%; }
.tile img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 0;
  transition: filter 0.5s ease, transform 0.6s ease;
}
.tile:hover img { filter: none; transform: scale(1.03); }
.tile figcaption {
  position: absolute; inset: auto 0 0 0; pointer-events: none;
  padding: 2.5rem 1.1rem 0.9rem;
  background: linear-gradient(to top, rgba(4, 34, 36, 0.88), transparent);
  color: #e8f6f6; font-size: 0.875rem; line-height: 1.4;
}
.tile figcaption .year {
  display: block; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: #7fe6e8;
}
@media (min-width: 760px) {
  .mosaic { grid-template-columns: 1.5fr 1fr; grid-template-rows: 1fr 1fr; height: clamp(30rem, 48vw, 40rem); }
  .tile-main { grid-row: span 2; }
}

/* ---------- Trust ---------- */
.vision {
  font-family: var(--serif); font-size: 1.75rem; line-height: 1.3;
  color: var(--ink); margin-bottom: 1.5rem;
}
.vision span {
  display: block; font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-ink); margin-bottom: 0.25rem;
}
.pull { margin-top: 0; }
.pillars {
  display: grid; gap: 1rem; margin-top: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
.pillars > div {
  background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--teal);
  border-radius: 6px; padding: 1.25rem 1.25rem 0.5rem;
}
.pillars h3 {
  font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--teal-ink);
}
.pillars p { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); }

/* Timeline: vertical on phones, horizontal on wide screens */
.timeline-title { margin-top: 3.5rem; }
.timeline { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 1.25rem; }
.timeline li { position: relative; padding-left: 1.75rem; border-left: 2px solid var(--line); }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 0.4rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--teal);
}
.timeline li:last-child::before { background: var(--teal); }
.timeline .year { display: block; font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--teal-ink); }
.timeline p { margin: 0.25rem 0 0; font-size: 0.95rem; }
@media (min-width: 900px) {
  .timeline { grid-template-columns: repeat(5, 1fr); gap: 1.5rem; }
  .timeline li { padding: 1.5rem 0 0; border-left: 0; border-top: 2px solid var(--line); }
  .timeline li::before { left: 0; top: -7px; }
}

/* ---------- Work ---------- */
.areas { display: grid; gap: 1.5rem; margin-top: 2rem; }
@media (min-width: 860px) { .areas { grid-template-columns: 1fr 1fr; } }
.area, .card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.area:hover, .card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }
.area { padding: 1.75rem 1.75rem 0.75rem; }
.area h3 { padding-bottom: 0.75rem; border-bottom: 2px solid var(--teal); }
.area dl { margin: 1rem 0 0; }
.area dt { font-weight: 650; color: var(--ink); margin-top: 1rem; }
.area dt:first-child { margin-top: 0; }
.area dd { margin: 0.25rem 0 1rem; font-size: 0.98rem; }

/* ---------- Fellowships ---------- */
.cards { display: grid; gap: 1.5rem; margin-top: 2rem; }
@media (min-width: 860px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { padding: 1.75rem; }
details { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 0.75rem; }
summary { cursor: pointer; font-weight: 600; color: var(--teal-ink); }
details ul { padding-left: 1.2rem; margin: 0.75rem 0 0; font-size: 0.95rem; }
details li { margin-bottom: 0.5rem; }

/* ---------- People ---------- */
.trustees { max-width: 40rem; margin-top: 1.5rem; }
.roster { list-style: none; margin: 0; padding: 0; }
.roster li {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.8rem 0; border-bottom: 1px solid var(--line);
}
.roster .name { font-weight: 600; color: var(--ink); }
.roster .role { color: var(--muted); }

/* ---------- Contact / footer ---------- */
.contact {
  background:
    radial-gradient(50rem 25rem at 15% 100%, rgba(0, 205, 208, 0.22), transparent 60%),
    #08484c;
  color: #d8f1f1; text-align: center;
}
.contact h2 { color: #fff; }
.contact p { font-size: 1.15rem; }
.site-footer { padding: 1.5rem 0; font-size: 0.875rem; color: var(--muted); text-align: center; }
.site-footer p { margin: 0; }

/* ---------- Gentle scroll reveal (decorative; progressive enhancement, no fallback) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes rise-in {
      from { opacity: 0; transform: translateY(24px); }
    }
    .numbers li, .tile, .innovation-grid li, .pillars > div, .timeline li, .area, .card, .roster li {
      animation: rise-in linear backwards;
      animation-timeline: view();
      animation-range: entry 0% entry 80%;
    }
  }
}

/* ---------- Line illustrations ---------- */
.icon {
  width: 1.4em; height: 1.4em; flex: none;
  fill: none; stroke: var(--teal-ink); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.area h3 { display: flex; align-items: center; gap: 0.6rem; }
.icon-lg { width: 2.25rem; height: 2.25rem; margin-bottom: 0.75rem; display: block; }
.pillars .icon-lg { width: 2rem; height: 2rem; }
.icon-xl {
  width: 3.25rem; height: 3.25rem; display: block; margin: 0 auto 1rem;
  stroke: #7fe6e8; stroke-width: 1.3;
}

/* Ripple motif: concentric rings behind the hero and contact bands */
.hero, .contact { position: relative; overflow: hidden; isolation: isolate; }
.ripples {
  position: absolute; z-index: -1; pointer-events: none;
  fill: none; stroke: #00cdd0; stroke-width: 1;
}
.ripples-hero { width: 46rem; height: 46rem; right: -14rem; bottom: -22rem; opacity: 0.22; }
.ripples-contact { width: 34rem; height: 34rem; left: -12rem; top: -12rem; opacity: 0.18; }
@media (max-width: 700px) {
  .ripples-hero { width: 30rem; height: 30rem; right: -12rem; bottom: -14rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .ripples circle { transform-origin: 200px 200px; animation: ripple 9s ease-in-out infinite; }
  .ripples circle:nth-child(2) { animation-delay: -1.8s; }
  .ripples circle:nth-child(3) { animation-delay: -3.6s; }
  .ripples circle:nth-child(4) { animation-delay: -5.4s; }
  .ripples circle:nth-child(5) { animation-delay: -7.2s; }
  @keyframes ripple { 50% { transform: scale(1.04); opacity: 0.55; } }
}

/* ---------- Innovation ---------- */
.innovation-grid {
  list-style: none; margin: 2.25rem 0 0; padding: 0;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.innovation-grid li {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.4rem 1.5rem; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line);
  font-family: var(--serif); font-size: 1.3rem; font-weight: 600; color: var(--ink);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.innovation-grid li:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }
.innovation-grid .icon-lg {
  margin: 0; width: 2.75rem; height: 2.75rem; padding: 0.55rem; flex: none;
  border-radius: 50%; background: var(--tint); stroke-width: 1.5;
}
.innovation-cta { margin-top: 2rem; font-size: 1.1rem; color: var(--muted); }
.innovation-cta a { font-weight: 600; }
@media (min-width: 900px) { .innovation-grid { grid-template-columns: repeat(3, 1fr); } }
