:root {
    color-scheme: dark;
    --bg: #090b0c;
    --panel: #111416;
    --panel-2: #15191b;
    --line: #2a3033;
    --line-soft: #1d2224;
    --text: #f8f8f2;
    --muted: #8b9490;
    --green: #a6e22e;
    --green-strong: #b9f34a;
    --cyan: #66d9ef;
    --pink: #f92672;
    --yellow: #e6db74;
    --purple: #ae81ff;
    --red: #ff5f56;
    --shadow: 0 30px 90px rgba(0, 0, 0, .55);
    --viewport-height: 100dvh;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  }

  * { box-sizing: border-box; }

  html, body { height: 100%; }

  body {
    margin: 0;
    min-width: 280px;
    min-height: 100%;
    overflow: hidden;
    background:
      radial-gradient(circle at 50% -20%, rgba(166, 226, 46, .08), transparent 42%),
      linear-gradient(180deg, #0d1011 0%, var(--bg) 100%);
    color: var(--text);
    font: 15px/1.65 var(--mono);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  body::before {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    content: "";
    opacity: .14;
    background: repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 2px,
      rgba(255, 255, 255, .05) 3px
    );
    mix-blend-mode: soft-light;
  }

  ::selection { color: #0b0d0e; background: var(--green); }

  .shell {
    display: grid;
    place-items: center;
    width: 100%;
    height: var(--viewport-height);
    padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  }

  .terminal {
    display: grid;
    grid-template-rows: auto 1fr;
    width: min(1060px, 100%);
    height: min(760px, 100%);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(13, 16, 17, .96);
    box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .025);
  }

  .terminal-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 46px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #1a1e20, #141719);
    user-select: none;
  }

  .traffic-lights { display: flex; gap: 8px; }

  .traffic-lights span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: inset 0 -1px 1px rgba(0, 0, 0, .35);
  }

  .traffic-lights span:nth-child(2) { background: #ffbd2e; }
  .traffic-lights span:nth-child(3) { background: #27c93f; }

  .terminal-title {
    overflow: hidden;
    color: #9ca4a0;
    font-size: 12px;
    letter-spacing: .02em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .status {
    justify-self: end;
    color: var(--green);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
  }

  .status::before {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
    content: "";
  }

  .terminal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: #3a4340 transparent;
    scrollbar-width: thin;
    padding: clamp(20px, 3vw, 38px);
    cursor: text;
  }

  .terminal-body::-webkit-scrollbar { width: 8px; }
  .terminal-body::-webkit-scrollbar-thumb { border-radius: 8px; background: #323a37; }

  .hero { margin: 0 0 28px; }

  .eyebrow {
    margin-bottom: 6px;
    color: var(--green);
    font-size: 12px;
    letter-spacing: .18em;
    text-transform: uppercase;
  }

  .wordmark {
    margin: 0;
    color: var(--text);
    font-size: clamp(25px, 5vw, 55px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.065em;
  }

  .wordmark .accent { color: var(--green); text-shadow: 0 0 28px rgba(166, 226, 46, .22); }

  .intro { max-width: 700px; margin: 13px 0 0; color: var(--muted); }
  .intro strong { color: var(--cyan); font-weight: 500; }
  .hint { margin-top: 13px; color: #6f7874; font-size: 13px; }
  kbd { color: var(--yellow); font: inherit; }

  .history-item { margin: 0 0 21px; }
  .command-line, .active-line { display: flex; align-items: flex-start; min-width: 0; }
  .command-line { margin-bottom: 7px; }

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

  .prompt .host { color: var(--cyan); }
  .prompt .path { color: var(--purple); }
  .prompt .symbol { color: var(--text); }
  .entered-command { min-width: 0; margin-left: 9px; overflow-wrap: anywhere; color: var(--text); }

  .command-output { color: #c9d1cd; }
  .command-output p { max-width: 760px; margin: 0 0 8px; }
  .command-output p:last-child { margin-bottom: 0; }
  .command-output strong { color: var(--text); font-weight: 600; }
  .command-output .dim { color: var(--muted); }
  .command-output .success { color: var(--green); }
  .command-output .error { color: var(--pink); }
  .command-output .warning { color: var(--yellow); }

  .command-output pre {
    max-width: 100%;
    margin: 0;
    overflow-x: auto;
    color: #c9d1cd;
    font: inherit;
    line-height: 1.5;
    white-space: pre-wrap;
  }

  .markdown h2,
  .markdown h3 {
    max-width: 760px;
    margin: 18px 0 7px;
    color: var(--green);
    font-size: 1em;
    font-weight: 600;
  }

  .markdown h2:first-child,
  .markdown h3:first-child { margin-top: 0; }

  .markdown ul,
  .markdown ol {
    max-width: 760px;
    margin: 5px 0 12px;
    padding-left: 24px;
  }

  .markdown li { margin: 2px 0; }
  .markdown li::marker { color: var(--purple); }

  .markdown code {
    padding: 1px 5px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel-2);
    color: var(--yellow);
    font: inherit;
  }

  .markdown blockquote {
    max-width: 760px;
    margin: 9px 0 12px;
    padding-left: 13px;
    border-left: 2px solid var(--purple);
    color: var(--muted);
  }

  .markdown hr {
    max-width: 760px;
    margin: 17px 0;
    border: 0;
    border-top: 1px solid var(--line-soft);
  }

  .command-output a {
    color: var(--cyan);
    text-decoration-color: rgba(102, 217, 239, .4);
    text-underline-offset: 3px;
  }

  .command-output a:hover, .command-output a:focus-visible { color: #a7effc; text-decoration-color: currentColor; }

  .command-grid {
    display: grid;
    grid-template-columns: minmax(90px, 140px) 1fr;
    max-width: 760px;
    column-gap: 18px;
    row-gap: 4px;
  }

  .command-grid dt { color: var(--green); }
  .command-grid dd { margin: 0; color: var(--muted); }

  .category { margin: 0 0 10px; }
  .category-name { display: inline-block; min-width: 150px; color: var(--yellow); }
  .tag { color: #c9d1cd; }
  .tag + .tag::before { margin: 0 8px; color: #4f5955; content: "·"; }

  .project {
    max-width: 760px;
    margin-bottom: 14px;
    padding-left: 15px;
    border-left: 2px solid #28302c;
  }

  .project:last-child { margin-bottom: 0; }
  .project-title { color: var(--green); }
  .project-meta { color: #7e8883; font-size: 13px; }
  .file-head { color: var(--purple); }

  .active-line { position: relative; padding-bottom: 2px; }

  #command-input {
    flex: 1 1 auto;
    min-width: 20px;
    margin: 0 0 0 9px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    caret-color: var(--green-strong);
    font: inherit;
    line-height: inherit;
    appearance: none;
  }

  #command-input::placeholder { color: #3f4844; opacity: 1; }

  .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: 640px) {
    body { font-size: 13px; line-height: 1.58; }
    .shell { padding: 0; }
    .terminal { width: 100%; height: 100%; border: 0; border-radius: 0; }
    .terminal-bar { min-height: 42px; padding: 0 12px; }
    .terminal-title { max-width: 155px; }
    .status { font-size: 9px; }
    .status span { display: none; }
    .terminal-body { padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); }
    .hero { margin-bottom: 24px; }
    .intro { margin-top: 10px; }
    .command-grid { grid-template-columns: 92px 1fr; column-gap: 10px; }
    .category-name { display: block; min-width: 0; margin-bottom: 2px; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; }
  }