/* ==========================================================================
   FaaSBox — landing page
   Palette is bichromatic on purpose: the product has exactly two triggers,
   so HTTP owns the amber and cron owns the indigo, everywhere, consistently.
   ========================================================================== */

:root {
  --paper:     #eceff3;
  --surface:   #ffffff;
  --surface-2: #f4f6f9;
  --line:      #ccd5de;
  --line-soft: #e0e6ec;
  --text:      #0e1720;
  --muted:     #57677a;
  --http:      #b4531a;
  --http-bg:   #fbf0e7;
  --cron:      #4a3ccd;
  --cron-bg:   #eeecfb;
  --code-bg:   #f7f9fb;
  --shadow:    0 1px 2px rgba(14, 23, 32, .05), 0 12px 32px -18px rgba(14, 23, 32, .30);
}

[data-theme="dark"] {
  --paper:     #0d1218;
  --surface:   #141c25;
  --surface-2: #19232e;
  --line:      #2a3743;
  --line-soft: #1f2b36;
  --text:      #dbe5ee;
  --muted:     #8496a8;
  --http:      #f0a15c;
  --http-bg:   #241a11;
  --cron:      #a89bff;
  --cron-bg:   #1c1a30;
  --code-bg:   #101820;
  --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -20px rgba(0, 0, 0, .8);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: Archivo, ui-sans-serif, system-ui, sans-serif;
  font-variation-settings: "wdth" 116;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.06;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: inherit; }

code, pre {
  font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}

:where(p, li, td) > code {
  font-size: .875em;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: .08em .34em;
}

:focus-visible {
  outline: 2px solid var(--cron);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--surface); padding: .8rem 1.2rem; border: 1px solid var(--line);
}
.skip:focus { left: 1rem; top: 1rem; }

.wrap { width: min(100% - 2.5rem, 1140px); margin-inline: auto; }

/* --- Entrance -------------------------------------------------------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.rise {
  animation: rise .75s cubic-bezier(.16, .8, .3, 1) both;
  animation-delay: calc(var(--d, 0) * 85ms);
}
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } }

/* --- Shared type ----------------------------------------------------- */

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 1.6rem; height: 1px;
  background: var(--http);
  vertical-align: .28em;
  margin-right: .7rem;
}

.lead {
  font-size: clamp(1.05rem, 1.7vw, 1.24rem);
  color: var(--muted);
  line-height: 1.6;
  max-width: 46ch;
}

/* --- Buttons --------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .72rem 1.3rem;
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: .93rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease;
}
.btn:hover { transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

.btn--solid { background: var(--text); color: var(--paper); }
.btn--solid:hover { background: var(--http); color: #fff; }
[data-theme="dark"] .btn--solid:hover { color: #17110a; }

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

/* --- Nav ------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 62px;
}

.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; margin-right: auto; }
.brand__mark { width: 26px; height: 26px; flex: none; }
.brand__name {
  font-family: Archivo, sans-serif;
  font-variation-settings: "wdth" 120;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -.01em;
}

.nav__links { display: flex; gap: 1.5rem; }
.nav__links a {
  font-size: .88rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .16s ease;
}
.nav__links a:hover { color: var(--text); }

.nav__end { display: flex; align-items: center; gap: .7rem; }
.nav__gh { padding: .48rem 1rem; font-size: .86rem; }

.lang { position: relative; display: flex; align-items: center; }
.lang__label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.lang__select {
  appearance: none;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: .84rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: .44rem 1.9rem .44rem .7rem;
  cursor: pointer;
  transition: border-color .16s ease;
}
.lang__select:hover { border-color: var(--muted); }
.lang__caret {
  position: absolute;
  right: .6rem;
  width: 12px; height: 12px;
  color: var(--muted);
  pointer-events: none;
}

.toggle {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease;
}
.toggle:hover { color: var(--text); border-color: var(--muted); }
.toggle svg { width: 17px; height: 17px; }
.toggle__moon { display: none; }
[data-theme="dark"] .toggle__sun { display: none; }
[data-theme="dark"] .toggle__moon { display: block; }

@media (max-width: 820px) {
  .nav__links { display: none; }
}

/* Language and theme keep their place; the repo is one tap away in the hero
   and the footer, so its button is the one that goes. */
@media (max-width: 600px) {
  .nav__gh { display: none; }
  .nav__inner { gap: 1rem; }
}

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

.hero { padding: clamp(2.25rem, 4.5vw, 3.5rem) 0 clamp(2rem, 4vw, 3.25rem); }
.hero__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }

.hero__title {
  font-size: clamp(2.25rem, 5.6vw, 3.9rem);
  font-variation-settings: "wdth" 112;
  letter-spacing: -.035em;
  margin-bottom: 1.5rem;
}
.hero .lead { max-width: 54ch; }

.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 2rem; }

.hero__meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: .76rem;
  color: var(--muted);
  margin-top: 1.5rem;
  letter-spacing: .02em;
}

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

.hero__shot {
  width: 100%;
  max-width: 1000px;
  margin-top: clamp(2.75rem, 6vw, 4rem);
}

@media (max-width: 480px) {
  .hero__cta { flex-direction: column; align-self: stretch; }
  .hero__cta .btn { justify-content: center; }
}

/* Below this width the forced break costs more than it buys — let it wrap. */
@media (max-width: 620px) {
  .wide-only { display: none; }
}

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

.sec { padding: clamp(3rem, 5.5vw, 4.5rem) 0; border-top: 1px solid var(--line-soft); }
.sec--quiet { background: var(--surface-2); }

.sec__title { font-size: clamp(1.7rem, 3.7vw, 2.6rem); max-width: 22ch; }
.sec__lead {
  font-size: 1.02rem;
  color: var(--muted);
  max-width: 62ch;
  margin-top: 1.1rem;
}

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

.code {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: var(--code-bg);
}
.code__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem .9rem;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
}
.code__name {
  font-family: "IBM Plex Mono", monospace;
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .04em;
}
.code__copy {
  font-family: "IBM Plex Mono", monospace;
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .2rem .55rem;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease;
}
.code__copy:hover { color: var(--text); border-color: var(--muted); }
.code__copy[data-done] { color: var(--cron); border-color: var(--cron); }

.code__body {
  margin: 0;
  padding: 1.05rem 1.1rem;
  overflow-x: auto;
  font-size: .8rem;
  line-height: 1.75;
  tab-size: 2;
}
.c-key  { color: var(--cron); }
.c-str  { color: var(--http); }
.c-fn   { color: var(--text); font-weight: 500; }

/* --- Steps ----------------------------------------------------------- */

.steps { margin-top: clamp(2rem, 3.5vw, 2.75rem); display: grid; gap: 1px; background: var(--line-soft); border-block: 1px solid var(--line-soft); }

.step {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, .95fr) minmax(0, 1.3fr);
  gap: 1.5rem 2rem;
  align-items: start;
  padding: 2.2rem 0;
  background: var(--paper);
}
.sec--quiet .step { background: var(--surface-2); }

.step__n {
  font-family: Archivo, sans-serif;
  font-variation-settings: "wdth" 120;
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--http);
  padding-top: .1rem;
}
.step__text h3 { font-size: 1.22rem; margin-bottom: .6rem; }
.step__text p { color: var(--muted); font-size: .96rem; }

.bullets { display: grid; gap: .75rem; margin-top: .95rem; }
.bullets li {
  position: relative;
  padding-left: 1.15rem;
  font-size: .93rem;
  color: var(--muted);
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
}
.bullets strong { color: var(--text); font-weight: 600; }

/* The two ways in, marked in the colour each trigger owns everywhere else. */
.bullets--triggers li:first-child::before { background: var(--http); }
.bullets--triggers li:last-child::before  { background: var(--cron); }
.step__code { grid-column: 3; grid-row: 1; }

.step:not(:has(.step__code)) .step__text { grid-column: 2 / -1; max-width: 68ch; }

@media (max-width: 900px) {
  .step { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .step__code { grid-column: 2; grid-row: auto; }
  .step:not(:has(.step__code)) .step__text { grid-column: 2; }
}

/* --- Screenshots ----------------------------------------------------- */

.shot__media { width: 100%; height: auto; border-radius: 10px; }
img.shot__media { border: 1px solid var(--line); box-shadow: var(--shadow); }

/* Captures come in two themes. Hiding one with display:none also keeps the
   browser from fetching it, since both are loading="lazy". */
[data-theme="light"] .shot--dark,
[data-theme="dark"] .shot--light { display: none; }

/* Awaiting a capture: holds the exact aspect ratio the image will occupy,
   so the layout does not shift when the file lands. */
.shot--pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  aspect-ratio: var(--ratio, 16 / 10);
  border: 1px dashed var(--line);
  border-radius: 10px;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent 0 9px,
      color-mix(in srgb, var(--line) 30%, transparent) 9px 10px
    ),
    var(--surface);
}
.shot__path {
  font-family: "IBM Plex Mono", monospace;
  font-size: .74rem;
  color: var(--muted);
  background: var(--surface);
  padding: .2rem .5rem;
  border-radius: 4px;
  text-align: center;
}
.shot__size {
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--muted);
  opacity: .7;
}

@media (max-width: 520px) {
  .shot__path { font-size: .64rem; }
  .shot__size { display: none; }
}

/* --- Storage diagram -------------------------------------------------- */

.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, .9fr) minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  margin: clamp(2rem, 3.5vw, 2.75rem) 0 0;
  max-width: 880px;
}

.flow__box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  background: var(--surface-2);
}
.flow__eyebrow {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .75rem;
}
.flow__file {
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface);
  padding: 1rem .75rem;
  text-align: center;
}
.flow__file strong {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.05rem;
  font-weight: 500;
}
.flow__file span { font-size: .82rem; color: var(--muted); }
.flow__note {
  margin-top: .6rem;
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
}

.flow__arrows { display: grid; gap: 1.6rem; }

/* Label sitting on its own line, the shaft drawn underneath it. */
.flow__arrow {
  position: relative;
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: .7rem;
  line-height: 1.4;
  text-align: center;
  padding-bottom: .6rem;
}
.flow__arrow::before {
  content: "";
  position: absolute;
  bottom: 0;
  height: 0;
  border-top: 1.5px solid currentColor;
}
.flow__arrow::after {
  content: "";
  position: absolute;
  bottom: -3.5px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.flow__arrow--out { color: var(--http); }
.flow__arrow--out::before { left: 0; right: 7px; }
.flow__arrow--out::after { right: 0; border-left: 8px solid currentColor; }

.flow__arrow--in { color: var(--cron); }
.flow__arrow--in::before { left: 7px; right: 0; border-top-style: dashed; }
.flow__arrow--in::after { left: 0; border-right: 8px solid currentColor; }

/* Stacked: the two flows turn to face down and up between the boxes. */
@media (max-width: 720px) {
  .flow { grid-template-columns: 1fr; gap: 1.5rem; max-width: 420px; }
  .flow__arrows { grid-auto-flow: column; grid-auto-columns: 1fr; gap: .75rem; }
  .flow__arrow { padding: 1.6rem 0 0; font-size: .65rem; }
  .flow__arrow::before { left: 50%; right: auto; top: 0; bottom: auto; height: 1.25rem; border-top: 0; border-left: 1.5px solid currentColor; }
  .flow__arrow::after { left: 50%; right: auto; bottom: auto; border: 0; margin-left: -4px; }
  .flow__arrow--out::after { top: 1.05rem; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 8px solid currentColor; }
  .flow__arrow--in::before { border-left-style: dashed; }
  .flow__arrow--in::after { top: -2px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 8px solid currentColor; }
}

.flow__middle { display: grid; gap: .9rem; }
.flow__mid-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.storage__note { margin-top: clamp(1.75rem, 3.5vw, 2.5rem); max-width: 74ch; }
.storage__note h3 {
  font-family: "IBM Plex Mono", monospace;
  font-variation-settings: normal;
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .85rem;
}
.storage__note p { font-size: .95rem; color: var(--muted); }
.storage__note p + p { margin-top: .7rem; }
.storage__note strong { color: var(--text); font-weight: 600; }
.storage__off {
  margin-top: 1.1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
}

/* --- Cards ----------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1px;
  margin-top: clamp(2rem, 3.5vw, 2.75rem);
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
}
.card {
  background: var(--surface);
  padding: 1.7rem 1.5rem;
  transition: background-color .18s ease;
}
.card:hover { background: var(--surface-2); }
.card h3 { font-size: 1.06rem; margin-bottom: .55rem; }
.card p { font-size: .92rem; color: var(--muted); }
.card strong { color: var(--text); font-weight: 600; }

/* --- Design traits --------------------------------------------------- */

.traits {
  display: grid;
  gap: 0;
  margin-top: clamp(1.8rem, 3.2vw, 2.4rem);
  max-width: 78ch;
}
.traits li {
  padding: 1.05rem 0 1.05rem 2.1rem;
  border-bottom: 1px solid var(--line);
  font-size: .96rem;
  color: var(--muted);
  position: relative;
}
.traits li:last-child { border-bottom: 0; }
/* A small solid marker rather than a tick or a cross: these are design
   decisions, not a checklist of what is present or missing. */
.traits li::before {
  content: "";
  position: absolute;
  left: .55rem;
  top: 1.55rem;
  width: 6px;
  height: 6px;
  background: var(--http);
  transform: rotate(45deg);
}
.traits strong { color: var(--text); font-weight: 600; }

/* --- Get started ----------------------------------------------------- */

.start {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  margin-top: clamp(2rem, 3.5vw, 2.75rem);
}
.start__aside h3 {
  font-size: .76rem;
  font-family: "IBM Plex Mono", monospace;
  font-variation-settings: normal;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .7rem;
}
.start__aside h3 + p { margin-bottom: .45rem; }
.start__aside p { font-size: .93rem; color: var(--muted); }
.start__aside > p + h3 { margin-top: 1.7rem; }
.start__cta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.8rem; }

@media (max-width: 860px) {
  .start { grid-template-columns: 1fr; }
}

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

.foot { border-top: 1px solid var(--line); padding: 3rem 0; background: var(--surface); }
.foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3rem;
  justify-content: space-between;
  align-items: flex-start;
}
.foot__brand { display: flex; gap: .8rem; align-items: flex-start; }
.foot__brand .brand__mark { width: 24px; height: 24px; flex: none; margin-top: .15rem; }
.foot__brand p { font-size: .84rem; color: var(--muted); line-height: 1.65; }

.foot__links {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: .5rem 2.5rem;
}
.foot__links a {
  font-size: .84rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .16s ease;
}
.foot__links a:hover { color: var(--http); }

@media (max-width: 520px) {
  .foot__links { grid-template-columns: 1fr; }
}
