/* ---------------------------------
   GLOBAL VARIABLES
--------------------------------- */
:root {
  --bg: #0b0c0f;
  --bg-soft: #11131a;
  --text: #e7e9ee;
  --muted: #a9afbd;
  --card: #151823;
  --line: #23283a;
  --brand: #7aa2ff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --maxw: 980px;
  --transition-fast: 0.2s ease;
  --transition-med: 0.35s ease;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fa;
    --bg-soft: #fff;
    --text: #11131a;
    --muted: #475065;
    --card: #ffffff;
    --line: #e7eaf1;
  }
}

/* ---------------------------------
   BASE
--------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), var(--bg-soft) 60%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.03) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.02) 0%, transparent 70%);
  z-index: 0;
}

a { color: inherit; text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--brand); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

/* ---------------------------------
   NAVIGATION
--------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(12px);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
}
.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 24px var(--brand);
}
.links {
  display: flex;
  gap: 18px;
  align-items: center;
}
.toggler {
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
}

/* Hide entire navbar on mobile */
@media (max-width: 640px) {
  .nav { display: none; }
}

/* ---------------------------------
   SECTION LAYOUT
--------------------------------- */
section { padding: 40px 0; scroll-margin-top: 80px; }
.hero { padding: 40px 0; text-align: center; }

h1 {
  font-size: clamp(42px, 7vw, 72px);
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
h2 {
  font-size: clamp(24px, 4.4vw, 34px);
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}
p.lead {
  font-size: clamp(18px, 2.4vw, 20px);
  color: var(--muted);
  max-width: 780px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ---------------------------------
   GRID SYSTEM
--------------------------------- */
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); gap: 20px; }

@media (max-width: 900px) {
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
}

/* ---------------------------------
   CARDS
--------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  display: block;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.card__media {
  aspect-ratio: 16/9;
  background: #0e1016;
  display: block;
  position: relative;
}
.card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card__body { padding: 16px; }
.card__title {
  font-weight: 650;
  margin: 0 0 8px;
}
.card__desc {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}
.card.small { padding: 20px; text-align: left; }
.card.small h3 { margin: 0 0 6px; font-size: 20px; }
.card.small p { margin: 0; color: var(--muted); }

/* Hover videos */
.video-thumb { position: relative; overflow: hidden; }
.video-thumb video, .video-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.4s ease;
}
.video-thumb video { opacity: 0; pointer-events: none; }
.card:hover .video-thumb video { opacity: 1; }
.card:hover .video-thumb img { opacity: 0; }

/* ---------------------------------
   BUTTONS
--------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all var(--transition-fast);
}
.btn:hover {
  transform: translateY(-1px);
  background: color-mix(in oklab, var(--card) 80%, transparent);
}

/* ---------------------------------
   FOOTER
--------------------------------- */
footer {
  padding: 60px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.muted { color: var(--muted); }

ul.focus {
  margin-top: 20px;
  padding-left: 0;
  list-style: none;
}
ul.focus li {
  margin: 8px 0;
  color: var(--muted);
  font-size: 17px;
}

/* ---------------------------------
   TWO COLUMN LAYOUT (Activities / Achievements)
--------------------------------- */
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: stretch;
}
.two-column .column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.two-column .column h2 {
  font-size: clamp(24px, 4.4vw, 34px);
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  color: var(--text);
  text-align: left;
}
@media (max-width: 900px) {
  .two-column { grid-template-columns: 1fr; }
}

/* ---------------------------------
   STATS (Robolytics)
--------------------------------- */
.stats-side {
  display: flex;
  justify-content: center;
  gap: 80px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.stats-side .stat { text-align: center; }
.stats-side strong {
  display: block;
  font-size: 3.2rem;
  color: #fff;
  text-shadow: 0 0 25px rgba(255, 255, 255, 0.25);
  font-weight: 700;
  line-height: 1.1;
}
.stats-side span {
  color: #e0e0e0;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ---------------------------------
   BIG CONNECT BUTTONS
--------------------------------- */
.big-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.big-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 30px;
  border: none;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-med), box-shadow var(--transition-med);
}
.big-btn.youtube {
  background: linear-gradient(135deg, #ff4c4c, #c80000);
  box-shadow: 0 0 25px rgba(255, 76, 76, 0.4);
}
.big-btn.discord {
  background: linear-gradient(135deg, #7289da, #5865f2);
  box-shadow: 0 0 25px rgba(88, 101, 242, 0.4);
}
.big-btn:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 0 35px rgba(255, 255, 255, 0.25);
}
.big-btn svg {
  fill: currentColor;
  height: 24px;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.big-btn .discord-icon { width: 22px; }
.big-btn .youtube-icon { width: 24px; }
.big-btn:hover svg {
  transform: scale(1.1);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
}

/* --- Worlds 2025 Button Variants --- */
.big-btn.github {
  background: linear-gradient(135deg, #2b3137, #000);
  box-shadow: 0 0 25px rgba(43, 49, 55, 0.4);
}

.big-btn.robotevents {
  background: linear-gradient(135deg, #0069ff, #003d99);
  box-shadow: 0 0 25px rgba(0, 105, 255, 0.4);
}

.big-btn.linkedin {
  background: linear-gradient(135deg, #0077b5, #005582);
  box-shadow: 0 0 25px rgba(0, 119, 181, 0.4);
}

.big-btn.email {
  background: linear-gradient(135deg, #6c63ff, #4e48d3);
  box-shadow: 0 0 25px rgba(108, 99, 255, 0.4);
}

.big-btn:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 0 35px rgba(255, 255, 255, 0.25);
}

.big-btn.instagram {
  background: linear-gradient(135deg, #ff6a00, #ee0979);
  box-shadow: 0 0 25px rgba(255, 105, 180, 0.4);
}

.big-btn.instagram:hover svg {
  transform: translateY(1px) scale(1.1);
  filter: drop-shadow(0 0 8px rgba(255, 200, 200, 0.4));
}

/* --- WORLDS 2025 PAGE --- */
.center-text {
  text-align: center;
}

#preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.preview-img {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 30px auto; /* centers and adds spacing below */
  max-width: 720px;
  width: 100%;
}

.preview-img img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: block;
}

#preview p.lead {
  margin-top: 0;
  margin-bottom: 0;
  text-align: center;
}

/* ---------------------------------
   ANIMATIONS
--------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- UNIFIED VIDEO & TEXT SPACING FIX --- */

/* Reduce excessive gap before video sections */
section#video {
  padding-top: 20px !important;
  margin-top: 0 !important;
}

/* Add breathing room for Robolytics-style pages */
section#videos {
  padding-top: 60px !important;
}

/* Ensure consistent alignment between video and text blocks */
.card__media iframe,
.card__media video {
  display: block;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: top;
}

.card__media {
  margin-bottom: 0 !important;
  background: var(--card);
  border-bottom: none;
}

.card__body {
  margin-top: 0 !important;
  padding-top: 16px !important;
  background: var(--card);
}


/* --- FIX SKILLS PAGE VIDEO GAP --- */
#video iframe {
  display: block;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: top;
  line-height: 0;
}

/* --- Precise fix for the gap under standalone video (Skills 2025 only) --- */
#video .card__media {
  aspect-ratio: auto !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

#video iframe {
  display: block;
  width: 100%;
  height: 500px;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0;
}

#video .card__body {
  margin-top: 0 !important;
  padding-top: 10px !important;
}

/* --- Consistent Hover Animation for Worlds 2025 Card --- */
.card.highlight {
  transform: translateY(0); /* same baseline as others */
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card.highlight:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}

html, body {
  background-color: var(--background, #0e0e0e); /* or whatever your hero bg color is */
  overscroll-behavior: none; /* disables the bounce glow on Safari/iOS */
}

/* Hide scrollbar but keep scroll functionality */
html {
  scrollbar-width: none; /* Firefox */
}

html::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

.top-crop {
  object-fit: cover;
  object-position: top;
}

/* Full-width highlight image */
.highlight-image img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover glow (same as .card highlight effect) */
.highlight-image img:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

/* Figcaption inherits site typography */
.highlight-image figcaption {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* --- Worlds 2025 Highlighted Image (reuses .card.highlight styles) --- */
.highlight-image {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  background: var(--card);
}

.highlight-image:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}

.highlight-image img {
  width: 100%;
  display: block;
  border-radius: 0;
  object-fit: cover;
}