:root {
  color-scheme: dark;
  --background: #101310;
  --surface: #171b17;
  --line: #2d352c;
  --text: #e3e9dc;
  --muted: #a1ad9c;
  --green: #badb9a;
  --amber: #d7ba7d;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", "PingFang SC", "Microsoft YaHei", monospace;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

html { min-height: 100%; background: var(--background); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: radial-gradient(ellipse at 50% 40%, #1b2218 0, var(--background) 68%);
}

::selection { background: #badb9a; color: #101310; }

.page {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 72px 32px 40px;
}

.terminal {
  width: min(100%, 880px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 32px 100px #00000040, 0 1px 0 #ffffff04 inset;
}

.terminal-bar {
  position: relative;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: #ffffff02;
}

.window-dots { display: flex; gap: 8px; }
.window-dots span { width: 9px; height: 9px; border-radius: 50%; background: #aa7463; }
.window-dots span:nth-child(2) { background: #ad9a63; }
.window-dots span:nth-child(3) { background: #809b6b; }

.terminal-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.window-mark { color: #798472; font-size: 16px; }

.terminal-body { padding: 54px 64px 36px; }
.prompt { margin: 0 0 26px; font-size: 14px; line-height: 1.6; }
.prompt-user { color: var(--green); }
.prompt-host { color: var(--muted); }
.prompt-path { color: var(--amber); }
.prompt-symbol { color: var(--muted); margin-left: 12px; }

h1 {
  margin: 0;
  font-size: clamp(64px, 10vw, 104px);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 1.18;
}

.domain-dot { color: var(--green); }
.welcome { margin: 24px 0 0; font-size: 16px; line-height: 1.8; color: var(--muted); letter-spacing: 0.055em; }
.idle-symbol { color: var(--green); font-size: 20px; }

.terminal-controls { margin-top: 32px; }
.command-form { display: flex; align-items: center; gap: 16px; min-height: 46px; }
.command-form input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 9px 0;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #3d4838;
  outline: none;
  background: transparent;
  color: var(--text);
  caret-color: var(--green);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
}
.command-form input::placeholder { color: #91a088; opacity: 1; }
.command-form input:focus { border-bottom-color: var(--green); }
.run-command {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #3d4838;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.terminal-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.quick-commands { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-commands button {
  min-height: 36px;
  padding: 3px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--green);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.quick-commands button:first-child { margin-left: -8px; }
.quick-commands button:hover, .run-command:hover { background: #badb9a12; color: var(--text); }
button:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.keyboard-hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; white-space: nowrap; }
.keyboard-hint span { padding: 0 4px; color: #697961; }

.terminal-output {
  max-height: 280px;
  overflow-y: auto;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
  scrollbar-color: #52604d transparent;
  overscroll-behavior: contain;
}
.terminal-output:empty { display: none; }
.terminal-output:not(:empty) { margin-top: 30px; padding-right: 8px; border-top: 1px solid var(--line); }
.output-entry { padding-top: 18px; }
.output-command { margin: 0 0 8px; color: var(--text); font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.output-command::before { content: "❯"; margin-right: 12px; color: var(--green); }
.output-result { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.8; white-space: pre-wrap; }
.output-result.is-error { color: var(--amber); }
.help-list { display: grid; grid-template-columns: max-content 1fr; gap: 5px 22px; margin: 0; font-size: 14px; line-height: 1.8; }
.help-list dt { color: var(--green); }
.help-list dd { margin: 0; color: var(--muted); }
.no-script { margin-top: 32px; color: var(--muted); font-size: 14px; line-height: 1.8; }

.filing {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 24px 24px 32px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
}

.filing a { color: inherit; text-decoration: none; text-underline-offset: 5px; transition: color 160ms ease; }
.filing a:hover { color: var(--text); text-decoration: underline; }
.filing a:focus-visible { outline: 2px solid var(--green); outline-offset: 6px; border-radius: 2px; }
.filing-divider { color: #52604d; }

@media (max-width: 600px) {
  .page { padding: 40px 20px 24px; }
  .terminal { border-radius: 10px; }
  .terminal-bar { min-height: 48px; padding: 0 16px; }
  .terminal-body { padding: 38px 26px 28px; }
  .prompt { margin-bottom: 24px; }
  h1 { font-size: clamp(52px, 15vw, 76px); }
  .welcome { margin-top: 20px; letter-spacing: 0; }
  .terminal-controls { margin-top: 30px; }
  .command-form { gap: 10px; }
  .terminal-tools { align-items: flex-start; flex-direction: column; gap: 5px; }
  .terminal-output { max-height: 240px; }
  .help-list { gap: 7px 16px; }
  .filing { flex-direction: column; gap: 7px; padding: 20px 16px 28px; }
  .filing-divider { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .filing a { transition: none; }
}
