/* Landing page for GitLab Pages.
   Palette and font metrics come from tokens.css; this file only does layout.
   Everything is local: no external fonts, scripts, or images. */

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  src: url('fonts/roboto-var.woff2') format('woff2');
  font-display: swap;
}

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

[hidden] { display: none !important; }

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

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

body:has(dialog[open]) { overflow: hidden; }

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

a {
  color: var(--rif-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { text-decoration: none; }

button { font: inherit; }

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

.wrap {
  width: min(1080px, calc(100% - 40px));
  margin-inline: auto;
}

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

.skip:focus { top: 12px; }

/* Header ------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--rif-panel);
  border-bottom: 1px solid var(--rif-border);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--rif-text);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand__icon { width: 26px; height: 26px; }

.nav { display: flex; gap: 20px; font-size: 14px; }

.nav a { color: var(--rif-meta); text-decoration: none; }

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

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(24px, 6vw, 72px);
  align-items: center;
  padding-block: clamp(40px, 6vw, 76px);
}

.hero__copy { max-width: 640px; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--rif-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.accent { color: var(--rif-accent); }

.lede {
  margin: 0 0 26px;
  max-width: 54ch;
  color: var(--rif-meta);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
}

.cta { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--rif-border);
  border-radius: 6px;
  background: var(--rif-panel);
  color: var(--rif-text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { border-color: var(--rif-accent); }

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

.btn--primary:hover { filter: brightness(0.94); }

.btn--lg { min-height: 52px; padding: 0 24px; font-size: 1.05rem; }

.fine {
  margin: 16px 0 0;
  color: var(--rif-dim);
  font-size: 13px;
}

.hero__shot {
  width: min(100%, 300px);
  margin: 0;
  justify-self: center;
  overflow: hidden;
  border: 1px solid var(--rif-border);
  border-radius: 18px;
  background: var(--rif-panel);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.35);
}

/* Sections ---------------------------------------------------------------- */

.section {
  padding-block: clamp(44px, 6vw, 76px);
  scroll-margin-top: 72px;
}

.section + .section { border-top: 1px solid var(--rif-border); }

.section__head { max-width: 760px; margin-bottom: 28px; }

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.section__lede { margin: 0; color: var(--rif-meta); }

/* Install ----------------------------------------------------------------- */

.installer {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--rif-accent);
  border-radius: 16px;
  background: var(--rif-panel);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.18);
}

.installer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--rif-border);
  border-radius: 999px;
  background: var(--rif-bg);
  color: var(--rif-meta);
  font-size: 13px;
  font-weight: 700;
}

.picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--rif-dim);
  font-size: 13px;
}

.picker select {
  max-width: min(340px, 60vw);
  padding: 6px 10px;
  border: 1px solid var(--rif-border);
  border-radius: 6px;
  background: var(--rif-bg);
  color: var(--rif-text);
  font: inherit;
  font-size: 13px;
}

.install-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.install-steps .step {
  position: relative;
  counter-increment: step;
  padding: 16px 18px 16px 58px;
  border: 1px solid var(--rif-border);
  border-radius: 12px;
  background: var(--rif-bg);
}

.install-steps .step + .step { margin-top: 10px; }

.install-steps .step::before {
  content: counter(step);
  position: absolute;
  top: 15px;
  left: 16px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--rif-border);
  border-radius: 50%;
  background: var(--rif-panel);
  color: var(--rif-meta);
  font-size: 13px;
  font-weight: 700;
}

.install-steps .step--active { border-color: var(--rif-accent); }

.install-steps .step--active::before {
  border-color: var(--rif-accent);
  background: var(--rif-accent);
  color: var(--rif-on-accent);
}

.install-steps .step--done::before {
  content: '✓';
  border-color: var(--rif-accent);
  color: var(--rif-accent);
}

.install-steps .step--done { opacity: 0.78; }

.step h3 { margin: 0 0 4px; font-size: 15px; }

.step p {
  margin: 0;
  color: var(--rif-meta);
  font-size: 14.5px;
  line-height: 1.5;
}

.installer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.installer__note {
  margin: 14px 0 0;
  color: var(--rif-dim);
  font-size: 13.5px;
}

.advanced {
  margin-top: 16px;
  padding: 16px 20px;
  border: 1px solid var(--rif-border);
  border-radius: 10px;
  background: var(--rif-panel);
  color: var(--rif-meta);
  font-size: 14px;
}

.advanced summary {
  color: var(--rif-text);
  font-weight: 700;
  cursor: pointer;
}

.advanced p { margin: 12px 0; }

.advanced .steps { margin: 0; padding-left: 20px; }

.advanced .steps li + li { margin-top: 8px; }

.privacy {
  max-width: 78ch;
  margin: 26px 0 0;
  color: var(--rif-meta);
  font-size: 14px;
}

/* Themes ------------------------------------------------------------------ */

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

.theme { margin: 0; }

.theme__shot {
  display: block;
  overflow: hidden;
  border: 1px solid var(--rif-border);
  border-radius: 12px;
  background: var(--rif-panel);
}

.theme__shot img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  object-position: top center;
}

.theme figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  font-size: 14px;
}

.theme figcaption span { color: var(--rif-dim); }

/* Features ---------------------------------------------------------------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.features li {
  padding: 20px;
  border: 1px solid var(--rif-border);
  border-radius: 10px;
  background: var(--rif-panel);
}

.features h3 { margin: 0 0 6px; font-size: 16px; }

.features p { margin: 0; color: var(--rif-meta); font-size: 14px; }

/* Dialog ------------------------------------------------------------------ */

.dialog {
  width: min(580px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 40px));
  max-height: min(820px, calc(100dvh - 40px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--rif-border);
  border-radius: 16px;
  background: var(--rif-panel);
  color: var(--rif-text);
  box-shadow: 0 30px 90px rgb(0 0 0 / 0.55);
}

.dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.dialog:not([open]) { display: none; }

.dialog::backdrop { background: rgb(0 0 0 / 0.62); }

.dialog__close-form {
  position: absolute;
  top: 10px;
  right: 10px;
  margin: 0;
}

.dialog__close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--rif-meta);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.dialog__close:hover {
  border-color: var(--rif-border);
  color: var(--rif-text);
}

.dialog__head { padding: clamp(20px, 4vw, 30px) clamp(20px, 4vw, 30px) 0; }

.dialog h2 { padding-right: 42px; }

.dialog__lede { margin: 0 0 16px; color: var(--rif-meta); }

.dialog__body {
  padding: 0 clamp(20px, 4vw, 30px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px clamp(20px, 4vw, 30px) clamp(20px, 4vw, 30px);
  border-top: 1px solid var(--rif-border);
  background: var(--rif-panel);
}

.dialog__note {
  flex: 1 1 100%;
  margin: 0 0 2px;
  color: var(--rif-dim);
  font-size: 13px;
}

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

.footer {
  border-top: 1px solid var(--rif-border);
  background: var(--rif-panel);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  padding-block: 24px;
  color: var(--rif-dim);
  font-size: 13px;
}

.footer p { margin: 0; }

/* Code -------------------------------------------------------------------- */

code {
  padding: 1px 5px;
  border: 1px solid var(--rif-border);
  border-radius: 4px;
  background: var(--rif-bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

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

.notfound {
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: start;
  gap: 6px;
}

.notfound .lede { margin-bottom: 24px; }

/* Responsive -------------------------------------------------------------- */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero__shot { justify-self: start; width: min(70vw, 300px); }
  .themes { gap: 12px; }
  .theme__shot img { height: 300px; }
}

@media (max-width: 620px) {
  .installer__bar { align-items: flex-start; flex-direction: column; }
  .picker { flex-wrap: wrap; }
  .installer__actions .btn { flex: 1 1 100%; }
  .install-steps .step { padding: 15px 14px 15px 52px; }
  .install-steps .step::before { left: 13px; }
  .dialog__actions .btn { flex: 1 1 100%; }
}

@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }
  .themes { grid-template-columns: 1fr; }
  .theme { width: 100%; max-width: 340px; margin-inline: auto; }
  .theme__shot img { height: 320px; }
}

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