$fg: #1a1a1a;
$muted: #555;
$bg: #fafafa;
$accent: #c2410c;
$code-bg: #f1f1f1;
$max-width: 760px;

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  color: $fg;
  background: $bg;
  line-height: 1.6;
}

main {
  max-width: $max-width;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

footer {
  max-width: $max-width;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid #e5e5e5;
  color: $muted;
  font-size: 0.9rem;

  a { color: $muted; margin-right: 0.5rem; }
  .license { margin-top: 0.5rem; font-size: 0.8rem; }
}

.hero {
  margin-bottom: 3rem;

  h1 {
    font-size: 3rem;
    margin: 0 0 0.5rem;
    color: $accent;
    letter-spacing: -0.02em;
  }

  .tagline {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
  }

  .sub {
    color: $muted;
    margin: 0 0 1.5rem;
  }
}

.cta {
  display: flex;
  gap: 0.75rem;

  a {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
  }

  .primary {
    background: $accent;
    color: white;
  }

  .secondary {
    border: 1px solid #d0d0d0;
    color: $fg;
  }
}

section {
  margin-bottom: 2.5rem;

  h2 {
    font-size: 1.4rem;
    margin: 0 0 1rem;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 0.3rem;
  }
}

.features {
  list-style: none;
  padding: 0;

  li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
  }

  li:last-child { border-bottom: none; }
}

pre {
  background: $code-bg;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.9rem;
}

code {
  font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
}

p code, li code {
  background: $code-bg;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.demo-caption {
  color: $muted;
  margin-bottom: 1.5rem;
}

.asciinema-player-wrap {
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.demo-wide {
  // Break out of the 760px main column so the side-by-side grid has room.
  // Negative-margin trick: span the full viewport width while still
  // honouring the section's own horizontal padding.
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  padding: 0 1.5rem;
  box-sizing: border-box;

  > h2,
  > .demo-caption,
  > .tabs {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e5e5e5;

  .tab {
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.6rem 0.9rem;
    margin-bottom: -1px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: $muted;
    transition: color 0.15s ease, border-color 0.15s ease;

    &:hover { color: $fg; }
    &:focus-visible {
      outline: none;
      color: $fg;
      box-shadow: 0 0 0 2px rgba($accent, 0.25);
      border-radius: 4px 4px 0 0;
    }

    &.is-active {
      color: $accent;
      border-bottom-color: $accent;
    }
  }
}

.tab-panel {
  max-width: 1200px;
  margin: 0 auto;
}

.panel-caption {
  color: $muted;
  margin: 0 auto 1.25rem;
  max-width: 1200px;
}

.demo-grid {
  max-width: 1200px;
  margin: 0 auto 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;

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

.demo-cast {
  position: sticky;
  top: 1rem;

  @media (max-width: 900px) {
    position: static;
  }
}

.demo-renders {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;

  figure {
    margin: 0;

    a {
      display: block;
      border-radius: 6px;
      overflow: hidden;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
      border: 1px solid #e5e5e5;
    }

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

    figcaption {
      margin-top: 0.5rem;
      font-size: 0.85rem;
      color: $muted;
      line-height: 1.4;
    }
  }
}
