:root {
  --bg: #0a3d1a;
  --text: #c8c8d0;
  --muted: #6e6e7a;
  --green: #5cff8d;
  --green-dim: #2a8f4e;
  --panel: rgba(0, 12, 4, 0.82);
  --panel-border: rgba(92, 255, 141, 0.28);
  --page-height: 40.7rem;
  --page-body-height: 15rem;
  --contact-form-height: 25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist Mono", ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-y: auto;
}

.bg-image {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("bg-binary-wave.png") center center / cover no-repeat;
  pointer-events: none;
}

.ascii-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  margin: 0;
  padding: 0.5rem;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.15;
  color: rgba(92, 255, 141, 0.22);
  white-space: pre;
  display: none;
}

#terrain-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  pointer-events: none;
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%,
      rgba(0, 20, 8, 0.15) 0%,
      rgba(0, 0, 0, 0.45) 100%);
}

.shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem;
  padding-top: max(1.5rem, 4vh);
  padding-bottom: 2.5rem;
}

.crt {
  position: relative;
  width: min(720px, 100%);
  min-width: 0;
  flex: 0 1 720px;
  max-height: none;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(0, 40, 10, 0.35),
    0 14px 44px rgba(0, 0, 0, 0.5);
}

.terminal {
  position: relative;
  z-index: 1;
  padding: 1.25rem 1.4rem 1.1rem;
  font-size: 0.82rem;
  line-height: 1.55;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(92, 255, 141, 0.14);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.status-right {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.boot {
  margin: 0 0 0.5rem;
  color: var(--green-dim);
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.banner {
  margin: 0 0 0.35rem;
  padding: 0;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: clamp(8px, 0.64vw, 12px);
  line-height: 1.08;
  letter-spacing: 0;
  color: var(--green);
  text-shadow:
    0 0 4px rgba(92, 255, 141, 0.5),
    0 0 12px rgba(92, 255, 141, 0.2);
  overflow: hidden;
  white-space: pre;
  user-select: none;
}

.tagline {
  margin: 0 0 1rem;
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  color: rgba(92, 255, 141, 0.55);
  text-align: center;
}

.output {
  margin: 0 0 0.35rem;
  white-space: pre-wrap;
  color: #b8b8c4;
  min-height: 3em;
}

.prompt-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 1.4em;
  margin-bottom: 0.35rem;
}

.prompt {
  color: var(--green);
  flex-shrink: 0;
}

.input {
  color: #d8d8e0;
  outline: none;
  min-width: 1ch;
  white-space: pre-wrap;
  word-break: break-all;
  caret-color: transparent;
}

.cursor {
  color: var(--green);
  animation: blink 1.05s step-end infinite;
  flex-shrink: 0;
}

.hint {
  margin: 0.75rem 0 0;
  font-size: 0.68rem;
  color: var(--muted);
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.crt--subtle::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background: repeating-linear-gradient(to bottom,
      transparent 0px,
      transparent 1px,
      rgba(0, 0, 0, 0.1) 1px,
      rgba(0, 0, 0, 0.1) 2px);
}

.crt--subtle::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 11;
  background: radial-gradient(ellipse at center,
      transparent 40%,
      rgba(0, 0, 0, 0.35) 100%);
}

.bg-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(92, 255, 141, 0.1);
  font-size: 0.7rem;
  color: var(--muted);
}

.bg-switcher .label {
  margin-right: 0.25rem;
}

.bg-switcher button {
  font-family: inherit;
  font-size: 0.7rem;
  color: var(--green-dim);
  background: transparent;
  border: 1px solid rgba(92, 255, 141, 0.25);
  border-radius: 3px;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
}

.bg-switcher button:hover {
  color: var(--green);
  border-color: rgba(92, 255, 141, 0.5);
}

.bg-switcher button.active {
  color: #03140a;
  background: var(--green);
  border-color: var(--green);
}

@media (min-width: 520px) {
  .banner {
    font-size: 0.55rem;
  }
}

@media (min-width: 700px) {
  .banner {
    font-size: 0.62rem;
  }
}

@media (max-width: 520px) {
  .terminal {
    font-size: 0.75rem;
    padding: 1rem;
  }

  .ascii-bg {
    font-size: 9px;
  }
}



.tip {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.4;
}

.tip .hl {
  color: var(--green);
}

.input:empty::before {
  content: attr(data-placeholder);
  color: #4a4a55;
  pointer-events: none;
}

.nav-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-top: 0.85rem;
  margin-bottom: 0.35rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(92, 255, 141, 0.1);
  font-size: 0.72rem;
  color: var(--muted);
}

.nav-label {
  margin-right: 0.25rem;
  opacity: 0.85;
}

/* Invert-on-hover chips (screenshot style) */
.chip,
.bg-switcher button {
  font-family: inherit;
  font-size: 0.72rem;
  color: var(--green);
  background: transparent;
  border: none;
  border-radius: 2px;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
  transition: background 0.08s ease, color 0.08s ease;
}

.chip:hover,
.chip:focus-visible,
.chip.is-active,
.bg-switcher button:hover,
.bg-switcher button:focus-visible,
.bg-switcher button.active {
  color: #03140a;
  background: var(--green);
  outline: none;
}

.bg-switcher {
  border-top: none;
  margin-top: 0.45rem;
  padding-top: 0.35rem;
}

.bg-switcher .label {
  color: var(--muted);
  margin-right: 0.25rem;
}

.bg-switcher button {
  border: 1px solid transparent;
  color: var(--green-dim);
}

.bg-switcher button:hover,
.bg-switcher button.active {
  color: #03140a;
  background: var(--green);
}



.pages {
  position: relative;
}

.page {
  display: none;
  height: var(--page-height);
  min-height: var(--page-height);
}

.page.is-active {
  display: block;
}

.page-body {
  margin: 0;
  min-height: var(--page-body-height);
  max-width: 100%;
  overflow: hidden;
  white-space: pre-wrap;
  color: #b8b8c4;
}

.donut {
  margin: 0.75rem 0 0;
  width: 100%;
  color: var(--green);
  font-size: clamp(0.8rem, 0.9vw, 1.1rem);
  line-height: 0.72;
  letter-spacing: 0.04em;
  white-space: pre;
  overflow: hidden;
  text-shadow: 0 0 6px rgba(92, 255, 141, 0.35);
  max-width: 100%;
  display: block;
}

#page-contact,
#page-home,
#page-work,
#page-about {
  height: var(--page-height);
  min-height: var(--page-height);
}

.ascii-container {
  max-width: 100%;
  overflow: hidden;
}

.ascii-art {
  display: block;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  font-size: clamp(4px, 0.56vw, 8px);
  line-height: 1;
  white-space: pre;
}

#page-contact .page-body {
  min-height: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
}

.contact-form {
  display: grid;
  gap: 0.35rem;
  max-width: 32rem;
  min-height: var(--contact-form-height);
  margin-top: 0;
}

.contact-form label {
  color: var(--green-dim);
  font-size: 0.68rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  margin-bottom: 0.35rem;
  padding: 0.42rem 0.5rem;
  border: 1px solid rgba(92, 255, 141, 0.28);
  border-radius: 2px;
  color: var(--text);
  background: rgba(0, 12, 4, 0.7);
  font: inherit;
  font-size: 0.75rem;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 1px solid var(--green);
  border-color: var(--green);
}

.btn-mail {
  justify-self: start;
  margin-top: 0.65rem;
  font-family: inherit;
  font-size: 0.75rem;
  color: #03140a;
  background: var(--green);
  border: none;
  border-radius: 2px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

.btn-mail:hover {
  box-shadow: 0 0 12px rgba(92, 255, 141, 0.4);
}

.contact-status {
  min-height: 1.2em;
  margin: 0;
  color: var(--green-dim);
  font-size: 0.68rem;
}