/* ==========================================================================
   Comunidade de Construção Digital
   Linguagem visual alinhada com Iscte-Sintra / Iscte-Meta Digital
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f4f2;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5a5f69;
  --line: #e4e2de;
  --line-strong: #cfccc6;
  --ink: #0a0a0a;
  --ink-contrast: #ffffff;
  --blue: #0d28c2;
  --cyan: #00a7e1;
  --cyan-dark: #0086b8;
  --hero-bg: #0a0f1f;
  --hero-text: #ffffff;
  --hero-muted: #b9c1d4;
  --header-bg: rgba(255, 255, 255, 0.92);
  --radius: 4px;
  --radius-pill: 999px;
  --shadow-hover: 0 14px 30px rgba(10, 15, 31, 0.08);
  --container: 1200px;
  color-scheme: light;
}

[data-theme='dark'] {
  --bg: #0c0f16;
  --bg-alt: #121722;
  --surface: #151b27;
  --text: #eef1f6;
  --muted: #a3abba;
  --line: #242c3b;
  --line-strong: #34405a;
  --ink: #ffffff;
  --ink-contrast: #0a0a0a;
  --cyan: #29bdf0;
  --cyan-dark: #29bdf0;
  --hero-bg: #070a14;
  --header-bg: rgba(12, 15, 22, 0.9);
  --shadow-hover: 0 14px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: 'Montserrat', 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
}

p {
  margin: 0;
  color: var(--muted);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.container {
  width: min(var(--container), calc(100% - 3rem));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--ink-contrast);
  padding: 0.6rem 1rem;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

.dash {
  color: var(--cyan);
  font-weight: 800;
  margin-right: 0.15em;
}

.logo-dark {
  display: none;
}

[data-theme='dark'] .logo-light {
  display: none;
}

[data-theme='dark'] .logo-dark {
  display: block;
}

/* ---------- Cabeçalho ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s ease;
}

.site-header.scrolled {
  box-shadow: 0 6px 20px rgba(10, 15, 31, 0.06);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  height: 30px;
  width: auto;
}

.brand-divider {
  width: 1px;
  height: 26px;
  background: var(--line-strong);
}

.brand-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
}

.menu a {
  position: relative;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.35rem 0;
}

.menu a:not(.menu-cta)::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.menu a:not(.menu-cta):hover::after,
.menu a.active::after {
  transform: scaleX(1);
}

.menu .menu-cta {
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--ink-contrast);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.menu .menu-cta:hover {
  background: var(--cyan);
  color: #ffffff;
}

/* Submenu */

.menu-item {
  position: relative;
  display: flex;
  align-self: stretch;
  align-items: center;
}

.menu-item > a {
  display: inline-flex;
  align-items: center;
}

.submenu {
  position: absolute;
  top: 100%;
  left: -1rem;
  min-width: 250px;
  padding: 0.4rem 0;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 16px 34px rgba(10, 15, 31, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 60;
}

.submenu a {
  display: block;
  padding: 0.65rem 1.1rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  border-left: 2px solid transparent;
}

.submenu a::after {
  display: none;
}

.submenu a:hover,
.submenu a:focus-visible {
  background: var(--bg-alt);
  border-left-color: var(--cyan);
  color: var(--cyan-dark);
}

.menu-item:hover .submenu,
.menu-item:focus-within .submenu,
.menu-item.open .submenu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.menu-item:hover .ico-chevron,
.menu-item:focus-within .ico-chevron,
.menu-item.open .ico-chevron {
  transform: rotate(180deg);
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--bg-alt);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sun {
  display: none;
}

[data-theme='dark'] .icon-sun {
  display: block;
}

[data-theme='dark'] .icon-moon {
  display: none;
}

.menu-toggle {
  display: none;
}

/* ---------- Ícones (SVG em máscara, para não virarem emoji no telemóvel) ---------- */

.ico {
  display: inline-block;
  width: 0.72em;
  height: 0.72em;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.ico-ext {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 11L11 5M5.6 5H11v5.4' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 11L11 5M5.6 5H11v5.4' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.ico-arrow {
  width: 0.9em;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.ico-chevron {
  width: 0.62em;
  height: 0.62em;
  margin-left: 0.3em;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transition: transform 0.2s ease;
}

.ico-up {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 13V3M4 7l4-4 4 4' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 13V3M4 7l4-4 4 4' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.link-arrow .ico,
.site-footer .ico {
  margin-left: 0.15em;
  vertical-align: -0.03em;
}

/* ---------- Botões e links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

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

.btn-primary {
  background: var(--cyan);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--cyan-dark);
}

[data-theme='dark'] .btn-primary {
  color: #041018;
}

[data-theme='dark'] .btn-primary:hover {
  background: #5fd0f5;
}

.btn-dark {
  background: var(--ink);
  color: var(--ink-contrast);
}

.btn-dark:hover {
  background: var(--cyan);
  color: #ffffff;
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
}

.btn-outline-light:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-lg {
  padding: 1rem 1.8rem;
  font-size: 1rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1.5px solid var(--cyan);
  padding-bottom: 2px;
}

.link-arrow.light {
  color: #ffffff;
}

.link-arrow:hover {
  color: var(--cyan);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: min(600px, calc(100vh - 76px - 215px));
  background:
    radial-gradient(900px 480px at 85% 10%, rgba(0, 167, 225, 0.22), transparent 60%),
    radial-gradient(700px 420px at 10% 100%, rgba(13, 40, 194, 0.35), transparent 60%),
    var(--hero-bg);
  color: var(--hero-text);
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(4.5rem, 8vw, 7rem);
  clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(115deg, transparent 20%, #000 75%);
  -webkit-mask-image: linear-gradient(115deg, transparent 20%, #000 75%);
}

.hero-content {
  position: relative;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hero-muted);
}

.hero h1 {
  display: flex;
  flex-direction: column;
  color: var(--hero-text);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin: 0.9rem 0 1.2rem;
}

.h1-brand {
  font-size: clamp(2.4rem, 6.4vw, 5rem);
}

.h1-accent {
  color: var(--cyan);
}

.h1-tail {
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--hero-muted);
  margin-top: 0.55rem;
}

.hero .lead {
  color: var(--hero-muted);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2.2rem;
}

/* ---------- Números ---------- */

.stats-band {
  position: relative;
  z-index: 2;
  padding: clamp(1.2rem, 2.6vw, 2rem) 0 clamp(0.8rem, 1.6vw, 1.2rem);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.stat {
  position: relative;
  padding: 0.6rem 2rem 0.6rem 0;
}

.stat + .stat {
  padding-left: 2rem;
  border-left: 1px solid var(--line);
}

.stat strong {
  display: block;
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat strong::after {
  content: '';
  display: block;
  width: 34px;
  height: 3px;
  margin: 0.9rem 0 0.8rem;
  background: var(--cyan);
  transition: width 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.stat:hover strong::after {
  width: 64px;
}

.stat span {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Secções ---------- */

.section {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem 3rem;
  flex-wrap: wrap;
  margin-bottom: 2.6rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.section h2,
.contact h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 700;
}

.section-head p {
  max-width: 44ch;
}

/* Programas */

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

.program {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 2.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.program:hover {
  border-top-color: var(--cyan);
  box-shadow: var(--shadow-hover);
}

.program-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 600;
}

.tag {
  color: var(--cyan-dark);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.code {
  color: var(--muted);
}

.program h3 {
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 700;
}

.checks {
  list-style: none;
  margin: 0.2rem 0 0.6rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.checks li {
  position: relative;
  padding-left: 1.7rem;
  font-weight: 500;
  font-size: 0.95rem;
}

.checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cyan)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 100% no-repeat;
}

.program .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* Cartões de especialização */

.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.card {
  position: relative;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card::before {
  content: '';
  position: absolute;
  left: -1px;
  top: -1px;
  width: 48px;
  height: 3px;
  background: var(--cyan);
  transition: width 0.3s ease;
}

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

.card:hover::before {
  width: calc(100% + 2px);
}

.card-num {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
}

/* Carrossel de destaques */

.carousel-nav {
  display: flex;
  gap: 0.5rem;
}

.carousel {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}

.carousel-track {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.slide {
  flex: 0 0 100%;
  min-width: 0;
}

.slide-inner {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 340px;
}

.slide-media {
  overflow: hidden;
  background: var(--hero-bg);
}

.slide-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  padding: clamp(1.5rem, 3vw, 2.6rem);
}

.slide-body h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  font-weight: 700;
}

.slide-body .link-arrow {
  margin-top: auto;
}

.carousel-dots {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.carousel-dots button {
  width: 30px;
  height: 4px;
  padding: 0;
  border: 0;
  background: var(--line-strong);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.carousel-dots button[aria-selected='true'] {
  background: var(--cyan);
}

/* Notícias */

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.news-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.news-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

.news-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--hero-bg);
}

.news-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 1.5rem;
  flex: 1;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.news-meta time {
  color: var(--muted);
}

.news-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.news-body .link-arrow {
  margin-top: auto;
}

/* Fórum e trabalhos futuros */

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 6vw, 5rem);
}

.lead-sm {
  margin: 1.2rem 0 1.8rem;
  font-size: 1.08rem;
  max-width: 46ch;
}

.pill-wrap {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.pill {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.pill:hover {
  border-color: var(--cyan);
  color: var(--cyan-dark);
}

.roadmap ol {
  list-style: none;
  counter-reset: step;
  margin: 1.4rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.roadmap li {
  counter-increment: step;
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.roadmap li::before {
  content: counter(step, decimal-leading-zero);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cyan-dark);
  min-width: 1.6rem;
}

/* Formadores */

.teachers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.teacher {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.teacher:hover {
  border-top-color: var(--cyan);
  box-shadow: var(--shadow-hover);
}

.teacher-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  transition: filter 0.3s ease;
}

.teacher-photo:not([src$='.svg']) {
  filter: grayscale(1);
}

.teacher:hover .teacher-photo {
  filter: none;
}

.teacher-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 1.4rem;
  flex: 1;
}

.teacher-body .link-arrow {
  margin-top: auto;
  padding-top: 0.3rem;
}

.teacher h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.teacher-role {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--cyan-dark);
}

.teacher p {
  font-size: 0.88rem;
  line-height: 1.55;
}

/* Parceiros e instituições: filas de logótipos */

.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: center;
  gap: 1.5rem;
}

.logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 104px;
  padding: 0.5rem 0;
  transition: transform 0.25s ease;
}

.logo-link img {
  max-height: 74px;
  max-width: 260px;
  width: auto;
  object-fit: contain;
  filter: grayscale(1) brightness(0.72) contrast(1.1);
  transition: filter 0.3s ease;
}

.logo-link:hover {
  transform: translateY(-3px);
}

.logo-link:hover img,
.logo-link:focus-visible img {
  filter: none;
}

[data-theme='dark'] .logo-link img {
  filter: brightness(0) invert(1) opacity(0.85);
}

[data-theme='dark'] .logo-link:hover img,
[data-theme='dark'] .logo-link:focus-visible img {
  filter: brightness(0) invert(1);
}

@media (max-width: 600px) {
  .logo-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .logo-link {
    min-height: 84px;
  }

  .logo-link img {
    max-height: 58px;
    max-width: 200px;
  }
}

/* Contacto */

.contact {
  background: var(--hero-bg);
  background-image: radial-gradient(600px 300px at 90% 0%, rgba(0, 167, 225, 0.2), transparent 60%);
  padding: clamp(3.5rem, 7vw, 5.5rem) 0;
}

.contact-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.contact h2 {
  color: #ffffff;
}

.contact p {
  color: var(--hero-muted);
  margin-top: 0.8rem;
  font-size: 1.05rem;
}

.contact .contact-places {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7f8aa3;
}

/* Logótipos */

.logos-band {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--line);
}

.logos-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}






/* ---------- Rodapé ---------- */

.site-footer {
  background: #07090f;
  color: #a3abba;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 2.5rem;
  padding: 4rem 0 3rem;
}

.footer-brand img {
  height: 30px;
  width: auto;
  margin-bottom: 1.2rem;
}

.footer-brand p {
  color: #a3abba;
  max-width: 34ch;
}

.site-footer h3 {
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.footer-grid > div,
.footer-grid > nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.site-footer a {
  text-decoration: none;
  color: #d6dbe5;
  width: fit-content;
}

.site-footer a:hover {
  color: var(--cyan);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.4rem 0 1.8rem;
  border-top: 1px solid #1c2230;
  font-size: 0.8rem;
}

/* ---------- Animações ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .carousel-track {
    transition: none !important;
  }
}

/* ---------- Responsivo ---------- */

@media (max-width: 1024px) {
  .menu {
    gap: 1.4rem;
  }

  .cards-3,
  .news-grid,
  .teachers {
    grid-template-columns: 1fr 1fr;
  }

  .slide-inner {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .slide-media {
    aspect-ratio: 16 / 7;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .menu-toggle {
    display: inline-grid;
  }

  .nav-tools {
    margin-left: auto;
  }

  .menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0.5rem 1.5rem 1.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 30px rgba(10, 15, 31, 0.08);
  }

  .menu.open {
    display: flex;
  }

  .menu-item {
    flex-direction: column;
    align-items: stretch;
  }

  .submenu {
    position: static;
    min-width: 0;
    padding: 0 0 0.6rem;
    border: 0;
    box-shadow: none;
    background: transparent;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .submenu a {
    padding: 0.55rem 0 0.55rem 1.1rem;
    border-bottom: 0;
    border-left: 2px solid var(--line);
    font-weight: 500;
    font-size: 0.95rem;
  }

  .submenu a:hover,
  .submenu a:focus-visible {
    background: transparent;
  }

  .menu-item > a {
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--line);
  }

  .ico-chevron {
    display: none;
  }

  .menu a {
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }

  .menu a:not(.menu-cta)::after {
    display: none;
  }

  .menu .menu-cta {
    margin-top: 1rem;
    text-align: center;
    border-bottom: 0;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 0;
  }

  .stat:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .programs,
  .split,
  .news-grid {
    grid-template-columns: 1fr;
  }

  .slide-media {
    aspect-ratio: 16 / 9;
  }

}

@media (max-width: 600px) {
  .container {
    width: calc(100% - 2rem);
  }

  .nav {
    min-height: 64px;
    gap: 1rem;
  }

  .brand-logo {
    height: 24px;
  }

  .brand-divider,
  .brand-label {
    display: none;
  }

  .hero {
    min-height: calc(100vh - 64px - 290px);
    padding: 2rem 0 3.5rem;
    clip-path: polygon(0 0, 100% 0, 100% 94%, 0 100%);
  }

  .hero .lead {
    font-size: 0.95rem;
  }

  .hero-actions {
    margin-top: 1.6rem;
  }

  .stat strong {
    font-size: 2rem;
  }

  .stat strong::after {
    margin: 0.6rem 0 0.5rem;
  }

  .stat span {
    font-size: 0.82rem;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat,
  .stat + .stat {
    padding: 0.4rem 1rem 0.4rem 0;
  }

  .stat:nth-child(2n) {
    padding-left: 1.2rem;
  }

  .program,
  .card {
    padding: 1.5rem;
  }

  .teacher-body {
    padding: 1.2rem;
  }

  .cards-3 {
    grid-template-columns: 1fr;
  }

  .carousel-dots button {
    flex: 1;
  }

  .card-num {
    margin-bottom: 1.2rem;
  }

  .contact .btn-lg {
    width: 100%;
    justify-content: center;
    font-size: 0.92rem;
    padding: 1rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Ecrãs baixos: hero mais compacto para os números caberem sem scroll */
@media (min-width: 601px) and (max-height: 860px) {
  .hero {
    min-height: 0;
    padding: 1.8rem 0 3.4rem;
  }

  .h1-brand {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
  }

  .h1-tail {
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  }

  .hero .lead {
    font-size: 0.95rem;
  }

  .hero-actions {
    margin-top: 1.5rem;
  }

  .stat strong {
    font-size: 2.3rem;
  }
}

/* Páginas interiores */

.hero-sm {
  min-height: 0;
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(4rem, 7vw, 6rem);
}

.hero-sm .h1-brand {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.hero-sm .lead {
  margin-top: 1rem;
  max-width: 52ch;
}

.roadmap-list {
  list-style: none;
  counter-reset: step;
  margin: 1.4rem 0 1.8rem;
  padding: 0;
  border-top: 1px solid var(--line);
}

.roadmap-list li {
  counter-increment: step;
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.95rem;
}

.roadmap-list li::before {
  content: counter(step, decimal-leading-zero);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cyan-dark);
  min-width: 1.6rem;
}

.card .link-arrow {
  margin-top: 1rem;
}
