/* =========================================================================
   Foundations of AI Agents — NYU Stern
   Design system
   ========================================================================= */

:root {
  /* Palette — NYU violet used sparingly against a warm neutral base */
  --bg:              #FAF8F5;
  --bg-elev:         #FFFFFF;
  --bg-muted:        #F2EFEA;
  --ink:             #18181B;
  --ink-muted:       #3F3F46;
  --ink-soft:        #71717A;
  --ink-faint:       #A1A1AA;
  --line:            #E7E3DC;
  --line-strong:     #D6D1C7;
  --violet:          #57068C;
  --violet-strong:   #3D0463;
  --violet-soft:     #F4ECFA;
  --violet-tint:     #EADDF5;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Inter Tight", "Inter", -apple-system, sans-serif;

  /* Scale */
  --container: 1200px;
  --pad-x: clamp(20px, 4vw, 56px);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* -------------------------------------------------------------------------
   Reset + base
   ------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

html, body { overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

img, svg, video { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

::selection { background: var(--violet); color: #fff; }

/* -------------------------------------------------------------------------
   Layout primitives
   ------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

section {
  padding: clamp(72px, 10vw, 128px) 0;
  position: relative;
}

section + section {
  border-top: 1px solid var(--line);
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
  margin: 0 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--violet);
  display: inline-block;
}

.section-head {
  max-width: 760px;
  margin: 0 0 56px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  color: var(--ink);
}

.section-head p {
  font-size: clamp(16px, 1.4vw, 18px);
  color: var(--ink-muted);
  margin: 0;
  max-width: 60ch;
  text-align: justify;
  hyphens: auto;
}

/* -------------------------------------------------------------------------
   Top navigation
   ------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 245, 0.0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.25s var(--ease), backdrop-filter 0.25s var(--ease), border-color 0.25s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(250, 248, 245, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand-text { line-height: 1.2; }
.brand-text small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-muted);
  border-radius: 999px;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  background: var(--bg-muted);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px !important;
  background: var(--ink) !important;
  color: #fff !important;
  font-weight: 500;
}
.nav-cta:hover {
  background: var(--violet) !important;
  color: #fff !important;
}

@media (max-width: 720px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .brand-text small { display: none; }
  .brand-text { font-size: 15px; }
}

@media (max-width: 420px) {
  .brand-text { font-size: 14px; max-width: 14ch; line-height: 1.2; }
  .nav-cta { padding: 9px 12px !important; font-size: 13px; }
}

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding-top: clamp(64px, 10vw, 120px);
  padding-bottom: clamp(72px, 11vw, 144px);
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
.hero::before {
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, var(--violet-tint), transparent 65%);
  top: -240px;
  right: -160px;
  opacity: 0.55;
}
.hero::after {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, var(--violet-soft), transparent 65%);
  bottom: -140px;
  left: -80px;
  opacity: 0.7;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 940px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 4.6vw, 60px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0 0 28px;
  color: var(--ink);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .hero h1 {
    white-space: normal;
    font-size: clamp(34px, 9vw, 46px);
    line-height: 1.08;
  }
}

.hero h1 .accent {
  color: var(--violet);
  font-style: italic;
  font-weight: 600;
}

.hero-lede {
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 62ch;
  margin: 0 0 36px;
  text-align: justify;
  hyphens: auto;
}

.hero-byline {
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  margin: 0;
}
.hero-byline strong {
  color: var(--ink);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--violet); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-elev); border-color: var(--ink); }

.btn .arrow {
  display: inline-block;
  transition: transform 0.2s var(--ease);
}
.btn:hover .arrow { transform: translateX(3px); }

/* -------------------------------------------------------------------------
   About
   ------------------------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(40px, 8vw, 96px);
  align-items: start;
}

@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
}

.about-grid h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0;
}

.about-body p {
  font-size: clamp(16px, 1.4vw, 18px);
  color: var(--ink-muted);
  margin: 0 0 20px;
  line-height: 1.65;
  text-align: justify;
  hyphens: auto;
}
.about-body p:last-child { margin-bottom: 0; }
.about-body strong { color: var(--ink); font-weight: 600; }

/* -------------------------------------------------------------------------
   Curriculum
   ------------------------------------------------------------------------- */

/* Editorial-style numbered list — distinct from card grids elsewhere */
.curriculum {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.day-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: baseline;
  gap: 32px;
  padding: 32px 0 32px;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: padding-left 0.3s var(--ease);
}

.day-row::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--violet);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.day-row:hover {
  padding-left: 16px;
}
.day-row:hover::before { opacity: 1; }

.day-row .day-num {
  font-family: var(--font-display);
  font-size: clamp(48px, 5.2vw, 64px);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 0.9;
}
.day-row .day-num sup {
  font-size: 0.4em;
  color: var(--violet);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--font-sans);
  vertical-align: top;
  margin-left: 6px;
  position: relative;
  top: 6px;
}

.day-row .day-content h3 {
  font-family: var(--font-display);
  font-size: clamp(20px, 1.9vw, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 10px;
  color: var(--ink);
}
.day-row .day-content p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 62ch;
}

.day-row .day-meta {
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
  align-self: start;
  padding-top: 8px;
}

@media (max-width: 720px) {
  .day-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 28px 0;
  }
  .day-row .day-meta { display: none; }
  .day-row .day-num { font-size: 44px; }
}

/* -------------------------------------------------------------------------
   People
   ------------------------------------------------------------------------- */

.people-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) { .people-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px)  { .people-grid { grid-template-columns: 1fr; } }

.person {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.person:hover {
  transform: translateY(-3px);
  border-color: var(--violet-tint);
  box-shadow: 0 14px 36px -18px rgba(87,6,140,0.2);
}

.portrait {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--violet-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid var(--violet-tint);
}
.portrait .initials {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  color: var(--violet);
  letter-spacing: -0.02em;
}
.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.person h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
  color: var(--ink);
}
.person .person-title {
  font-size: 13.5px;
  color: var(--violet);
  font-weight: 500;
  margin: 0;
}

/* -------------------------------------------------------------------------
   Projects grid (projects.html)
   ------------------------------------------------------------------------- */

.page-header {
  padding: clamp(72px, 10vw, 120px) 0 clamp(40px, 6vw, 64px);
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--violet-tint), transparent 70%);
  filter: blur(80px);
  top: -180px;
  right: -120px;
  opacity: 0.5;
  pointer-events: none;
}
.page-header-inner { position: relative; z-index: 1; max-width: 820px; }
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 20px;
  color: var(--ink);
}
.page-header p {
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--ink-muted);
  max-width: 64ch;
  margin: 0;
  line-height: 1.55;
  text-align: justify;
  hyphens: auto;
}

.projects-section { padding-top: 0; }
.projects-section section + section { border-top: none; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

@media (max-width: 880px) { .projects-grid { grid-template-columns: 1fr; } }

.project-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--violet-tint);
  box-shadow: 0 18px 44px -22px rgba(87,6,140,0.22);
}

.project-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-muted);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.project-media video,
.project-media .video-placeholder,
.project-media .project-iframe {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.project-media video,
.project-media .project-iframe { background: #000; border: 0; }

.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background:
    radial-gradient(circle at 30% 20%, var(--violet-soft), transparent 50%),
    radial-gradient(circle at 75% 80%, #FFE7CC55, transparent 55%),
    var(--bg-muted);
  color: var(--ink-soft);
  font-size: 13px;
  text-align: center;
  padding: 24px;
}
.video-placeholder .play-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--violet);
}
.video-placeholder .play-icon svg { width: 22px; height: 22px; }
.video-placeholder .placeholder-label {
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--ink-soft);
}

.project-body {
  padding: 24px 26px 26px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 4px 0 0;
  color: var(--ink);
}
.project-team {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
}
.project-team strong { color: var(--ink-muted); font-weight: 600; }
.project-card p.project-desc {
  font-size: 14.5px;
  color: var(--ink-muted);
  margin: 6px 0 14px;
  line-height: 1.55;
  text-align: justify;
  hyphens: auto;
}

/* New team-list with optional LinkedIn-icon links per member */
.project-team-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.project-team-member {
  display: inline-flex;
  align-items: center;
}
.project-team-member .team-link {
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.18s var(--ease);
}
.project-team-member .team-link:hover {
  color: var(--violet);
}
.project-team-member .li-icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
  opacity: 0.7;
  transition: opacity 0.18s var(--ease);
}
.project-team-member .team-link:hover .li-icon {
  opacity: 1;
}

.project-external {
  font-size: 13.5px;
  margin: 12px 0 0;
}
.project-external .external-link {
  color: var(--violet);
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s var(--ease);
}
.project-external .external-link:hover {
  border-bottom-color: var(--violet);
}

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

footer.site-footer {
  padding: 56px 0 64px;
  background: var(--bg-muted);
  border-top: 1px solid var(--line);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; }
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  color: var(--ink);
}
.footer-tag {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  max-width: 50ch;
}
.footer-credit {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 16px 0 0;
}
.footer-meta {
  font-size: 13px;
  color: var(--ink-soft);
  text-align: right;
}
@media (max-width: 720px) {
  .footer-meta { text-align: left; }
}
.footer-meta a {
  color: var(--ink-muted);
  border-bottom: 1px dotted var(--ink-faint);
}
.footer-meta a:hover { color: var(--violet); border-color: var(--violet); }

/* -------------------------------------------------------------------------
   Reveal-on-scroll
   ------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children of a .stagger parent */
.stagger > .reveal { transition-delay: 0ms; }
.stagger > .reveal:nth-child(2) { transition-delay: 70ms; }
.stagger > .reveal:nth-child(3) { transition-delay: 140ms; }
.stagger > .reveal:nth-child(4) { transition-delay: 210ms; }
.stagger > .reveal:nth-child(5) { transition-delay: 280ms; }
.stagger > .reveal:nth-child(6) { transition-delay: 350ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
