/* ============================================================
   IoT Mushroom — Premium Minimal Stylesheet
   ============================================================ */

/* --- Custom Properties --------------------------------------- */
:root {
  --bg:            #0a0f1a;
  --surface:       rgba(255,255,255,0.05);
  --surface-hover: rgba(255,255,255,0.08);
  --border:        rgba(255,255,255,0.09);
  --border-hover:  rgba(94,234,212,0.35);
  --text:          #e8ecf4;
  --muted:         #8b95a8;
  --accent:        #5eead4;
  --accent-dim:    rgba(94,234,212,0.12);
  --shadow:        0 4px 32px rgba(0,0,0,0.45);
  --radius:        14px;
  --max-w:         960px;
  --transition:    0.25s ease;
}

/* --- Reset & Base ------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); margin-bottom: 1rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }

p { color: var(--muted); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.75; }

ul, ol { padding-left: 1.5rem; color: var(--muted); }
li { margin-bottom: 0.35rem; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* --- Layout ------------------------------------------------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 4rem 0;
}

/* --- Navbar ------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,15,26,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  opacity: 1;
}

/* --- Hero --------------------------------------------------- */
.hero {
  padding: 6rem 0 4rem;
  text-align: center;
}

.hero h1 {
  margin-bottom: 1.5rem;
}

.hero .subtitle {
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto 2rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.badges img {
  height: 26px;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

/* --- Buttons ----------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 1;
}

.btn-primary {
  background: var(--accent);
  color: #0a0f1a;
}

.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(94,234,212,0.3);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

/* --- Cards -------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.card h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.9rem;
}

.card a.card-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

/* --- Grid --------------------------------------------------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* --- Section heading ---------------------------------------- */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* --- Tables ------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-weight: 600;
  text-align: left;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 0.75rem 1.25rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* --- Gallery ----------------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}

figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform var(--transition), border-color var(--transition);
}

figure:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
}

figure img {
  width: 100%;
  display: block;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: rgba(255,255,255,0.03);
}

figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

/* --- Placeholder image ------------------------------------- */
.img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.02),
    rgba(255,255,255,0.02) 10px,
    transparent 10px,
    transparent 20px
  );
  color: var(--muted);
  font-size: 0.85rem;
  gap: 0.5rem;
  border-radius: var(--radius) var(--radius) 0 0;
}

.img-placeholder .placeholder-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

.sdg-logo-placeholder {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.85rem;
  gap: 0.5rem;
  text-align: center;
  padding: 2rem;
}

.sdg-logo-placeholder .placeholder-icon {
  font-size: 3rem;
  opacity: 0.4;
}

.team-photo-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.85rem;
  gap: 0.5rem;
  text-align: center;
  padding: 2rem;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.02),
    rgba(255,255,255,0.02) 10px,
    transparent 10px,
    transparent 20px
  );
}

.team-photo-placeholder .placeholder-icon {
  font-size: 3rem;
  opacity: 0.4;
}

/* --- Team cards -------------------------------------------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  text-align: center;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.member-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.avatar {
  width: 400px;
  height: 400px;
  border-radius: 12px;
  background: var(--accent-dim);
  border: 2px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 auto 1rem;
  letter-spacing: 0;
}

.member-card h3 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.member-card p {
  font-size: 0.8rem;
  margin: 0;
}

.member-card .member-photo {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--border-hover);
  display: block;
  margin: 0 auto 1rem;
}

.member-card .avatar-fallback {
  display: none;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.contact-links a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: color var(--transition);
}

.contact-links a:hover {
  color: var(--accent);
}

/* --- SDG items --------------------------------------------- */
.sdg-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
  list-style: none;
  padding: 0;
}

.sdg-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.sdg-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.sdg-item .sdg-emoji {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.sdg-item .sdg-logo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.sdg-item h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.sdg-item p {
  font-size: 0.82rem;
  margin: 0;
}

/* --- Docs content ------------------------------------------ */
.docs-section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

.docs-section:last-of-type {
  border-bottom: none;
}

.docs-section h2 {
  margin-bottom: 1.25rem;
}

.docs-section ul {
  margin-top: 0.5rem;
}

/* --- Footer ------------------------------------------------ */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  text-align: center;
}

footer p {
  font-size: 0.85rem;
  margin: 0;
}

/* --- Accent text ------------------------------------------- */
.accent { color: var(--accent); }

/* --- Responsive -------------------------------------------- */
@media (max-width: 768px) {
  .grid-3  { grid-template-columns: 1fr; }
  .grid-2  { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: 1fr; }
  .sdg-list { grid-template-columns: 1fr; }

  .nav-links {
    gap: 1.25rem;
  }

  .hero {
    padding: 4rem 0 3rem;
  }

  section {
    padding: 3rem 0;
  }

  .avatar {
    width: 90px;
    height: 90px;
    font-size: 1.8rem;
  }

  .team-photo-placeholder {
    min-height: 300px;
  }
}

@media (max-width: 480px) {
  .team-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 1rem; }
  .cta-group { flex-direction: column; align-items: center; }
}

/* --- Print ------------------------------------------------- */
@media print {
  header, .cta-group { display: none; }
  body { background: white; color: #111; }
  .card, .member-card { border: 1px solid #ddd; }
}

/* --- Standardize Image Holders to Normal Size ----------------- */
.member-card .member-photo,
.avatar,
.sdg-logo-img,
.img-placeholder,
.sdg-logo-placeholder,
.team-photo-placeholder,
.sdg-item .sdg-logo {
    width: 150px;
    height: 150px;
    aspect-ratio: 1;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    margin: 0 auto 1rem;
}