:root {
  --bg: #0f1419;
  --bg-2: #1a2129;
  --card: #1f2832;
  --text: #e8edf2;
  --muted: #8a97a6;
  --accent: #f5a623;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 0%, var(--bg-2), var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  padding: 64px 16px 32px;
}

header h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

header h1 span { color: var(--accent); }

header p {
  color: var(--muted);
  margin-top: 12px;
  font-size: 1.1rem;
}

main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.tile {
  --c: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 28px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--c);
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(-4px);
  border-color: var(--c);
  box-shadow: 0 12px 32px -12px var(--c);
  outline: none;
}

.tile .icon {
  font-size: 2.2rem;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: color-mix(in srgb, var(--c) 18%, transparent);
}

.tile h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.tile .arrow {
  color: var(--c);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Colores por tema */
.motores        { --c: #ef5350; }
.fluidos        { --c: #29b6f6; }
.carga          { --c: #ffca28; }
.mecanica       { --c: #9ccc65; }
.digitalizacion { --c: #ab47bc; }
.ipo            { --c: #ff7043; }

/* Páginas de tema */
.topic-header {
  padding: 48px 16px 24px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.back {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.2s;
}

.back:hover { color: var(--text); }

.topic-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  display: flex;
  align-items: center;
  gap: 16px;
}

.topic-header h1::after {
  content: "";
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--c), transparent);
}

.empty {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 64px 16px;
  text-align: center;
  color: var(--muted);
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 32px 16px;
}

/* Secciones y enlaces dentro de un tema */
.section { margin-bottom: 40px; }

.section h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 4px solid var(--c);
}

.links {
  display: grid;
  gap: 12px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.link-card:hover,
.link-card:focus-visible {
  transform: translateX(4px);
  border-color: var(--c);
  outline: none;
}

.link-icon { font-size: 1.5rem; }
.link-title { flex: 1; font-weight: 600; font-size: 1.05rem; }
.link-go { color: var(--c); font-weight: 700; }
