/* ============================================================
   Cosine brand stylesheet
   Palette: white / greens pulled from the wordmark
   ============================================================ */

:root {
  --green: #169e43;          /* logo green */
  --green-dark: #0d7a32;
  --green-deep: #06301c;     /* near-black forest, dark sections */
  --green-deeper: #042415;
  --ink: #0b120d;            /* body headings on white */
  --body: #3c4a41;           /* body text on white */
  --mist: #f3f8f4;           /* green-tinted off-white */
  --line: #e2ece4;
  --white: #ffffff;

  --font-display: "Outfit", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --radius: 18px;
  --shadow-soft: 0 20px 60px -24px rgba(6, 48, 28, 0.25);
  --wrap: 1160px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--body);
  background: var(--white);
  line-height: 1.65;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}

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

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 600;
}

::selection { background: rgba(22, 158, 67, 0.22); }

/* ---------- text wordmark (matches logo: green “s”) ---------- */
.wordmark {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.wordmark .s {
  color: var(--green);
  display: inline-block;
  transform: translateX(1px) scaleX(-1);
}
.on-dark .wordmark { color: #fff; }

/* ---------- eyebrow labels ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--green);
  border-radius: 2px;
}
.on-dark .eyebrow { color: #7fd8a0; }
.on-dark .eyebrow::before { background: #7fd8a0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  cursor: pointer;
  border: none;
}
.btn svg { transition: transform 0.18s ease; }
.btn:hover svg { transform: translateX(3px); }

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(22, 158, 67, 0.55);
}
.btn-primary:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn-ghost:hover {
  box-shadow: inset 0 0 0 1.5px var(--green);
  color: var(--green-dark);
  transform: translateY(-2px);
}
.on-dark .btn-ghost {
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.28);
}
.on-dark .btn-ghost:hover { box-shadow: inset 0 0 0 1.5px #fff; color: #fff; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.nav.scrolled {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.announce {
  display: block;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
  color: #fff;
  text-align: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 12px 16px;
}
.announce .arrow {
  display: inline-block;
  margin-left: 6px;
  transition: transform 0.18s ease;
}
.announce:hover .arrow { transform: translateX(4px); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.nav-logo img { height: 36px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
  list-style: none;
}
.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
}
.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.nav-links a:not(.btn):hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links .btn { padding: 10px 20px; font-size: 14px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: 230px 0 110px;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(22, 158, 67, 0.10), transparent 65%),
    radial-gradient(700px 420px at -10% 40%, rgba(22, 158, 67, 0.07), transparent 60%),
    var(--white);
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(6, 48, 28, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 48, 28, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, black 30%, transparent 75%);
}
.hero .wrap { position: relative; }

.hero h1 {
  font-size: clamp(44px, 6.4vw, 78px);
  max-width: 13ch;
  margin-bottom: 26px;
}
.hero h1 .accent { color: var(--green); }

.hero-sub {
  font-size: clamp(17px, 1.6vw, 20px);
  max-width: 56ch;
  margin-bottom: 38px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* animated cosine wave under the hero */
.hero-wave {
  margin-top: 84px;
  position: relative;
}
.hero-wave svg { width: 100%; height: auto; display: block; }
.hero-wave .wave-line {
  stroke-dasharray: 2600;
  stroke-dashoffset: 2600;
  animation: drawWave 2.6s cubic-bezier(0.6, 0, 0.2, 1) 0.3s forwards;
}
@keyframes drawWave { to { stroke-dashoffset: 0; } }
.hero-wave .molecule {
  opacity: 0;
  animation: molIn 0.45s ease forwards;
}
/* delays track the wave's drawing edge as it sweeps left to right */
.hero-wave .molecule.m1 { animation-delay: 0.8s; }
.hero-wave .molecule.m2 { animation-delay: 1.35s; }
.hero-wave .molecule.m3 { animation-delay: 1.75s; }
@keyframes molIn { to { opacity: 0.9; } }

/* ---------- stat strip ---------- */
.stats {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--mist);
}
.stats-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 44px 0;
}
.stat { text-align: left; padding: 0 8px; }
.stat .num {
  font-family: var(--font-display);
  font-size: clamp(44px, 4.8vw, 62px);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat .num em { color: var(--green); font-style: normal; }
.stat .label {
  margin-top: 8px;
  font-size: 14.5px;
  color: var(--body);
}

/* ============================================================
   SECTIONS
   ============================================================ */
section { padding: 110px 0; scroll-margin-top: 140px; }

.section-head { max-width: 720px; margin-bottom: 64px; }
.section-head h2 {
  font-size: clamp(32px, 4vw, 48px);
  margin-bottom: 18px;
}
.section-head p { font-size: 17.5px; }

/* ---------- technology (dark) ---------- */
.tech {
  background:
    radial-gradient(800px 500px at 100% 0%, rgba(22, 158, 67, 0.16), transparent 60%),
    var(--green-deep);
}
.tech .section-head h2, .tech h3 { color: #fff; }
.tech .section-head p { color: rgba(255, 255, 255, 0.72); }

.tech-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
.tech-card.wide { grid-column: 1 / -1; }
.tech-card.wide .wide-cols {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 12px 44px;
  align-items: start;
}
.tech-card.wide .wide-cols ul { margin-top: 6px; }
.tech-card {
  position: relative;
  border-radius: var(--radius);
  padding: 42px 38px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.tech-card:hover {
  transform: translateY(-5px);
  border-color: rgba(127, 216, 160, 0.4);
  background: rgba(255, 255, 255, 0.07);
}
.tech-card .icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(22, 158, 67, 0.22);
  color: #7fd8a0;
  margin-bottom: 26px;
}
.tech-card h3 { font-size: 24px; margin-bottom: 14px; }
.tech-card p { color: rgba(255, 255, 255, 0.72); font-size: 16px; }
.tech-card ul {
  margin-top: 20px;
  list-style: none;
}
.tech-card li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.tech-card li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  transform: translateY(-1px);
}

/* ---------- process steps (inside technology section) ---------- */
.steps-head {
  color: #fff;
  font-size: clamp(22px, 2.6vw, 30px);
  margin: 74px 0 32px;
}
.tech .step {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.09);
}
.tech .step:hover {
  box-shadow: none;
  border-color: rgba(127, 216, 160, 0.4);
  background: rgba(255, 255, 255, 0.07);
}
.tech .step h3 { color: #fff; }
.tech .step p { color: rgba(255, 255, 255, 0.72); }
.tech .step::before { color: #7fd8a0; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  counter-reset: step;
}
.step {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 38px 32px;
  background: var(--white);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.step:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(22, 158, 67, 0.35);
}
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--green);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 20px;
}
.step h3 { font-size: 21px; margin-bottom: 12px; }
.step p { font-size: 15.5px; }

/* ---------- applications ---------- */
.apps { background: var(--mist); }
.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.app {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.app:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(22, 158, 67, 0.35);
}
.app .icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(22, 158, 67, 0.1);
  color: var(--green-dark);
  margin-bottom: 20px;
}
.app h3 { font-size: 18px; margin-bottom: 10px; }
.app p { font-size: 14.5px; }

/* ---------- news ---------- */
.news-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.news-photo { min-height: 340px; }
.news-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.news-body { padding: 44px 42px; align-self: center; }
.news-date {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin-bottom: 10px;
}
.news-body h3 { font-size: 24px; margin-bottom: 14px; }
.news-body p { font-size: 15.5px; }

/* ---------- CTA band ---------- */
.cta {
  padding: 0;
}
.cta-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(700px 400px at 90% 10%, rgba(127, 216, 160, 0.25), transparent 60%),
    linear-gradient(135deg, var(--green-deep), var(--green-deeper));
  padding: 84px 64px;
  margin: 110px 0;
  text-align: center;
}
.cta-card h2 {
  color: #fff;
  font-size: clamp(30px, 3.8vw, 46px);
  max-width: 22ch;
  margin: 0 auto 18px;
}
.cta-card p {
  color: rgba(255, 255, 255, 0.72);
  max-width: 52ch;
  margin: 0 auto 36px;
}
.cta-wave {
  position: absolute;
  inset: auto 0 0 0;
  opacity: 0.35;
  pointer-events: none;
}

/* ---------- sponsors ---------- */
.sponsors { padding: 0 0 100px; }
.sponsors-title {
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7d8c83;
  margin-bottom: 40px;
}
.sponsors-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 36px clamp(36px, 5vw, 72px);
}
.sponsor {
  opacity: 0.6;
  filter: grayscale(1);
  transition: opacity 0.25s ease, filter 0.25s ease;
}
.sponsor:hover { opacity: 1; filter: grayscale(0); }
.sponsor img {
  display: block;
  width: auto;
  height: 54px;
}
.sponsor-nsf img { height: 44px; }
.sponsor-mit img { height: 62px; }
.sponsor-doerr img { height: 56px; }
.sponsor-hit img { height: 42px; }

/* ============================================================
   TEAM PAGE
   ============================================================ */
.page-hero {
  position: relative;
  padding: 230px 0 90px;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(22, 158, 67, 0.1), transparent 65%),
    var(--white);
  overflow: hidden;
}
.page-hero h1 {
  font-size: clamp(40px, 5.4vw, 64px);
  max-width: 16ch;
  margin-bottom: 22px;
}
.page-hero h1 .accent { color: var(--green); }
.page-hero p { font-size: 18px; max-width: 58ch; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.person {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.person:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-soft);
}
.person .photo {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--mist);
}
.person .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transition: transform 0.45s ease;
}
.person:hover .photo img { transform: scale(1.045); }
.person .photo img.shift-up { object-position: center 59%; }
.person .info { padding: 26px 26px 30px; }
.person .role {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin-bottom: 6px;
}
.person h3 { font-size: 21px; margin-bottom: 10px; }
.person p { font-size: 15px; }

.join {
  background: var(--mist);
  text-align: center;
}
.join h2 { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 16px; }
.join p { max-width: 52ch; margin: 0 auto 32px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--green-deeper);
  color: rgba(255, 255, 255, 0.65);
  padding: 64px 0 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer .wordmark { font-size: 26px; }
.footer .tagline { margin-top: 10px; font-size: 14.5px; max-width: 34ch; }
.footer-links { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-links h4 {
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 9px; }
.footer-links a {
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.15s ease;
}
.footer-links a:hover { color: #7fd8a0; }
.footer-links a.social-link {
  display: inline-flex;
  margin-top: 6px;
}
.footer-links a.social-link svg { display: block; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 28px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.4);
}

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.1s; }
.reveal.d2 { transition-delay: 0.2s; }
.reveal.d3 { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-wave .wave-line { animation: none; stroke-dashoffset: 0; }
  .hero-wave .molecule { animation: none; opacity: 0.9; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .tech-cards, .steps { grid-template-columns: 1fr; }
  .tech-card.wide .wide-cols { grid-template-columns: 1fr; }
  .news-card { grid-template-columns: 1fr; }
  .news-photo { min-height: 240px; }
  .apps-grid { grid-template-columns: 1fr 1fr; }
  .team-grid { grid-template-columns: 1fr 1fr; }
  section { padding: 84px 0; }
  .cta-card { padding: 64px 32px; margin: 84px 0; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .announce { font-size: 14px; padding: 10px 14px; }
  .nav-links {
    position: fixed;
    top: 118px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 20px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 13px 0; font-size: 16px; }
  .nav-links .btn { margin-top: 10px; }
  .nav.scrolled, .nav:has(.nav-links.open) { background: #fff; }

  .hero { padding: 150px 0 70px; }
  .stats-inner { grid-template-columns: 1fr; gap: 30px; }
  .apps-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .hero-wave { margin-top: 56px; }
}
