/* ============================================
   Team Portfolio — dark tech theme
   Pure CSS3, no JavaScript
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  /* Color palette */
  --color-bg: #060a12;
  --color-bg-alt: #0a0f1c;
  --color-card: #0d1526;
  --color-border: #1b2740;
  --color-accent: #4fd8ff;
  --color-accent-2: #8b6bff;
  --color-text: #e9eefb;
  --color-text-muted: #92a1c2;

  --font-display: 'IBM Plex Mono', monospace;
  --font-body: 'Inter', sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(79, 216, 255, 0.06), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(139, 107, 255, 0.06), transparent 40%);
  color: var(--color-text);
  line-height: 1.65;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: var(--color-text);
}

h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin-bottom: var(--space-sm);
  text-shadow: 0 0 18px rgba(79, 216, 255, 0.35);
}
h3 { font-size: 1.1rem; }

p { color: var(--color-text-muted); max-width: 62ch; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 var(--space-md); }

/* ---------- Header / nav ---------- */
header.site-header {
  background-color: rgba(6, 10, 18, 0.9);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  max-width: 1140px;
  margin: 0 auto;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-text);
}
.brand span { color: var(--color-accent); }

nav ul { display: flex; gap: var(--space-md); flex-wrap: wrap; }

nav a {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  padding: var(--space-xs) 0;
  transition: color 0.2s ease, border-color 0.2s ease;
}
nav a:hover, nav a:focus-visible {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-lg) var(--space-md);
  max-width: 800px;
  margin: 0 auto;
}
.hero h1 { text-shadow: 0 0 26px rgba(79, 216, 255, 0.45); }
.hero p.lede { margin: var(--space-sm) auto 0; }
.home-page { overflow: hidden; }
.home-page .hero { max-width: 100%; }
.home-page .btn {
  min-width: 0;
  align-self: center;
}

.page-back {
  display: inline-block;
  margin-bottom: var(--space-md);
  color: var(--color-text-muted);
  transition: color 0.2s ease, transform 0.2s ease;
}
.page-back:hover {
  color: var(--color-accent);
  transform: translateX(-3px);
}

.hero-split {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-xl) var(--space-md);
  max-width: 1140px;
  margin: 0 auto;
}
.hero-split-text,
.hero-split-image {
  min-width: 0;
  flex: 1 1 0;
}
.hero-split-image img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: 0 0 40px rgba(79, 216, 255, 0.15);
}

.btn {
  display: inline-block;
  margin-top: var(--space-md);
  padding: 0.75rem 1.6rem;
  background-color: var(--color-accent);
  color: #04121c;
  border-radius: var(--radius);
  font-weight: 600;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.btn:hover { box-shadow: 0 0 24px rgba(79, 216, 255, 0.5); transform: translateY(-2px); }

.btn-ghost {
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
}
.btn-ghost:hover { border-color: var(--color-accent); box-shadow: 0 0 18px rgba(79, 216, 255, 0.25); }

/* ---------- Section base ---------- */
section { padding: var(--space-lg) var(--space-md); max-width: 1140px; margin: 0 auto; }
section.alt-bg { background-color: var(--color-bg-alt); max-width: none; }
section.alt-bg > .container { padding: var(--space-lg) 0; }
.section-intro { max-width: 68ch; margin-bottom: var(--space-md); color: var(--color-text-muted); }

/* ---------- Member grid (hoverable team cards) ---------- */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}

.member-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
  text-align: center;
  display: block;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.member-card img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto var(--space-sm);
  border: 2px solid var(--color-border);
  transition: border-color 0.25s ease;
}

.member-card h3 { font-size: 1rem; }
.member-card h2 { font-size: 1.5rem; }
.member-card .role { color: var(--color-accent); font-size: 0.85rem; margin-top: 0.2rem; }

.member-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-accent);
  box-shadow: 0 0 26px rgba(79, 216, 255, 0.25);
}
.member-card:hover img { border-color: var(--color-accent); }

/* ---------- Card grid (achievements / projects) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

/* If 3 or fewer cards, use 2-column layout with scaling */
.card-grid:has(> .info-card:nth-child(n+4)) {
  grid-template-columns: repeat(3, 1fr);
}

.card-grid:not(:has(> .info-card:nth-child(4))) {
  grid-template-columns: repeat(2, 1fr);
}

.info-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* Scale middle card when 3 or fewer cards */
.card-grid:not(:has(> .info-card:nth-child(4))) .info-card:nth-child(2) {
  transform: scale(1.1);
  transform-origin: center;
}

.card-grid:not(:has(> .info-card:nth-child(4))) .info-card:nth-child(2) img { 
  height: 200px; 
}

.info-card img { height: 170px; width: 100%; object-fit: cover; }
.image-trigger {
  display: block;
  cursor: zoom-in;
}
.image-trigger:hover img,
.image-trigger:focus-visible img {
  filter: brightness(1.15);
  outline: none;
  box-shadow: none;
}
.info-card .info-card-body { padding: var(--space-sm); }
.info-card:hover {
  border-color: var(--color-accent-2);
  box-shadow: 0 0 22px rgba(139, 107, 255, 0.25);
  transform: translateY(-4px);
}

.image-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: var(--space-md);
  background: rgba(6, 10, 18, 0.94);
  overflow-y: auto;
}
.image-modal:target {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.image-modal-content {
  position: relative;
  width: min(100%, 760px);
  margin: auto;
  padding: var(--space-md);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  box-shadow: 0 0 36px rgba(79, 216, 255, 0.25);
}
.image-modal-content h2 {
  padding-right: var(--space-lg);
  color: var(--color-accent);
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
}
.image-modal-photo {
  display: block;
  width: min(100%, 560px);
  max-height: 65vh;
  margin: 0 auto;
  object-fit: contain;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.image-modal-content h3 {
  margin-top: var(--space-md);
  color: var(--color-accent);
}
.highlight-marker {
  color: var(--color-accent);
}
.image-modal-content p {
  margin-top: var(--space-xs);
}
.image-modal-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.7rem;
  text-align: center;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.image-modal-close:hover,
.image-modal-close:focus-visible {
  background-color: var(--color-accent);
  color: var(--color-bg);
  transform: rotate(90deg);
}

/* ---------- Badge row (achievements without images) ---------- */
.badge-row { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-sm); }
.badge {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--color-accent);
  background: rgba(79, 216, 255, 0.06);
}

/* ---------- Member profile page ---------- */
.profile-hero {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
  padding: var(--space-xl) var(--space-md);
  max-width: 1140px;
  margin: 0 auto;
}
.profile-photo { flex: 0 0 220px; }
.profile-photo img {
  width: 220px; height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-accent);
  box-shadow: 0 0 40px rgba(79, 216, 255, 0.3);
}
.profile-intro { flex: 1 1 400px; }
.profile-intro .role { color: var(--color-accent); font-family: var(--font-display); font-size: 0.95rem; }

.split-block {
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
}
.split-block > div { flex: 1 1 320px; }
.project-image {
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.project-placeholder {
  min-height: 220px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(79, 216, 255, 0.08), transparent),
    var(--color-card);
  border-style: dashed;
}

.featured-project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}
.project-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.project-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 26px rgba(79, 216, 255, 0.2);
  transform: translateY(-4px);
}
.project-card > img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}
.project-card-body { padding: var(--space-md); }
.project-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
}
.project-card-heading h3 { color: var(--color-accent); }
.project-type {
  flex: 0 0 auto;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 0.75rem;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: var(--space-sm) 0;
}
.project-tags span {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  color: var(--color-accent);
  font-size: 0.75rem;
}
.project-code {
  display: block;
  padding: 0.55rem var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  text-align: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.project-code:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.project-code-disabled { color: var(--color-text-muted); }

/* ---------- Contact ---------- */
.contact-hero {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  min-height: 560px;
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}
.contact-hero-text,
.contact-hero-image {
  min-width: 0;
  flex: 1 1 0;
}
.contact-hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: var(--space-sm);
}
.contact-hero .lede {
  max-width: 58ch;
  margin-bottom: var(--space-md);
}
.contact-hero address a {
  color: var(--color-accent);
}
.contact-hero address a:hover {
  text-decoration: underline;
}
.eyebrow {
  margin-bottom: var(--space-xs);
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.contact-hero-image img {
  width: 100%;
  min-height: 380px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: 0 0 40px rgba(79, 216, 255, 0.15);
}
.member-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}
.contact-panel {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
}
.contact-panel h3 { color: var(--color-accent); margin-bottom: var(--space-sm); }
.contact-panel address { display: grid; gap: var(--space-sm); }
.contact-panel address p { margin: 0; }
.contact-panel a:not(.project-code) { color: var(--color-accent); }
.contact-panel a:not(.project-code):hover { text-decoration: underline; }

.contact-wrap { display: flex; gap: var(--space-lg); flex-wrap: wrap; }
.contact-info { flex: 1 1 300px; }
.contact-map { flex: 1 1 340px; }
.contact-map img { border-radius: var(--radius); border: 1px solid var(--color-border); }
address { font-style: normal; color: var(--color-text-muted); }

/* ---------- Footer ---------- */
footer.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-md);
  margin-top: var(--space-lg);
}
.footer-wrap {
  max-width: 1140px; margin: 0 auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-sm);
  font-size: 0.85rem; color: var(--color-text-muted);
}
.footer-wrap a:hover { color: var(--color-accent); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav-wrap { flex-direction: column; gap: var(--space-sm); }
  .hero { min-height: 100dvh; }
  .hero-split, .split-block, .contact-wrap, .profile-hero, .contact-hero { flex-direction: column; }
  .featured-project-grid { grid-template-columns: 1fr; }
  .member-contact-grid { grid-template-columns: 1fr; }
  .profile-photo img { width: 160px; height: 160px; }
}
