/* Mikel Gastaminza — candidatura automoción
   Tokens: grafito #121417 · alt #1A1D21 · tinta #E9E7E2 · muted #9AA0A6
   acento ámbar #E8A33D · línea rgba(255,255,255,.08) */

:root {
  --bg: #121417;
  --bg-alt: #1A1D21;
  --ink: #E9E7E2;
  --muted: #9AA0A6;
  --accent: #E8A33D;
  --line: rgba(255, 255, 255, 0.08);
  --display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 880px; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--accent); }

h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }

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

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

.hero-kicker {
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero h1 { font-size: clamp(2.5rem, 8vw, 4rem); }

.hero-sub {
  font-size: clamp(1.25rem, 4vw, 1.625rem);
  font-weight: 650;
  margin: 1rem 0 1.5rem;
  color: var(--ink);
}

.hero-text { color: var(--muted); max-width: 62ch; }

.video-card { margin: 2.25rem 0; }

.video-placeholder {
  border: 1px dashed var(--line);
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9375rem;
}

.video-icon { font-size: 1.75rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  font-weight: 650;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
  font-family: var(--display);
}

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

.btn-primary { background: var(--accent); color: #16130B; }
.btn-primary:hover { background: #F0B35A; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

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

/* ---------- Secciones ---------- */

.section { padding: 4rem 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section h2 {
  font-size: clamp(1.625rem, 5vw, 2.125rem);
  margin-bottom: 2rem;
}

.section h2::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 3px;
  background: var(--accent);
  margin-top: 0.75rem;
  border-radius: 2px;
}

/* Cards de valor */

.cards { display: grid; gap: 1rem; grid-template-columns: 1fr; }

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem;
  background: var(--bg);
}

.card h3 { font-size: 1.125rem; margin-bottom: 0.6rem; }
.card p { color: var(--muted); font-size: 0.9875rem; }

/* ---------- Trayectoria: marchas 1ª→5ª ---------- */

.timeline { list-style: none; counter-reset: gear; position: relative; }

.timeline::before {
  content: "";
  position: absolute;
  left: 1.35rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: var(--line);
}

.timeline-item {
  counter-increment: gear;
  position: relative;
  padding: 0 0 2.25rem 4rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: counter(gear) "ª";
  position: absolute;
  left: 0;
  top: 0;
  width: 2.7rem;
  height: 2.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 50%;
}

.timeline-item h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.timeline-item p { color: var(--muted); font-size: 0.9875rem; max-width: 60ch; }

.muted { color: var(--muted); font-weight: 400; font-size: 0.9em; }

.timeline-item h3 a { color: var(--ink); text-decoration-color: var(--accent); }
.timeline-item h3 a:hover { color: var(--accent); }

.case-shot { display: block; margin-top: 1rem; max-width: 34rem; }
.case-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.case-shot:hover img { border-color: var(--accent); }

/* ---------- Chat intro + CTA final ---------- */

.chat-intro p { color: var(--muted); max-width: 58ch; margin-bottom: 1.5rem; }

.cta-final p { color: var(--muted); margin-bottom: 1rem; }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 5.5rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-family: var(--mono);
}

/* ---------- Widget de chat ---------- */

#chat-toggle {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  z-index: 50;
}

#chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.5rem;
  width: min(24rem, calc(100vw - 2.5rem));
  height: min(30rem, calc(100vh - 8rem));
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 51;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

#chat-panel[hidden] { display: none; }

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  font-weight: 650;
  font-size: 0.9375rem;
}

#chat-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chat-msg {
  max-width: 85%;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  font-size: 0.9375rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.chat-msg-user { align-self: flex-end; background: var(--accent); color: #16130B; }
.chat-msg-bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); }
.chat-msg-typing { align-self: flex-start; color: var(--muted); font-family: var(--mono); font-size: 0.875rem; }

#chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--line);
}

#chat-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 0.6rem 0.75rem;
  font-size: 0.9375rem;
  font-family: var(--display);
}

#chat-input:focus { border-color: var(--accent); outline: none; }

#chat-send {
  background: var(--accent);
  color: #16130B;
  border: none;
  border-radius: 6px;
  padding: 0 1rem;
  font-weight: 650;
  cursor: pointer;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero .container { animation: rise 0.5s ease-out both; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
}

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

/* ---------- ≥768px ---------- */

@media (min-width: 768px) {
  .hero { padding: 6.5rem 0 4.5rem; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 5rem 0; }
}
