/* =========================================================
   GIBE — Global Infrastructure Built Environment
   Token system
   ========================================================= */
:root {
  --bg: #0a0a0c;
  --bg-raised: #131417;
  --text: #f2f1ec;
  --text-muted: #b7b8bd;
  --border: #2a2b30;

  --nav-a: #123a52;
  --nav-b: #1b5e5e;
  --accent-amber: #e8a33d;
  --accent-red: #c1443c;

  --font-head: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  --container-w: 1120px;
  --radius: 4px;
  --header-h: 76px;
}

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

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(rgba(242,241,236,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242,241,236,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--text);
}

h1 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; color: var(--text-muted); max-width: 68ch; }

a { color: var(--accent-amber); }
a:hover { color: #f4c07a; }

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

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

.skip-link {
  position: absolute; left: 12px; top: -48px;
  background: var(--accent-amber); color: #14140f;
  padding: 10px 16px; border-radius: var(--radius);
  font-family: var(--font-body); font-weight: 600;
  transition: top 0.15s ease;
  z-index: 200;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--accent-amber);
  outline-offset: 2px;
}

/* Page headings are focused programmatically on navigation for screen-reader
   users; they aren't interactive controls, so suppress the visible ring here. */
h1[tabindex="-1"]:focus {
  outline: none;
}

/* =========================================================
   Header / Navigation
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(120deg, var(--nav-a), var(--nav-b));
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
}

.brand-logo {
  height: 40px;
  width: auto;
  flex-shrink: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: 2px solid var(--accent-amber);
  position: relative;
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: var(--accent-amber);
}
.brand-mark::before { left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-50%); }
.brand-mark::after { top: 50%; left: 0; right: 0; height: 2px; transform: translateY(-50%); }

.brand-text {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.primary-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: var(--radius);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.primary-nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }

.primary-nav a.is-active {
  color: #fff;
  border-bottom-color: var(--accent-amber);
}

.ext-icon { width: 14px; height: 14px; fill: currentColor; opacity: 0.85; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 20px;
  margin: 0 auto;
  background: #fff;
}

/* =========================================================
   Page routing
   ========================================================= */
.page { display: none; }
.page.is-active { display: block; }

.page-header { padding: 56px 0 24px; }
.lede { font-size: 1.05rem; max-width: none; }

.section-heading {
  margin-top: 8px;
  padding-top: 8px;
}

/* =========================================================
   Home page video
   ========================================================= */
.hero-video {
  width: 100%;
  background: #05060a;
  margin-top: 24px;
}

#home-video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 70vh;
}

/* If real embed code (e.g. an <iframe>) is inserted, make it fill the frame */
#home-video-embed iframe,
#home-video-embed video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.home-intro { padding: 48px 0 24px; }

.home-secondary-text { padding: 0 0 64px; }
.home-secondary-text h2 { margin-top: 0; }
.home-secondary-text h3 { margin-top: 36px; margin-bottom: 0.5em; }
.home-secondary-text p { color: var(--text-muted); max-width: none; }
.home-secondary-text strong { color: var(--text); font-weight: 600; }
.home-secondary-text ul {
  margin: 0 0 20px;
  padding-left: 22px;
  color: var(--text-muted);
  max-width: none;
}
.home-secondary-text li { margin-bottom: 6px; }
.home-secondary-text li::marker { color: var(--accent-amber); }

/* =========================================================
   About / Team
   ========================================================= */
.team-grid {
  list-style: none;
  margin: 24px 0 40px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.team-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.team-card h3 { margin: 16px 22px 0.4em; }
.team-card > p { margin: 0 22px 22px; font-size: 0.94rem; }

.team-photo-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #05060a;
}

.team-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.team-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #14161a;
  color: var(--text-muted);
  text-align: center;
  padding: 12px;
  font-size: 0.85rem;
}
.team-photo-placeholder span {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
}

.closing-statement {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  margin-top: 8px;
  font-size: 1.05rem;
  color: var(--text);
  max-width: none;
}

/* =========================================================
   News
   ========================================================= */
.news-stack {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding-bottom: 64px;
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.pdf-current-label { font-family: var(--font-head); font-weight: 600; }
.pdf-open-link { font-size: 0.9rem; white-space: nowrap; }

.pdf-frame-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
}

.pdf-frame {
  display: block;
  width: 100%;
  aspect-ratio: 210 / 297; /* A4 portrait, so a single page fits with no inner scrollbar */
  border: 0;
}

.pdf-fallback {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
}

/* =========================================================
   Events
   ========================================================= */
.events-text-list {
  margin: 8px 0 64px;
}

.event-entry {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.event-entry:first-child { padding-top: 0; }
.event-entry:last-child { border-bottom: none; }

.event-tag {
  font-family: var(--font-head);
  font-size: 0.8rem;
  color: var(--accent-amber);
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}

.event-title { margin: 0 0 10px; font-size: 1.05rem; }

.event-meta-line { margin: 0 0 4px; font-size: 0.95rem; color: var(--text); max-width: none; }
.event-meta-line strong { color: var(--text-muted); font-weight: 500; }

.event-description { font-size: 0.95rem; margin: 10px 0 0; max-width: none; }

.is-disabled { pointer-events: none; opacity: 0.55; cursor: default; }

/* =========================================================
   Digital Twin
   ========================================================= */
.digital-twin-frame {
  margin-bottom: 64px;
}

#digital-twin-embed {
  min-height: 60vh;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
}

.embed-placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}
.embed-placeholder span {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
  margin-top: 16px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  font-family: var(--font-head);
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.footer-copyright { margin: 0; font-size: 0.88rem; }

.footer-links {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
}
.footer-links a { color: var(--text-muted); text-decoration: none; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 760px) {
  .nav-toggle { display: flex; }

  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(120deg, var(--nav-a), var(--nav-b));
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .primary-nav.is-open { max-height: 420px; }

  .primary-nav ul {
    flex-direction: column;
    padding: 8px 16px 16px;
    gap: 2px;
  }
  .primary-nav a { width: 100%; }

  .brand-text { font-size: 0.85rem; }

  #home-video-embed { aspect-ratio: 4 / 3; max-height: 60vh; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}