/* ════════════════════════════════════════════
   DESIGN TOKENS
════════════════════════════════════════════ */
:root {
  /* Palette */
  --navy:          #0d1b2a;
  --blue-dark:     #1e4d7b;
  --teal:          #00b4d8;
  --teal-light:    #90e0ef;
  --orange:        #f77f00;
  --off-white:     #f0f4f8;
  --white:         #ffffff;
  --text-dark:     #1a1a2e;
  --text-mid:      #3d4a5c;
  --text-muted:    #6b7a8d;

  /* Category accent colors */
  --science-color:     #2d6a4f;
  --technology-color:  #0077b6;
  --engineering-color: #e85d04;
  --math-color:        #6a2c91;
  --art-color:         #c1121f;

  /* Shape */
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  22px;

  /* Typography */
  --font-head: 'Montserrat', sans-serif;
  --font-body: 'Open Sans', sans-serif;
}

/* ════════════════════════════════════════════
   RESET & BASE
════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--text-dark);
  overflow-x: hidden;
}

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

a { text-decoration: none; }

/* ════════════════════════════════════════════
   NAVIGATION
════════════════════════════════════════════ */
.site-nav {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 36px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 10;        /* sits above hero content when logo spills below nav */
}

.nav-logo-img {
  height: 90px;       /* intentionally taller than the nav — spills into page */
  width: auto;
  display: block;
  object-fit: contain;
}

/* Allow logo to overflow the nav bar downward */
.site-nav,
.nav-inner {
  overflow: visible;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.09);
}

.btn-join {
  background: var(--teal) !important;
  color: var(--navy) !important;
  font-weight: 700 !important;
  margin-left: 8px;
}

.btn-join:hover {
  background: var(--teal-light) !important;
}

/* ════════════════════════════════════════════
   HERO
   Left column: tall portrait main image
   Right column: horizontally scrolling square-ish tiles
════════════════════════════════════════════ */
.hero {
  background: var(--navy);
  padding: 32px 36px 36px;
}

.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  height: 460px; /* extra height to give blurb room above the gallery */
}

/* ── Featured image (left) ── */
.hero-main {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
}

.hero-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-badge {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: var(--orange);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 100px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* ── Right column wrapper (blurb + gallery) ── */
.hero-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;      /* prevents gallery-track max-content width from escaping the grid column */
  overflow: hidden;
}

.hero-blurb {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--teal);
  text-align: center;
  letter-spacing: 0.4px;
  padding: 10px 0 12px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

/* Gallery fills remaining height inside the right column */
.hero-right .hero-gallery {
  flex: 1;
  min-height: 0;
}

/* ── Scrolling gallery (right) ── */
.hero-gallery {
  overflow: hidden;
  border-radius: var(--radius-lg);
  position: relative;
}

/* Soft fade at left and right edges into navy */
.hero-gallery::before,
.hero-gallery::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 56px;
  z-index: 2;
  pointer-events: none;
}

.hero-gallery::before {
  left: 0;
  background: linear-gradient(to right, var(--navy), transparent);
}

.hero-gallery::after {
  right: 0;
  background: linear-gradient(to left, var(--navy), transparent);
}

/*
  Seamless scroll math:
    Tile slot = 210px wide + 16px margin-right = 226px per slot
    7 tiles per set × 226px = 1582px per set
    translateX(-50%) of the 14-tile track (3164px) = -1582px = exactly one set width ✓
*/
.gallery-track {
  display: flex;
  height: 100%;
  align-items: center;
  width: max-content;
  animation: scroll-left 30s linear infinite;
}

.hero-gallery:hover .gallery-track {
  animation-play-state: paused;
}

.gallery-tile {
  width: 210px;
  height: 280px;      /* shorter than before — landscape/square-ish per wireframe */
  flex-shrink: 0;
  margin-right: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-tile:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.65);
}

.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes scroll-left {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ════════════════════════════════════════════
   INTRO
   Narrower centered block per wireframe —
   NOT full width; floats in the center of the page.
════════════════════════════════════════════ */
.intro-section {
  padding: 52px 36px;
  display: flex;
  justify-content: center;   /* centers the card horizontally */
}

.intro-card {
  position: relative;
  width: 100%;
  max-width: 760px;           /* narrower than full page — matches wireframe */
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.15);
}

.intro-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.intro-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(13, 27, 42, 0.93) 0%,
    rgba(0, 119, 182, 0.60) 55%,
    rgba(0, 180, 216, 0.40) 100%
  );
  z-index: 1;
}

.intro-text {
  position: relative;
  z-index: 2;
  padding: 56px 64px;
  text-align: center;         /* centered text per wireframe */
}

.intro-text h1 {
  font-family: var(--font-head);
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 24px;
}

.intro-text h1 span {
  color: var(--teal);
}

.intro-text p {
  font-size: 1rem;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 16px;
}

.intro-cta {
  margin-top: 28px !important;
  font-weight: 600;
  color: var(--white) !important;
}

.intro-link {
  color: var(--teal);
  font-weight: 700;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.intro-link:hover {
  color: var(--teal-light);
  border-bottom-color: var(--teal-light);
}

/* ════════════════════════════════════════════
   DISCOVERY  —  search bar + category tiles
   Also centered, matching the intro width.
════════════════════════════════════════════ */
.discovery-section {
  padding: 0 36px 90px;
}

.discovery-inner {
  max-width: 960px;           /* centered column, not full 1280px */
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-head);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--navy);
  text-align: center;
  margin-bottom: 32px;
}

/* ── Search bar ── */
.search-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 48px;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: 100px;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.11);
  padding: 7px 7px 7px 22px;
  width: 100%;
  max-width: 680px;
  border: 2px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar:focus-within {
  border-color: var(--teal);
  box-shadow: 0 4px 28px rgba(0, 180, 216, 0.22);
}

.cat-select {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-head);
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--blue-dark);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231e4d7b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 26px;
  white-space: nowrap;
}

.search-divider {
  display: block;
  width: 1px;
  height: 26px;
  background: #ced4da;
  margin: 0 18px;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-dark);
  background: transparent;
  min-width: 0;
}

.search-input::placeholder { color: var(--text-muted); }

.search-btn {
  background: var(--teal);
  color: var(--white);
  border: none;
  border-radius: 100px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}

.search-btn:hover {
  background: var(--blue-dark);
  transform: scale(1.06);
}

/* ════════════════════════════════════════════
   CATEGORY TILES
   Per wireframe: category name sits ABOVE each tile
   as a text label; tile itself is square.
════════════════════════════════════════════ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}

/* Wrapper that stacks label above tile */
.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.cat-label {
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-align: center;
}

/* Square tile */
.cat-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: block;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.14);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cat-tile:hover {
  transform: translateY(-7px) scale(1.03);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.cat-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.cat-tile:hover img {
  transform: scale(1.08);
}

/* Hover overlay — reveals icon + description on hover */
.cat-hover-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cat-tile:hover .cat-hover-body {
  opacity: 1;
}

/* Colour-coded gradient per category — always present, darkens on hover */
.cat-tile.science     { background: var(--science-color); }
.cat-tile.technology  { background: var(--technology-color); }
.cat-tile.engineering { background: var(--engineering-color); }
.cat-tile.math        { background: var(--math-color); }
.cat-tile.art         { background: var(--art-color); }

/* Technology image shows full width (robot evolution) — no cropping, white bg matches image */
.cat-tile.technology {
  background: #ffffff;
}
.cat-tile.technology img {
  object-fit: contain;
  object-position: center;
}
.cat-tile.technology:hover img {
  transform: scale(1.04);
}

.cat-tile.science .cat-hover-body {
  background: linear-gradient(to top, rgba(45,106,79,0.94), rgba(45,106,79,0.75));
}
.cat-tile.technology .cat-hover-body {
  background: linear-gradient(to top, rgba(0,119,182,0.94), rgba(0,119,182,0.75));
}
.cat-tile.engineering .cat-hover-body {
  background: linear-gradient(to top, rgba(232,93,4,0.94), rgba(232,93,4,0.75));
}
.cat-tile.math .cat-hover-body {
  background: linear-gradient(to top, rgba(106,44,145,0.94), rgba(106,44,145,0.75));
}
.cat-tile.art .cat-hover-body {
  background: linear-gradient(to top, rgba(193,18,31,0.94), rgba(193,18,31,0.75));
}

.cat-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.cat-hover-body p {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.45;
  font-weight: 500;
}

/* ════════════════════════════════════════════
   COMMUNITY  —  join the conversation
════════════════════════════════════════════ */
.community-section {
  background: var(--navy);
  padding: 72px 36px 80px;
}

.community-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.community-header {
  text-align: center;
  margin-bottom: 52px;
}

.community-header h2 {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 16px;
}

.community-header p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.72);
  max-width: 680px;
  margin: 0 auto;
}

/* Two-column layout: form left, comments right */
.community-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: start;
}

.panel-heading {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Comment form panel ── */
.comment-form-wrap {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group label {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group .optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
}

.req { color: var(--orange); }

.form-group input,
.form-group textarea {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 10px 14px;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--teal);
  background: rgba(255, 255, 255, 0.11);
}

/* Type selection pills */
.type-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.type-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 100px;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.type-pill:hover {
  background: rgba(255, 255, 255, 0.13);
  color: var(--white);
}

.type-pill.active {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--navy);
  font-weight: 700;
}

/* Character counter */
.char-count {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  text-align: right;
  margin-top: 4px;
}

/* Submit button */
.submit-btn {
  background: var(--teal);
  color: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 13px 28px;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.2s, transform 0.15s;
}

.submit-btn:hover:not(:disabled) {
  background: var(--teal-light);
  transform: translateY(-2px);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Form success / error message */
.form-msg {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
}

.form-msg.success {
  background: rgba(45, 106, 79, 0.35);
  border: 1px solid rgba(45, 106, 79, 0.6);
  color: #a8e6c3;
}

.form-msg.error {
  background: rgba(193, 18, 31, 0.25);
  border: 1px solid rgba(193, 18, 31, 0.5);
  color: #ffb3b3;
}

/* ── Comments list panel ── */
.comments-list-wrap {
  display: flex;
  flex-direction: column;
}

.comment-count {
  background: var(--teal);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 100px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.no-comments {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  font-size: 0.9rem;
  padding: 20px 0;
}

.comment-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: background 0.2s;
}

.comment-card:hover {
  background: rgba(255, 255, 255, 0.09);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.comment-author {
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--white);
}

.comment-badge {
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
}

.comment-badge.feedback    { background: rgba(0,180,216,0.25); color: var(--teal-light); }
.comment-badge.contribute  { background: rgba(247,127,0,0.25);  color: #ffc07a; }
.comment-badge.suggestion  { background: rgba(106,44,145,0.3);  color: #d4a0ff; }

.comment-date {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  margin-left: auto;
}

.comment-text {
  font-size: 0.88rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}

/* ════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════ */
.site-footer {
  background: var(--navy);
  padding: 48px 36px;
  text-align: center;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-logo {
  font-family: var(--font-head);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--white);
}

.footer-logo span { color: var(--teal); }

.footer-tag {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin: 8px 0 0;
}

.footer-copy {
  color: rgba(255, 255, 255, 0.28);
  font-size: 0.78rem;
  margin-top: 14px;
}
