/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 16px;
  z-index: 2000;
  font-size: 14px;
}

.skip-link:focus {
  top: 0;
}

/* Static resume — hidden when JS is active */
#static-resume {
  display: none;
  padding: 32px 16px;
  max-width: 700px;
  margin: 0 auto;
  font-family: var(--font-mono);
  color: var(--text);
  line-height: var(--line-height);
}

#static-resume a {
  color: var(--accent);
}

/* Resume overlay (toggled by resume command): a square framed pane in the
   theme colours, still monospace */
#static-resume.resume-visible {
  display: block !important;
  position: fixed;
  top: 5vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(700px, calc(100vw - 32px));
  max-height: 90vh;
  max-height: 90dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-wrap: break-word;
  background: var(--widget-bg);
  color: var(--text);
  padding: 0 2ch 24px;
  border: 1px solid var(--accent);
  z-index: 500;
}

/* Close button: a sticky bar at the top of the pane so it stays reachable
   while scrolling, in the [x] style of the dashboard */
.resume-close {
  display: none;
}

#static-resume.resume-visible .resume-close {
  display: block;
  position: sticky;
  top: 0;
  margin: 0 -2ch 8px auto;
  padding: 8px 2ch;
  background: var(--widget-bg);
  color: var(--accent);
  border: none;
  border-left: 1px solid var(--frame);
  border-bottom: 1px solid var(--frame);
  font-family: var(--font-mono);
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  z-index: 501;
}

#static-resume.resume-visible .resume-close:hover {
  background: var(--accent);
  color: var(--bg);
}

#static-resume.resume-visible .resume-close:focus-visible,
#static-resume.resume-visible .resume-close:focus {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}

#static-resume h1 { font-size: 1.4em; color: var(--accent); margin-bottom: 4px; }
#static-resume .resume-headline { font-weight: 700; margin-bottom: 8px; }
#static-resume .resume-highlights { margin-bottom: 12px; }
#static-resume .resume-highlights li { list-style: none; }
#static-resume .resume-highlights li::before { content: '› '; color: var(--accent); margin-left: -2ch; }
#static-resume .resume-dates { color: var(--dim); }
#static-resume h2 { font-size: 1.1em; color: var(--accent); margin-top: 24px; margin-bottom: 8px; border-bottom: 1px solid var(--frame); padding-bottom: 4px; }
#static-resume h3 { font-size: 1em; margin-top: 16px; margin-bottom: 4px; }
#static-resume p { margin-bottom: 8px; }
#static-resume ul { margin-left: 2ch; margin-bottom: 12px; }
#static-resume li { margin-bottom: 4px; list-style: disc; }
#static-resume li::marker { color: var(--dim); }

/* Quick commands — hidden by default, shown on mobile */
.quick-commands {
  display: none;
  padding: 8px 16px;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* Square [ help ] buttons, like a TUI menu bar */
.quick-commands button {
  background: transparent;
  color: var(--accent);
  border: none;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.quick-commands button::before {
  content: '[ ';
  color: var(--dim);
}

.quick-commands button::after {
  content: ' ]';
  color: var(--dim);
}

.quick-commands button:hover,
.quick-commands button:active {
  background: var(--accent);
  color: var(--bg);
}

.quick-commands button:hover::before,
.quick-commands button:hover::after,
.quick-commands button:active::before,
.quick-commands button:active::after {
  color: var(--bg);
}

/* Reduced motion: no smooth scrolling, sliding, underline sweeps or
   fireflies (the fireflies are only shown with no-preference, in terminal.css) */
@media (prefers-reduced-motion: reduce) {
  #cursor {
    animation: none;
    opacity: 1;
  }

  #terminal-output {
    scroll-behavior: auto;
  }

  .dashboard {
    transition: none;
  }

  #boot-screen {
    display: none !important;
  }

  .thinking-dots::after {
    animation: none;
    content: '...';
  }

  .output-line a,
  .cmd-link,
  .status-label a,
  .status-value a {
    transition: none;
  }
}

/* Mobile: <=768px */
@media (max-width: 768px) {
  :root {
    --font-size: 13px;
  }

  .quick-commands {
    display: flex;
  }

  #terminal-output {
    padding: 12px;
  }

  #input-line {
    padding: 8px 12px;
  }

  /* Prompt: shorten on mobile */
  .prompt .host {
    display: none;
  }

  .prompt .separator:nth-of-type(1),
  .prompt .separator:nth-of-type(2) {
    display: none;
  }

  /* Hide dashboard toggle on mobile */
  .dashboard-toggle {
    display: none;
  }

  /* Dashboard: overlay on mobile */
  .dashboard {
    width: 100%;
    border-left: none;
  }

  body:has(.dashboard:not(.hidden)) #terminal-output,
  body:has(.dashboard:not(.hidden)) #input-line,
  body:has(.dashboard:not(.hidden)) #quick-commands {
    margin-right: 0;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  :root {
    --font-size: 12px;
  }

  .quick-commands {
    column-gap: 1ch;
  }
}
