/* The GarageStack website: plain CSS for every page.

   Breakpoints, the app's set (frontend/src/assets/main.css):
     (width <= 479px)   narrow phones
     (width <= 767px)   phones: one column, the page links on a row of their own
     (width >= 1024px)  desktop: the home page's hero side by side */

:root {
  color-scheme: dark;

  /* The app's dark palette, copied from frontend/src/assets/main.css so the site looks like the
     app. The app's stylesheet itself is not loaded: it carries the app's own layout rules. */
  --color-bg: #0f1117;
  --color-surface: #1a1d27;
  --color-surface-2: #252836;
  --color-border: #2e3347;
  --color-text: #e2e8f0;
  --color-text-muted: #8892a4;
  --color-primary: #3b82f6;
  --color-primary-light: #60a5fa;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --radius: 10px;
  --shadow-pop: rgb(0 0 0 / 50%);

  /* The site's own. */
  --color-primary-tint: rgb(59 130 246 / 14%);
  --container: 1160px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --section-space: clamp(3.5rem, 8vw, 6rem);
  --topbar-height: 3.75rem;
  --font: inter, system-ui, -apple-system, 'Segoe UI', roboto, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'SF Mono', consolas, monospace;
}

/* ── Base ─────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-height) + 1.5rem);
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-primary-light);
  text-underline-offset: 0.2em;
}

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

:focus-visible {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}

p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--color-surface-2);
  overflow-wrap: anywhere;
}

.text-muted {
  color: var(--color-text-muted);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

.skip-link {
  position: absolute;
  top: -10rem;
  left: 1rem;
  z-index: 20;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: var(--color-primary);
  color: #fff;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ── Buttons, cards, icons, screenshots ───────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: #2563eb;
  color: #fff;
}

.btn-ghost {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

.btn-small {
  min-height: 2.25rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.9rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

/* A card that is a link lights its border up on hover. */
a.card {
  color: var(--color-text);
  text-decoration: none;
  transition: border-color 0.15s;
}

a.card:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  background: var(--color-primary-tint);
  color: var(--color-primary-light);
}

.icon-tile svg {
  width: 1.2rem;
  height: 1.2rem;
}

.shot {
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: 0 1.25rem 2.5rem var(--shadow-pop);
}

.more {
  margin-top: 2.5rem;
  text-align: center;
}

.more a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

/* A list with a tick before each item. */
.checklist {
  display: grid;
  gap: 0.6rem;
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 1.6rem;
}

.checklist li::before {
  content: '';
  position: absolute;
  top: 0.45em;
  left: 0.2rem;
  width: 0.4rem;
  height: 0.7rem;
  border: solid var(--color-success);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ── Top bar ──────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(15 17 23 / 85%);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: var(--topbar-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

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

.topbar-nav {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
}

.topbar-nav a {
  position: relative;
  padding-block: 0.4rem;
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.topbar-nav a:hover,
.topbar-nav a[aria-current='page'] {
  color: var(--color-text);
}

.topbar-nav a[aria-current='page']::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  border-radius: 1px;
  background: var(--color-primary);
}

/* ── Home: hero ───────────────────────────────────────────── */

.hero {
  padding-block: clamp(3rem, 8vw, 5.5rem);
  background:
    radial-gradient(ellipse 60% 50% at 80% 30%, rgb(59 130 246 / 18%), transparent), var(--color-bg);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.hero-text {
  display: grid;
  gap: 1.5rem;
  max-width: 36rem;
}

.eyebrow {
  color: var(--color-primary-light);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.2rem, 1.4rem + 3.5vw, 3.6rem);
  letter-spacing: -0.025em;
}

.lead {
  color: var(--color-text-muted);
  font-size: 1.15rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  font-size: 0.9rem;
}

.hero-shots {
  position: relative;
  padding-bottom: 2rem;
}

.shot-phone {
  position: absolute;
  right: -1rem;
  bottom: 0;
  width: 22%;
  border-radius: 1rem;
}

/* ── Home: the strip under the hero ───────────────────────── */

.compat {
  border-block: 1px solid var(--color-border);
  background: var(--color-surface);
}

.compat-inner {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.75rem;
  padding-block: 1.25rem;
  color: var(--color-text-muted);
}

.compat-inner .icon {
  position: relative;
  top: 0.15em;
  color: var(--color-success);
}

.compat strong {
  color: var(--color-text);
}

/* ── Sections ─────────────────────────────────────────────── */

.section {
  padding-block: var(--section-space);
}

.section-tight {
  padding-top: clamp(2rem, 5vw, 3rem);
}

.section-alt {
  background: var(--color-surface);
  border-block: 1px solid var(--color-border);
}

.section-alt .card {
  background: var(--color-bg);
}

.section-head {
  display: grid;
  gap: 0.6rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
  text-align: center;
}

.section-head h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  letter-spacing: -0.015em;
}

.section-head p {
  max-width: 40rem;
  margin-inline: auto;
}

/* ── Home: highlights, spotlight, pillars, call to action ─── */

.highlight-grid,
.link-grid,
.pillars,
.gallery,
.footer-links,
.alert-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
}

.highlight,
.link-card {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  height: 100%;
  padding: 1.4rem;
}

.highlight .icon-tile,
.link-card .icon-tile {
  margin-bottom: 0.4rem;
}

.highlight-title,
.link-card-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.spotlight {
  max-width: 64rem;
}

.spotlight-shot {
  display: block;
  border-radius: var(--radius);
}

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 2.5rem;
  text-align: center;
}

.pillars li {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
}

.pillars h3 {
  font-size: 1.15rem;
}

.pillars p {
  max-width: 20rem;
}

.cta {
  padding-block: var(--section-space);
  border-top: 1px solid var(--color-border);
  background:
    radial-gradient(ellipse 50% 80% at 50% 100%, rgb(59 130 246 / 16%), transparent),
    var(--color-surface);
}

.cta-inner {
  display: grid;
  justify-items: center;
  gap: 1rem;
  text-align: center;
}

.cta h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
}

.cta .actions {
  justify-content: center;
  margin-top: 0.5rem;
}

/* ── Subpages: page header and its chips ──────────────────── */

.page-head {
  padding-block: clamp(2.5rem, 6vw, 4rem) clamp(2rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--color-border);
  background:
    radial-gradient(ellipse 50% 100% at 85% 0%, rgb(59 130 246 / 14%), transparent), var(--color-bg);
}

.page-head .container {
  display: grid;
  gap: 1rem;
}

.page-head h1 {
  font-size: clamp(2rem, 1.4rem + 2.5vw, 3rem);
  letter-spacing: -0.02em;
}

.page-head .lead {
  max-width: 44rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chips a {
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.chips a:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

/* ── Features page ────────────────────────────────────────── */

.feature-section {
  padding-block: clamp(3rem, 7vw, 5rem);
}

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

.feature-row {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.feature-shot {
  display: block;
  border-radius: var(--radius);
}

.feature-text {
  display: grid;
  gap: 1rem;
}

.feature-text h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  letter-spacing: -0.01em;
}

.alert-card {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.alert-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
  gap: 0.75rem 1.5rem;
}

.alert-list li {
  position: relative;
  padding-left: 1.25rem;
}

.alert-list li::before {
  content: '';
  position: absolute;
  top: 0.55em;
  left: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-warning);
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
}

.link-card .text-muted {
  font-size: 0.95rem;
}

.privacy {
  display: grid;
  justify-items: center;
  gap: 1rem;
  max-width: 44rem;
  text-align: center;
}

.privacy h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
}

/* ── Screenshots page ─────────────────────────────────────── */

.gallery-title {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 2rem 1.5rem;
}

.gallery-phone {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
}

.gallery-item {
  display: grid;
  gap: 0.75rem;
}

.gallery-item a {
  display: block;
  border-radius: var(--radius);
}

.gallery-item .shot {
  box-shadow: none;
  transition: border-color 0.15s;
}

.gallery-item a:hover .shot {
  border-color: var(--color-primary);
}

.gallery-item figcaption {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ── Install page ─────────────────────────────────────────── */

.guide {
  display: grid;
  max-width: 52rem;
}

.guide-step {
  display: grid;
  gap: 1.25rem;
  padding-block: clamp(2.5rem, 6vw, 3.5rem);
}

.guide-step + .guide-step {
  border-top: 1px solid var(--color-border);
}

.guide-step h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(1.4rem, 1.2rem + 1vw, 1.8rem);
}

.guide-step h2 .icon {
  color: var(--color-primary-light);
}

.step-tag {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--color-primary-tint);
  color: var(--color-primary-light);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Numbered steps, the number in a circle beside each. */
.steps {
  display: grid;
  gap: 1.75rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  display: grid;
  gap: 0.85rem;
  position: relative;
  padding-left: 2.75rem;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  top: -0.1rem;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 0.9rem;
}

.steps h3 {
  font-size: 1.1rem;
}

.var-list {
  display: grid;
  gap: 0.25rem 1.5rem;
}

.var-list dd {
  margin-bottom: 0.6rem;
  color: var(--color-text-muted);
}

.callout {
  display: flex;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgb(245 158 11 / 40%);
  border-radius: var(--radius);
  background: rgb(245 158 11 / 8%);
}

.callout > .icon {
  margin-top: 0.3rem;
  color: var(--color-warning);
}

.callout ol {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding-left: 1.25rem;
}

.code-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.5rem 0.35rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
}

.code-block pre {
  margin: 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.7;
}

.copy-button.is-copied .icon {
  color: var(--color-success);
}

/* ── Footer ───────────────────────────────────────────────── */

.footer {
  padding-block: 3rem;
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  display: grid;
  gap: 1.5rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.5rem 3rem;
}

.footer-top .brand {
  margin-right: auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

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

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

.footer-note {
  max-width: 48rem;
  font-size: 0.875rem;
}

.footer-note a {
  color: inherit;
}

/* ── Wider screens ────────────────────────────────────────── */

@media (width >= 768px) {
  .feature-row {
    grid-template-columns: 3fr 2fr;
    gap: 3.5rem;
  }

  /* Every other feature puts its screenshot on the right, still in the wider column. */
  .feature-section:nth-of-type(even) .feature-row {
    grid-template-columns: 2fr 3fr;
  }

  .feature-section:nth-of-type(even) .feature-row > :first-child {
    order: 2;
  }

  .var-list {
    grid-template-columns: max-content 1fr;
  }

  .var-list dd {
    margin-bottom: 0;
  }
}

@media (width >= 1024px) {
  .hero-inner {
    grid-template-columns: 5fr 7fr;
  }
}

/* ── Phones ───────────────────────────────────────────────── */

@media (width <= 767px) {
  /* The page links get a row of their own under the logo, scrolling sideways if they must.
     The logo row gets room above it, so it does not touch the top of the screen. */
  .topbar-inner {
    flex-wrap: wrap;
    row-gap: 0.25rem;
    padding-top: 0.75rem;
  }

  .topbar-github {
    margin-left: auto;
  }

  .topbar-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topbar-nav a {
    padding-block: 0.5rem 0.65rem;
  }

  /* The phone screenshot stays, a little larger, overlapping the right edge of the desktop one. */
  .hero-shots {
    padding-right: 1rem;
    padding-bottom: 2.5rem;
  }

  .shot-phone {
    right: 0;
    width: 30%;
    border-radius: 0.6rem;
  }

  .compat-inner {
    justify-content: flex-start;
  }

  .section-head {
    text-align: left;
  }

  .section-head p {
    margin-inline: 0;
  }

  /* One card per row: the icon beside the text keeps the list short. */
  .highlight,
  .link-card {
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1rem;
  }

  .highlight .icon-tile,
  .link-card .icon-tile {
    grid-row: span 2;
    margin-bottom: 0;
  }
}

@media (width <= 479px) {
  .actions .btn {
    flex: 1 1 100%;
  }

  .code-block pre {
    padding: 0.9rem 1rem;
    font-size: 0.8rem;
  }

  .callout {
    padding: 0.9rem 1rem;
  }

  .steps > li {
    padding-left: 0;
    padding-top: 2.6rem;
  }

  .gallery-phone {
    grid-template-columns: repeat(2, 1fr);
  }
}

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