* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "JetBrains Mono", "Space Grotesk", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: var(--text);
  background: radial-gradient(circle at 10% 10%, rgba(80, 255, 180, 0.16), transparent 40%),
    radial-gradient(circle at 90% 20%, rgba(255, 125, 80, 0.14), transparent 35%),
    linear-gradient(160deg, #050607 0%, #0b0f12 45%, #060809 100%);
  min-height: 100vh;
}

html[data-theme="light"] body {
  background: radial-gradient(circle at 10% 10%, rgba(12, 159, 130, 0.18), transparent 35%),
    radial-gradient(circle at 90% 20%, rgba(255, 106, 61, 0.2), transparent 40%),
    linear-gradient(160deg, #f6f4ef 0%, #f0ebe3 50%, #f6f4ef 100%);
}

.page {
  display: flex;
  justify-content: center;
  padding: 64px 20px 40px;
}

.terminal {
  width: min(920px, 100%);
  background: rgba(6, 8, 9, 0.8);
  border: 1px solid rgba(120, 230, 180, 0.2);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  position: relative;
}

html[data-theme="light"] .terminal {
  background: rgba(250, 248, 244, 0.9);
  border: 1px solid rgba(12, 159, 130, 0.25);
  box-shadow: 0 24px 60px rgba(30, 40, 50, 0.2);
}

.terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
      to bottom,
      rgba(120, 230, 180, 0.06) 0,
      rgba(120, 230, 180, 0.06) 1px,
      transparent 1px,
      transparent 4px
    ),
    radial-gradient(circle at top right, rgba(80, 255, 180, 0.12), transparent 55%);
  opacity: 0.3;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: scan 8s linear infinite;
}

html[data-theme="light"] .terminal::before {
  background: repeating-linear-gradient(
      to bottom,
      rgba(12, 159, 130, 0.08) 0,
      rgba(12, 159, 130, 0.08) 1px,
      transparent 1px,
      transparent 4px
    ),
    radial-gradient(circle at top right, rgba(255, 106, 61, 0.15), transparent 55%);
  mix-blend-mode: multiply;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(16, 22, 26, 0.95), rgba(12, 16, 19, 0.9));
  border-bottom: 1px solid rgba(120, 230, 180, 0.18);
}

html[data-theme="light"] .terminal-bar {
  background: linear-gradient(90deg, rgba(248, 244, 238, 0.95), rgba(242, 236, 226, 0.9));
  border-bottom: 1px solid rgba(12, 159, 130, 0.2);
}

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

.dot.red {
  background: #ff5f56;
}

.dot.yellow {
  background: #ffbd2e;
}

.dot.green {
  background: #27c93f;
}

.terminal-bar .title {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
}

.theme-toggle {
  margin-left: 12px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(120, 230, 180, 0.25);
  background: rgba(10, 14, 16, 0.75);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
  position: relative;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.icon-sun,
.icon-moon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 150ms ease;
}

html[data-theme="light"] .theme-toggle {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(12, 159, 130, 0.35);
}

html[data-theme="light"] .icon-sun {
  opacity: 0;
}

html:not([data-theme="light"]) .icon-moon {
  opacity: 0;
}

html:not([data-theme="light"]) .icon-sun,
html[data-theme="light"] .icon-moon {
  opacity: 1;
}

.terminal-body {
  padding: 28px 28px 32px;
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.prompt-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--muted);
  opacity: 0;
  animation: show 0s steps(1, end) forwards;
  animation-delay: var(--show-delay, 0s);
}

.prompt {
  color: #50ffb4;
}

html[data-theme="light"] .prompt {
  color: #0c9f82;
}

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

.command {
  color: #f9f4e7;
}

html[data-theme="light"] .command {
  color: #1d1d1d;
}

.command.type {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  animation: type var(--type-duration, 1.2s) steps(var(--chars)) forwards;
  animation-delay: var(--type-delay, 0s);
}

.typing {
  display: inline-flex;
  align-items: baseline;
}

.block-cursor {
  display: inline-block;
  width: 0.65ch;
  height: 1.1em;
  background: #f9f4e7;
  box-shadow: 0 0 6px rgba(249, 244, 231, 0.6);
  opacity: 0;
  animation: cursorTyping var(--type-duration, 1.2s) steps(2, start) forwards;
  animation-delay: var(--type-delay, 0s);
}

html[data-theme="light"] .block-cursor {
  background: #1a1a1a;
  box-shadow: 0 0 6px rgba(26, 26, 26, 0.35);
}

.prompt-line.is-last .block-cursor {
  animation: cursorTyping var(--type-duration, 1.2s) steps(2, start) forwards,
    cursorBlink 0.9s steps(2, start) infinite;
  animation-delay: var(--type-delay, 0s),
    calc(var(--type-delay, 0s) + var(--type-duration, 1.2s));
}

.output h1 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  margin: 0 0 8px;
}

.output {
  opacity: 0;
  animation: show 0s steps(1, end) forwards;
  animation-delay: var(--show-delay, 0s);
}

.output .role {
  margin: 0 0 6px;
  font-size: 1.1rem;
  color: var(--accent-2);
}

.output .location {
  margin: 0 0 16px;
  color: var(--muted);
}

.output .bio {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

.output.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.link {
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(120, 230, 180, 0.3);
  color: var(--text);
  background: rgba(10, 14, 16, 0.8);
  font-weight: 600;
  transition: transform 150ms ease, border-color 150ms ease;
}

html[data-theme="light"] .link {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(12, 159, 130, 0.25);
}

.link:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.output.status {
  display: grid;
  gap: 12px;
}

.status-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.status-item .label {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}

.output.experience {
  display: grid;
  gap: 16px;
}

.experience-item {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(120, 230, 180, 0.18);
  background: rgba(7, 10, 12, 0.7);
}

html[data-theme="light"] .experience-item {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(12, 159, 130, 0.2);
}

.experience-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.experience-header .role {
  font-size: 1rem;
  color: #f9f4e7;
  margin: 0;
}

html[data-theme="light"] .experience-header .role {
  color: #1a1a1a;
}

.experience-header .dates {
  font-size: 0.85rem;
  color: var(--muted);
}

.experience-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

html[data-theme="light"] .output .bio,
html[data-theme="light"] .output .location,
html[data-theme="light"] .status-item,
html[data-theme="light"] .experience-header .dates,
html[data-theme="light"] .experience-meta {
  color: #4f5461;
}


@media (max-width: 720px) {
  .page {
    padding-top: 40px;
  }

  .terminal-body {
    padding: 22px 20px 26px;
  }

  .status-item {
    grid-template-columns: 1fr;
  }

  .experience-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .terminal::before,
  .caret,
  .command.type,
  .prompt-line,
  .block-cursor,
  .output {
    animation: none !important;
  }

  .output {
    opacity: 1;
  }

  .command.type {
    width: auto;
  }

  .prompt-line {
    opacity: 1;
  }
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}

@keyframes cursorBlink {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0.25;
  }
}

@keyframes cursorTyping {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
  100% {
    opacity: 0;
  }
}

@keyframes type {
  to {
    width: calc(var(--chars) * 1ch);
  }
}

@keyframes show {
  to {
    opacity: 1;
  }
}

@keyframes scan {
  0% {
    transform: translateY(-6%);
  }
  50% {
    transform: translateY(2%);
  }
  100% {
    transform: translateY(-6%);
  }
}
