/* easl landing page — shares the docs site's palette tokens */

:root {
  --bg: #0d0e13;
  --text: #d7dae2;
  --text-dim: #a4a8b3;
  --accent: #a98cf0;
  --border: rgba(255, 255, 255, 0.1);
  --hl-comment: #6d7180;
  --hl-string: #7fc79a;
  --hl-number: #e0a06a;
  --hl-keyword: #a98cf0;
  --hl-type: #72b5dd;
  --hl-call: #ccd0da;
  --hl-paren: #7d818e;
  --hl-annotation: #dd7ec1;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* how opaque the panels are; the code panel fades in on hover */
  --panel-opacity: 0.74;
  --code-panel-opacity: 0.2;
  --code-panel-opacity-hover: 0.8;
  --panel-blur: 10px;

  /* room around the code panel's lines: the nav, the page's bottom margin,
     and the panel's padding and note */
  --program-chrome: 9.5rem;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---- background ---- */

#hero-canvas,
.scrim {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#hero-canvas {
  display: block;
}

.scrim {
  background: linear-gradient(
    100deg,
    rgba(10, 10, 16, 0.86) 0%,
    rgba(10, 10, 16, 0.6) 34%,
    rgba(10, 10, 16, 0) 62%
  );
}

.no-webgpu #hero-canvas {
  display: none;
}

.no-webgpu .scrim {
  background: radial-gradient(
      75rem 50rem at 80% -10%,
      #241d3d 0%,
      transparent 60%
    ),
    radial-gradient(60rem 40rem at 10% 110%, #14243a 0%, transparent 60%);
}

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

.top {
  position: relative;
  padding: 1rem clamp(1.2rem, 4vw, 2.5rem);
}

.top ul {
  list-style: none;
  display: flex;
  justify-content: flex-end;
  gap: 1.4rem;
  margin: 0;
  padding: 0;
}

.top a {
  color: var(--text);
  font-size: 0.95rem;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}

/* ---- layout ---- */

main {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: 0 clamp(1.2rem, 4vw, 2.5rem) 1.5rem;
}

.intro {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

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

.hero {
  margin-block: auto;
  padding-block: 1.5rem;
  max-width: 34rem;
}

.hero h1 {
  font-family: var(--mono);
  font-size: clamp(4rem, 13vw, 9rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  margin: 0 0 0.8rem;
}

.hero p {
  color: var(--text-dim);
  font-size: 1.06rem;
  margin: 0 0 1.5rem;
}

.hero h1 + p {
  color: var(--text);
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  font-weight: 550;
  line-height: 1.3;
  margin-bottom: 0.7rem;
}

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

/* every link in hero.md is a button */
.hero a {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  background: var(--accent);
  color: #14121c;
  font-weight: 600;
}

.hero a:hover {
  filter: brightness(1.1);
  text-decoration: none;
}

/* ---- get started ---- */

.get-started {
  max-width: 34rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(13, 14, 19, var(--panel-opacity));
  backdrop-filter: blur(var(--panel-blur));
}

.get-started p {
  margin: 0;
  font-size: 0.95rem;
}

.get-started p:last-child {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.get-started pre {
  margin: 0.5rem 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
}

/* ---- program ---- */

.program {
  /* big enough to show every line at once, down to the smallest size that's
     still readable; below that, the code scrolls */
  --program-size: clamp(
    0.62rem,
    calc((100svh - var(--program-chrome)) / (var(--program-lines) * 1.5)),
    0.86rem
  );
  align-self: center;
  min-width: 0;
  max-width: 100%;
  padding: 0.8rem 1.3rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(13, 14, 19, var(--code-panel-opacity));
  backdrop-filter: blur(0);
  transition: background-color 0.25s ease, backdrop-filter 0.25s ease;
}

.program:hover {
  background: rgba(13, 14, 19, var(--code-panel-opacity-hover));
  backdrop-filter: blur(var(--panel-blur));
}

pre.code {
  margin: 0;
  overflow: auto;
  max-height: calc(100svh - var(--program-chrome));
  font-family: var(--mono);
  font-size: var(--program-size);
  line-height: 1.5;
}

.easl .c { color: var(--hl-comment); font-style: italic; }
.easl .s { color: var(--hl-string); }
.easl .n { color: var(--hl-number); }
.easl .k { color: var(--hl-keyword); font-weight: 600; }
.easl .t { color: var(--hl-type); }
.easl .f { color: var(--hl-call); font-weight: 550; }
.easl .p { color: var(--hl-paren); }
.easl .a { color: var(--hl-annotation); }

.program-note {
  margin-bottom: 0.6rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.program-note p {
  margin: 0;
}

.fallback-note {
  display: none;
}

.no-webgpu .program-note {
  display: none;
}

.no-webgpu .fallback-note {
  display: block;
}

/* ---- small screens ---- */

@media (max-width: 60rem) {
  main {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero {
    padding-block: 2rem 2.5rem;
  }

  .get-started {
    max-width: none;
  }

  .scrim {
    background: rgba(10, 10, 16, 0.6);
  }

  pre.code {
    font-size: 0.72rem;
    max-height: none;
  }
}
