/* Phoenix user guide */

:root {
  --bg: #ffffff;
  --surface: #f6f6f7;
  --surface-2: #eeeef0;
  --text: #1b1b1f;
  --muted: #5d6068;
  --border: #e3e3e7;
  --accent: #d9480f;
  --accent-soft: #fff1e6;
  --accent-text: #b33a06;
  --link: #c2410c;
  --code-bg: #f3f3f5;
  --tip: #0f7b5f;
  --tip-soft: #e8f6f1;
  --note: #2f5fb3;
  --note-soft: #ebf1fb;
  --warn: #a15c00;
  --warn-soft: #fdf4e3;
  --planned: #7046c2;
  --planned-soft: #f2edfb;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .06);
  --radius: 10px;
  --sidebar: 272px;
  --toc: 220px;
  --header: 60px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131315;
    --surface: #1b1b1e;
    --surface-2: #232327;
    --text: #e9e9ec;
    --muted: #a2a5ad;
    --border: #2d2d32;
    --accent: #ff7a2f;
    --accent-soft: #2b1b10;
    --accent-text: #ffa269;
    --link: #ff9a5c;
    --code-bg: #222226;
    --tip: #4cc9a0;
    --tip-soft: #11251f;
    --note: #7ea6f0;
    --note-soft: #141d2e;
    --warn: #f0b04f;
    --warn-soft: #2a2010;
    --planned: #b69cf2;
    --planned-soft: #1f1830;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #131315;
  --surface: #1b1b1e;
  --surface-2: #232327;
  --text: #e9e9ec;
  --muted: #a2a5ad;
  --border: #2d2d32;
  --accent: #ff7a2f;
  --accent-soft: #2b1b10;
  --accent-text: #ffa269;
  --link: #ff9a5c;
  --code-bg: #222226;
  --tip: #4cc9a0;
  --tip-soft: #11251f;
  --note: #7ea6f0;
  --note-soft: #141d2e;
  --warn: #f0b04f;
  --warn-soft: #2a2010;
  --planned: #b69cf2;
  --planned-soft: #1f1830;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--header) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand span { color: var(--muted); font-weight: 500; }

.header-spacer { flex: 1; }

.search {
  position: relative;
  min-width: 0;
  width: min(320px, 40vw);
}
.search input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.search svg {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.search-results {
  position: absolute;
  top: 42px;
  left: 0;
  right: 0;
  max-height: 60vh;
  overflow: auto;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.search-results[hidden] { display: none; }
.search-results a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}
.search-results a small { display: block; color: var(--muted); font-size: 12px; }
.search-results a:hover, .search-results a.active { background: var(--surface-2); text-decoration: none; }
.search-results .empty { padding: 8px 10px; color: var(--muted); font-size: 14px; }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.icon-button svg { width: 18px; height: 18px; }
.menu-button { display: none; }

/* Layout */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--toc);
  max-width: 1440px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: var(--header);
  height: calc(100vh - var(--header));
  overflow-y: auto;
  padding: 24px 16px 40px 20px;
  border-right: 1px solid var(--border);
}
.sidebar h4 {
  margin: 22px 0 6px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sidebar h4:first-child { margin-top: 0; }
.sidebar ul { margin: 0; padding: 0; list-style: none; }
.sidebar a {
  display: block;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--text);
  font-size: 14.5px;
}
.sidebar a:hover { background: var(--surface-2); text-decoration: none; }
.sidebar a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}

main {
  min-width: 0;
  padding: 40px 56px 80px;
}

.content { max-width: 780px; margin: 0 auto; }

.toc {
  position: sticky;
  top: var(--header);
  height: calc(100vh - var(--header));
  overflow-y: auto;
  padding: 40px 20px 40px 8px;
  font-size: 13.5px;
}
.toc h4 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.toc ul { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--border); }
.toc a {
  display: block;
  margin-left: -1px;
  padding: 4px 0 4px 12px;
  border-left: 2px solid transparent;
  color: var(--muted);
}
.toc a.sub { padding-left: 24px; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { border-left-color: var(--accent); color: var(--text); }

/* Content */

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.015em; }
h1 { margin: 0 0 12px; font-size: 38px; font-weight: 720; letter-spacing: -.025em; }
h2 {
  margin: 56px 0 14px;
  padding-top: 8px;
  font-size: 26px;
  font-weight: 680;
}
h3 { margin: 32px 0 10px; font-size: 19px; font-weight: 650; }
h4 { margin: 24px 0 8px; font-size: 16px; font-weight: 650; }

.lead { margin: 0 0 28px; color: var(--muted); font-size: 19px; line-height: 1.55; }

.anchor {
  margin-left: 6px;
  color: var(--border);
  font-weight: 400;
  opacity: 0;
}
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
.anchor:hover { color: var(--accent); text-decoration: none; }

p, ul, ol, table, figure, .callout, pre { margin: 0 0 18px; }
li { margin: 4px 0; }
li > ul, li > ol { margin: 4px 0 0; }

strong { font-weight: 640; }

code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--code-bg);
  font: .88em var(--mono);
}
pre {
  overflow-x: auto;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
  font: 13.5px/1.6 var(--mono);
}
pre code { padding: 0; background: none; font-size: inherit; }

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  font: 600 .8em/1.7 var(--font);
  text-align: center;
  white-space: nowrap;
}

.menu-path {
  font-weight: 600;
  white-space: nowrap;
}

hr { margin: 40px 0; border: 0; border-top: 1px solid var(--border); }

/* Tables */

.table-wrap { overflow-x: auto; margin: 0 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table-wrap table { margin: 0; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
tbody tr:hover { background: var(--surface); }
td:first-child { white-space: nowrap; }
td.wrap { white-space: normal; }

/* Figures */

figure { margin: 24px 0 28px; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
  cursor: zoom-in;
}
figure.inline img { width: auto; max-width: 100%; margin: 0 auto; }
figure.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
figure.narrow img { width: auto; max-width: 100%; margin: 0 auto; }
figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 10, 12, .82);
  cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }

/* Callouts */

.callout {
  padding: 14px 16px 14px 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--note);
  border-radius: 8px;
  background: var(--note-soft);
  font-size: 15px;
}
.callout > :last-child { margin-bottom: 0; }
.callout .label {
  display: block;
  margin-bottom: 2px;
  color: var(--note);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.callout.tip { border-left-color: var(--tip); background: var(--tip-soft); }
.callout.tip .label { color: var(--tip); }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout.warn .label { color: var(--warn); }
.callout.planned { border-left-color: var(--planned); background: var(--planned-soft); }
.callout.planned .label { color: var(--planned); }

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--planned-soft);
  color: var(--planned);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .03em;
  vertical-align: 3px;
  text-transform: uppercase;
}
.badge.new { background: var(--accent-soft); color: var(--accent-text); }

/* Steps */

ol.steps { counter-reset: step; padding: 0; list-style: none; }
ol.steps > li {
  position: relative;
  margin: 0 0 14px;
  padding-left: 40px;
  counter-increment: step;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
}

/* Cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 0 0 28px;
}
.card {
  display: block;
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.card .card-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.card .card-icon svg { width: 18px; height: 18px; }

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 0 0 40px;
}
.hero h1 { font-size: 44px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}
.button:hover { text-decoration: none; border-color: var(--accent); }
.button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button.primary:hover { filter: brightness(1.05); }

/* Two-column definition list for tools and options */

dl.defs { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0 0 20px; }
dl.defs dt { font-weight: 640; }
dl.defs dd { margin: 0; color: var(--text); }

.tool-grid figure img { width: auto; max-width: 100%; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}
.tool {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14.5px;
}
.tool h4 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 4px; font-size: 15px; }
.tool p { margin: 0; color: var(--muted); line-height: 1.5; }

/* An image beside its explanation */

.split {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin: 24px 0 28px;
}
.split > figure { margin: 0; }
.split > figure img { width: auto; max-width: 100%; }
.split > :last-child > :last-child { margin-bottom: 0; }

/* Two figures side by side */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
  margin: 24px 0 28px;
}
.grid-2 > figure { margin: 0; }
.grid-2 > figure img { width: auto; max-width: 100%; margin: 0 auto; }

/* Page navigation */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.pager a {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager small { display: block; color: var(--muted); font-size: 12.5px; }
.pager .next { grid-column: 2; text-align: right; }

.site-footer {
  margin-top: 40px;
  color: var(--muted);
  font-size: 13px;
}

/* Narrow screens */

@media (max-width: 1180px) {
  .layout { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 860px) {
  .layout { display: block; }
  .menu-button { display: inline-grid; }
  .sidebar {
    position: fixed;
    top: var(--header);
    left: 0;
    z-index: 15;
    width: min(300px, 86vw);
    background: var(--bg);
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    transition: transform .2s;
  }
  body.nav-open .sidebar { transform: none; }
  main { padding: 28px 16px 60px; }
  h1, .hero h1 { font-size: 32px; }
  .brand span { display: none; }
  .search { width: auto; flex: 1; min-width: 0; }
  .github-link { display: none; }
  .header-spacer { display: none; }
  .site-header { gap: 10px; padding: 0 16px; }
  dl.defs { grid-template-columns: 1fr; gap: 2px; }
  .split { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  dl.defs dd { margin-bottom: 10px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}
