@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Source+Serif+4:wght@600;700&display=swap");

:root {
  --bg: #f7f4ee;
  --surface: #ffffff;
  --surface-strong: #111827;
  --muted: #eef1f5;
  --text: #172033;
  --subtle: #596579;
  --line: #d9dee8;
  --accent: #2563eb;
  --accent-dark: #1e3a8a;
  --accent-soft: #dbeafe;
  --gold: #b7791f;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 34rem),
    linear-gradient(180deg, #fbfaf7 0%, var(--bg) 48%, #edf1f7 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.94rem;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(217, 222, 232, 0.72);
  background: rgba(247, 244, 238, 0.82);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}

.brand,
.nav-links,
.hero-actions,
.cta-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-logo {
  height: 48px;
  width: auto;
  display: block;
  border-radius: 8px;
}

.nav-links {
  color: var(--subtle);
  font-size: 0.86rem;
  font-weight: 700;
}

.nav-links a {
  border-radius: 999px;
  padding: 8px 12px;
}

.nav-links a:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-dark);
}

.section {
  padding: 96px 0;
}

.section-muted {
  background: rgba(255, 255, 255, 0.52);
  border-block: 1px solid rgba(217, 222, 232, 0.72);
}

.hero {
  padding-top: 82px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 44px;
  align-items: center;
}

.eyebrow,
.card-kicker,
.project-card .tag,
.document-card span {
  color: var(--accent-dark);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Source Serif 4", Georgia, serif;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(2.35rem, 5.6vw, 4.8rem);
}

.hero-copy h1 {
  font-size: clamp(1.6rem, 3.8vw, 3.2rem);
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(1.65rem, 3.3vw, 2.75rem);
}

h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.hero-lede,
.section-copy {
  color: var(--subtle);
  font-size: 1rem;
}

.hero-lede {
  max-width: 660px;
  margin-bottom: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 20px;
  font-size: 0.9rem;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover,
.project-card:hover,
.document-card:hover {
  transform: translateY(-3px);
}

.button.primary {
  background: var(--surface-strong);
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(17, 24, 39, 0.24);
}

.button.secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.profile-card,
.project-card,
.document-card,
.feature-card,
.cta-card {
  border: 1px solid rgba(217, 222, 232, 0.9);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.profile-card {
  border-radius: var(--radius-xl);
  padding: 28px;
}

.feature-card {
  border-radius: var(--radius-xl);
  padding: clamp(28px, 5vw, 52px);
}

.avatar {
  width: 96px;
  height: 96px;
  margin-bottom: 24px;
  border: 5px solid #ffffff;
  border-radius: 28px;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.18);
}

.profile-card p,
.project-card p,
.document-card p {
  color: var(--subtle);
}

.profile-stats {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
}

.profile-stats div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.profile-stats dt {
  color: var(--subtle);
  font-weight: 600;
}

.profile-stats dd {
  margin: 0;
  font-weight: 800;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 32px;
  text-align: center;
}

.section-copy.narrow {
  max-width: 640px;
  margin-inline: auto;
}

.project-grid,
.document-grid {
  display: grid;
  gap: 22px;
}

.project-card,
.document-card {
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.split-heading,
.footer-inner {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.text-link,
.project-card a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(30, 58, 138, 0.28);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.project-grid {
  grid-template-columns: repeat(4, 1fr);
}

.project-card.featured {
  background: var(--surface-strong);
  color: #ffffff;
}

.project-card.featured p,
.project-card.featured .card-topline {
  color: #cbd5e1;
}

.project-card.featured a {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.42);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
  color: var(--subtle);
  font-size: 0.76rem;
  font-weight: 800;
}

.project-card .tag {
  display: inline-flex;
  border-radius: 999px;
  background: var(--accent-soft);
  padding: 5px 10px;
  letter-spacing: 0.08em;
}


.document-grid {
  grid-template-columns: repeat(3, 1fr);
}

.document-card {
  display: block;
}

.document-card:hover {
  box-shadow: 0 28px 90px rgba(37, 99, 235, 0.16);
}

.document-page {
  max-width: 920px;
  border: 1px solid rgba(217, 222, 232, 0.9);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 58px);
}

.document-page h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
}

.document-section {
  border-top: 1px solid var(--line);
  padding-top: 28px;
  margin-top: 32px;
}

.document-section h2 {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.document-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--subtle);
}

.document-list li + li {
  margin-top: 10px;
}

.document-list a {
  color: var(--accent-dark);
  font-weight: 800;
}

.cta-section {
  padding: 24px 0 96px;
}

.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: var(--radius-xl);
  padding: 36px;
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.96), rgba(30, 58, 138, 0.92)),
    var(--surface-strong);
  color: #ffffff;
}

.cta-card .eyebrow,
.cta-card h2 {
  color: #ffffff;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--subtle);
  font-size: 0.86rem;
}

.footer p {
  margin: 0;
}

.footer a {
  font-weight: 800;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .profile-card {
    max-width: 520px;
  }

  .project-grid,
  .document-grid,
  .stem-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 28px, 1120px);
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .section {
    padding: 68px 0;
  }

  .hero {
    padding-top: 48px;
  }

  .hero-actions,
  .cta-actions,
  .split-heading,
  .footer-inner,
  .cta-card {
    align-items: stretch;
    flex-direction: column;
  }

  .project-grid,
  .document-grid,
  .stem-grid {
    grid-template-columns: 1fr;
  }

}

/* ─── STEM Cards ─────────────────────────────────────── */

.stem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.stem-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(217, 222, 232, 0.9);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
  display: block;
}

.stem-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 90px rgba(37, 99, 235, 0.16);
}

.stem-card > img,
.stem-card > video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.stem-card-body {
  padding: 20px 24px 24px;
}

.stem-card-body p {
  color: var(--subtle);
  margin: 0;
}

/* ─── Chat Widget ─────────────────────────────────────── */

#chat-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

#chat-toggle {
  position: relative;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.38);
  transition: transform 0.18s, box-shadow 0.18s;
  flex-shrink: 0;
}

#chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(37, 99, 235, 0.5);
}

#chat-toggle .icon-chat,
#chat-toggle .icon-close {
  position: absolute;
  transition: opacity 0.18s, transform 0.18s;
}

#chat-toggle .icon-close {
  opacity: 0;
  transform: rotate(-80deg) scale(0.8);
}

#chat-toggle[aria-expanded="true"] .icon-chat {
  opacity: 0;
  transform: rotate(80deg) scale(0.8);
}

#chat-toggle[aria-expanded="true"] .icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

#chat-panel {
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chat-rise 0.2s ease;
}

@keyframes chat-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-header {
  background: var(--surface-strong);
  color: #fff;
  padding: 0.875rem 1.125rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-header span {
  flex: 1;
}

#chat-minimize {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

#chat-minimize:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

#chat-minimize .icon-max {
  display: none;
}

#chat-panel.minimized #chat-minimize .icon-min {
  display: none;
}

#chat-panel.minimized #chat-minimize .icon-max {
  display: block;
}

#chat-panel.minimized #chat-messages,
#chat-panel.minimized #chat-form {
  display: none;
}

.chat-header::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  flex-shrink: 0;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  min-height: 180px;
  max-height: 300px;
}

.chat-msg {
  max-width: 84%;
  padding: 0.5rem 0.8rem;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.chat-msg.assistant {
  background: var(--muted);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-msg.user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-msg.error {
  background: #fee2e2;
  color: #991b1b;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.55rem 0.8rem;
  background: var(--muted);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  background: var(--subtle);
  border-radius: 50%;
  display: block;
  animation: chat-dot 1.1s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: 0.18s; }
.chat-typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes chat-dot {
  0%, 80%, 100% { transform: scale(0.75); opacity: 0.45; }
  40%            { transform: scale(1);    opacity: 1; }
}

#chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--line);
}

#chat-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}

#chat-input:focus {
  border-color: var(--accent);
}

#chat-form .chat-send {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.875rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

#chat-form .chat-send:hover {
  background: var(--accent-dark);
}

#chat-form .chat-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  #chat-widget {
    bottom: 1rem;
    right: 1rem;
  }

  #chat-panel {
    width: calc(100vw - 2rem);
  }
}
