:root {
  color-scheme: light;

  /* palette pulled from the Fell gitea theme */
  --body: #fdf9ef;
  --box-header: #eee2c2;
  --card: #ffffff;
  --secondary: #c8b89a;
  --secondary-l4: #f5f0e8;
  --secondary-d4: #876c50;

  --text-dark: #171208;
  --text: #2d1f0e;
  --text-light: #5a4b34;
  --text-mute: #8a7a5e;

  --primary: #2f9d6b;
  --primary-dark: #227a52;
  --primary-soft: rgba(47, 157, 107, 0.1);

  --nav-bg: #171410;
  --nav-link: #cdc4a8;
  --gold-on-dark: #d1a94a;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;
  --serif: "Zilla Slab", Georgia, serif;
  --display: "IM Fell English SC", Georgia, serif;

  --radius-sm: 5px;
  --radius-md: 6px;

  --page-pad: clamp(1rem, 4vw, 24px);
  --content-width: 1040px;
  --prose-width: 62ch;
}

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

html {
  scroll-behavior: smooth;
  background: var(--body);
}

/* Set by the inline head script and cleared once the display faces resolve
   (or after its timeout). Never applied when JS is off, so the page always
   renders. */
.fonts-pending body {
  opacity: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--body);
  color: var(--text);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  opacity: 1;
  transition: opacity 0.2s ease-in;
}

@media (prefers-reduced-motion: reduce) {
  body {
    transition: none;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

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

.page {
  position: relative;
  overflow-x: hidden;
}

.site-header__inner,
.hero__inner,
.section__inner,
.site-footer__inner {
  width: min(var(--content-width), calc(100vw - var(--page-pad) * 2));
  margin: 0 auto;
}

/* Header — full-bleed dark bar, constrained contents. */

.site-header {
  background: var(--nav-bg);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 16px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.brand__mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
}

.brand__mark svg,
.brand__mark img {
  width: 100%;
  height: 100%;
}

.brand__text {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.brand__name {
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--gold-on-dark);
}

.brand__tagline {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.3;
  color: var(--nav-link);
  opacity: 0.72;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
}

.site-nav__link {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--nav-link);
  transition: color 160ms ease;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: #fff;
  outline: none;
}

.site-nav__link--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
}

.site-nav__link--icon svg {
  width: 100%;
  height: 100%;
}

/* Hero — single column, mark on top, like the reference. */

.hero {
  padding: 56px var(--page-pad);
  border-bottom: 1px solid var(--secondary);
}

/* The bottle sits beside the headline, lead, and actions. */
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.hero__headline {
  grid-column: 1;
  grid-row: 1;
}

.hero__copy {
  grid-column: 1;
  grid-row: 2;
}

.hero__visual {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.bottle-scene {
  position: relative;
  width: clamp(9rem, 18vw, 14rem);
}

.bottle-scene__slot {
  position: relative;
  display: grid;
  place-items: center;
}

.bottle-scene__slot--one {
  --bottle-glass-fill: #4a5c53;
}

.bottle {
  display: block;
  width: 100%;
  height: auto;
}

.bottle__glass {
  fill: var(--bottle-glass-fill, #4a5c53);
}

.hero__eyebrow,
.section__eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  color: var(--primary-dark);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section__eyebrow:hover,
.section__eyebrow:focus-visible {
  text-decoration: underline;
  outline: none;
}

.hero__title {
  margin: 0 0 20px;
  max-width: 680px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(22px, 4.4vw, 40px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-dark);
}

.hero__lead {
  margin: 0 0 30px;
  max-width: 560px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-light);
}

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

.button {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.button:focus-visible {
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
}

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

.button--primary:hover {
  background: var(--primary-dark);
}

.button--ghost {
  border-color: var(--secondary);
  color: var(--text);
}

.button--ghost:hover {
  background: var(--secondary-l4);
}

/* Hero CTAs as a numbered onboarding path: download → define → watch. */
.hero__step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero__step-n {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
}

.button--primary .hero__step-n {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.button--ghost .hero__step-n {
  background: var(--secondary-l4);
  border: 1px solid var(--secondary);
  color: var(--primary-dark);
}

/* Sections */

.section {
  padding: 60px var(--page-pad) 0;
}

.section__heading {
  margin-bottom: 24px;
}

.section__title {
  margin: 0;
  max-width: 680px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(19px, 2.4vw, 25px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-dark);
}

.section__stats {
  margin: 14px 0 0;
  max-width: var(--prose-width);
  color: var(--text-light);
  font-size: 15.5px;
}

.section__stats-link {
  margin-left: 0.3rem;
  color: var(--primary-dark);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.section__stats-link:hover,
.section__stats-link:focus-visible {
  color: var(--primary);
  outline: none;
}

/* The For Teams panel reads as a quoted aside in the reference. */
.section--alt .section__inner {
  padding: 24px 26px;
  border: 1px solid var(--secondary);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  background: var(--secondary-l4);
}

.section--alt .section__heading {
  margin-bottom: 0;
}

/* Cards */

.feature-grid,
.case-study-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.case-study-grid + .section__stats {
  margin-top: 24px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  border: 1px solid var(--secondary);
  border-radius: var(--radius-md);
  background: var(--card);
}

.feature-card__title {
  margin: 0;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  color: var(--text-dark);
}

.feature-card__text {
  margin: 8px 0 0;
  color: var(--text-light);
  font-size: 14.5px;
  line-height: 1.6;
}

.feature-card__link {
  display: inline-block;
  margin-top: 10px;
  color: var(--primary-dark);
  font-family: var(--mono);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.feature-card__link:hover,
.feature-card__link:focus-visible {
  color: var(--primary);
  outline: none;
}

.stakes-card__list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text-light);
  font-size: 14.5px;
  line-height: 1.6;
}

.stakes-card__list li {
  margin-bottom: 10px;
}

.stakes-card__list li:last-child {
  margin-bottom: 0;
}

.stakes-card__tags {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--secondary);
}

.stakes-card__tags-label {
  margin: 0 0 8px;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stakes-card__tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stakes-card__tag {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--secondary);
  border-radius: 3px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

/* Demo */

.demo {
  margin: 0;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.demo__gif {
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--secondary);
  border-radius: var(--radius-md);
}

.demo__caption {
  max-width: var(--prose-width);
  color: var(--text-mute);
  font-size: 13.5px;
  line-height: 1.6;
  text-align: center;
}

/* Code */

.manifest {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.manifest__code {
  min-width: 0;
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--secondary);
  border-radius: var(--radius-md);
  background: var(--secondary-l4);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.manifest__code code {
  font-family: var(--mono);
  font-size: inherit;
}

/* A file card: an intro note, then its path as a header tab attached to the
   code below it. */
.manifest__file {
  min-width: 0;
}

.manifest__note {
  margin: 0 0 8px;
  color: var(--text-light);
  font-size: 14.5px;
  line-height: 1.55;
}

.manifest__path {
  margin: 0;
  padding: 8px 16px;
  border: 1px solid var(--secondary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--secondary-l4);
  color: var(--primary-dark);
  font-family: var(--mono);
  font-size: 12px;
}

.manifest__file .manifest__code {
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.get-started__code {
  position: relative;
}

.get-started__code .manifest__code {
  padding-right: 5.5rem;
}

.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 12px;
  border: 1px solid var(--secondary);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.copy-button:hover,
.copy-button:focus-visible {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  outline: none;
}

.copy-button[data-copied="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Footer */

.site-footer {
  padding: 0 var(--page-pad) 28px;
  margin-top: 70px;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  border-top: 1px solid var(--secondary);
  color: var(--text-mute);
  font-size: 12.5px;
}

.site-footer__link {
  color: var(--text-mute);
  font-family: var(--mono);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer__link:hover,
.site-footer__link:focus-visible {
  color: var(--primary-dark);
  outline: none;
}

@media (max-width: 900px) {
  .feature-grid,
  .case-study-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header__inner {
    flex-wrap: wrap;
    gap: 12px;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 16px;
  }

  .hero {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  /* Put the bottle beside the header lines (top row); the copy + buttons
     span the full width underneath both. */
  .hero__inner {
    column-gap: 1rem;
  }

  .hero__visual {
    grid-row: 1;
  }

  .hero__copy {
    grid-column: 1 / -1;
  }

  .bottle-scene {
    width: clamp(4.25rem, 19vw, 7rem);
  }

  .feature-grid,
  .case-study-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .section {
    padding-top: 44px;
  }

  .site-footer {
    margin-top: 48px;
  }
}

@media (max-width: 540px) {
  .brand__tagline {
    display: none;
  }

  .site-nav {
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav__link {
    white-space: nowrap;
  }
}
