:root {
  color-scheme: dark;
  --bg: #050606;
  --terminal: #080a09;
  --pane: #0c0f0e;
  --pane-soft: #111514;
  --ink: #ece7df;
  --muted: #a79e97;
  --dim: #6f7770;
  --line: #24312d;
  --line-hot: #5f7468;
  --green: #b8db88;
  --cyan: #81cad6;
  --amber: #e8c982;
  --rose: #d98b99;
  --red: #ef7b72;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 88% 8%, rgba(129, 202, 214, 0.08), transparent 28rem),
    radial-gradient(circle at 12% 82%, rgba(184, 219, 136, 0.07), transparent 30rem),
    var(--bg);
  background-size: 100% 4px, auto, auto, auto;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0));
  mix-blend-mode: overlay;
  opacity: 0.4;
  z-index: 20;
}

a {
  color: inherit;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

.terminal-shell {
  width: min(1560px, calc(100% - 28px));
  min-height: calc(100vh - 28px);
  margin: 14px auto;
  border: 1px solid var(--line-hot);
  background: rgba(8, 10, 9, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52);
}

.titlebar,
.statusbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #0a0d0c;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
}

.statusbar {
  min-height: 34px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.traffic {
  display: inline-flex;
  gap: 7px;
  flex: 0 0 auto;
}

.traffic span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--dim);
}

.traffic span:nth-child(1) {
  background: var(--red);
}

.traffic span:nth-child(2) {
  background: var(--amber);
}

.traffic span:nth-child(3) {
  background: var(--green);
}

.title-path,
.status-path {
  min-width: 0;
  overflow: hidden;
  color: var(--green);
  text-overflow: ellipsis;
}

.title-spacer,
.status-spacer {
  flex: 1 1 auto;
}

.viewport {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  width: auto;
  min-height: calc(100vh - 114px);
  margin: 0;
  padding: 0;
}

.tree-pane {
  position: sticky;
  top: 0;
  align-self: start;
  height: calc(100vh - 76px);
  border-right: 1px solid var(--line);
  background: rgba(10, 13, 12, 0.96);
  overflow: auto;
}

.tree-header,
.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  background: var(--pane-soft);
  color: var(--cyan);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.tree-header span,
.pane-header span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tree {
  display: block;
  position: static;
  top: auto;
  z-index: auto;
  flex-wrap: nowrap;
  gap: 0;
  padding: 14px 12px 24px;
  background: transparent;
  backdrop-filter: none;
  font-size: 0.86rem;
}

.tree-group {
  margin: 0 0 18px;
}

.tree-dir {
  color: var(--green);
  margin: 0 0 6px;
}

.tree a {
  display: block;
  position: relative;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 3px 6px 3px 29px;
  color: var(--muted);
  text-decoration: none;
  font: inherit;
}

.tree a::before {
  content: "|--";
  position: absolute;
  left: 6px;
  color: var(--dim);
}

.tree a:hover,
.tree a:focus-visible {
  background: rgba(129, 202, 214, 0.09);
  color: var(--ink);
  outline: 1px solid rgba(129, 202, 214, 0.36);
  outline-offset: -1px;
}

.tree .external::after {
  content: " ->";
  color: var(--dim);
}

.content-pane {
  min-width: 0;
  overflow: hidden;
  background: var(--terminal);
}

.buffer {
  min-height: calc(100vh - 154px);
  padding: 22px;
  overflow: hidden;
}

.terminal-card,
.terminal-section {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(6, 8, 7, 0.82);
}

.terminal-card {
  margin-bottom: 18px;
}

.terminal-section {
  scroll-margin-top: 22px;
  margin: 0 0 18px;
}

.cmd-line {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 21, 20, 0.88);
  color: var(--green);
  font-size: 0.84rem;
}

.prompt {
  color: var(--green);
  flex: 0 0 auto;
}

.cmd {
  color: var(--cyan);
  overflow-wrap: anywhere;
}

.output {
  min-width: 0;
  padding: 16px;
  overflow-wrap: anywhere;
}

.output.hero-output {
  min-height: 520px;
  display: grid;
  align-content: end;
  background-image:
    linear-gradient(90deg, rgba(6, 8, 7, 0.98) 0%, rgba(6, 8, 7, 0.9) 46%, rgba(6, 8, 7, 0.34) 100%),
    url("phone-blog-assets/01-launcher.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: right center;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: clamp(3.2rem, 7vw, 6.6rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  color: var(--ink);
  font-size: 1rem;
}

p {
  max-width: 920px;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
}

.lead {
  max-width: 760px;
  font-size: 1.15rem;
}

.page-output h1 {
  max-width: 1120px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.02;
}

.page-output h2 {
  font-size: clamp(1.45rem, 2.5vw, 2.15rem);
}

.meta-line,
.doc-meta {
  color: var(--amber);
  font-size: 0.84rem;
}

.policy-copy {
  display: grid;
  gap: 12px;
}

.policy-copy p {
  margin-bottom: 0;
}

.kicker {
  margin-bottom: 10px;
  color: var(--green);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.terminal-links,
.doc-grid,
.command-grid,
.download-grid,
.shot-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.terminal-links {
  display: flex;
  flex-wrap: wrap;
}

.terminal-link,
.action-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  border: 1px solid rgba(129, 202, 214, 0.38);
  background: rgba(129, 202, 214, 0.06);
  color: var(--cyan);
  padding: 7px 9px;
  text-decoration: none;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.terminal-link::before,
.action-link::before {
  content: "$";
  color: var(--green);
}

.terminal-link.primary,
.action-link.primary {
  border-color: rgba(184, 219, 136, 0.7);
  background: rgba(184, 219, 136, 0.14);
  color: var(--ink);
}

.terminal-link:hover,
.terminal-link:focus-visible,
.action-link:hover,
.action-link:focus-visible {
  border-color: var(--rose);
  color: var(--ink);
  outline: none;
}

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

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

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

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

.file-row,
.command-row,
.download-row,
figure,
.note {
  min-width: 0;
  border: 1px solid rgba(36, 49, 45, 0.95);
  background: rgba(17, 21, 20, 0.72);
  padding: 12px;
}

.file-row {
  display: grid;
  gap: 8px;
}

.file-row .path,
.command-row strong,
code {
  color: var(--cyan);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.file-row .path::before {
  content: "./";
  color: var(--dim);
}

.file-row p,
.command-row p,
.download-row p,
.note p {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-links a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 219, 136, 0.34);
  font-size: 0.82rem;
}

.inline-links a:hover,
.inline-links a:focus-visible {
  color: var(--ink);
  border-color: var(--rose);
  outline: none;
}

.command-row {
  display: grid;
  gap: 7px;
  align-content: start;
  min-height: 110px;
}

.download-row {
  display: grid;
  gap: 10px;
  align-content: start;
}

figure {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

figure img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 19.8;
  object-fit: cover;
  object-position: top;
  background: #020303;
}

figcaption {
  padding: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.84rem;
}

.note {
  border-color: rgba(217, 139, 153, 0.42);
  background: rgba(217, 139, 153, 0.06);
}

.terminal-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
}

.terminal-list li {
  padding: 9px 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.terminal-list li:last-child {
  border-bottom: 0;
}

.terminal-list strong {
  color: var(--cyan);
}

.terminal-list a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 219, 136, 0.34);
}

.terminal-list a:hover,
.terminal-list a:focus-visible {
  color: var(--ink);
  border-color: var(--rose);
  outline: none;
}

.quick-commands {
  margin: 14px 0 0;
  padding: 13px;
  border: 1px solid var(--line);
  background: #050606;
  color: var(--green);
  white-space: pre-wrap;
  overflow-x: auto;
}

.markdown-body {
  width: 100%;
  max-width: 1040px;
  min-width: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 24px 0 10px;
}

.markdown-body h1:first-child {
  margin-top: 0;
}

.markdown-body h1 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(2rem, 4.2vw, 4.4rem);
}

.markdown-body h2 {
  padding-top: 8px;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
}

.markdown-body h3,
.markdown-body h4 {
  color: var(--cyan);
}

.markdown-body p,
.markdown-body li {
  max-width: 920px;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.markdown-body ul,
.markdown-body ol {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  padding-left: 1.35rem;
}

.markdown-body a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 219, 136, 0.34);
}

.markdown-body a:hover,
.markdown-body a:focus-visible {
  color: var(--ink);
  border-color: var(--rose);
  outline: none;
}

.markdown-body blockquote {
  margin: 16px 0;
  padding: 6px 0 6px 14px;
  border-left: 2px solid var(--rose);
  color: var(--muted);
}

.markdown-body hr {
  height: 1px;
  margin: 22px 0;
  border: 0;
  background: var(--line);
}

.markdown-body pre,
.markdown-body table {
  margin: 16px 0;
  border: 1px solid var(--line);
  background: #050606;
}

.markdown-body pre {
  padding: 13px;
  color: var(--green);
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.markdown-body code {
  padding: 1px 4px;
  background: rgba(129, 202, 214, 0.09);
}

.markdown-body table {
  display: block;
  width: max-content;
  max-width: 100%;
  border-collapse: collapse;
  overflow-x: auto;
}

.markdown-body th,
.markdown-body td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: left;
  vertical-align: top;
}

.markdown-body th {
  color: var(--cyan);
  background: rgba(17, 21, 20, 0.88);
}

.tree a[aria-current="page"] {
  background: rgba(184, 219, 136, 0.12);
  color: var(--ink);
  outline: 1px solid rgba(184, 219, 136, 0.38);
  outline-offset: -1px;
}

.empty-state,
.error-state {
  border: 1px solid var(--line);
  background: #050606;
  padding: 14px;
}

.error-state {
  border-color: rgba(239, 123, 114, 0.56);
  color: var(--red);
}

.legacy-page {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 18px;
}

.legacy-page > nav {
  display: none;
}

.legacy-page .hero,
.legacy-page section.guide,
.legacy-page .marketplace-header,
.legacy-page .layout,
.legacy-page .toolbar {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.legacy-page .hero {
  display: block;
}

.legacy-page .split,
.legacy-page .wide-split,
.legacy-page .layout {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 14px;
}

.legacy-page .split > *,
.legacy-page .wide-split > *,
.legacy-page .layout > *,
.legacy-page .grid > *,
.legacy-page .two-grid > *,
.legacy-page .marketplace > * {
  min-width: 0;
  max-width: 100%;
}

.legacy-page .chips,
.legacy-page .cta-row,
.legacy-page .action-row,
.legacy-page .preset-actions,
.legacy-page .actions,
.legacy-page .toolbar {
  gap: 8px;
}

.legacy-page .tile,
.legacy-page .note,
.legacy-page .command-list,
.legacy-page .command-list div,
.legacy-page .table-wrap,
.legacy-page .panel,
.legacy-page .preset-card,
.legacy-page .card,
.legacy-page .toolbar,
.legacy-page pre,
.legacy-page input,
.legacy-page textarea,
.legacy-page select {
  min-width: 0;
  max-width: 100%;
  border-color: var(--line);
  border-radius: 0;
  background-color: rgba(17, 21, 20, 0.72);
  overflow-wrap: anywhere;
}

.legacy-page code,
.legacy-page p,
.legacy-page li,
.legacy-page h1,
.legacy-page h2,
.legacy-page h3 {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.legacy-page .table-wrap,
.legacy-page pre {
  max-width: 100%;
  overflow-x: auto;
}

.legacy-page pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.legacy-page table {
  max-width: 100%;
}

.legacy-page input,
.legacy-page textarea,
.legacy-page select {
  background: #050606;
  color: var(--ink);
}

.legacy-page input:focus,
.legacy-page textarea:focus,
.legacy-page select:focus {
  border-color: var(--cyan);
  outline: none;
}

.legacy-page .chips span,
.legacy-page .cta-row a,
.legacy-page .button-link,
.legacy-page .action-link,
.legacy-page .download-link,
.legacy-page .wallpaper-link,
.legacy-page button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(129, 202, 214, 0.38);
  border-radius: 0;
  background: rgba(129, 202, 214, 0.06);
  color: var(--cyan);
  padding: 7px 9px;
  text-decoration: none;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
}

.legacy-page .cta-row a:first-child,
.legacy-page .primary-link,
.legacy-page .action-link.primary,
.legacy-page .download-link,
.legacy-page button.primary,
.legacy-page button[type="submit"] {
  border-color: rgba(184, 219, 136, 0.7);
  background: rgba(184, 219, 136, 0.14);
  color: var(--ink);
}

.legacy-page button.danger {
  border-color: rgba(239, 123, 114, 0.72);
  background: rgba(239, 123, 114, 0.1);
}

.legacy-page .chips span {
  color: var(--muted);
}

.legacy-page .cta-row a:hover,
.legacy-page .cta-row a:focus-visible,
.legacy-page .button-link:hover,
.legacy-page .button-link:focus-visible,
.legacy-page .action-link:hover,
.legacy-page .action-link:focus-visible,
.legacy-page .download-link:hover,
.legacy-page .download-link:focus-visible,
.legacy-page .wallpaper-link:hover,
.legacy-page .wallpaper-link:focus-visible,
.legacy-page button:hover,
.legacy-page button:focus-visible {
  border-color: var(--rose);
  color: var(--ink);
  outline: none;
}

.legacy-page table {
  border-collapse: collapse;
}

.legacy-page th,
.legacy-page td {
  border-color: var(--line);
}

.legacy-page .preset-shot.placeholder {
  background: #050606;
}

.legacy-page .preset-shot,
.legacy-page .shot {
  border-bottom: 1px solid var(--line);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1080px) {
  .viewport {
    grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  }

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

@media (max-width: 920px) {
  .legacy-page .split,
  .legacy-page .wide-split,
  .legacy-page .layout {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .terminal-shell {
    width: calc(100% - 16px);
    margin: 8px auto;
  }

  .viewport {
    display: block;
  }

  .tree-pane {
    position: relative;
    height: auto;
    max-height: 36vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tree {
    display: flex;
    gap: 12px;
    padding: 12px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .tree-group {
    flex: 0 0 min(250px, 78vw);
    margin: 0;
    scroll-snap-align: start;
  }

  .buffer {
    padding: 12px;
  }

  .output.hero-output {
    min-height: 560px;
    background-image:
      linear-gradient(180deg, rgba(6, 8, 7, 0.94), rgba(6, 8, 7, 0.76)),
      url("phone-blog-assets/01-launcher.png");
    background-position: center top;
  }

  .titlebar,
  .statusbar {
    flex-wrap: wrap;
    gap: 6px 10px;
    height: auto;
    padding-block: 8px;
    font-size: 0.72rem;
    white-space: normal;
  }

  .title-path,
  .status-path {
    flex-basis: 100%;
    order: 2;
  }

  .title-spacer,
  .status-spacer {
    display: none;
  }

  .doc-grid,
  .command-grid,
  .download-grid,
  .shot-grid {
    grid-template-columns: 1fr;
  }

  .terminal-links {
    display: grid;
  }
}

@media (max-width: 520px) {
  .terminal-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border-right: 0;
    border-left: 0;
  }

  .tree-pane {
    max-height: 32vh;
  }

  .tree-group {
    flex-basis: min(220px, 82vw);
  }

  .buffer,
  .output {
    padding: 10px;
  }

  .cmd-line {
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .prompt {
    flex-basis: 100%;
  }

  h1,
  .markdown-body h1,
  .page-output h1 {
    font-size: 2rem;
    line-height: 1.05;
  }

  h2,
  .markdown-body h2,
  .page-output h2 {
    font-size: 1.35rem;
  }
}
