/* Avenya palette and type, as on avenya.ch (avenya-website/DESIGN.md).
   Cyan Deep on light surfaces, Cyan on dark ones; Coral only for the one
   primary action. */
@font-face {
  font-family: "Syne";
  font-style: normal;
  font-display: swap;
  font-weight: 400 800;
  src: url("../fonts/syne-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Syne";
  font-style: normal;
  font-display: swap;
  font-weight: 400 800;
  src: url("../fonts/syne-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("../fonts/dm-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("../fonts/dm-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --cyan: #1fb6de;
  --cyan-deep: #0b7c9c;
  --coral: #ff5c4d;
  --coral-deep: #e8402f;
  --ink: #12161a;
  --ink-deep: #1b2126;
  --slate: #5a6469;
  --mist: #f5f8f9;
  --mist-deep: #ebeff1;
  --paper: #ffffff;
  --hairline: #dce3e6;
  --display: "Syne", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 400 1rem/1.7 var(--body);
  -webkit-font-smoothing: antialiased;
  /* Keeps the footer at the bottom when the page is shorter than the window. */
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

main { flex: 1; }

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

a { color: var(--cyan-deep); text-underline-offset: 3px; }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--cyan-deep); outline-offset: 3px; }

code { font-family: var(--mono); font-size: 0.9em; }
p code, li code { background: var(--mist-deep); padding: 0.1em 0.35em; border-radius: 4px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

h1, h2, h3 { font-family: var(--display); margin: 0; }
h1 {
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
h2 {
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
h3 {
  font-weight: 700;
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.label {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan-deep);
}
.accent { color: var(--cyan-deep); }
.lead { font-size: 1.15rem; color: var(--slate); max-width: 52ch; margin: 1.5rem 0 0; }
.intro { color: var(--slate); max-width: 60ch; margin: 1rem 0 0; }

/* ---- top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--mist) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 64px; }
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  text-decoration: none;
  font: 700 1.3rem var(--display);
  letter-spacing: -0.02em;
}
.topnav { display: flex; gap: 1.5rem; }
.topnav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.topnav a:hover { color: var(--cyan-deep); }
@media (max-width: 640px) { .topnav { display: none; } }

/* ---- buttons ---- */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s, box-shadow 0.15s, color 0.15s;
}
.btn-primary { background: var(--coral); color: var(--ink); }
.btn-primary:hover { background: var(--coral-deep); box-shadow: 0 8px 24px rgb(232 64 47 / 0.3); }
.btn-secondary { color: var(--ink); }
.btn-secondary:hover { color: var(--cyan-deep); }

/* ---- scenes: a pose stacked on a background, at the generator's
   POSE_AT (210, 112) and POSE_SCALE 0.95 on the 800 x 500 canvas ---- */
.scene {
  position: relative;
  margin: 0;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: var(--mist);
}
.scene-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-pose { position: absolute; left: 26.25%; top: 22.4%; width: 47.5%; }

.hop { animation: hop 1.6s cubic-bezier(0.3, 0, 0.3, 1) infinite; transform-origin: 50% 90%; }
@keyframes hop {
  0%, 100% { transform: translateY(0) scale(1.03, 0.97); }
  15% { transform: translateY(0) scale(1, 1); }
  45% { transform: translateY(-9%) scale(0.98, 1.02); }
  75% { transform: translateY(0) scale(1, 1); }
}
@media (prefers-reduced-motion: reduce) { .hop { animation: none; } }

/* ---- sections ---- */
.hero { padding: clamp(3rem, 8vw, 6rem) 0; }
.hero-grid { display: grid; gap: 3rem; align-items: center; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.scene-hero { box-shadow: 0 24px 60px rgb(18 22 26 / 0.12); }

.section { padding: clamp(3rem, 8vw, 6rem) 0; }
.section-alt { background: var(--mist-deep); }
.section-dark { background: var(--ink); color: var(--mist); }
.section-dark .label, .section-dark a { color: var(--cyan); }
.section-dark .intro { color: #b7c1c6; }
.section-dark p code { background: var(--ink-deep); color: var(--mist); }

.steps {
  list-style: none;
  padding: 0;
  margin: 3rem 0 0;
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.step h3 { margin-top: 1.25rem; display: flex; align-items: center; gap: 0.6rem; }
.step p { margin: 0.5rem 0 0; color: var(--slate); }
.num {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--mist);
  font-size: 0.95rem;
}

.modules {
  margin-top: 3rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
}
.module {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.module:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgb(18 22 26 / 0.1); }
.module .scene { border: 0; border-radius: 0; border-bottom: 1px solid var(--hairline); }
.module-body { padding: 1.5rem; }
.module-body p { margin: 0.5rem 0 0; color: var(--slate); }
.module-body .route { margin: 0 0 0.5rem; }
.module-next h3 { color: var(--slate); }

.api-grid { display: grid; gap: 3rem; align-items: center; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.section-dark .scene { border-color: rgb(255 255 255 / 0.12); }
.code {
  margin: 2rem 0 0;
  padding: 1.25rem 1.5rem;
  background: var(--ink-deep);
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 8px;
  overflow-x: auto;
  font: 0.85rem/1.7 var(--mono);
  color: var(--mist);
}
.code .c { color: var(--cyan); }

.poses {
  list-style: none;
  padding: 0;
  margin: 3rem 0 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}
.poses li {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 0.75rem 0.5rem 0.6rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--slate);
  transition: transform 0.2s;
}
.poses li:hover { transform: translateY(-4px) rotate(-2deg); }
.poses img { width: 100%; aspect-ratio: 1; }
.scenes-row {
  margin-top: 2rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
}

/* ---- footer ---- */
.footer { background: var(--ink-deep); color: #b7c1c6; padding: 2rem 0; font-size: 0.9rem; }
.footer a { color: var(--cyan); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer p { margin: 0; }
