/* Diffexia landing — terminal aesthetic, no external assets */

:root {
  --bg: #050505;
  --bg-deep: #000000;
  --green: #00ff41;
  --green-dim: #00c833;
  --green-muted: #147a2e;
  --green-faint: #0a3d16;
  --panel: #070707;
  --line: #0f3d18;
  --glow: 0 0 10px rgba(0, 255, 65, 0.45);
  --font: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", "Courier New", "Noto Sans Mono CJK SC", "Microsoft YaHei", "PingFang SC", "Noto Sans Thai", Tahoma, monospace;
}

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

html {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--green);
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(0, 255, 65, 0.06), transparent 55%),
    var(--bg);
  text-rendering: optimizeLegibility;
}

.crt {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0.18) 3px
    );
  opacity: 0.35;
  mix-blend-mode: multiply;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0 0.5rem;
}

.brand {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.28em;
  text-transform: lowercase;
  color: var(--green-dim);
  text-shadow: var(--glow);
}

.lang-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.lang-switcher button {
  appearance: none;
  margin: 0;
  min-width: 2.75rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--green-muted);
  border-radius: 2px;
  background: transparent;
  color: var(--green);
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.lang-switcher button:hover {
  background: var(--green-faint);
  box-shadow: var(--glow);
}

.lang-switcher button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.lang-switcher button[aria-pressed="true"] {
  background: var(--green);
  color: var(--bg-deep);
  border-color: var(--green);
  font-weight: 700;
  box-shadow: var(--glow);
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 0 2.5rem;
}

.hero {
  display: flex;
  justify-content: center;
}

.terminal {
  width: min(680px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(0, 255, 65, 0.08),
    0 0 40px rgba(0, 255, 65, 0.08),
    0 18px 50px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.terminal:focus {
  outline: none;
}

.terminal:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.terminal.is-waiting {
  cursor: pointer;
}

.terminal-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--line);
  background: #080808;
}

.dots {
  display: flex;
  gap: 0.35rem;
}

.dots span {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--green-muted);
  box-shadow: 0 0 6px rgba(0, 255, 65, 0.25);
}

.terminal-title {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--green-dim);
  text-align: center;
}

.terminal-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 11.5rem;
  padding: 1.6rem 1.35rem 1.4rem;
  background:
    linear-gradient(180deg, rgba(0, 255, 65, 0.03), transparent 40%),
    var(--bg-deep);
}

.terminal[data-expanded="true"] .terminal-body {
  justify-content: flex-start;
  min-height: 14.5rem;
}

.terminal-output {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
}

.prompt-line,
.log-line {
  margin: 0;
  max-width: 100%;
}

.prompt-line.init-line {
  font-size: clamp(1.05rem, 4.6vw, 1.85rem);
  letter-spacing: 0.02em;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.55);
  white-space: nowrap;
}

.terminal[data-expanded="true"] .prompt-line.init-line {
  font-size: clamp(0.95rem, 3.4vw, 1.25rem);
  letter-spacing: 0.01em;
}

.log-line,
.prompt-line.next-prompt {
  font-size: clamp(0.92rem, 3.3vw, 1.08rem);
  line-height: 1.55;
  letter-spacing: 0.01em;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.35);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.log-line.status {
  color: var(--green-dim);
}

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

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

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

.cursor {
  display: inline-block;
  width: 0.65ch;
  height: 1.05em;
  margin-left: 0.12em;
  vertical-align: text-bottom;
  background: var(--green);
  box-shadow: var(--glow);
  animation: blink 1s steps(1, end) infinite;
}

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

.continue-hint {
  margin: 1.15rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--green-muted);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.continue-hint.is-visible {
  opacity: 0.85;
  animation: hint-pulse 2.4s ease-in-out infinite;
}

.continue-hint kbd {
  font: inherit;
  color: var(--green-dim);
}

@keyframes hint-pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.9;
  }
}

.site-footer {
  padding: 0 0 1.5rem;
  color: var(--green-dim);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 480px) {
  .site-header,
  main,
  .site-footer {
    width: min(920px, calc(100% - 1.25rem));
  }

  .site-header {
    align-items: flex-start;
  }

  .brand {
    padding-top: 0.45rem;
    letter-spacing: 0.18em;
  }

  .terminal-body {
    min-height: 9.5rem;
    padding: 1.2rem 1rem 1.1rem;
  }

  .terminal[data-expanded="true"] .terminal-body {
    min-height: 13.5rem;
  }

  main {
    padding-top: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lang-switcher button,
  .continue-hint {
    transition: none;
  }

  .cursor {
    animation: none;
    opacity: 1;
  }

  .continue-hint.is-visible {
    animation: none;
    opacity: 0.85;
  }
}
