﻿:root {
      --bg: #050815;
      --panel: #0e1425;
      --line: #263b68;
      --text: #edf7ff;
      --muted: #a9b6cb;
      --accent: #65d9ff;
      --accent-2: #c8d7ff;
      --danger: #ff6b8a;
      --glow: rgba(101, 217, 255, .18);
    }

    * {
      box-sizing: border-box;
    }

    html {
      scrollbar-color: var(--line) var(--bg);
    }

    body {
      min-height: 100vh;
      margin: 0;
      color: var(--text);
      background:
        linear-gradient(rgba(101, 217, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(101, 217, 255, .035) 1px, transparent 1px),
        radial-gradient(circle at 70% 20%, rgba(101, 217, 255, .16), transparent 28rem),
        radial-gradient(circle at 15% 85%, rgba(200, 215, 255, .08), transparent 24rem),
        var(--bg);
      background-size: 34px 34px, 34px 34px, auto, auto, auto;
      font-family: "FiraCode Nerd Font", "Fira Code", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
      font-size: 14px;
      line-height: 1.6;
    }

    ::selection {
      color: #050815;
      background: var(--accent);
    }

    a {
      color: var(--accent);
      text-decoration: underline;
      text-decoration-color: rgba(101, 217, 255, .45);
      text-underline-offset: 3px;
      transition: color .16s ease, text-shadow .16s ease;
    }

    a:hover {
      color: var(--accent-2);
      text-decoration-color: var(--accent-2);
      text-shadow: 0 0 18px var(--glow);
    }

    a:focus-visible,
    button:focus-visible,
    input:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 3px;
    }

    .page {
      width: min(1000px, calc(100% - 28px));
      margin: 24px auto;
    }

    .topbar {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 10px;
      color: var(--muted);
      font-size: .82rem;
    }

    .terminal {
      min-height: calc(100vh - 92px);
      display: flex;
      flex-direction: column;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      background:
        linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 36%),
        rgba(14, 20, 37, .96);
      box-shadow: 0 24px 80px rgba(1, 6, 18, .42), inset 0 1px 0 rgba(237, 247, 255, .04);
      transition: border-color .18s ease, box-shadow .18s ease;
    }

    .terminal:hover,
    .terminal:focus-within {
      border-color: rgba(101, 217, 255, .72);
      box-shadow: 0 28px 90px rgba(1, 6, 18, .48), 0 0 0 1px rgba(101, 217, 255, .10), inset 0 1px 0 rgba(237, 247, 255, .06);
    }

    .terminal-head {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--line);
      color: var(--accent);
    }

    .screen {
      flex: 1;
      overflow: auto;
      padding: 16px;
      color: var(--muted);
      white-space: pre-wrap;
      scrollbar-color: var(--line) transparent;
    }

    .line {
      margin: 0 0 6px;
    }

    .prompt {
      color: var(--accent);
    }

    .file {
      color: var(--text);
    }

    .warn {
      color: var(--accent-2);
    }

    .error {
      color: var(--danger);
    }

    .neofetch {
      display: grid;
      grid-template-columns: 150px minmax(0, 1fr);
      gap: 18px;
      align-items: center;
      margin: 8px 0 14px;
      color: var(--text);
    }

    .neofetch img {
      width: 150px;
      aspect-ratio: 1;
      object-fit: cover;
      object-position: center 34%;
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: 0 0 30px rgba(101, 217, 255, .16);
    }

    .neofetch pre {
      margin: 0;
      overflow-x: auto;
      color: var(--muted);
      font: inherit;
      white-space: pre;
    }

    .neofetch strong {
      color: var(--accent);
      font-weight: 700;
    }

    .terminal-form {
      display: flex;
      gap: 8px;
      padding: 14px 16px;
      border-top: 1px solid var(--line);
    }

    .terminal-form label {
      color: var(--accent);
      white-space: nowrap;
    }

    .terminal-form input {
      width: 100%;
      border: 0;
      color: var(--text);
      background: transparent;
      font: inherit;
      outline: none;
    }

    .terminal-form button {
      border: 1px solid var(--line);
      border-radius: 6px;
      color: var(--accent);
      background: #121b31;
      font: inherit;
      cursor: pointer;
      transition: border-color .16s ease, color .16s ease, background .16s ease;
    }

    .terminal-form button:hover {
      border-color: var(--accent);
      color: var(--text);
      background: rgba(101, 217, 255, .10);
    }

    .terminal.broken {
      animation: terminal-break 1.4s steps(2, end) forwards;
      pointer-events: none;
    }

    .terminal.broken .terminal-head,
    .terminal.broken .screen,
    .terminal.broken .terminal-form {
      animation: screen-tear 1.4s linear forwards;
    }

    .rebuild-panel {
      display: none;
      min-height: calc(100vh - 92px);
      place-items: center;
    }

    .rebuild-panel.visible {
      display: grid;
    }

    .rebuild-panel button {
      border: 1px solid var(--accent);
      border-radius: 6px;
      padding: 12px 18px;
      color: var(--bg);
      background: var(--accent);
      font: inherit;
      cursor: pointer;
      box-shadow: 0 0 32px var(--glow);
    }

    @keyframes terminal-break {
      0% { transform: translate(0); filter: none; }
      20% { transform: translate(7px, -4px) skewX(4deg); filter: hue-rotate(80deg); }
      40% { transform: translate(-10px, 5px) skewX(-8deg); filter: contrast(2); }
      60% { transform: translate(12px, 0) scaleY(.82); opacity: .9; }
      80% { transform: translate(-18px, 8px) scaleX(1.08); opacity: .55; }
      100% { transform: translateY(42vh) scale(.2) rotate(4deg); opacity: 0; }
    }

    @keyframes screen-tear {
      0%, 100% { clip-path: inset(0); }
      25% { clip-path: inset(12% 0 42% 0); }
      50% { clip-path: inset(42% 0 18% 0); }
      75% { clip-path: inset(4% 0 70% 0); }
    }

    @media (max-width: 560px) {
      body { font-size: 13px; }
      .page { width: min(100% - 20px, 1000px); margin: 10px auto; }
      .topbar { align-items: flex-start; flex-direction: column; }
      .terminal { min-height: calc(100vh - 88px); }
      .neofetch { grid-template-columns: 1fr; }
      .neofetch img { width: 132px; }
    }
