/* ==========================================================================
   Agentic AI Security Initiative — base stylesheet
   ========================================================================== */

:root {
  --color-bg: #ffffff;
  --color-bg-elevated: #f5f5f7;
  --color-bg-dark: #0f1419;
  --color-bg-dark-soft: #161c23;
  --color-text: #18181b;
  --color-text-muted: #5b6470;
  --color-text-inverse: #f3f4f6;
  --color-text-inverse-muted: #aab2bd;
  --color-border: #e4e6ea;
  --color-border-dark: #2a323d;
  --color-accent: #2596be;
  --color-accent-strong: #1d7a99;
  --color-accent-soft: rgba(37, 150, 190, 0.12);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, serif;

  --shadow-sm: 0 1px 2px rgba(15, 20, 25, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 20, 25, 0.08);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  --content-max: 1180px;
  --content-narrow: 820px;

  --nav-height: 68px;
}

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

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--color-accent-strong);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover,
a:focus-visible {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text);
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
}
h2 {
  font-size: clamp(1.5rem, 2.4vw, 1.95rem);
}
h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* ---------- Layout helpers ---------- */

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: var(--content-narrow);
}

.section {
  padding: 4rem 0;
}

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

.section-heading {
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.6rem;
}

.section-heading::after {
  content: "";
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
}

.lead {
  font-size: 1.08rem;
  color: var(--color-text-muted);
  max-width: 60ch;
}

/* ---------- Navigation ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  gap: 1.5rem;
}

.site-nav__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-text);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-nav__brand:hover,
.site-nav__brand:focus-visible {
  color: var(--color-text);
  text-decoration: none;
}

.site-nav__logo {
  height: 46px;
  width: auto;
  flex-shrink: 0;
}



.site-nav__links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__link {
  color: var(--color-text);
  font-size: 1.1rem;
  font-weight: 500;
  padding: 0.4rem 0;
  position: relative;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--color-text);
  text-decoration: none;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 2px;
  background: #9aa3ad;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s ease, background-color 0.28s ease;
}

.site-nav__link:hover::after,
.site-nav__link:focus-visible::after {
  transform: scaleX(1);
}

.site-nav__link[aria-current="page"] {
  color: var(--color-accent-strong);
}

.site-nav__link[aria-current="page"]::after {
  transform: scaleX(1);
  background: var(--color-accent);
}

.site-nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.4rem;
  cursor: pointer;
  color: var(--color-text);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav__toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.site-nav__toggle:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.site-nav__toggle[aria-expanded="true"] {
  color: #9aa3ad;
  border-color: #c8ced6;
}

.site-nav__toggle-bar {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  margin: 2.5px 0;
  border-radius: 1px;
  transition: background-color 0.2s ease;
}

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

.site-footer {
  margin-top: 5rem;
  background: #1a2657;
  color: var(--color-text-inverse-muted);
  padding: 2.5rem 0 2rem;
  font-size: 0.92rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: baseline;
}

.site-footer a {
  color: var(--color-text-inverse);
}

.site-footer__org {
  color: var(--color-text-inverse);
  font-weight: 500;
}

.site-footer__email {
  font-size: 0.88rem;
  color: var(--color-text-inverse-muted);
}

.site-footer__meta {
  text-align: right;
  font-size: 0.85rem;
  line-height: 1.5;
}

.site-footer__updated {
  color: var(--color-text-inverse-muted);
}

@media (max-width: 560px) {
  .site-footer__meta {
    text-align: left;
  }
}

/* ---------- Hero (home) ---------- */

/* The whole hero is one continuous dark "stage": the dark title band flows
   straight into the photo area below, so the photo reads as a framed
   centerpiece rather than a strip with empty sides. */
.hero {
  position: relative;
  background: var(--color-bg-dark);
  overflow: hidden;
}

/* Title band that sits above the group photo, on the shared dark stage. */
.hero__intro {
  position: relative;
  background: var(--color-bg-dark);
  color: var(--color-text-inverse);
  text-align: center;
  padding: 3.5rem 0 3rem;
  overflow: hidden;
}

/* Soft accent glow for depth, kept subtle behind the text. */
.hero__intro::before {
  content: "";
  position: absolute;
  top: -40%;
  left: 50%;
  width: 80%;
  height: 180%;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(37, 150, 190, 0.18) 0%,
    rgba(37, 150, 190, 0) 65%
  );
  pointer-events: none;
}

.hero__title {
  position: relative;
  margin: 0;
  color: var(--color-text-inverse);
  font-size: clamp(1.9rem, 4.5vw, 3.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hero__title-accent {
  color: var(--color-accent);
  white-space: nowrap;
}

/* Accent bar between the title and subtitle — echoes the section headings. */
.hero__title::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin: 1.1rem auto 0;
  background: var(--color-accent);
  border-radius: 2px;
}

.hero__subtitle {
  position: relative;
  margin: 1.1rem 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  color: var(--color-text-inverse-muted);
  letter-spacing: 0.01em;
}

/* The photo is ~4:3, so full-width would be far too tall. Instead it is
   capped in height and centered on the dark stage, with the background
   flanking it on both sides. A soft radial "spotlight" lifts it off the
   stage — depth without any blur. */
.hero__media {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 1.5rem 3.5rem;
}

.hero__media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 55% 75% at 50% 42%,
    var(--color-bg-dark-soft) 0%,
    var(--color-bg-dark) 72%
  );
  pointer-events: none;
}

/* Sharp image, natural aspect ratio, framed as a centerpiece. */
.hero__image {
  position: relative;
  width: auto;
  max-width: 100%;
  max-height: 460px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-dark);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.hero__caption {
  background: var(--color-bg-dark);
  color: var(--color-text-inverse-muted);
  text-align: center;
  font-size: 0.85rem;
  padding: 0.75rem 1rem 1rem;
  letter-spacing: 0.02em;
}

/* ---------- Mission ---------- */

.mission {
  padding: 4rem 0 3rem;
}

.mission__body p {
  font-size: 1.08rem;
  color: var(--color-text);
}

.mission__body p + p {
  margin-top: 1rem;
}

/* ---------- Featured carousel ---------- */

.featured {
  padding: 2.5rem 0 5rem;
  background: var(--color-bg-elevated);
}

.carousel {
  position: relative;
}

.carousel__track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.5rem 0 1.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.carousel__track::-webkit-scrollbar {
  height: 8px;
}

.carousel__track::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.feature-card {
  flex: 0 0 min(86%, 520px);
  scroll-snap-align: start;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: row;
  gap: 1.1rem;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.feature-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

.feature-card__thumb {
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.feature-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-card__tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent-strong);
  margin-bottom: 0.35rem;
}

.feature-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--color-text);
}

.feature-card__desc {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

.carousel__controls {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

.carousel__btn {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.carousel__btn:hover,
.carousel__btn:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}

.carousel__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

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

.people-group {
  margin-bottom: 2.5rem;
}

.people-group__title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.4rem;
}

.people-group__empty {
  color: var(--color-text-muted);
  font-style: italic;
  font-size: 0.95rem;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem 1.25rem;
}

.person {
  text-align: center;
}

.person__photo-wrap {
  width: 132px;
  height: 132px;
  margin: 0 auto 0.7rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-bg-elevated);
  border: 2px solid var(--color-border);
  transition: border-color 0.15s ease;
}

.person a:hover .person__photo-wrap,
.person a:focus-visible .person__photo-wrap {
  border-color: var(--color-accent);
}

.person__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}

.person__name {
  display: block;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--color-text);
}

.person a {
  text-decoration: none;
}

.person a:hover .person__name,
.person a:focus-visible .person__name {
  color: var(--color-accent-strong);
}

/* ---------- Projects (card grid) ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.project-card:hover {
  border-color: var(--color-accent);
}

.project-card__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-bg-elevated);
  flex-shrink: 0;
}

.project-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card__body {
  padding: 1.25rem 1.4rem 1rem;
  flex: 1;
}

.project-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--color-text);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.project-card__desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.55;
}

.project-card__footer {
  padding: 0.8rem 1.4rem 1rem;
  border-top: 1px solid var(--color-border);
}

.project-card__projects {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-card__projects li a {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 2rem;
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.project-card__projects li a:hover,
.project-card__projects li a:focus-visible {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}

/* ---------- Publications ---------- */

.pubs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.pub {
  padding: 1rem 1.1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 1rem;
  align-items: start;
}

.pub__year {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--color-accent-strong);
  font-size: 0.95rem;
  padding-top: 0.15rem;
}

.pub__title {
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.pub__venue {
  margin: 0 0 0.25rem;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.pub__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.pub__btn {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.pub__btn--arxiv {
  background: rgba(179, 27, 27, 0.1);
  color: #b31b1b;
}
.pub__btn--arxiv:hover,
.pub__btn--arxiv:focus-visible {
  background: #b31b1b;
  color: #fff;
  text-decoration: none;
}

.pub__btn--paper {
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
}
.pub__btn--paper:hover,
.pub__btn--paper:focus-visible {
  background: var(--color-accent-strong);
  color: #fff;
  text-decoration: none;
}

.pub__btn--code {
  background: rgba(36, 41, 47, 0.08);
  color: #24292f;
}
.pub__btn--code:hover,
.pub__btn--code:focus-visible {
  background: #24292f;
  color: #fff;
  text-decoration: none;
}

/* ---------- Funding ---------- */

.funding-intro {
  max-width: 90ch;
  color: var(--color-text);
  margin: 0 auto 2.5rem;
  text-align: center;
  font-size: 1.02rem;
}

.logo-wall {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  align-items: center;
}

.logo-wall__item {
  flex: 0 0 180px;
  padding: 1.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  filter: grayscale(15%);
  opacity: 0.92;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.logo-wall__item img {
  max-width: 100%;
  max-height: 70px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ---------- Blog (placeholder) ---------- */

.blog-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-text-muted);
}

.blog-empty h1 {
  color: var(--color-text);
}

/* ---------- Page headers (non-home pages) ---------- */

/*---- background: var(--color-bg-dark); ----*/
  

.page-header {
  background: #1a2657;; 
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--color-border-dark);
}

.page-header h1 {
  margin: 0 0 0.4rem;
  color: var(--color-text-inverse);
}

.page-header p {
  margin: 0;
  color: var(--color-text-inverse-muted);
  max-width: 65ch;
}

/* ---------- Utility ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive ---------- */


@media (max-width: 720px) {
  :root {
    --nav-height: 60px;
  }

  .site-nav__toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .site-nav__links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    box-shadow: var(--shadow-md);

    /* Closed state */
    display: flex;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: max-height 0.32s ease, opacity 0.22s ease,
      transform 0.32s ease, visibility 0s linear 0.32s;
  }

  .site-nav__links.is-open {
    max-height: 560px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: max-height 0.32s ease, opacity 0.22s ease,
      transform 0.32s ease, visibility 0s linear 0s;
  }

  /* Stagger each row in as the menu unfolds. */
  .site-nav__links li {
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 0.22s ease, transform 0.22s ease;
  }

  .site-nav__links.is-open li {
    opacity: 1;
    transform: translateY(0);
  }

  .site-nav__links.is-open li:nth-child(1) {
    transition-delay: 0.05s;
  }
  .site-nav__links.is-open li:nth-child(2) {
    transition-delay: 0.09s;
  }
  .site-nav__links.is-open li:nth-child(3) {
    transition-delay: 0.13s;
  }
  .site-nav__links.is-open li:nth-child(4) {
    transition-delay: 0.17s;
  }
  .site-nav__links.is-open li:nth-child(5) {
    transition-delay: 0.21s;
  }
  .site-nav__links.is-open li:nth-child(6) {
    transition-delay: 0.25s;
  }
  .site-nav__links.is-open li:nth-child(7) {
    transition-delay: 0.29s;
  }

  .site-nav__link {
    display: block;
    padding: 1rem 24px;
    border-bottom: 1px solid var(--color-border);
    font-size: 1rem;
  }

  .site-nav__links li:last-child .site-nav__link {
    border-bottom: none;
  }

  /* Disable the desktop underline animation on mobile — it overlaps rows. */
  .site-nav__link::after {
    display: none;
  }

  .site-nav__link:hover,
  .site-nav__link:focus-visible {
    background: var(--color-bg-elevated);
    color: var(--color-text);
  }

  .site-nav__link[aria-current="page"] {
    background: var(--color-accent-soft);
    color: var(--color-accent-strong);
    border-left: 3px solid var(--color-accent);
    padding-left: 21px;
  }

  .hero__intro {
    padding: 2.5rem 0 1.75rem;
  }

  .hero__media {
    padding: 0.5rem 1rem 2.5rem;
  }

  .hero__image {
    max-height: 320px;
  }

  .feature-card {
    flex: 0 0 88%;
    flex-direction: column;
    gap: 0.75rem;
  }

  .feature-card__thumb {
    width: 100%;
    height: 120px;
  }

  .person__photo-wrap {
    width: 110px;
    height: 110px;
  }

  .pub {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .pub__year {
    font-size: 0.85rem;
  }

  .section {
    padding: 3rem 0;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .site-nav__inner {
    gap: 0.75rem;
  }
}

/* ---------- Reduced motion ---------- */

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