/* =========================================================
   Curso HTML & CSS — Design System v2
   Paleta de cores frias (azul / ciano / índigo / slate)
   Autor: Enzo Pontes
========================================================= */

:root {
  --bg: #070c18;
  --bg-soft: #0c1526;
  --surface: #111c33;
  --surface-2: #17233f;
  --border: #24314f;
  --border-soft: #1b2740;

  --text: #eaf1fb;
  --text-soft: #a9b8d6;
  --text-mute: #6a7aa0;

  --cyan: #38bdf8;
  --blue: #4f83ff;
  --indigo: #7c8cff;
  --teal: #2dd4bf;
  --violet: #a78bfa;

  --accent: var(--cyan);

  --grad: linear-gradient(135deg, #38bdf8 0%, #4f83ff 45%, #7c8cff 100%);
  --grad-teal: linear-gradient(135deg, #2dd4bf 0%, #38bdf8 100%);
  --glow:
    0 0 0 1px rgba(56, 189, 248, 0.25),
    0 18px 50px -12px rgba(56, 189, 248, 0.4);

  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 24px 55px -24px rgba(2, 8, 23, 0.95);

  --maxw: 1200px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Space Grotesk", var(--font);
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- Fundo animado (orbs) ---------- */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}
.orb.o1 {
  width: 520px;
  height: 520px;
  background: #1d4ed8;
  top: -160px;
  left: -120px;
  animation: float1 18s ease-in-out infinite;
}
.orb.o2 {
  width: 440px;
  height: 440px;
  background: #0e7490;
  top: 10%;
  right: -140px;
  animation: float2 22s ease-in-out infinite;
}
.orb.o3 {
  width: 400px;
  height: 400px;
  background: #6d28d9;
  bottom: -160px;
  left: 30%;
  animation: float1 26s ease-in-out infinite reverse;
}
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 255, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(
    circle at 50% 0%,
    #000 0%,
    transparent 75%
  );
}
@keyframes float1 {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(40px, 50px);
  }
}
@keyframes float2 {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-50px, 40px);
  }
}

/* ---------- Spotlight do cursor ---------- */
.spotlight {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  z-index: 0;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.1), transparent 65%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity 0.3s;
  opacity: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(7, 12, 24, 0.55);
  border-bottom: 1px solid transparent;
  transition: 0.3s;
}
.site-header.scrolled {
  background: rgba(7, 12, 24, 0.85);
  border-bottom-color: var(--border-soft);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-family: var(--display);
}
.brand .logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--grad);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  color: #051023;
  box-shadow: var(--glow);
}
.brand small {
  display: block;
  font-weight: 500;
  color: var(--text-mute);
  font-size: 12px;
  font-family: var(--font);
}
.nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav a {
  padding: 8px 15px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-soft);
  transition: 0.2s;
}
.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}
.nav a.gh {
  color: var(--accent);
}
@media (max-width: 780px) {
  .nav a:not(.gh) {
    display: none;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 84px 0 70px;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 940px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(17, 28, 51, 0.6);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}
.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 12px var(--teal);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.3rem, 5.2vw, 3.9rem);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -1.5px;
}
.hero h1 .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  margin-top: 22px;
  font-size: clamp(1rem, 2vw, 1.18rem);
  color: var(--text-soft);
  max-width: 52ch;
}
.hero .cta {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  transition: 0.22s;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn i {
  font-size: 14px;
}
.btn-primary {
  background: var(--grad);
  color: #051023;
  box-shadow: var(--glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}
.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: rgba(17, 28, 51, 0.5);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.stats {
  display: flex;
  gap: 38px;
  margin-top: 52px;
  flex-wrap: wrap;
}
.stats .stat .num {
  font-family: var(--display);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -1px;
  background: var(--grad-teal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stats .stat .label {
  color: var(--text-mute);
  font-size: 13.5px;
}

/* ---------- Hero visual (browser mockup) ---------- */
.hero-visual {
  position: relative;
  perspective: 1200px;
}
.mockup {
  position: relative;
  z-index: 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow:
    0 40px 90px -30px rgba(2, 8, 23, 1),
    var(--glow);
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
}
.mockup .bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 15px;
  background: #0d1729;
  border-bottom: 1px solid var(--border);
}
.mockup .bar .dots {
  display: flex;
  gap: 6px;
}
.mockup .bar .dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.mockup .bar .dots span:nth-child(1) {
  background: #ff5f57;
}
.mockup .bar .dots span:nth-child(2) {
  background: #febc2e;
}
.mockup .bar .dots span:nth-child(3) {
  background: #28c840;
}
.mockup .bar .url {
  flex: 1;
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-mute);
  background: #060c18;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  white-space: nowrap;
}
.mockup .url i {
  color: var(--teal);
  font-size: 10px;
}
.mockup .screen {
  position: relative;
  aspect-ratio: 1280 / 720;
  background: #060c18;
}
.mockup .screen .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 0.7s,
    transform 0.7s;
}
.mockup .screen .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.mockup .screen .slide.active {
  opacity: 1;
  transform: scale(1);
}
.mockup .screen .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 18px 14px;
  background: linear-gradient(transparent, rgba(6, 12, 24, 0.92));
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.mockup .screen .caption i {
  color: var(--accent);
}

.dots-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
.dots-nav button {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  background: var(--border);
  cursor: pointer;
  transition: 0.25s;
  padding: 0;
}
.dots-nav button.active {
  width: 26px;
  background: var(--accent);
}

/* badges flutuantes */
.floaty {
  position: absolute;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(17, 28, 51, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.floaty i {
  font-size: 18px;
}
.floaty.f1 {
  top: -20px;
  right: -12px;
  animation: bob 5s ease-in-out infinite;
}
.floaty.f2 {
  bottom: 24px;
  left: -26px;
  animation: bob 6s ease-in-out infinite 0.6s;
}
.floaty.f3 {
  top: 44%;
  right: -22px;
  animation: bob 7s ease-in-out infinite 1.2s;
}
.floaty .fa-html5 {
  color: #e34f26;
}
.floaty .fa-css3-alt {
  color: #2965f1;
}
.floaty .fa-js {
  color: #f7df1e;
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}
@media (max-width: 940px) {
  .floaty {
    display: none;
  }
}

/* ---------- Sections ---------- */
section.block {
  position: relative;
  padding: 66px 0;
  z-index: 1;
}
.section-head {
  margin-bottom: 38px;
}
.section-head .kicker {
  color: var(--accent);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.section-head h2 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.8px;
  margin-top: 10px;
}
.section-head p {
  color: var(--text-soft);
  margin-top: 10px;
  max-width: 62ch;
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  gap: 24px;
}
.grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 940px) {
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }
}

/* Card base */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition:
    transform 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
  box-shadow: var(--shadow);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: 0.25s;
  z-index: 2;
}
.card:hover {
  transform: translateY(-7px);
  border-color: transparent;
  box-shadow: 0 30px 60px -25px rgba(56, 189, 248, 0.35);
}
.card:hover::before {
  opacity: 1;
}

/* Card de projeto (com thumbnail) */
.project-card .thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #060c18;
}
.project-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.5s;
}
.project-card:hover .thumb img {
  transform: scale(1.07);
}
.project-card .thumb .overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    180deg,
    rgba(7, 12, 24, 0.1),
    rgba(7, 12, 24, 0.75)
  );
  opacity: 0;
  transition: 0.3s;
}
.project-card:hover .thumb .overlay {
  opacity: 1;
}
.project-card .thumb .overlay .view {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--grad);
  color: #051023;
  font-weight: 700;
  font-size: 14px;
  transform: translateY(10px);
  transition: 0.3s;
}
.project-card:hover .thumb .overlay .view {
  transform: translateY(0);
}
.project-card .body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.project-card .cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
}
.project-card h3 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
}
.project-card p {
  color: var(--text-soft);
  font-size: 14px;
}

/* Card de módulo/desafio (ícone) */
.icon-card {
  padding: 28px;
}
.icon-card .icon {
  width: 56px;
  height: 56px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 24px;
  margin-bottom: 20px;
  color: var(--accent);
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.16),
    rgba(124, 140, 255, 0.1)
  );
  border: 1px solid var(--border);
}
.icon-card .tag {
  align-self: flex-start;
  margin-bottom: 13px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 4px 11px;
  border-radius: 999px;
}
.icon-card h3 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.icon-card p {
  color: var(--text-soft);
  font-size: 14.5px;
  margin-top: 9px;
  flex-grow: 1;
}
.icon-card .go {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}
.icon-card .go i {
  transition: transform 0.2s;
}
.icon-card:hover .go i {
  transform: translateX(5px);
}

/* ---------- Lista de exercícios (páginas de módulo) ---------- */
.ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.ex-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  transition: 0.2s;
}
.ex-item:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  background: var(--surface-2);
}
.ex-item .num {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}
.ex-item .name {
  font-weight: 600;
}
.ex-item .desc {
  font-size: 13px;
  color: var(--text-mute);
}

/* ---------- Breadcrumb ---------- */
.crumb {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text-mute);
  font-size: 14px;
  margin-bottom: 10px;
}
.crumb a:hover {
  color: var(--accent);
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-soft);
  margin-top: 40px;
  padding: 44px 0;
  color: var(--text-mute);
  font-size: 14px;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.site-footer a {
  color: var(--text-soft);
}
.site-footer a:hover {
  color: var(--accent);
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--grad);
  color: #051023;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  box-shadow: var(--glow);
  opacity: 0;
  transform: translateY(20px);
  transition: 0.3s;
  z-index: 60;
}
.to-top.show {
  opacity: 1;
  transform: translateY(0);
}
.to-top:hover {
  transform: translateY(-3px);
}

/* ---------- Reveal ---------- */
.reveal-init {
  opacity: 0;
  transform: translateY(24px);
}
.reveal-in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  .reveal-init {
    opacity: 1;
    transform: none;
  }
}
