/* Base y variables */
:root {
  color-scheme: dark;
  --paper: #0c0d0f;
  --paper-light: #141517;
  --ink: #f2f0e9;
  --muted: #aaa7a0;
  --line: #3b3c3f;
  --blue: #365bdc;
  --blue-text: #6f8fff;
  --red: #f06b56;
  --yellow: #f2d34f;
  --white: #ffffff;
  --max-width: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: 80px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px var(--paper);
}

h1,
h2,
h3,
p,
figure,
dl,
dd {
  margin-top: 0;
}

.container {
  width: min(var(--max-width), calc(100% - 48px));
  margin-inline: auto;
}

/* Cabecera */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(12, 13, 15, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-check {
  width: 27px;
  height: 27px;
  position: relative;
  display: inline-block;
  background: var(--red);
  border-radius: 4px;
}

.brand-check::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  width: 11px;
  height: 6px;
  border-bottom: 3px solid var(--white);
  border-left: 3px solid var(--white);
  transform: rotate(-45deg);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 0.84rem;
}

.site-nav a {
  padding-block: 5px;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.site-nav .app-link {
  color: var(--blue-text);
  font-weight: 700;
}

/* Presentación */
.hero {
  padding: 52px 0 48px;
}

.hero-grid {
  min-height: calc(100vh - 210px);
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(520px, 1.22fr);
  align-items: center;
  gap: 58px;
}

.hero-copy,
.app-preview {
  min-width: 0;
}

.overline,
.section-number {
  margin-bottom: 17px;
  color: var(--blue-text);
  font-size: 0.73rem;
  font-weight: 700;
}

.hero h1 {
  margin-bottom: 22px;
  font-size: 6.2rem;
  line-height: 0.84;
}

.hero-tagline {
  margin-bottom: 20px;
  color: var(--red);
  font-size: 1.72rem;
  line-height: 1.1;
  font-weight: 700;
}

.hero-intro {
  max-width: 560px;
  margin-bottom: 28px;
  color: var(--muted);
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 0 17px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-size: 0.86rem;
  font-weight: 700;
}

.button-primary {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.button-primary:hover {
  color: var(--ink);
  background: var(--yellow);
  border-color: var(--ink);
}

/* Maqueta de la aplicación */
.app-preview {
  position: relative;
  margin: 0;
  color: var(--ink);
  background: #111214;
  border: 1px solid var(--ink);
  box-shadow: 22px 22px 0 var(--blue);
}

.preview-bar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
}

.preview-bar span {
  color: var(--muted);
}

.preview-body {
  min-height: 390px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
}

.preview-form,
.preview-list {
  padding: 24px;
}

.preview-form {
  background: #1b1c1f;
  border-right: 1px solid var(--line);
}

.preview-form > p,
.preview-list > p {
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
}

.preview-form label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.66rem;
  font-weight: 700;
}

.fake-input,
.fake-textarea {
  margin-bottom: 15px;
  padding: 10px;
  background: #101113;
  border: 1px solid var(--line);
  font-size: 0.72rem;
}

.fake-textarea {
  min-height: 92px;
}

.fake-button {
  display: inline-block;
  padding: 9px 12px;
  color: var(--white);
  background: var(--blue);
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 700;
}

.preview-list article {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 11px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.preview-list article:last-child {
  border-bottom: 1px solid var(--line);
}

.preview-list i {
  width: 16px;
  height: 16px;
  display: block;
  border: 1px solid var(--ink);
}

.preview-list .task-done i {
  position: relative;
  background: var(--yellow);
}

.preview-list .task-done i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 7px;
  height: 4px;
  border-bottom: 2px solid #171815;
  border-left: 2px solid #171815;
  transform: rotate(-45deg);
}

.preview-list strong,
.preview-list small {
  display: block;
}

.preview-list strong {
  margin-bottom: 3px;
  font-size: 0.76rem;
}

.preview-list small {
  color: var(--muted);
  font-size: 0.64rem;
}

.app-preview figcaption {
  position: absolute;
  right: 0;
  bottom: -28px;
  color: var(--muted);
  font-size: 0.66rem;
}

/* Franja de datos */
.facts {
  color: var(--white);
  background: #101113;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.facts p {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 0;
  padding: 22px;
  border-left: 1px solid #3d3d3c;
}

.facts p:last-child {
  border-right: 1px solid #3d3d3c;
}

.facts span {
  color: #a8a8a3;
  font-size: 0.7rem;
}

.facts strong {
  color: var(--yellow);
  font-size: 1.03rem;
}

/* Secciones de contenido */
.section {
  padding: 108px 0;
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  gap: 100px;
}

.story-grid h2,
.flow-heading h2,
.features-heading h2,
.launch h2 {
  margin-bottom: 0;
  font-size: 3.8rem;
  line-height: 0.98;
}

.story-copy {
  padding-top: 32px;
}

.story-copy p {
  color: var(--muted);
}

.story-copy .story-lead {
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 700;
}

/* Recorrido de la petición */
.flow-section {
  padding: 108px 0;
  color: var(--white);
  background: var(--blue);
}

.flow-section .section-number {
  color: var(--white);
}

.flow-heading {
  max-width: 780px;
  margin-bottom: 60px;
}

.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.flow li {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.45);
}

.flow li:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.45);
}

.flow strong {
  margin-top: auto;
  font-size: 1.12rem;
}

.flow p {
  margin: 9px 0 0;
  color: #dfe5ff;
  font-size: 0.84rem;
}

/* Funciones */
.features {
  background: var(--paper-light);
}

.features-heading {
  margin-bottom: 56px;
}

.feature-list {
  border-top: 1px solid var(--ink);
}

.feature-list article {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 34px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.feature-list span {
  font-weight: 700;
}

.feature-list p {
  margin-bottom: 0;
  color: var(--muted);
}

/* Acceso a la demo */
.launch {
  padding: 104px 0;
  color: #171815;
  background: var(--yellow);
}

.launch .section-number {
  color: #675817;
}

.launch-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.65fr);
  gap: 100px;
}

.launch-access > p {
  font-size: 1.05rem;
}

.launch dl {
  margin-bottom: 30px;
  border-top: 1px solid rgba(24, 24, 23, 0.4);
}

.launch dl div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(24, 24, 23, 0.4);
}

.launch dt,
.launch dd {
  font-size: 0.8rem;
}

.launch dd {
  margin-bottom: 0;
  font-weight: 700;
}

.button-dark {
  color: var(--white);
  background: #111210;
}

/* Pie de página */
.site-footer {
  color: var(--white);
  background: #08090a;
}

.footer-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #aaa9a4;
  font-size: 0.76rem;
}

.footer-inner p {
  margin-bottom: 0;
}

.footer-inner a {
  color: var(--white);
}

/* Adaptación para tablet */
@media (max-width: 1180px) {
  .hero-grid {
    grid-template-columns: minmax(400px, 0.9fr) minmax(0, 1.1fr);
    gap: 35px;
  }

  .hero h1 {
    font-size: 4.8rem;
  }

  .story-grid,
  .launch-grid {
    gap: 52px;
  }

  .story-grid h2,
  .flow-heading h2,
  .features-heading h2,
  .launch h2 {
    font-size: 3.1rem;
  }
}

/* Apila la maqueta cuando las dos columnas dejan de respirar */
@media (max-width: 1000px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .hero-copy {
    max-width: 650px;
  }
}

/* Adaptación para móvil */
@media (max-width: 740px) {
  section[id] {
    scroll-margin-top: 108px;
  }

  .container {
    width: min(100% - 28px, var(--max-width));
  }

  .header-inner {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 13px 0;
  }

  .site-nav {
    width: 100%;
    gap: 17px;
    overflow-x: auto;
  }

  .site-nav a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
  }

  .hero {
    padding-top: 40px;
    padding-bottom: 24px;
  }

  .hero-grid {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero h1 {
    font-size: 4rem;
  }

  .app-preview {
    box-shadow: 12px 12px 0 var(--blue);
  }

  .preview-body {
    min-height: 260px;
  }

  .preview-form,
  .preview-list {
    padding: 16px;
  }

  .preview-form > p,
  .preview-list > p {
    margin-bottom: 17px;
  }

  .fake-textarea {
    min-height: 70px;
  }

  .preview-list article {
    padding: 10px 0;
  }

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

  .facts p:nth-child(2) {
    border-right: 1px solid #3d3d3c;
  }

  .facts p:nth-child(n + 3) {
    border-top: 1px solid #3d3d3c;
  }

  .section,
  .flow-section,
  .launch {
    padding: 76px 0;
  }

  .story-grid,
  .launch-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .story-grid h2,
  .flow-heading h2,
  .features-heading h2,
  .launch h2 {
    font-size: 2.5rem;
  }

  .story-copy {
    padding-top: 0;
  }

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

  .flow li {
    min-height: 190px;
  }

  .flow li:nth-child(2) {
    border-right: 1px solid rgba(255, 255, 255, 0.45);
  }

  .flow li:nth-child(n + 3) {
    border-top: 1px solid rgba(255, 255, 255, 0.45);
  }
}

@media (max-width: 460px) {
  .hero h1 {
    font-size: 3.25rem;
  }

  .hero-tagline {
    font-size: 1.42rem;
  }

  .preview-body,
  .facts-grid,
  .flow {
    grid-template-columns: 1fr;
  }

  .preview-body {
    min-height: 0;
  }

  .preview-form {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .facts p,
  .facts p:last-child,
  .flow li,
  .flow li:nth-child(2) {
    border-right: 1px solid;
  }

  .facts p + p,
  .flow li + li {
    border-top: 1px solid;
  }

  .feature-list article {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}

/* Evita ocultar el enlace al portfolio en el ancho mínimo compatible */
@media (max-width: 360px) {
  .site-nav {
    justify-content: space-between;
    gap: 5px;
    overflow-x: visible;
    font-size: 0.78rem;
  }
}

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