/* opportun.app marketing site: shared styles for every page under site/.
   Color tokens are copied from apps/web/src/index.css (same OKLCH values) so this site and the
   app read as the same product. Dark/light here is a plain prefers-color-scheme media query,
   not the app's own JS-driven toggle: a marketing page has no settings to remember, so there is
   nothing a script would add over letting the browser answer directly.
   System fonts only, no network requests of any kind: see the no-trackers note in README. */

:root {
  --background: oklch(0.985 0.002 260);
  --foreground: oklch(0.21 0.02 265);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.21 0.02 265);
  --primary: oklch(0.5 0.2 275);
  --primary-foreground: oklch(0.985 0.005 275);
  --muted-foreground: oklch(0.48 0.02 265);
  --accent: oklch(0.94 0.02 275);
  --accent-foreground: oklch(0.3 0.08 275);
  --border: oklch(0.91 0.008 265);
  --ring: oklch(0.55 0.2 275);
  --radius: 0.5rem;
  --max-width: 72rem;
  --font-sans:
    ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(0.17 0.012 265);
    --foreground: oklch(0.94 0.006 265);
    --card: oklch(0.21 0.014 265);
    --card-foreground: oklch(0.94 0.006 265);
    --primary: oklch(0.7 0.15 275);
    --primary-foreground: oklch(0.18 0.03 275);
    --muted-foreground: oklch(0.72 0.015 265);
    --accent: oklch(0.3 0.04 275);
    --accent-foreground: oklch(0.94 0.02 275);
    --border: oklch(0.3 0.014 265);
    --ring: oklch(0.72 0.15 275);
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

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

a:not(.button) {
  text-underline-offset: 0.2em;
}

/* Visible on every interactive element, including the custom button/link "classes" below:
   never remove outline without replacing it (#214's standing keyboard-access rule). */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: calc(var(--radius) / 2);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  z-index: 10;
  transition: top 0.15s ease;
}

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

.wrap {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ---- header / nav ------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  color: var(--foreground);
  text-decoration: none;
  flex-shrink: 0;
}

.logo svg {
  height: 1.75rem;
  width: auto;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--foreground);
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ---- buttons -------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius);
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}

.button-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.button-primary:hover {
  opacity: 0.92;
}

.button-outline {
  border-color: var(--border);
  color: var(--foreground);
  background: var(--card);
}

.button-outline:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

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

/* ---- hero ------------------------------------------------------------------------------ */

.hero {
  padding-block: clamp(3rem, 6vw, 5.5rem);
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}

.hero .lede {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--muted-foreground);
  max-width: 42rem;
  margin-inline: auto;
}

.hero .button-row {
  justify-content: center;
  margin-top: 2rem;
}

/* ---- sections --------------------------------------------------------------------------- */

section {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

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

section > .wrap > h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  margin-top: 0;
}

.section-lede {
  color: var(--muted-foreground);
  max-width: 48rem;
  font-size: 1.05rem;
}

/* ---- feature / card grids ----------------------------------------------------------------- */

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin-top: 2rem;
}

.card {
  /* .steps > li's comment explains why (issue #277): a grid item's own content sets a floor
     this grid can't shrink below unless something overrides it. */
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card h3 {
  margin-top: 0;
}

.card p:last-child {
  margin-bottom: 0;
  color: var(--muted-foreground);
}

/* ---- callout (the "stays on your machine" privacy note) ------------------------------------ */

.callout {
  background: var(--accent);
  color: var(--accent-foreground);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-top: 2rem;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ---- screenshots ----------------------------------------------------------------------------- */

.screenshot-gallery {
  display: grid;
  gap: 2rem;
  margin-top: 2.5rem;
}

.screenshot {
  /* .steps > li's comment explains why (issue #277). */
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.04), 0 8px 24px oklch(0 0 0 / 0.06);
}

.screenshot img {
  display: block;
  width: 100%;
}

.screenshot figcaption {
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

/* ---- getting-started steps ----------------------------------------------------------------- */

.steps {
  counter-reset: step;
  padding: 0;
  margin: 2rem 0 0;
  list-style: none;
  display: grid;
  gap: 1.5rem;
}

.steps > li {
  /* Grid (and flex) items default to min-width: auto, which refuses to shrink narrower than
     the item's own content -- here, the step 1 code block's longest line. Without this, that
     line sets this item's floor, the page grows past the viewport, and .steps pre's own
     overflow-x: auto below never gets a chance to run, because nothing ever asks the <pre> to
     be narrower than its content in the first place (confirmed on a phone, issue #277). Every
     other grid container in this file has the same latent floor; see .card, .screenshot,
     .docs-layout, .docs-toc li. */
  min-width: 0;
  position: relative;
  padding-left: 3rem;
}

.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.steps h3 {
  margin: 0 0 0.35rem;
}

.steps pre {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  overflow-x: auto;
}

code {
  font-family:
    ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.9em;
}

/* ---- footer ------------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
  color: var(--muted-foreground);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.site-footer ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--foreground);
  text-decoration: underline;
}

/* ---- docs page ------------------------------------------------------------------------------ */

.docs-layout {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 14rem 1fr;
  align-items: start;
}

.docs-layout > * {
  /* .steps > li's comment explains why (issue #277). Both of .docs-layout's children (the toc
     nav and the main content column) are unclassed in the markup, so this addresses them by
     position rather than by name. */
  min-width: 0;
}

.docs-toc {
  position: sticky;
  top: 1.5rem;
}

.docs-toc-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
  margin-top: 0;
}

.docs-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.docs-toc li {
  /* .steps > li's comment explains why (issue #277). */
  min-width: 0;
}

.docs-toc a {
  color: var(--foreground);
  text-decoration: none;
}

.docs-toc a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.docs-topic + .docs-topic {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 48rem) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-toc {
    position: static;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
  }
}
