@import './fonts.css';

/* =========================================================================
   Cloud Practitioner Lab: design system
   Identidade própria. Azul profundo para tecnologia/navegação, laranja apenas
   como acento pontual em elementos ligados à AWS.
   ========================================================================= */

:root {
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #5b6b7f;
  --brand: #0b3a6f;
  --brand-2: #1d4ed8;
  --brand-soft: #e0ecff;
  --accent: #ed7100;
  /* Versão do laranja para TEXTO: o tom da marca não alcança 4.5:1 sobre o fundo claro. */
  --accent-strong: #94480a;
  --accent-soft: #fff1e3;
  --ok: #12805c;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #be123c;
  --danger-soft: #ffe4e6;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06), 0 1px 3px rgb(15 23 42 / 0.05);
  --shadow-md: 0 4px 12px rgb(15 23 42 / 0.07), 0 2px 4px rgb(15 23 42 / 0.04);
  --shadow-lg: 0 18px 40px rgb(15 23 42 / 0.12), 0 4px 10px rgb(15 23 42 / 0.05);
  --radius: 14px;
  --radius-lg: 20px;
  --maxw: 1200px;
  --header-h: 64px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --icon-bg: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
  }
}

:root[data-theme='dark'],
html.dark {
  --bg: #020617;
  --bg-soft: #0b1222;
  --surface: #0f172a;
  --surface-2: #131f38;
  --border: #1e293b;
  --border-strong: #334155;
  --text: #e8eef8;
  --text-soft: #cbd5e1;
  --muted: #94a3b8;
  --brand: #60a5fa;
  --brand-2: #3b82f6;
  --brand-soft: #10233f;
  --accent: #ff9d3d;
  --accent-strong: #ff9d3d;
  --accent-soft: #2a1a08;
  --ok: #4ade80;
  --ok-soft: #052e21;
  --warn: #fbbf24;
  --warn-soft: #2a2008;
  --danger: #fb7185;
  --danger-soft: #350f1b;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 6px 16px rgb(0 0 0 / 0.45);
  --shadow-lg: 0 20px 45px rgb(0 0 0 / 0.55);
  --icon-bg: #f8fafc;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1rem;
}

code,
kbd {
  font-family: var(--mono);
  font-size: 0.86em;
}

kbd {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.1em 0.42em;
  color: var(--text-soft);
}

:focus-visible {
  outline: 3px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.7rem 1.1rem;
  z-index: 100;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

/* A logo é escura: fica sobre um fundo claro para continuar legível no tema escuro. */
.brand-mark {
  display: grid;
  place-items: center;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  flex: none;
}

.brand-mark img {
  display: block;
  width: 40px;
  height: 24px;
  object-fit: contain;
}

.brand small {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1;
}

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

.nav a {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 9px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav a:hover {
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
}

.nav a[aria-current='page'] {
  color: var(--brand-2);
  background: var(--brand-soft);
  font-weight: 600;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

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

.icon-btn:active {
  transform: scale(0.95);
}

.palette-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 38px;
  padding: 0 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}

.palette-trigger:hover {
  border-color: var(--border-strong);
  color: var(--text-soft);
}

.palette-trigger kbd {
  font-size: 0.72rem;
}

.nav-toggle {
  display: none;
}

/* Entre ~940px e ~1200px os oito links da navegação não cabiam ao lado da marca
   e das ações: o cabeçalho empurrava a página. O drawer entra antes disso. */
@media (min-width: 1101px) and (max-width: 1240px) {
  .site-header .wrap {
    gap: 0.75rem;
  }

  .nav {
    gap: 0.1rem;
  }

  .nav a {
    padding-inline: 0.5rem;
    font-size: 0.88rem;
  }
}

@media (max-width: 1100px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem clamp(1rem, 4vw, 2rem) 1.2rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-130%);
    transition: transform 0.25s ease;
  }

  .nav[data-open='true'] {
    transform: translateY(0);
  }

  .nav a {
    padding: 0.7rem 0.6rem;
    font-size: 1rem;
  }

  .nav-toggle {
    display: inline-grid;
  }

  .palette-trigger kbd {
    display: none;
  }
}

@media (max-width: 720px) {
  .palette-trigger span {
    display: none;
  }
}

/* Em telas estreitas a marca fica só com o nome. */
@media (max-width: 430px) {
  .brand-text small {
    display: none;
  }

  .site-header .wrap {
    gap: 0.5rem;
  }

  .brand-text {
    font-size: 0.98rem;
  }
}

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(1100px 520px at 82% -10%, color-mix(in srgb, var(--brand-2) 16%, transparent), transparent 65%),
    radial-gradient(760px 420px at 8% 110%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    var(--bg);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(color-mix(in srgb, var(--border-strong) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--border-strong) 55%, transparent) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 72%);
  opacity: 0.5;
  pointer-events: none;
}

.hero-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.16;
  filter: saturate(0.5);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

:root[data-theme='dark'] .hero-photo {
  opacity: 0.22;
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

/*
 * Item de grid encolhe até o conteúdo por padrão (min-width:auto). Sem isto, o
 * diagrama do hero esticava a coluna e era cortado pelo overflow do .hero,
 * sem deixar rolar. Com min-width:0 a coluna cede e o próprio diagrama rola.
 */
.hero .wrap > * {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-2);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand-2) 22%, transparent);
  padding: 0.34rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1.2rem;
}

.hero-lead {
  font-size: clamp(1.02rem, 0.95rem + 0.4vw, 1.22rem);
  color: var(--text-soft);
  max-width: 34rem;
}

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

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.8rem;
  margin-top: 2.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
}

.hero-stats div strong {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-stats div span {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Em duas colunas abaixo de ~1040px o diagrama do hero ficava pequeno demais. */
@media (max-width: 1040px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    padding-block: clamp(2.2rem, 6vw, 3.5rem);
  }

  .hero-lead {
    max-width: none;
  }
}

/* diagrama flutuante do hero */
.hero-visual {
  position: relative;
}

.hero-visual .diagram {
  margin: 0;
  box-shadow: var(--shadow-lg);
}

.float-card {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: float-in 0.6s ease both;
}

.float-card strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.float-card span {
  font-size: 0.72rem;
  color: var(--muted);
}

.float-card img {
  width: 26px;
  height: 26px;
}

.float-card--a {
  top: -14px;
  left: -14px;
  animation-delay: 0.15s;
}

.float-card--b {
  bottom: 44px;
  right: -18px;
  animation-delay: 0.3s;
}

.float-card--c {
  bottom: -16px;
  left: 24px;
  animation-delay: 0.45s;
}

.float-card .up {
  color: var(--ok);
  font-weight: 700;
  font-size: 0.8rem;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 620px) {
  .float-card--a,
  .float-card--b,
  .float-card--c {
    display: none;
  }
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.25rem;
  border-radius: 11px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  min-height: 44px;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
}

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

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

.btn-secondary:hover {
  background: var(--bg-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--brand-2);
  padding-inline: 0.4rem;
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------- layout */

.section {
  padding-block: clamp(3rem, 6vw, 5rem);
}

.section--alt {
  background: var(--bg-soft);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 46rem;
  margin-bottom: 2.4rem;
}

.section-head p {
  color: var(--muted);
  font-size: 1.03rem;
  margin: 0;
}

.grid {
  display: grid;
  gap: 1.2rem;
}

.grid--3 {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}

.grid--services {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr));
}

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.card h3 {
  margin-bottom: 0.4rem;
}

.card p:last-child {
  margin-bottom: 0;
}

a.card:hover,
.card--link:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--brand-2) 40%, var(--border));
}

.card--muted {
  background: var(--surface-2);
  box-shadow: none;
}

/* ícone de serviço AWS */
.aws-icon {
  display: inline-grid;
  place-items: center;
  background: var(--icon-bg);
  border-radius: 10px;
  flex: none;
}

.aws-icon img {
  display: block;
}

.aws-icon--xs {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}
.aws-icon--xs img {
  width: 20px;
  height: 20px;
}
.aws-icon--sm {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
.aws-icon--sm img {
  width: 28px;
  height: 28px;
}
.aws-icon--md {
  width: 48px;
  height: 48px;
}
.aws-icon--md img {
  width: 40px;
  height: 40px;
}
.aws-icon--lg {
  width: 64px;
  height: 64px;
  border-radius: 12px;
}
.aws-icon--lg img {
  width: 54px;
  height: 54px;
}
.aws-icon--xl {
  width: 88px;
  height: 88px;
  border-radius: 16px;
}
.aws-icon--xl img {
  width: 72px;
  height: 72px;
}

/* card de serviço */
.service-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  color: inherit;
  position: relative;
}

.service-card:hover {
  color: inherit;
}

.service-card__name {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.02rem;
}

.service-card__cat {
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.service-card__hover {
  color: var(--text-soft);
  font-size: 0.88rem;
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.22s ease, opacity 0.22s ease;
}

.service-card:hover .service-card__hover,
.service-card:focus-visible .service-card__hover {
  max-height: 8rem;
  opacity: 1;
}

/* selos */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge--essential {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.badge--important {
  background: var(--brand-soft);
  color: var(--brand-2);
  border-color: color-mix(in srgb, var(--brand-2) 25%, transparent);
}

.badge--complementary {
  background: var(--bg-soft);
  color: var(--muted);
  border-color: var(--border);
}

/* ------------------------------------------------------------- diagramas */

.diagram {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  margin: 1.8rem 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

/*
 * Diagrama responsivo sem virar ilegível.
 * Encolher o SVG junto com a tela levava o rótulo a ~5px no celular. Em vez
 * disso o SVG para de encolher num limite legível e o container rola na
 * horizontal, com aviso visual. `--vb` é a largura do viewBox, injetada no build.
 */
.diagram > svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: min(calc(var(--vb, 620) * 1px), 620px);
}

/*
 * Exceção do hero em telas largas: a coluna do diagrama é estreita por design e
 * os rótulos ali são curtos, então ele encolhe em vez de ganhar barra de rolagem.
 */
@media (min-width: 1041px) {
  .hero-visual .diagram {
    overflow: visible;
  }

  .hero-visual .diagram > svg {
    min-width: 0;
  }
}

/* aviso de rolagem, só quando realmente há conteúdo escondido */
.diagram[data-scrollable='true']::after {
  content: 'Arraste para ver o diagrama completo';
  position: sticky;
  left: 0;
  display: block;
  width: max-content;
  margin-top: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.diagram[data-scrolled='true']::after {
  content: none;
}

.diagram figcaption {
  margin-top: 0.9rem;
  font-size: 0.86rem;
  color: var(--muted);
  padding-inline: 0.3rem;
}

.diagram .d-label {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  fill: var(--text);
}

.diagram .d-sub {
  font-family: var(--font);
  font-size: 10.5px;
  fill: var(--muted);
}

.diagram .d-box {
  fill: var(--surface-2);
  stroke: var(--border-strong);
  stroke-width: 1.2;
}

.diagram .d-zone {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.4;
  stroke-dasharray: 6 5;
  rx: 12;
}

.diagram .d-zone-label {
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  fill: var(--muted);
}

.diagram .d-line {
  stroke: var(--border-strong);
  stroke-width: 2;
  fill: none;
}

.diagram .d-line--accent {
  stroke: var(--brand-2);
}

.diagram .d-flow {
  stroke-dasharray: 5 6;
  animation: dash 1.6s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: -22;
  }
}

@media (prefers-reduced-motion: reduce) {
  .diagram .d-flow {
    animation: none;
  }
  * {
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------ comparação */

.compare {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.compare .card ul {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-soft);
  font-size: 0.93rem;
}

.compare .card li {
  margin-bottom: 0.35rem;
}

.rule {
  margin-top: 1.4rem;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-soft);
  padding: 1.1rem 1.3rem;
}

.rule h4 {
  margin: 0 0 0.6rem;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.rule p {
  margin: 0.2rem 0;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text);
}

/* ------------------------------------------------------- página serviço */

.service-hero {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
  padding-block: clamp(2rem, 4vw, 3rem);
}

.service-hero h1 {
  margin-bottom: 0.2rem;
}

.service-hero .meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  padding-top: 1.4rem;
}

.breadcrumb a {
  color: var(--muted);
}

.prose h2 {
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
}

.prose h2:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.prose ul {
  padding-left: 1.2rem;
  color: var(--text-soft);
}

.prose li {
  margin-bottom: 0.5rem;
}

.callout {
  border-left: 4px solid var(--brand-2);
  background: var(--brand-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.2rem;
  margin: 1.4rem 0;
}

.callout--exam {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.callout p:last-child {
  margin-bottom: 0;
}

.confuse-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.confuse-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.confuse-item p {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* ------------------------------------------------------------- pesquisa */

.search-bar {
  position: relative;
  max-width: 30rem;
}

.search-bar input {
  width: 100%;
  height: 48px;
  padding: 0 2.6rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
}

.search-bar svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 38px;
}

.chip[aria-pressed='true'] {
  background: var(--brand-2);
  border-color: var(--brand-2);
  color: #fff;
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

/* ------------------------------------------------------ command palette */

.palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(2 6 23 / 0.5);
  backdrop-filter: blur(3px);
  z-index: 90;
  display: none;
}

.palette-backdrop[data-open='true'] {
  display: block;
}

.palette {
  position: fixed;
  z-index: 91;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(94vw, 620px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
}

.palette[data-open='true'] {
  display: block;
}

.palette input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.02rem;
  padding: 1rem 1.2rem;
}

.palette input:focus {
  outline: none;
}

.palette-results {
  max-height: min(56vh, 420px);
  overflow-y: auto;
  padding: 0.4rem;
  margin: 0;
  list-style: none;
}

.palette-results li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  color: var(--text);
}

.palette-results li a:hover,
.palette-results li[data-active='true'] a {
  background: var(--brand-soft);
  text-decoration: none;
}

.palette-results .r-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.palette-results .r-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.palette-foot {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--muted);
}

/* ------------------------------------------------------------ flashcards */

.flashcard {
  perspective: 1400px;
  min-height: 300px;
}

.flashcard__inner {
  position: relative;
  width: 100%;
  min-height: 300px;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}

.flashcard[data-flipped='true'] .flashcard__inner {
  transform: rotateY(180deg);
}

.flashcard__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.flashcard__face--back {
  transform: rotateY(180deg);
  align-items: flex-start;
  text-align: left;
  justify-content: flex-start;
  overflow-y: auto;
}

.flashcard__key {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-strong);
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
}

@media (prefers-reduced-motion: reduce) {
  .flashcard__inner {
    transition: none;
  }
}

/* ---------------------------------------------------------------- quiz */

.quiz-option {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 0.7rem;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-height: 48px;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--brand-2);
  background: var(--brand-soft);
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-option__key {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--muted);
  flex: none;
}

.quiz-option[data-state='correct'] {
  border-color: var(--ok);
  background: var(--ok-soft);
}

.quiz-option[data-state='wrong'] {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.feedback {
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin-top: 1rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  animation: float-in 0.28s ease both;
}

.feedback h4 {
  margin: 0 0 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.feedback--ok {
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
  background: var(--ok-soft);
}

.feedback--review {
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
  background: var(--warn-soft);
}

.feedback svg {
  width: 20px;
  height: 20px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-2), var(--accent));
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------- módulos */

.module-cover {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-block: 1.6rem 2rem;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--border);
}

.module-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.module-cover__overlay {
  position: relative;
  width: 100%;
  padding: 1.4rem 1.6rem;
  background: linear-gradient(0deg, rgb(2 6 23 / 0.86) 0%, rgb(2 6 23 / 0.45) 55%, transparent 100%);
  color: #f8fafc;
}

.module-cover__overlay h2 {
  margin: 0;
  color: #fff;
}

.module-cover__overlay p {
  margin: 0.3rem 0 0;
  color: #cbd5e1;
  font-size: 0.94rem;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: 2.6rem;
  margin-top: 3rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.site-footer .cols {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  margin-bottom: 2rem;
}

.site-footer h4 {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  margin-bottom: 0.7rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 0.35rem;
}

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

.disclaimer {
  border-top: 1px solid var(--border);
  padding-top: 1.4rem;
  line-height: 1.6;
  max-width: 62rem;
}

.disclaimer strong {
  color: var(--text-soft);
}

/* crédito do autor */
.credit {
  margin-bottom: 1rem;
}

.credit-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.credit-link:hover {
  text-decoration: none;
  border-color: var(--brand-2);
  background: var(--brand-soft);
}

.credit-link .lucide {
  width: 16px;
  height: 16px;
  color: var(--brand-2);
}

.credit-net {
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--muted);
  padding-left: 0.45rem;
  border-left: 1px solid var(--border-strong);
}

/* ----------------------------------------------------------------- misc */

.lucide {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

.mono {
  font-family: var(--mono);
}

.text-center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

/* =========================================================================
   Responsividade
   Testado em 360, 390, 430, 768, 1024, 1440 e 1920.
   ========================================================================= */

/* --- tablet ------------------------------------------------------------ */

@media (max-width: 1024px) {
  .section {
    padding-block: clamp(2.4rem, 5vw, 3.6rem);
  }

  .section-head {
    margin-bottom: 1.8rem;
  }

  .hero-stats {
    gap: 1.2rem 2rem;
  }
}

/* --- celular ----------------------------------------------------------- */

@media (max-width: 680px) {
  body {
    font-size: 15.5px;
  }

  /* Duas colunas de serviço cabem bem já em 360px e reduzem a rolagem. */
  .grid--services {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr));
    gap: 0.8rem;
  }

  .grid--3,
  .grid--2 {
    gap: 0.9rem;
  }

  .card {
    padding: 1.1rem;
  }

  /* No toque não existe hover: o resumo do serviço fica sempre visível. */
  .service-card__hover {
    max-height: none;
    opacity: 1;
    font-size: 0.84rem;
  }

  .aws-icon--xl {
    width: 64px;
    height: 64px;
    border-radius: 12px;
  }

  .aws-icon--xl img {
    width: 54px;
    height: 54px;
  }

  .service-hero {
    gap: 1rem;
    padding-block: 1.4rem 0.5rem;
  }

  .prose h2 {
    margin-top: 2rem;
    padding-top: 1.2rem;
  }

  .diagram {
    padding: 0.9rem;
    border-radius: var(--radius);
    margin-block: 1.4rem;
  }

  .module-cover {
    min-height: 170px;
  }

  .module-cover__overlay {
    padding: 1.1rem;
  }

  .rule {
    padding: 0.9rem 1rem;
  }

  .rule p {
    font-size: 0.84rem;
  }

  .site-footer {
    padding-block: 2rem;
  }

  /* Alvos de toque com pelo menos 44px. */
  .chip,
  .btn,
  .quiz-option {
    min-height: 44px;
  }

  /* Filtros viram uma faixa rolável em vez de ocupar três linhas. */
  .filters,
  [data-quiz-filters],
  [data-deck-filters] {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    padding-bottom: 0.3rem;
    margin-inline: calc(clamp(1rem, 4vw, 2rem) * -1);
    padding-inline: clamp(1rem, 4vw, 2rem);
  }

  .filters::-webkit-scrollbar,
  [data-quiz-filters]::-webkit-scrollbar,
  [data-deck-filters]::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex: none;
  }

  /* Controles de flashcard e de questão ocupam a largura toda. */
  .flashcard,
  .flashcard__inner {
    min-height: 340px;
  }

  .flashcard__face {
    padding: 1.4rem;
  }

  .flashcard + .row,
  [data-quiz-root] .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  [data-deck-flip] {
    grid-column: 1 / -1;
    order: -1;
  }

  .flashcard + .row .btn,
  [data-quiz-root] .row .btn {
    justify-content: center;
    width: 100%;
  }

  .palette {
    top: 0;
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .palette-results {
    max-height: calc(100dvh - 130px);
  }
}

/* --- telas muito estreitas --------------------------------------------- */

@media (max-width: 380px) {
  .grid--services {
    grid-template-columns: 1fr;
  }

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

  .hero-stats {
    gap: 1rem 1.6rem;
  }

  .hero-stats div strong {
    font-size: 1.3rem;
  }
}

/* --- telas grandes ----------------------------------------------------- */

@media (min-width: 1600px) {
  :root {
    --maxw: 1320px;
  }
}

/* --- toque: sem estados presos de hover -------------------------------- */

@media (hover: none) {
  a.card:hover,
  .card--link:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .btn:hover {
    transform: none;
  }
}
