/* Landing de Rowly DB. Sigue el tema del sistema: claro u oscuro, con las
   capturas del mismo tema. Sin JavaScript la página se lee entera. */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #fafbfa;
  --bg-2: #f0f4f4;
  --surface: #ffffff;
  --surface-2: #f5f8f8;
  --line: rgba(6, 26, 53, 0.09);
  --line-2: rgba(6, 26, 53, 0.18);
  --text: #061a35;
  --muted: #546270;
  --accent: #00b6b3;
  --accent-text: #00716f;
  --on-accent: #03191c;
  --glow: rgba(0, 182, 179, 0.24);
  --glow-2: rgba(70, 110, 255, 0.08);
  --cell: rgba(0, 150, 148, 0.09);
  --shadow: 0 50px 100px -44px rgba(6, 26, 53, 0.45);
  --nav: rgba(250, 251, 250, 0.78);
  --warn: #8a5a00;
  --chip: rgba(0, 182, 179, 0.12);
  --code: #0b1b2e;
  --code-text: #dce7ee;
  --wrap: 1200px;
  --gutter: 24px;
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070c12;
    --bg-2: #0b131b;
    --surface: #101b26;
    --surface-2: #142231;
    --line: rgba(255, 255, 255, 0.08);
    --line-2: rgba(255, 255, 255, 0.16);
    --text: #edf2f5;
    --muted: #9aa9b5;
    --accent: #2ec4bf;
    --accent-text: #5ed8d2;
    --glow: rgba(0, 182, 179, 0.4);
    --glow-2: rgba(70, 110, 255, 0.16);
    --cell: rgba(46, 196, 191, 0.1);
    --shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.9);
    --nav: rgba(7, 12, 18, 0.72);
    --warn: #e8c27a;
    --chip: rgba(46, 196, 191, 0.12);
    --code: #0a1219;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 8px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* --- Botones ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 1rem/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform 100ms ease-out, filter 150ms ease, background-color 150ms ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-accent {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-accent:hover {
  filter: brightness(1.06);
}

.btn-ghost {
  border-color: var(--line-2);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-2);
}

.btn-large {
  min-height: 54px;
  padding: 0 28px;
  font-size: 1.0625rem;
}

.btn-small {
  min-height: 36px;
  padding: 0 16px;
  font-size: 0.875rem;
}

/* --- Cabecera ----------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: flex;
  flex-shrink: 0;
}

.brand img {
  width: 94px;
  height: 28px;
}

.logo-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .logo-light {
    display: none;
  }
  .logo-dark {
    display: block;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-inline: auto;
  font-size: 0.875rem;
  font-weight: 500;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  opacity: 0.82;
}

.nav a:hover {
  opacity: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 8px;
}

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

/* Menú móvil: un <details>, funciona sin JavaScript. */
.menu {
  display: none;
  position: relative;
}

.menu summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  list-style: none;
  cursor: pointer;
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu summary svg {
  width: 22px;
  height: 22px;
}

.menu nav {
  position: absolute;
  right: 0;
  top: 52px;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: 8px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.5);
}

.menu nav a {
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.menu nav a:hover {
  background: var(--surface-2);
}

/* --- Portada ------------------------------------------------------------ */

.hero {
  position: relative;
  padding-top: 96px;
  text-align: center;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -64px 0 auto;
  height: 1400px;
  z-index: -2;
  background-image:
    linear-gradient(var(--cell) 1px, transparent 1px),
    linear-gradient(90deg, var(--cell) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, transparent 30%, #000 90%);
  mask-image: radial-gradient(70% 60% at 50% 45%, transparent 30%, #000 90%);
}

.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 520px;
  width: min(1200px, 100%);
  height: 900px;
  translate: -50% 0;
  z-index: -1;
  background:
    radial-gradient(50% 45% at 50% 50%, var(--glow), transparent 72%),
    radial-gradient(40% 40% at 80% 30%, var(--glow-2), transparent 70%);
  pointer-events: none;
}

.notice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--accent-text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.notice svg {
  width: 14px;
  height: 14px;
}

h1 {
  margin: 28px auto 0;
  max-width: 1100px;
  font-size: clamp(3rem, 1.2rem + 7.4vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 700;
  text-wrap: balance;
}

.lead {
  margin: 28px auto 0;
  max-width: 60ch;
  font-size: clamp(1.125rem, 0.95rem + 0.8vw, 1.5rem);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--muted);
  text-wrap: balance;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}

.meta {
  margin: 18px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.shot {
  display: block;
  margin: 48px auto 0;
}

.shot img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
}

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

.section {
  padding-top: 160px;
}

h2 {
  margin: 0;
  font-size: clamp(2.25rem, 1.4rem + 3.4vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  text-wrap: balance;
}

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

/* Vitrina de funciones. Sin JavaScript se ven las cuatro, una tras otra; con
   JavaScript son pestañas y cambia una sola captura. */
.showcase {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  margin-top: 56px;
}

.tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tab {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

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

.tab[aria-selected="true"] {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--text);
}

.tab-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tab-text {
  display: none;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--muted);
}

.tab[aria-selected="true"] .tab-text {
  display: block;
}

.stage {
  padding: 20px;
  border-radius: 24px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.panel img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line-2);
}

.panel[hidden] {
  display: none;
}

.js .panel:not([hidden]) {
  animation: appear 220ms ease-out;
}

@keyframes appear {
  from {
    opacity: 0;
  }
}

.panel-caption {
  display: none;
}

/* Sin JavaScript: la lista de pestañas no sirve, cada panel lleva su texto. */
.no-js .showcase {
  display: block;
}

.no-js .tabs {
  display: none;
}

.no-js .stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  padding: 0;
  background: none;
  border: 0;
}

.no-js .panel-caption {
  display: block;
  margin-top: 16px;
}

.panel-caption h3 {
  margin: 0;
  font-size: 1.25rem;
}

.panel-caption p {
  margin: 6px 0 0;
  color: var(--muted);
}

.points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.points strong {
  display: block;
  font-size: clamp(1.625rem, 1.2rem + 1.2vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.points span {
  display: block;
  margin-top: 12px;
  font-size: 1.0625rem;
  color: var(--muted);
}

kbd {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--surface);
}

/* --- Descargas ---------------------------------------------------------- */

.downloads-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 40px;
}

.downloads-head p {
  margin: 0 0 8px;
  color: var(--muted);
}

.platforms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.platform {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.platform.is-suggested {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--chip);
}

.platform-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.platform h3 {
  margin: 0;
  font-size: 1.625rem;
  letter-spacing: -0.02em;
}

.suggested {
  display: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--accent-text);
  font-size: 0.75rem;
  font-weight: 600;
}

.is-suggested .suggested {
  display: inline-block;
}

.requirement {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.files {
  flex-grow: 1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.files li {
  border-top: 1px solid var(--line);
}

.files a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  color: var(--text);
  text-decoration: none;
}

.file-name {
  flex-grow: 1;
}

.file-name b {
  display: block;
  font-weight: 600;
}

.file-name small {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.file-name code {
  font-family: var(--mono);
  font-size: 0.95em;
}

.file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  transition: background-color 150ms ease, color 150ms ease;
}

.file-icon svg {
  width: 18px;
  height: 18px;
}

.files a:hover .file-icon {
  background: var(--text);
  color: var(--bg);
}

.note {
  display: flex;
  gap: 8px;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
}

.note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--warn);
}

/* Terminal */
.terminal {
  margin-top: 20px;
  border-radius: 20px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.terminal summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 28px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.terminal summary::-webkit-details-marker {
  display: none;
}

.terminal summary svg {
  width: 18px;
  height: 18px;
  margin-left: auto;
  transition: rotate 200ms ease;
}

.terminal[open] summary svg {
  rotate: 180deg;
}

.terminal-body {
  padding: 0 28px 24px;
}

.pm-tabs {
  display: none;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.js .pm-tabs {
  display: flex;
}

.pm-tab {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  font: 600 0.8125rem/1 var(--font);
  cursor: pointer;
}

.pm-tab[aria-selected="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.cmd + .cmd {
  margin-top: 14px;
}

.js .cmd + .cmd {
  margin-top: 0;
}

.cmd h3 {
  margin: 0 0 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}

.js .cmd h3 {
  display: none;
}

.cmd-box {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--code);
}

.cmd pre {
  flex-grow: 1;
  margin: 0;
  overflow-x: auto;
  font: 400 0.84rem/1.75 var(--mono);
  color: var(--code-text);
}

.copy {
  display: none;
  flex-shrink: 0;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #edf2f5;
}

.js .copy {
  display: inline-flex;
}

.cmd-note {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.live {
  display: block;
  min-height: 1.2em;
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--accent-text);
}

.after {
  margin: 20px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

/* --- Ayuda y pie -------------------------------------------------------- */

.help {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  margin: 120px 0 0;
  padding: 32px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.help a {
  font-weight: 600;
  text-decoration: none;
}

.help a:hover {
  text-decoration: underline;
}

.help span {
  display: block;
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding: 32px 0 44px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.footer img {
  width: 22px;
  height: 22px;
}

.footer span {
  flex-grow: 1;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

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

/* --- 404 ---------------------------------------------------------------- */

.lost {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  min-height: calc(100vh - 64px - 110px);
  padding: 64px 0;
  max-width: 640px;
}

.lost h1 {
  margin: 0;
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4rem);
}

.lost p {
  margin: 0;
  font-size: 1.125rem;
  color: var(--muted);
}

.lost .actions {
  justify-content: flex-start;
  margin-top: 10px;
}

/* --- Tamaños ------------------------------------------------------------ */

@media (max-width: 1000px) {
  .showcase {
    grid-template-columns: 1fr;
  }
  .tabs {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tab {
    flex: 0 0 auto;
    width: auto;
    padding: 10px 16px;
    border-color: var(--line-2);
    border-radius: 999px;
  }
  .tab-title {
    font-size: 0.9375rem;
  }
  .tab[aria-selected="true"] {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
  }
  .tab .tab-text {
    display: none !important;
  }
  .js .panel-caption {
    display: block;
    margin-top: 16px;
    padding: 0 6px;
  }
  .platforms {
    grid-template-columns: 1fr;
  }
  .help {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --gutter: 16px;
  }
  .nav,
  .topbar-actions .btn {
    display: none;
  }
  .menu {
    display: block;
  }
  .topbar-actions {
    margin-left: auto;
  }
  .hero {
    padding-top: 48px;
  }
  .actions {
    flex-direction: column;
  }
  .actions .btn {
    width: 100%;
  }
  .shot {
    margin-top: 32px;
  }
  .shot img {
    border-radius: 10px;
  }
  .section {
    padding-top: 96px;
  }
  .showcase {
    margin-top: 28px;
    gap: 20px;
  }
  .stage {
    padding: 12px;
    border-radius: 20px;
  }
  .no-js .stage {
    grid-template-columns: 1fr;
  }
  .points {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .platform {
    padding: 20px;
  }
  .terminal summary,
  .terminal-body {
    padding-inline: 18px;
  }
  .help {
    margin-top: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
