/* ==========================================================================
   Women in Frontier AI — shared stylesheet
   Cool aerospace-tech palette + floating glass nav, inspired by
   degla.ai (ink/steel/blue tones, Geist type, soft-rounded cards,
   filmic grain). Component conventions (pill buttons, categorized
   team grid) carried over from matsprogram.org.
   ========================================================================== */

:root {
  --paper: 244 245 247;
  --surface: 255 255 255;
  --surface-alt: 197 202 209;
  --ink: 10 11 13;
  --muted: 72 80 90;
  --faint: 118 129 142;
  --rule: 179 185 194;
  --accent: 58 82 102;
  --accent-bg: 214 224 230;
  --avatar-bg: 255 255 255;

  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --heading: var(--sans);
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --max-page: 72rem;
  --max-measure: 38rem;

  --radius-pill: 999px;
  --radius-soft: 0.75rem;
  --radius-card: 20px;

  --ease-editorial: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: 10 11 13;
    --surface: 17 19 23;
    --surface-alt: 26 26 31;
    --ink: 244 245 247;
    --muted: 195 199 206;
    --faint: 113 124 136;
    --rule: 36 38 43;
    --accent: 110 138 160;
    --accent-bg: 24 30 35;
    --avatar-bg: 0 0 0;
  }
}

:root[data-theme="dark"] {
  --paper: 10 11 13;
  --surface: 17 19 23;
  --surface-alt: 26 26 31;
  --ink: 244 245 247;
  --muted: 195 199 206;
  --faint: 113 124 136;
  --rule: 36 38 43;
  --accent: 110 138 160;
  --accent-bg: 24 30 35;
  --avatar-bg: 0 0 0;
}

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

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

body {
  margin: 0;
  padding-top: 4.75rem;
  background-color: rgb(var(--paper));
  color: rgb(var(--ink));
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* fixed, low-opacity fractal-noise overlay for a filmic texture */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

[id] { scroll-margin-top: 6rem; }

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

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

::selection { background-color: rgb(var(--accent) / 0.18); }

:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 400;
  font-family: var(--heading);
  letter-spacing: -0.02em;
}

p { margin: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }

/* ---------- layout ---------- */

.container {
  width: 100%;
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 640px) {
  .container { padding: 0 2.5rem; }
}

section { padding: 3.5rem 0; }

.section-tight { padding: 2.25rem 0; }

.rule {
  border: none;
  border-top: 1px solid rgb(var(--rule));
}

/* ---------- typography helpers ---------- */

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgb(var(--faint));
}

.text-display {
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 400;
}

.text-title {
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 400;
}

.text-lead {
  font-size: clamp(0.92rem, 1.2vw, 1.02rem);
  line-height: 1.55;
  color: rgb(var(--muted));
  max-width: var(--max-measure);
}

.text-muted { color: rgb(var(--muted)); }
.text-faint { color: rgb(var(--faint)); }
.text-accent { color: rgb(var(--accent)); }

.accent-em {
  color: rgb(var(--accent));
  font-weight: 500;
  font-style: normal;
  background-image: linear-gradient(90deg, #e0668f, #f0a35c, #9b7fd4, #5b8ab8);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.italic { font-style: italic; }

.link {
  position: relative;
  color: rgb(var(--ink));
  text-decoration: none;
  background-image: linear-gradient(rgb(var(--accent)), rgb(var(--accent)));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.4s var(--ease-editorial), color 0.3s ease;
}

.link:hover, .link:focus-visible {
  color: rgb(var(--accent));
  background-size: 100% 1px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: all 0.25s var(--ease-editorial);
  white-space: nowrap;
}

.btn-primary {
  background-color: rgb(var(--accent));
  color: rgb(var(--surface));
  border-color: rgb(var(--accent));
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgb(var(--accent) / 0.28);
}

.btn-ghost {
  background-color: rgb(var(--surface));
  border-color: rgb(var(--rule));
  color: rgb(var(--ink));
}

.btn-ghost:hover {
  border-color: rgb(var(--accent));
  color: rgb(var(--accent));
}

.btn-arrow {
  transition: transform 0.25s var(--ease-editorial);
}

.btn:hover .btn-arrow { transform: translateX(3px); }

/* ---------- header / nav ---------- */

.site-header {
  position: fixed;
  top: 0.85rem;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1.5rem;
  pointer-events: none;
}

@media (min-width: 640px) {
  .site-header { padding: 0 2.5rem; }
}

.nav {
  pointer-events: auto;
  width: 100%;
  max-width: var(--max-page);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
  padding: 0.6rem 1.25rem;
  background: rgb(var(--surface) / 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgb(var(--rule));
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--heading);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgb(var(--ink));
}

.brand-mark {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: var(--radius-soft);
  background: #ffffff;
  border: 1px solid rgb(var(--rule));
  padding: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  object-fit: contain;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 1.6rem;
  margin-left: auto;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
}

.nav-links a {
  color: rgb(var(--muted));
  transition: color 0.25s ease;
  position: relative;
  padding-bottom: 0.2rem;
}

.nav-links a::before { content: "("; margin-right: 0.3em; }
.nav-links a::after { content: ")"; margin-left: 0.3em; }

.nav-links a::before, .nav-links a::after {
  color: rgb(var(--faint));
  transition: color 0.25s ease;
}

.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: rgb(var(--ink));
}

.nav-links a:hover::before, .nav-links a:hover::after,
.nav-links a[aria-current="page"]::before, .nav-links a[aria-current="page"]::after {
  color: rgb(var(--accent));
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  width: 1.7rem;
  height: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(var(--rule));
  border-radius: var(--radius-pill);
  color: rgb(var(--muted));
  transition: all 0.25s ease;
}

.theme-toggle:hover { color: rgb(var(--accent)); border-color: rgb(var(--accent)); }

.theme-toggle svg { width: 0.8rem; height: 0.8rem; }

.icon-moon { display: block; }
.icon-sun { display: none; }

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

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon { display: none; }
  :root:not([data-theme="light"]) .icon-sun { display: block; }
}

.nav-toggle {
  display: flex;
  width: 1.7rem;
  height: 1.7rem;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .nav-toggle { display: none; }
}

.nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 1px;
  background: rgb(var(--ink));
  position: relative;
}

.nav-toggle span::before, .nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 1.1rem;
  height: 1px;
  background: rgb(var(--ink));
  transition: transform 0.2s ease;
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.mobile-nav {
  display: none;
  pointer-events: auto;
  flex-direction: column;
  width: 100%;
  max-width: var(--max-page);
  margin-top: 0.6rem;
  padding: 0.85rem 1.25rem 1.25rem;
  gap: 0.85rem;
  background: rgb(var(--surface) / 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgb(var(--rule));
  border-radius: var(--radius-card);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.1);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
}

.mobile-nav.open { display: flex; }

.mobile-nav a { color: rgb(var(--muted)); }
.mobile-nav a[aria-current="page"] { color: rgb(var(--accent)); }

@media (min-width: 768px) {
  .mobile-nav { display: none !important; }
}

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

.hero {
  padding: 3.5rem 0 3rem;
  background-image:
    linear-gradient(90deg, rgb(var(--paper) / 0.6) 0%, rgb(var(--paper) / 0.2) 45%, rgb(var(--paper) / 0) 68%),
    url("../assets/background.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* the background art is a light-mode pastel graphic; drop it in dark
   mode rather than fight its palette against the dark theme */
:root[data-theme="dark"] .hero {
  background-image: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero {
    background-image: none;
  }
}

@media (min-width: 768px) {
  .hero { padding: 5rem 0 3.5rem; }
}

.hero-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
  align-items: center;
}

@media (min-width: 640px) {
  .hero-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

.hero-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid rgb(var(--rule));
  border-radius: var(--radius-card);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.7rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.9rem;
}

.pill {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  padding: 0.32rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgb(var(--accent-bg));
  color: rgb(var(--accent));
}

/* ---------- reveal on scroll ---------- */

/* [data-reveal] elements are only hidden once JS confirms it can reveal
   them (html.has-reveal, set in main.js) — if JS fails or is disabled,
   content stays visible by default instead of being stuck at opacity:0. */
html.has-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease-editorial), transform 0.8s var(--ease-editorial);
  transition-delay: var(--reveal-delay, 0ms);
}

html.has-reveal [data-reveal][data-revealed="true"] {
  opacity: 1;
  transform: none;
}

.no-motion [data-reveal],
.no-motion [data-reveal][data-revealed="true"] {
  opacity: 1;
  transform: none;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * , *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- cards ---------- */

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  padding: 1.4rem;
  border: 1px solid rgb(var(--rule));
  border-radius: var(--radius-card);
  background: rgb(var(--surface));
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: rgb(var(--accent) / 0.45);
  box-shadow: 0 8px 24px rgb(30 32 33 / 0.06);
}

.card-number {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: rgb(var(--accent));
  letter-spacing: 0.05em;
}

.card h3 {
  font-size: 1.02rem;
  margin-top: 0.7rem;
  letter-spacing: -0.005em;
}

.card p {
  margin-top: 0.5rem;
  color: rgb(var(--muted));
  font-size: 0.86rem;
  line-height: 1.55;
}

/* ---------- team ---------- */

.team-section + .team-section {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgb(var(--rule));
}

.team-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1.6rem;
}

.team-card {
  display: flex;
  flex-direction: column;
  border: 1px solid rgb(var(--rule));
  border-radius: var(--radius-card);
  background: rgb(var(--surface));
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.team-card:hover {
  border-color: rgb(var(--accent) / 0.45);
  box-shadow: 0 8px 24px rgb(30 32 33 / 0.06);
}

.avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgb(var(--avatar-bg));
  color: rgb(var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--heading);
  font-weight: 500;
  font-size: 1.9rem;
  flex-shrink: 0;
  object-fit: cover;
}

.team-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.15rem;
}

.team-card-name {
  font-family: var(--heading);
  font-size: 0.98rem;
  letter-spacing: -0.005em;
}

a.team-card-name:hover {
  text-decoration: underline;
  text-decoration-color: rgb(var(--faint));
}

.team-card-role {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(var(--accent));
  margin-top: 0.25rem;
}

.team-card-location {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  color: rgb(var(--faint));
  margin-top: 0.15rem;
}

.team-card-bio {
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgb(var(--muted));
}

.placeholder-flag {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(var(--faint));
  border: 1px dashed rgb(var(--rule));
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.55rem;
  display: inline-block;
  width: fit-content;
}

.team-add-card {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgb(var(--rule));
  border-radius: var(--radius-card);
  padding: 1.6rem;
  color: rgb(var(--faint));
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  min-height: 100%;
}

/* ---------- notice banner ---------- */

.notice {
  border: 1px solid rgb(var(--accent) / 0.3);
  background: rgb(var(--accent-bg));
  border-radius: var(--radius-card);
  padding: 0.9rem 1.15rem;
  font-size: 0.82rem;
  color: rgb(var(--muted));
  line-height: 1.55;
}

.notice strong { color: rgb(var(--ink)); font-weight: 600; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid rgb(var(--rule));
  padding: 2.75rem 0 2rem;
  margin-top: 3.5rem;
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .footer-top { flex-direction: row; }
}

.footer-links {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgb(var(--faint));
  margin-bottom: 0.7rem;
}

.footer-col ul { display: flex; flex-direction: column; gap: 0.5rem; }

.footer-col a { color: rgb(var(--muted)); font-size: 0.82rem; }
.footer-col a:hover { color: rgb(var(--accent)); }

.footer-bottom {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgb(var(--rule));
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: rgb(var(--faint));
}

@media (min-width: 768px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

/* ---------- misc page bits ---------- */

.page-hero {
  padding: 4rem 0 1rem;
}

@media (min-width: 768px) {
  .page-hero { padding: 6rem 0 1.5rem; }
}

.two-col {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .two-col { grid-template-columns: 2fr 3fr; }
}

.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 1.6rem 0;
  border-top: 1px solid rgb(var(--rule));
}

.timeline-item:first-child { border-top: 1px solid rgb(var(--rule)); }

.timeline-date {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: rgb(var(--faint));
  letter-spacing: 0.03em;
}

.timeline-item h3 { font-size: 1.1rem; }
.timeline-item p { margin-top: 0.4rem; color: rgb(var(--muted)); font-size: 0.95rem; }

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat-number {
  font-family: var(--heading);
  font-size: clamp(2rem, 4vw, 2.6rem);
  color: rgb(var(--accent));
  letter-spacing: -0.01em;
}

.stat-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(var(--faint));
}
