:root {
  color-scheme: dark;
  --bg: #07110d;
  --bg-deep: #020604;
  --panel: #0b1812;
  --panel-2: #10251b;
  --green: #54f48b;
  --green-soft: #91ffb3;
  --cyan: #66e6ff;
  --amber: #ffd166;
  --pink: #ff6ea8;
  --text: #d7ffe3;
  --muted: #7da58b;
  --line: rgba(84, 244, 139, 0.2);
  --shadow: rgba(84, 244, 139, 0.12);
  --radius: 8px;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-deep);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 16%, rgba(84, 244, 139, 0.12), transparent 30%),
    linear-gradient(135deg, #020604 0%, #07110d 38%, #101517 100%);
  color: var(--text);
  font-family: var(--font-mono);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 7px
    );
  mix-blend-mode: soft-light;
  opacity: 0.55;
}

a {
  color: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 32px 0;
}

.shell--error {
  width: min(880px, calc(100% - 32px));
}

.terminal {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 17, 13, 0.92);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 0 48px var(--shadow);
  overflow: hidden;
}

.terminal::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: radial-gradient(
    circle at var(--cursor-x, 50%) var(--cursor-y, 50%),
    rgba(84, 244, 139, 0.1),
    transparent 34%
  );
  opacity: 0.85;
}

.terminal__bar {
  position: relative;
  z-index: 1;
  min-height: 44px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}

.window-controls {
  display: flex;
  gap: 8px;
}

.control {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: 0 0 14px currentColor;
}

.control--close {
  color: var(--pink);
  background: var(--pink);
}

.control--min {
  color: var(--amber);
  background: var(--amber);
}

.control--max {
  color: var(--green);
  background: var(--green);
}

.terminal__title,
.terminal__status {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.terminal__title {
  text-align: center;
}

.terminal__status {
  color: var(--green-soft);
}

.terminal__screen {
  position: relative;
  z-index: 1;
  min-height: 620px;
  padding: clamp(22px, 4vw, 52px);
  background:
    linear-gradient(90deg, rgba(84, 244, 139, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(84, 244, 139, 0.04) 1px, transparent 1px),
    rgba(3, 10, 7, 0.84);
  background-size: 44px 44px;
}

.terminal__screen--error {
  min-height: 460px;
}

.line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  margin-top: 26px;
  font-size: clamp(0.92rem, 2vw, 1.12rem);
  line-height: 1.45;
}

.line:first-child {
  margin-top: 0;
}

.prompt {
  color: var(--green);
  text-shadow: 0 0 18px rgba(84, 244, 139, 0.4);
  white-space: nowrap;
}

.command {
  color: var(--amber);
}

.output {
  margin: 12px 0 0;
  padding-left: clamp(18px, 4vw, 40px);
}

.identity {
  display: grid;
  gap: 8px;
  max-width: 760px;
}

.identity p {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  text-shadow: 0 0 24px rgba(84, 244, 139, 0.22);
}

.identity p:nth-child(2) {
  color: var(--cyan);
}

.identity p:nth-child(3) {
  color: var(--green-soft);
}

.error-copy {
  display: grid;
  gap: 12px;
  max-width: 780px;
}

.error-copy h1,
.error-copy p {
  margin: 0;
}

.error-copy h1 {
  color: var(--pink);
  font-size: clamp(2.4rem, 8vw, 6.2rem);
  line-height: 0.95;
  text-shadow: 0 0 28px rgba(255, 110, 168, 0.32);
}

.error-copy p {
  color: var(--green-soft);
  font-size: clamp(1.05rem, 3vw, 1.6rem);
  line-height: 1.35;
}

.project-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-grid li {
  min-height: 82px;
  padding: 14px;
  border: 1px solid rgba(84, 244, 139, 0.18);
  border-radius: var(--radius);
  background: rgba(16, 37, 27, 0.52);
}

.project-name,
.project-meta {
  display: block;
}

.project-name {
  color: var(--green-soft);
  font-size: 1rem;
}

.project-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.link-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid rgba(102, 230, 255, 0.25);
  border-radius: var(--radius);
  background: rgba(102, 230, 255, 0.08);
  color: var(--cyan);
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.link-list a:hover,
.link-list a:focus-visible {
  border-color: var(--green);
  color: var(--green-soft);
  transform: translateY(-2px);
  outline: none;
}

.link-index {
  color: var(--amber);
  font-size: 0.74rem;
}

.line--active {
  color: var(--green);
}

.cursor {
  width: 0.72em;
  height: 1.1em;
  background: var(--green);
  box-shadow: 0 0 18px rgba(84, 244, 139, 0.7);
  animation: blink 1s steps(2, start) infinite;
}

.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;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 520px);
    align-items: start;
    padding: 10px 0;
  }

  .terminal__bar {
    grid-template-columns: auto 1fr;
    padding: 0 12px;
  }

  .terminal__status {
    display: none;
  }

  .terminal__screen {
    min-height: calc(100vh - 66px);
    padding: 20px 14px 26px;
    background-size: 32px 32px;
  }

  .line {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    margin-top: 22px;
  }

  .output {
    padding-left: 0;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .link-list {
    flex-direction: column;
  }

  .link-list a {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
