/*
  The studio's own palette, `app/lib/src/ui/design/themes/flutter_blue.dart`,
  and the navy of its icon, so the page and the demo it opens are one product:
  thin borders, small mono labels, commands drawn as terminals.
*/
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist.woff2") format("woff2");
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-mono.woff2") format("woff2");
}

:root {
  --bg: #ffffff;
  --panel: #f6f8fb;
  --ink: #11151b;
  --ink2: #3b4049;
  --mut: #6b7280;
  --line: #e5e8ee;
  --accent: #0553b1;
  --accent-hover: #04407f;
  --accent-soft: #e7f0fb;
  --navy: #0c1826;
  --navy-2: #1a2f4c;
  --navy-line: #22344d;
  --on-navy: #e6edf7;
  --on-navy-mut: #9fb0c7;
  --sky: #8ec2ff;
  --code-keyword: #7ab8ff;
  --code-string: #9fdcb0;
  --code-comment: #7d91ab;
  --code-accent: #e7c58a;
  --shadow: 0 28px 64px -28px rgba(12, 24, 38, 0.45);
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --panel: #141821;
    --ink: #eceef2;
    --ink2: #c5c9d2;
    --mut: #8d93a1;
    --line: #242936;
    --accent: #6cb2f8;
    --accent-hover: #9ccbfb;
    --accent-soft: #13283d;
    --shadow: 0 28px 64px -28px rgba(0, 0, 0, 0.85);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink2);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 600;
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h3 {
  font-size: 0.98rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

code,
pre {
  font-family: var(--mono);
}

:not(pre) > code {
  font-size: 0.86em;
  padding: 0.12em 0.36em;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--ink);
}

.wrap {
  max-width: 1128px;
  margin: 0 auto;
  padding: 0 28px;
}

section {
  padding: 96px 0;
}

.band {
  background: var(--panel);
  border-block: 1px solid var(--line);
}

/* What a section is, above its title. */
.label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--mut);
  font: 500 0.74rem/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.label b {
  color: var(--accent);
  font-weight: 500;
}

.label::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--line);
}

/* Hero: a navy band the picture steps out of. */

/* The header lies on the band rather than in it, so it stays the page's
   header and the band stays the first thing in the page's content. */
.top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 1;
}

.hero {
  position: relative;
  isolation: isolate;
  padding: 68px 0 72px;
  color: var(--on-navy-mut);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0 0 clamp(140px, 23vw, 330px) 0;
  z-index: -1;
}

.hero::before {
  background:
    radial-gradient(900px 420px at 78% 0%, var(--navy-2), transparent 70%),
    linear-gradient(180deg, #101f33, var(--navy));
}

.hero::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
}

.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  border-radius: 7px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.top nav,
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  font-size: 0.9rem;
}

.top nav a {
  color: var(--on-navy-mut);
}

.top nav a:hover,
.top nav a[aria-current] {
  color: #fff;
  text-decoration: none;
}

/* A page with no hero to lie on: the header is a bar of its own. */
.top.bar {
  position: static;
  background: linear-gradient(180deg, #101f33, var(--navy));
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 56px;
  align-items: end;
  padding-top: 68px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--on-navy);
  font: 400 0.76rem/1.2 var(--mono);
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5fd08a;
}

.hero h1 {
  margin-top: 22px;
  color: #fff;
  font-size: clamp(2.2rem, 4.5vw, 3.35rem);
  line-height: 1.07;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

.hero h1 span {
  color: var(--sky);
}

.lede {
  max-width: 34em;
  margin-top: 22px;
  color: var(--on-navy);
  font-size: 1.08rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  padding: 0.66em 1.1em;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-weight: 500;
  font-size: 0.94rem;
}

.button:hover {
  border-color: var(--mut);
  text-decoration: none;
}

.hero .button {
  border-color: rgba(255, 255, 255, 0.24);
  background: transparent;
  color: #fff;
}

.hero .button:hover {
  border-color: rgba(255, 255, 255, 0.6);
}

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

.hero .button.primary:hover {
  border-color: #dbe8f8;
  background: #dbe8f8;
}

.note {
  max-width: 36em;
  margin-top: 18px;
  font-size: 0.86rem;
}

.hero-side p {
  margin-top: 12px;
  font-size: 0.86rem;
}

.shot {
  display: block;
  margin-top: 60px;
}

.shot img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), var(--shadow);
}

/* Code, and a terminal wherever the page shows commands. */

.code {
  position: relative;
  border: 1px solid var(--navy-line);
  border-radius: 10px;
  background: var(--navy);
  overflow: hidden;
}

.code .title {
  display: block;
  padding: 9px 18px;
  border-bottom: 1px solid var(--navy-line);
  color: var(--on-navy-mut);
  font: 400 0.74rem/1.4 var(--mono);
}

pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  color: var(--on-navy);
  font-size: 0.82rem;
  line-height: 1.7;
}

/* What `lib/code.dart` marks in a snippet. */
.hljs-keyword,
.hljs-built_in,
.hljs-literal {
  color: var(--code-keyword);
}

.hljs-string {
  color: var(--code-string);
}

.hljs-subst {
  color: var(--on-navy);
}

.hljs-comment {
  color: var(--code-comment);
}

.hljs-number,
.hljs-meta,
.hljs-attr {
  color: var(--code-accent);
}

/* The prompt is drawn, so a copied command is the command alone. */
.shell .ln::before {
  content: "$ ";
  color: #5f7592;
}

.code button {
  position: absolute;
  top: 7px;
  right: 8px;
  padding: 2px 9px;
  border: 1px solid rgba(230, 237, 247, 0.22);
  border-radius: 6px;
  background: var(--navy);
  color: var(--on-navy);
  font: 400 0.72rem var(--sans);
  cursor: pointer;
}

.code button:hover {
  border-color: rgba(230, 237, 247, 0.6);
}

/* With no title to sit in, the button gets a row of its own, so it never
   covers a long command. */
.code:not(:has(.title)):has(button) pre {
  padding-top: 40px;
}

.hero .code {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(8, 17, 28, 0.72);
}

.hero .code .title {
  border-color: rgba(255, 255, 255, 0.14);
}

/* Tools */

.sub {
  max-width: 36em;
  margin-top: 12px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
  color: var(--ink2);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tile:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 28px -18px rgba(5, 83, 177, 0.5);
  text-decoration: none;
}

.tile.big {
  grid-column: span 2;
}

.tile .pic {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.tile.big .pic {
  aspect-ratio: 4 / 3;
}

.tile.big .pic img {
  width: 100%;
}

/* A small tile shows one part of its panel, at a size you can read. */
.tile:not(.big) .pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--fx, 0%) var(--fy, 0%);
  transform: scale(1.85);
  transform-origin: var(--fx, 0%) var(--fy, 0%);
}

.tile h3 {
  padding: 16px 18px 0;
}

.tile p {
  padding: 6px 18px 18px;
  color: var(--mut);
  font-size: 0.88rem;
  line-height: 1.55;
}

.tile.big h3 {
  padding: 20px 22px 0;
  font-size: 1.08rem;
}

.tile.big p {
  padding: 6px 22px 22px;
  color: var(--ink2);
  font-size: 0.94rem;
}

.rest-title {
  margin-top: 56px;
}

.rest {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  margin: 14px 0 0;
}

.rest div {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}

.rest dt a {
  color: var(--ink);
  font-weight: 500;
}

.rest dd {
  margin: 0;
  color: var(--mut);
}

/* Text beside a picture or a code block */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

/* For a snippet whose lines are longer than half the page. */
.split.code-wide {
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
}

.split p {
  margin-top: 16px;
}

.outcomes {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.outcomes li {
  display: flex;
  gap: 12px;
  padding: 11px 16px;
  font-size: 0.94rem;
}

.outcomes li + li {
  border-top: 1px solid var(--line);
}

.outcomes li::before {
  content: "\2192";
  color: var(--accent);
  font-family: var(--mono);
}

.outcomes a {
  color: var(--ink);
  font-weight: 500;
}

.framed {
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

/* Agents */

.ways {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 56px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.ways > div {
  padding: 22px 24px 24px;
}

.ways > div + div {
  border-left: 1px solid var(--line);
}

.ways .code {
  margin-top: 14px;
}

.ways pre {
  min-height: 9em;
}

.ways p {
  margin-top: 14px;
  color: var(--mut);
  font-size: 0.9rem;
}

.same {
  margin-top: 28px;
  color: var(--mut);
  font-size: 0.94rem;
}

/* Try it */

.steps {
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 44px minmax(0, 4fr) minmax(0, 5fr);
  gap: 0 24px;
  align-items: center;
  padding: 26px 28px;
}

.steps li + li {
  border-top: 1px solid var(--line);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  align-self: start;
  padding-top: 3px;
  color: var(--accent);
  font: 500 0.8rem var(--mono);
}

.steps pre {
  font-size: 0.78rem;
}

.steps p {
  margin-top: 6px;
  color: var(--mut);
  font-size: 0.93rem;
}

.fine {
  max-width: 48em;
  margin-top: 24px;
  color: var(--mut);
  font-size: 0.88rem;
}

/* Get in touch */

.contact {
  max-width: 48em;
  margin-top: 18px;
  font-size: 1.02rem;
  text-wrap: pretty;
}

/* Footer */

footer {
  border-top: 1px solid var(--line);
  color: var(--mut);
  font-size: 0.9rem;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 28px;
}

footer span {
  display: flex;
  align-items: center;
  gap: 10px;
}

footer nav a {
  color: var(--mut);
}

footer nav a:hover {
  color: var(--ink);
  text-decoration: none;
}

/* Docs: the menu of every guide, the guide, and the list of its sections. */

.docs {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr) 200px;
  gap: 56px;
  align-items: start;
  padding-top: 48px;
  padding-bottom: 96px;
}

.docs-menu {
  display: none;
}

.docs-side,
.docs-toc {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.docs-nav {
  font-size: 0.9rem;
}

.docs-nav a {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--ink2);
}

.docs-nav a:hover {
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}

.docs-nav a[aria-current] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.docs-nav .group {
  display: block;
  margin: 22px 0 6px;
  padding: 0 10px;
  color: var(--mut);
  font: 500 0.7rem/1.3 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.docs-toc .label {
  margin-bottom: 12px;
}

.docs-toc .label::after {
  content: none;
}

.docs-toc a {
  display: block;
  padding: 4px 0 4px 12px;
  border-left: 1px solid var(--line);
  color: var(--mut);
  font-size: 0.84rem;
  line-height: 1.4;
}

.docs-toc a.level-3 {
  padding-left: 24px;
}

.docs-toc a:hover {
  border-left-color: var(--mut);
  color: var(--ink);
  text-decoration: none;
}

/* A guide's own words: markdown, with nothing but tags to style it by. */

.prose {
  min-width: 0;
  max-width: 760px;
}

.prose > .label {
  margin-bottom: 14px;
}

.prose h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.prose h2 {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.prose h3 {
  margin-top: 36px;
  font-size: 1.08rem;
}

.prose h2,
.prose h3 {
  scroll-margin-top: 24px;
}

.prose .anchor {
  margin-left: 8px;
  color: var(--mut);
  font-weight: 400;
  opacity: 0;
}

.prose h2:hover .anchor,
.prose h3:hover .anchor,
.prose .anchor:focus-visible {
  opacity: 1;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose .code,
.prose .table {
  margin: 16px 0 0;
}

/* The paragraph that says what the tool is for. */
.prose h1 + p {
  margin-top: 20px;
  color: var(--ink);
  font-size: 1.1rem;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose li {
  margin-top: 6px;
}

.prose li > ul,
.prose li > ol {
  margin-top: 6px;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose img {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.prose blockquote {
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
  color: var(--ink);
}

.prose blockquote p:first-child {
  margin-top: 0;
}

.prose .table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.prose th,
.prose td {
  padding: 9px 14px;
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--panel);
  color: var(--ink);
  font-weight: 500;
}

.prose tr + tr td,
.prose tbody tr:first-child td {
  border-top: 1px solid var(--line);
}

/* On a guide the button waits for the pointer, so a snippet stays the height
   of its code; where there is no pointer there is no button. */
.prose .code:not(:has(.title)):has(button) pre {
  padding-top: 18px;
}

.prose .code button {
  opacity: 0;
  transition: opacity 0.15s;
}

.prose .code:hover button,
.prose .code button:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .prose .code button {
    display: none;
  }
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 64px;
}

.pager a {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-weight: 500;
}

.pager a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.pager small {
  display: block;
  color: var(--mut);
  font-size: 0.78rem;
  font-weight: 400;
}

.pager .next {
  grid-column: 2;
  text-align: right;
}

.edit {
  margin-top: 28px;
  font-size: 0.86rem;
}

/* The page on a 404: the band alone, with nothing stepping out of it. */

.lost {
  min-height: 100vh;
  padding-bottom: 96px;
}

.lost::before,
.lost::after {
  inset: 0;
}

.hero.lost h1 {
  margin-top: 96px;
}

.lost p {
  margin-top: 16px;
  color: var(--on-navy);
}

@media (max-width: 1100px) {
  .docs {
    grid-template-columns: 216px minmax(0, 1fr);
    gap: 48px;
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  section {
    padding: 64px 0;
  }

  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-top: 24px;
    padding-bottom: 64px;
  }

  .docs-side {
    display: none;
  }

  .docs-menu {
    display: block;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .docs-menu summary {
    padding: 11px 16px;
    color: var(--ink);
    font-weight: 500;
    cursor: pointer;
  }

  .docs-menu .docs-nav {
    padding: 0 6px 12px;
  }

  .hero {
    padding-bottom: 48px;
  }

  .lost {
    padding-bottom: 64px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    padding-top: 40px;
  }

  .split,
  .split.code-wide {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .ways > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .ways pre {
    min-height: 0;
  }

  .steps li {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 14px;
    padding: 22px;
  }

  .steps li > :last-child {
    grid-column: 2;
  }
}

@media (max-width: 680px) {
  .wrap {
    padding: 0 20px;
  }

  .in-page {
    display: none;
  }

  .top nav {
    flex-wrap: nowrap;
    gap: 8px 16px;
  }

  footer nav {
    gap: 8px 16px;
  }

  /* One column: every tile shows its whole picture. */
  .tiles {
    grid-template-columns: minmax(0, 1fr);
  }

  .tile.big {
    grid-column: auto;
  }

  .tile:not(.big) .pic {
    aspect-ratio: 4 / 3;
  }

  .tile:not(.big) .pic img {
    transform: none;
  }

  .rest div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .shot {
    margin-top: 40px;
  }

  .shot img {
    border-radius: 8px;
  }
}
