:root {
  --bg: #000000;
  --bg-alt: #050a07;
  --surface: #0a120d;
  --border: #16301f;
  --text: #e4f5ea;
  --muted: #83a591;
  --accent: #40d873;
  --accent-2: #18a94e;
  --radius: 14px;
  --wrap: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #000; padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* HEADER / NAV */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--wrap); margin: 0 auto; padding: 14px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; }
.brand-name { font-weight: 700; }
.brand-name strong { color: var(--accent); }

/* Menu hidden by default; the toggle button reveals it (all widths) */
.nav-menu {
  position: absolute; top: 100%; right: 0; min-width: 220px;
  display: flex; flex-direction: column; gap: 0; list-style: none;
  background: var(--bg-alt);
  border: 1px solid var(--border); border-top: 0;
  border-bottom-left-radius: var(--radius);
  max-height: 0; overflow: hidden; transition: max-height .3s ease;
}
.nav-menu.open { max-height: calc(100vh - 60px); overflow-y: auto; }
.nav-menu li { border-top: 1px solid var(--border); }
.nav-menu li:first-child { border-top: 0; }
.nav-menu a { display: block; padding: 14px 24px; color: var(--muted); font-size: 0.95rem; font-weight: 500; }
.nav-menu a:hover { color: var(--text); text-decoration: none; }

.nav-toggle { display: flex; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 6px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); transition: .3s; }

/* HERO */
.hero {
  position: relative; overflow: hidden;
  padding: 110px 0 90px;
  background: radial-gradient(1200px 500px at 70% -10%, rgba(64,216,115,.20), transparent 60%),
              radial-gradient(900px 500px at 0% 10%, rgba(24,169,78,.16), transparent 55%);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .18;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}
.hero-inner { position: relative; }
.hero-logo {
  width: 200px; height: auto; margin-bottom: 8px;
  filter: drop-shadow(0 14px 40px rgba(64,216,115,.35));
  animation: float 5s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@media (prefers-reduced-motion: reduce) { .hero-logo { animation: none; } }
.eyebrow {
  text-transform: uppercase; letter-spacing: .18em; font-size: .78rem;
  color: var(--accent); font-weight: 600; margin-bottom: 16px;
}
h1 {
  font-size: clamp(2.2rem, 5.5vw, 4rem); line-height: 1.05; letter-spacing: -.02em;
  max-width: 16ch; margin-bottom: 20px;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 56ch; }

.hero-actions { display: flex; gap: 14px; margin: 32px 0 48px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; transition: transform .15s, box-shadow .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04140c; box-shadow: 0 8px 30px rgba(64,216,115,.28); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }

.stats { display: flex; gap: 48px; flex-wrap: wrap; }
.stats dt { font-size: .82rem; color: var(--muted); }
.stats dd { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }

/* SECTIONS */
.section { padding: 90px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 60ch; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); letter-spacing: -.02em; margin-bottom: 10px; }
.section-lede { color: var(--muted); font-size: 1.05rem; }

/* VIDEO */
.video {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: #000;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* CARDS */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--accent); transform: translateY(-4px); }
.card-icon { display: block; margin-bottom: 16px; color: var(--accent); }
.card-icon svg { width: 34px; height: 34px; }
.card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .95rem; }

/* PROJECTS */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.project {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; position: relative;
}
.project-tag {
  display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px; margin-bottom: 14px;
}
.project h3 { font-size: 1.25rem; margin-bottom: 8px; }
.project p { color: var(--muted); font-size: .95rem; }

/* PEOPLE */
.member-group + .member-group { margin-top: 44px; }
.member-group-title {
  font-size: 1rem; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: .12em; margin-bottom: 22px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; }
.people-more { margin-top: 40px; text-align: center; }
.person { text-align: center; }
.avatar {
  width: 92px; height: 92px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.5rem; font-weight: 700;
  color: #04140c; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  overflow: hidden;
}
.avatar.has-photo { background: var(--surface); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person figcaption strong { display: block; }
.person figcaption span { display: block; color: var(--muted); font-size: .88rem; }

/* JOIN US */
.join-tile a { display: block; color: inherit; text-decoration: none; }
.join-tile a:hover { text-decoration: none; }
.join-tile a:hover .avatar { transform: scale(1.06); box-shadow: 0 0 24px rgba(64,216,115,.5); }
.join-tile .avatar { transition: transform .2s, box-shadow .2s; }
.join-tile a:hover figcaption strong { color: var(--accent); }

.join-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
.join-steps {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.join-steps h3 { font-size: 1.15rem; margin-bottom: 16px; }
.join-steps ol, .join-list { padding-left: 20px; color: var(--muted); }
.join-steps li { margin-bottom: 10px; }
.join-steps a { font-weight: 600; }
.join-steps code {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 6px; font-size: .88em; color: var(--text);
}
@media (max-width: 760px) { .join-grid { grid-template-columns: 1fr; } }

/* PUBLICATIONS */
.pubs { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.pubs li {
  display: flex; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--border);
}
.pub-year { color: var(--accent); font-weight: 700; min-width: 56px; }
.pub-title { font-weight: 600; }
.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--accent); }
.pub-ext { font-size: .8em; margin-left: 6px; color: var(--accent); opacity: .7; }
.pub-title a:hover .pub-ext { opacity: 1; }
.pubs-loading { color: var(--muted); padding: 20px 0; }
.pub-meta { color: var(--muted); font-size: .92rem; }

/* COMPETITIONS */
.competitions { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 32px; }
@media (max-width: 760px) { .competitions { grid-template-columns: 1fr; } }

/* Info block above the gallery */
.competition-info {
  display: flex; flex-direction: column; gap: 1px; margin-bottom: 14px;
}
.competition-info .competition-year { color: var(--accent); font-weight: 700; font-size: .78rem; }
.competition-info strong { font-size: 1.02rem; line-height: 1.25; }
.competition-info .competition-loc { color: var(--muted); font-size: .8rem; }
.competition-info .competition-loc::before { content: "📍 "; }

.gallery {
  position: relative;
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
}
.slides { position: relative; width: 100%; aspect-ratio: 16 / 10; }
.slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease;
  display: grid; place-items: center;
}
.slide.active { opacity: 1; }
/* No crop: fit whole image, black letterbox fills the rest */
.slide { background: #000; }
.slide img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.gallery-empty { color: var(--muted); font-size: .95rem; }

.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border); color: var(--text);
  background: rgba(5,10,7,.55); backdrop-filter: blur(4px);
  font-size: 1.6rem; line-height: 1; display: grid; place-items: center;
  opacity: 0; transition: opacity .2s, background .2s;
}
.gallery:hover .gallery-nav { opacity: 1; }
.gallery-nav:hover { background: var(--accent); color: #04140c; }
.gallery-prev { left: 14px; }
.gallery-next { right: 14px; }

.dots {
  position: absolute; left: 0; right: 0; bottom: 14px; z-index: 2;
  display: flex; justify-content: center; gap: 9px;
}
.dot {
  width: 9px; height: 9px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 0; background: rgba(228,245,234,.4); transition: background .2s, transform .2s;
}
.dot.active { background: var(--accent); transform: scale(1.25); }

@media (max-width: 760px) { .gallery-nav { opacity: 1; } }

/* CONTACT */
.contact { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: start; }
.contact-details p { margin-bottom: 20px; color: var(--muted); }
.contact-details strong { color: var(--text); }
.social a { color: var(--muted); }

/* FOOTER */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .9rem; flex-wrap: wrap; gap: 12px; }
.footer-inner a { color: var(--muted); }

/* BACK TO TOP (floating) */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 1.4rem; line-height: 1; color: #04140c;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(64,216,115,.35);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top:hover { transform: translateY(-3px); }

/* MOBILE */
@media (max-width: 760px) {
  .contact { grid-template-columns: 1fr; }
  .stats { gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; transition: none !important; }
}
