:root {
  --black: #000000;
  --white: #f5f5f5;
  --soft-white: #d8d8d8;
  --gray: #8a8a8a;
  --dim: #535353;
  --line: #202020;

  --terminal-width: 980px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--black);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--black);
  color: var(--white);
  font-family:
    "SFMono-Regular",
    "Cascadia Code",
    Consolas,
    "Liberation Mono",
    Menlo,
    monospace;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

::selection {
  background: var(--white);
  color: var(--black);
}

/* BOOT */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  padding: 18px 22px;
  background: #000;
  color: #d7d7d7;
  font-size: clamp(0.68rem, 1.25vw, 0.82rem);
  line-height: 1.45;
}

.boot-screen.is-leaving {
  animation: boot-fade-out 420ms ease forwards;
}

@keyframes boot-fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    visibility: hidden;
  }
}

.boot-output {
  max-width: 1180px;
}

.boot-entry {
  min-height: 1.45em;
  white-space: pre-wrap;
}

.boot-entry .ok {
  color: #fff;
  font-weight: 700;
}

.boot-entry .kernel-time {
  color: #686868;
}

.boot-entry .service {
  color: #bdbdbd;
}

.boot-entry .bright {
  color: #fff;
}

.boot-cursor-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 1.45em;
  margin-top: 3px;
}

.boot-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: #fff;
  animation: terminal-blink 0.9s steps(1) infinite;
}

.site-hidden {
  opacity: 0;
  visibility: hidden;
}

.site-visible {
  animation: site-fade-in 460ms ease forwards;
}

@keyframes site-fade-in {
  from {
    opacity: 0;
    visibility: visible;
  }

  to {
    opacity: 1;
    visibility: visible;
  }
}

/* MAIN TERMINAL */

.page-shell {
  width: 100%;
  margin: 0;
  padding: 30px 32px 44px;
}

.terminal {
  width: min(100%, var(--terminal-width));
  margin: 0;
  background: transparent;
}

.terminal-header,
.terminal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 38px;
  padding: 0;
  color: var(--gray);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  background: transparent;
}

.terminal-header {
  margin-bottom: 38px;
}

.terminal-footer {
  margin-top: 42px;
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--soft-white);
}

.terminal-symbol,
.prompt-symbol {
  color: var(--white);
}

.terminal-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.terminal-status {
  position: relative;
  padding-left: 11px;
  color: var(--soft-white);
}

.terminal-status::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.45);
  transform: translateY(-50%);
  animation: status-pulse 2.6s ease-in-out infinite;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 0.28;
  }

  50% {
    opacity: 1;
  }
}

.terminal-body {
  padding: 0;
}

.boot-line {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  color: var(--soft-white);
  font-size: 0.78rem;
}

.boot-line + .boot-line {
  margin-top: 3px;
}

.muted {
  color: var(--dim);
}

.divider {
  overflow: hidden;
  margin: 28px 0;
  color: var(--line);
  white-space: nowrap;
  user-select: none;
}

.terminal-section + .terminal-section {
  margin-top: 35px;
}

.command-label {
  display: flex;
  gap: 10px;
  color: var(--white);
  font-size: 0.82rem;
}

.terminal-output {
  margin-top: 13px;
  padding-left: 24px;
  color: var(--soft-white);
  font-size: 0.86rem;
}

.terminal-output h1 {
  margin-bottom: 2px;
  color: var(--white);
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 1;
}

.role {
  color: var(--gray);
  font-size: clamp(0.82rem, 2vw, 1rem);
  text-transform: lowercase;
}

.description {
  max-width: 720px;
  margin-top: 20px;
  color: var(--soft-white);
}

.output-grid {
  display: grid;
  gap: 6px;
}

.output-grid > div {
  display: grid;
  grid-template-columns: 110px 18px 1fr;
  align-items: baseline;
}

.key {
  color: var(--gray);
}

.separator {
  color: var(--dim);
}

.list-output {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 28px;
}

.list-output span::before {
  content: "- ";
  color: var(--dim);
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.skills span {
  color: var(--soft-white);
  transition:
    color 160ms ease,
    transform 160ms ease;
}

.skills span::before {
  content: "./";
  color: var(--dim);
}

.skills span:hover {
  color: var(--white);
  transform: translateX(2px);
}

.socials {
  display: grid;
  gap: 7px;
}

.socials a,
.socials .social-item {
  display: grid;
  width: fit-content;
  grid-template-columns: 78px 1fr auto;
  gap: 14px;
  align-items: center;
  color: var(--soft-white);
}

.socials a {
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.socials a:hover {
  color: var(--white);
  transform: translateX(3px);
}

.social-prefix {
  color: var(--gray);
}

.social-link {
  border-bottom: 1px solid transparent;
}

.socials a:hover .social-link {
  border-bottom-color: var(--gray);
}

.external-mark {
  color: var(--dim);
}

.interactive-terminal {
  position: relative;
}

.command-history {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
  font-size: 0.8rem;
}

.history-command {
  color: var(--white);
}

.history-command::before {
  content: "❯ ";
  color: var(--white);
}

.history-output {
  max-width: 760px;
  padding-left: 20px;
  color: var(--gray);
  white-space: pre-wrap;
}

.command-form {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
}

.input-wrap {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
}

#command-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  text-shadow: 0 0 0 var(--white);
  font-size: 0.85rem;
}

.fake-cursor {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 16px;
  pointer-events: none;
  background: var(--white);
  transform: translateY(-50%);
  animation: terminal-blink 1s steps(1) infinite;
}

@keyframes terminal-blink {
  0%,
  45% {
    opacity: 1;
  }

  46%,
  100% {
    opacity: 0;
  }
}

.hint {
  margin-top: 8px;
  color: var(--dim);
  font-size: 0.7rem;
}

.hint span {
  color: var(--gray);
}

.reveal-line {
  opacity: 0;
  transform: translateY(7px);
}

.site-visible .reveal-line {
  animation: reveal 420ms ease forwards;
}

.site-visible .reveal-line:nth-child(1) {
  animation-delay: 40ms;
}

.site-visible .reveal-line:nth-child(2) {
  animation-delay: 80ms;
}

.site-visible .reveal-line:nth-child(3) {
  animation-delay: 120ms;
}

.site-visible .reveal-line:nth-child(4) {
  animation-delay: 160ms;
}

.site-visible .reveal-line:nth-child(5) {
  animation-delay: 200ms;
}

.site-visible .reveal-line:nth-child(6) {
  animation-delay: 240ms;
}

.site-visible .reveal-line:nth-child(7) {
  animation-delay: 280ms;
}

.site-visible .reveal-line:nth-child(8) {
  animation-delay: 320ms;
}

.site-visible .reveal-line:nth-child(9) {
  animation-delay: 360ms;
}

.site-visible .reveal-line:nth-child(10) {
  animation-delay: 400ms;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .reveal-line {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: 100%;
    padding: 18px 14px 36px;
  }

  .boot-screen {
    padding: 12px;
    font-size: 0.66rem;
  }

  .terminal-header {
    margin-bottom: 28px;
  }

  .terminal-meta > span:first-child {
    display: none;
  }

  .terminal-output {
    padding-left: 14px;
  }

  .output-grid > div {
    grid-template-columns: 90px 12px 1fr;
  }

  .list-output {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .socials a,
  .socials .social-item {
    grid-template-columns: 70px 1fr auto;
    gap: 9px;
  }
}


/* ABOUT ME TERMINAL SEQUENCE */

.reveal-line {
  opacity: 1;
  transform: none;
}

.site-visible .reveal-line {
  animation: none;
}

.sequence-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
}

.sequence-visible {
  opacity: 1 !important;
  visibility: visible !important;
}

.sequence-row,
#learning-output > span,
#skills-output > span,
#languages-output > span,
#tools-output > span,
#contact-output > * {
  transition:
    opacity 120ms linear,
    transform 120ms ease;
}

.sequence-pop-hidden {
  opacity: 0;
  transform: translateY(3px);
}

.sequence-pop-visible {
  opacity: 1;
  transform: translateY(0);
}

.typewriter-target {
  white-space: pre-wrap;
}

.typing-active::after {
  content: "█";
  display: inline-block;
  margin-left: 3px;
  color: var(--white);
  font-size: 0.82em;
  font-weight: 400;
  animation: terminal-blink 0.72s steps(1) infinite;
  vertical-align: 0.04em;
}

#name-output.typing-active::after {
  font-size: 0.42em;
  vertical-align: 0.28em;
}

.sequence-divider {
  transform-origin: left center;
}

.sequence-divider.sequence-drawing {
  animation: draw-divider 320ms ease-out forwards;
}

@keyframes draw-divider {
  from {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }

  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}


/* DISCREET SESSION INFO */

.terminal-footer #last-login {
  margin-left: auto;
  margin-right: auto;
  color: var(--dim);
}

@media (max-width: 680px) {
  .terminal-footer {
    flex-wrap: wrap;
  }

  .terminal-footer #last-login {
    order: 3;
    width: 100%;
    margin: -4px 0 0;
  }
}


/* EXIT / LOGOUT */

.exit-screen {
  display: none;
  min-height: 100vh;
  padding: 24px 32px;
  background: #000;
  color: var(--soft-white);
  font-size: 0.8rem;
}

.exit-screen.is-visible {
  display: block;
}

.exit-message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.exit-message > span:first-child {
  color: var(--white);
}

.exit-cursor {
  display: inline-block;
  margin-top: 6px;
  animation: terminal-blink 1s steps(1) infinite;
}

@media (max-width: 680px) {
  .exit-screen {
    padding: 18px 14px;
  }
}


/* SKIP ANIMATION HINT */

.skip-hint {
  margin-bottom: 16px;
  color: #6f6f6f;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  user-select: none;
}

.skip-hint::before {
  content: "[hint] ";
  color: #444;
}


@media (max-width: 680px) {
  .skip-hint {
    font-size: 0.64rem;
  }
}
