/* youcli.vercel.app — no framework, no build step. */

/* Self-hosted, on purpose. Google Fonts serves JetBrains Mono subsetted to
   latin/greek/cyrillic, which stops at U+2122 — so every box-drawing and
   block character the terminal draws (│ ─ ╭ ▍ █ ░ ▁▂▃) would fall back to
   whatever monospace the OS has, at a different advance width, and the grid
   would come apart. The full font has all of them at the same 600/1000 em
   advance as every other glyph. */
@font-face {
  font-family: "JetBrains Mono Web";
  src: url("/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400 700;   /* one face; every weight on the page is 500 or lighter */
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:      #08080a;
  --panel:   #0e0e11;
  --panel-2: #131317;
  --line:    #212127;
  --fg:      #d8d8dc;
  --fg-soft: #9a9aa4;
  --dim:     #63636e;
  --red:     #ff2f43;
  --red-dim: #a01c28;
  --green:   #56d39a;
  --yellow:  #e8c07d;
  --blue:    #74b4ff;
  --mono: "JetBrains Mono Web", ui-monospace, SFMono-Regular, "SF Mono",
          Menlo, Consolas, "Liberation Mono", monospace;
  /* JetBrains Mono's own line box: (ascender 1020 + descender 300) / 1000 em.
     At exactly this value the box-drawing glyphs tile edge to edge, so the
     sidebar divider is one unbroken line instead of a dashed one. */
  --cell: 1.32;
  --w: 860px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  font-variant-ligatures: none;
  background-image:
    radial-gradient(900px 420px at 50% -180px, rgba(255,47,67,.10), transparent 70%);
  background-repeat: no-repeat;
}

main {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 20px 80px;
}

a { color: var(--fg); text-decoration-color: var(--dim); text-underline-offset: 3px; }
a:hover { color: var(--red); text-decoration-color: var(--red); }

code { font-family: var(--mono); color: var(--fg-soft); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.sep { color: var(--line); margin: 0 .5em; }

.skip {
  position: absolute; left: -9999px;
  background: var(--panel); padding: 8px 14px; border: 1px solid var(--line);
}
.skip:focus { left: 12px; top: 12px; z-index: 10; }

/* ── hero ─────────────────────────────────────────────────────── */

.hero { padding: 72px 0 8px; }

.wordmark {
  margin: 0;
  font-size: clamp(5.5px, 1.62vw, 12px);
  line-height: 1.15;
  color: var(--red);
  white-space: pre;
  overflow: hidden;
  text-shadow: 0 0 24px rgba(255,47,67,.35);
}

.tagline { margin: 26px 0 30px; font-size: 15px; line-height: 1.75; }

/* command block */

.cmd {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 12px 12px 14px;
  overflow: hidden;
}
.cmd code {
  flex: 1;
  min-width: 0;
  color: var(--fg);
  font-size: 12.5px;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.cmd code::-webkit-scrollbar { display: none; }
.cmd .prompt { color: var(--red); user-select: none; margin-right: 8px; }

.copy {
  flex: none;
  font: inherit;
  font-size: 12px;
  color: var(--dim);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
}
.copy:hover { color: var(--fg); border-color: #333; }
.copy.done { color: var(--green); border-color: var(--green); }

.alt { margin: 14px 0 0; }
.alt summary {
  cursor: pointer; color: var(--dim); font-size: 12.5px;
  list-style: none; padding: 4px 0;
}
.alt summary::-webkit-details-marker { display: none; }
.alt summary::before { content: "+ "; color: var(--red); }
.alt[open] summary::before { content: "− "; }
.alt summary:hover { color: var(--fg); }
.alt .cmd { margin-top: 10px; }
.alt p { margin: 12px 0 4px; }

.links { margin: 30px 0 0; font-size: 12.5px; display: flex; flex-wrap: wrap; align-items: center; }
.links a { display: inline-flex; align-items: center; gap: 7px; }

/* ── terminal ─────────────────────────────────────────────────── */

.term-section { margin: 52px 0 0; }

.term-window {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.9);
}

.term-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 13px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--dim);
}
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #26262c; }
.dots i:first-child { background: #35262a; }
.term-title { flex: 1; }
.term-note {
  border: 1px solid var(--line); border-radius: 3px;
  padding: 1px 7px; font-size: 10.5px; letter-spacing: .04em;
  color: var(--dim); cursor: help;
}

.term-body {
  background: #050506;
  padding: 14px 0 14px 14px;
  height: 560px;
  overflow-y: auto;
  overflow-x: auto;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: #26262c transparent;
}
.term-body::-webkit-scrollbar { width: 9px; height: 9px; }
.term-body::-webkit-scrollbar-thumb { background: #26262c; border-radius: 9px; }
.term-body:focus-visible { box-shadow: inset 0 0 0 1px var(--red-dim); }

.term-out {
  font-size: 12.5px;
  line-height: var(--cell);
  white-space: pre;
  color: var(--fg);
  width: max-content;
  min-width: 100%;
  padding-right: 14px;
}
.term-out.wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  width: auto;
}

/* terminal colours */
.t-dim   { color: var(--dim); }
.t-red   { color: var(--red); }
.t-green { color: var(--green); }
.t-yel   { color: var(--yellow); }
.t-blue  { color: var(--blue); }
.t-b     { color: #fff; }   /* colour only: a weight change could shift grid metrics */
.t-soft  { color: var(--fg-soft); }
.t-inv   { background: var(--fg); color: #050506; }
.t-sel   { background: #1a1a1f; }
.t-selfg { color: var(--red); }
.t-bar   { background: #1c1c22; color: var(--fg-soft); }
/* the app's mark: a red rounded badge carrying a white play triangle */
.t-yt    { background: var(--red); color: #fff; border-radius: 3px; }
/* Explore chips */
.t-chip    { background: #16161b; }
.t-chipsel { background: #26262e; }
.c-a { color: #ff2f43; } .c-b { color: #74b4ff; } .c-c { color: #56d39a; }
.c-d { color: #e8c07d; } .c-e { color: #c98bdb; } .c-f { color: #6fd3d3; }
.t-barhi { background: var(--fg); color: #050506; }

.cursor {
  background: var(--fg);
  color: #050506;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { background: transparent; color: var(--fg); } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

.term-hint { margin: 14px 2px 0; line-height: 1.7; }
.term-hint code { color: var(--fg-soft); }

/* ── content sections ─────────────────────────────────────────── */

.section-h {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
  margin: 0 0 6px;
}

.grid {
  margin: 70px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px 34px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}
.grid h2 { margin: 0 0 6px; font-size: 13.5px; font-weight: 500; color: #fff; }
.grid h2::before { content: "▍"; color: var(--red); margin-right: 6px; }
.grid p { margin: 0; color: var(--fg-soft); font-size: 13px; }

.keys, .legal {
  margin: 62px 0 0;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.keys table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 13px; }
.keys td { padding: 7px 0; border-bottom: 1px solid #16161a; vertical-align: top; }
.keys td:first-child { width: 210px; padding-right: 18px; white-space: nowrap; }
.keys td:last-child { color: var(--fg-soft); }
.keys tr:last-child td { border-bottom: 0; }

kbd {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--fg);
}

.legal p { color: var(--fg-soft); font-size: 13px; margin: 0 0 16px; max-width: 66ch; }
.legal strong { color: var(--fg); font-weight: 500; }
.legal p:first-of-type { margin-top: 18px; }

footer {
  margin: 62px 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

/* ── misc ─────────────────────────────────────────────────────── */

/* Kept inside the window rather than off-screen: mobile keyboards refuse to
   open for an input that is nowhere near the viewport. */
.offscreen {
  position: absolute;
  bottom: 0; left: 0;
  width: 1px; height: 1px;
  padding: 0; border: 0;
  opacity: 0;
  background: transparent;
  pointer-events: none;
}

@media (max-width: 620px) {
  body { font-size: 13px; }
  .hero { padding-top: 46px; }
  .term-body { height: 460px; padding-left: 10px; }
  .term-out { font-size: 10px; }
  .keys td:first-child { width: auto; white-space: normal; }
  .keys table, .keys tr, .keys td { display: block; }
  .keys td { border-bottom: 0; padding: 2px 0; }
  .keys tr { padding: 8px 0; border-bottom: 1px solid #16161a; }
}
