:root {
  --cursor-x: 50vw;
  --cursor-y: 50vh;
  --cursor-alpha: 0.85;

  --bg: #111215;
  --bg-soft: #171a20;
  --line: #313846;
  --line-soft: #262c38;
  --text: #d4d7dd;
  --muted: #808590;
  --accent: #f08f6f;
  --banner-blue: #8ecbff;
  --banner-blue-strong: #5ea9ff;
  --green: #3ae58f;
  --cyan: #8be9ff;
  --mono: "JetBrains Mono", "Menlo", "Monaco", "Consolas", monospace;
  --shadow: 0 24px 84px rgba(0, 0, 0, 0.56);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color-scheme: dark;
}

body {
  --gutter: clamp(8px, 1.8vw, 18px);
  padding: var(--gutter);
  min-height: 100dvh;
  font-family: var(--mono);
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(240, 143, 111, 0.17), transparent 42%),
    radial-gradient(circle at 100% 20%, rgba(139, 233, 255, 0.12), transparent 36%),
    linear-gradient(180deg, #111215 0%, #151820 100%);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 3px;
  opacity: 0.28;
  z-index: -2;
}

a {
  color: inherit;
  -webkit-tap-highlight-color: rgba(240, 143, 111, 0.2);
}

button {
  -webkit-tap-highlight-color: rgba(139, 233, 255, 0.2);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(11, 12, 15, 0.96);
  color: #dae1ef;
  font-size: 12px;
  transform: translateY(-130%);
  transition: transform 140ms ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.cursor-light {
  position: fixed;
  width: 360px;
  height: 360px;
  left: calc(var(--cursor-x) - 180px);
  top: calc(var(--cursor-y) - 180px);
  pointer-events: none;
  opacity: calc(var(--cursor-alpha) * 0.62);
  background: radial-gradient(circle, rgba(139, 233, 255, 0.3) 0%, rgba(240, 143, 111, 0.16) 34%, transparent 74%);
  filter: blur(18px);
  mix-blend-mode: screen;
  z-index: -1;
}

.shell {
  position: relative;
  width: min(1280px, 100%);
  height: calc(100dvh - (var(--gutter) * 2));
  margin: 0 auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(16, 18, 23, 0.85);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.titlebar {
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

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

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.dot-red {
  background: #ff5f57;
}

.dot-yellow {
  background: #ffbd2e;
}

.dot-green {
  background: #28c840;
}

.title {
  color: #8d93a1;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-toggle,
.title-link {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: #c6cedb;
  font: 600 12px var(--mono);
  text-decoration: none;
  cursor: pointer;
}

.lang-toggle:hover,
.title-link:hover {
  border-color: #495266;
}

.viewport {
  flex: 1;
  min-height: 0;
  padding: clamp(8px, 1.6vw, 16px);
  padding-bottom: 138px;
}

.terminal-frame {
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.terminal-output {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 22px 24px;
  scrollbar-width: none;
}

.terminal-output::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.terminal-line {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  margin: 0 0 10px;
  align-items: start;
  font-size: 14px;
  line-height: 1.6;
}

.terminal-line:last-child {
  margin-bottom: 0;
}

.line-enter {
  animation: line-in 240ms ease both;
}

.line-marker {
  color: #7d8594;
}

.line-value {
  min-width: 0;
  color: #d8dde8;
  white-space: pre-wrap;
  word-break: break-word;
}

.type-command .line-marker {
  color: var(--green);
}

.type-command .line-value {
  color: #effff7;
}

.type-info .line-marker {
  color: #87dbff;
}

.type-info .line-value {
  color: #cfe7ff;
}

.type-summary .line-marker {
  color: var(--accent);
}

.type-summary .line-value {
  color: #ffdccc;
}

.type-section .line-marker {
  color: #f09a6f;
}

.type-section .line-value {
  color: #ffc9aa;
  font-weight: 700;
}

.type-point .line-marker {
  color: #58d8b2;
}

.type-point .line-value {
  color: #bff6ea;
}

.type-skill .line-marker {
  color: #7ec7ff;
}

.type-skill .line-value {
  color: #d3ebff;
}

.type-highlight .line-value {
  border: 1px solid rgba(142, 203, 255, 0.5);
  background: rgba(94, 169, 255, 0.1);
  color: #cde6ff;
  line-height: 1.52;
  padding: 10px 12px;
}

.type-link .line-marker {
  color: var(--accent);
}

.type-link .line-value a {
  color: #9ee8ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(158, 232, 255, 0.4);
}

.type-banner .line-marker {
  color: var(--banner-blue);
}

.banner-block {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 2px 0 4px;
  --banner-x: 50%;
  --banner-y: 50%;
  --banner-shift: 0px;
  --spark-x: 50%;
  --spark-y: 50%;
}

.banner-block::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--banner-x) var(--banner-y), rgba(94, 169, 255, 0.2), transparent 42%);
  mix-blend-mode: screen;
  z-index: 0;
}

.banner-block::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.08) 0px,
    rgba(255, 255, 255, 0) 1px
  );
  background-size: 100% 3px;
  opacity: 0.1;
  z-index: 0;
}

.banner-line {
  position: relative;
  z-index: 1;
  color: var(--banner-blue);
  white-space: pre;
  font-size: var(--banner-font-size, 13px);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: 0.02em;
  transform: translateX(calc(var(--banner-shift) * var(--line-depth, 1) * 0.15));
  transition: transform 120ms ease;
  text-shadow:
    1px 0 0 color-mix(in srgb, var(--banner-blue-strong) 70%, transparent),
    0 0 14px color-mix(in srgb, var(--banner-blue-strong) 32%, transparent),
    0 0 28px color-mix(in srgb, var(--banner-blue-strong) 20%, transparent);
}

.banner-spark {
  position: absolute;
  left: var(--spark-x);
  top: var(--spark-y);
  width: 14px;
  height: 14px;
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  border-radius: 2px;
  mix-blend-mode: screen;
  transform: translate(-50%, -50%) rotate(45deg) scale(0.64);
  background: linear-gradient(135deg, #ffe38c 0%, #ffd15f 52%, #ffbb37 100%);
  box-shadow:
    0 0 0 1px rgba(255, 241, 184, 0.72),
    0 0 14px rgba(255, 204, 82, 0.78),
    0 0 32px rgba(255, 196, 64, 0.56);
}

.banner-spark::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 30px;
  opacity: 0.66;
  transform: translate(-50%, -50%) rotate(45deg);
  background: linear-gradient(to bottom, transparent, rgba(255, 224, 134, 0.95), transparent);
}

.banner-spark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 1px;
  opacity: 0.66;
  transform: translate(-50%, -50%) rotate(45deg);
  background: linear-gradient(to right, transparent, rgba(255, 224, 134, 0.95), transparent);
}

.banner-hover .banner-spark {
  opacity: 0.92;
  animation: spark-hover 1.05s ease-in-out infinite;
}

.typing::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1.08em;
  margin-left: 6px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 0.95s steps(2) infinite;
}

.command-bar-wrap {
  position: absolute;
  left: clamp(8px, 1.6vw, 16px);
  right: clamp(8px, 1.6vw, 16px);
  bottom: clamp(8px, 1.6vw, 16px);
  z-index: 10;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

.metrics {
  display: none;
}

.metrics em {
  font-style: normal;
}

.command-bar {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(240, 143, 111, 0.42);
  border-radius: 12px;
  background: rgba(240, 143, 111, 0.09);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: #e4eaf7;
  font: 600 14px var(--mono);
  cursor: pointer;
}

.command-bar:hover {
  border-color: rgba(240, 143, 111, 0.7);
}

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

.command-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.58);
}

.palette {
  position: fixed;
  left: 50%;
  bottom: calc(clamp(8px, 1.6vw, 16px) + 114px);
  transform: translateX(-50%);
  z-index: 21;
  width: min(880px, calc(100vw - 18px));
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #181c23;
  box-shadow: var(--shadow);
}

.palette.hidden,
.palette-backdrop.hidden {
  display: none;
}

.palette-head {
  min-height: 44px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-soft);
  color: #97a0af;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.palette-list {
  max-height: min(48vh, 420px);
  overflow: auto;
  padding: 6px;
}

.palette-item {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  cursor: pointer;
}

.palette-item:hover,
.palette-item.active {
  background: rgba(240, 143, 111, 0.14);
}

.palette-command {
  color: var(--accent);
}

.palette-description {
  color: #d5dcea;
}

.lang-toggle:focus-visible,
.title-link:focus-visible,
.command-bar:focus-visible,
.palette-item:focus-visible {
  outline: 2px solid #7fc7ff;
  outline-offset: 1px;
}

@keyframes line-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes spark-hover {
  0% {
    transform: translate(-50%, -50%) rotate(45deg) scale(0.64);
    filter: brightness(0.95);
  }
  55% {
    transform: translate(-50%, -50%) rotate(45deg) scale(1.02);
    filter: brightness(1.34);
  }
  100% {
    transform: translate(-50%, -50%) rotate(45deg) scale(0.64);
    filter: brightness(0.95);
  }
}

@media (max-width: 840px) {
  .viewport {
    padding-bottom: 130px;
  }

  .terminal-output {
    padding: 14px;
  }

  .terminal-line {
    grid-template-columns: 62px minmax(0, 1fr);
    font-size: 13px;
  }

  .banner-line {
    font-size: var(--banner-font-size, 9px);
  }

  .palette-item {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

@media (max-width: 560px) {
  body {
    overflow: auto;
  }

  .shell {
    border-radius: 12px;
  }

  .title {
    max-width: 40vw;
    font-size: 13px;
  }

  .lang-toggle,
  .title-link {
    min-height: 31px;
    font-size: 11px;
    padding: 0 10px;
  }

  .viewport {
    padding: 6px;
    padding-bottom: 126px;
  }

  .terminal-output {
    padding: 12px 10px;
  }

  .command-bar-wrap {
    left: 6px;
    right: 6px;
    bottom: 6px;
    padding: 0;
  }

  .metrics {
    gap: 7px;
    font-size: 10px;
  }

  .command-bar {
    min-height: 48px;
    font-size: 12px;
  }

  .palette {
    width: calc(100vw - 12px);
    bottom: 108px;
  }
}

@media (hover: none), (pointer: coarse) {
  .cursor-light {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
