/* ┌──────────────────────────────────────────────────────┐
   │  DAVID TANDY — terminal website styles                │
   │  Dracula-inspired palette, full-bleed dark terminal    │
   └──────────────────────────────────────────────────────┘ */

/* ── Reset & Base ─────────────────────────────────── */

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

:root {
  --bg:        #1a1a1a;
  --bg-light:  #222222;
  --fg:        #e0e0e0;
  --fg-dim:    #888888;
  --cyan:      #50fa7b;
  --cyan-dim:  #2a7a3f;
  --pink:      #ff79c6;
  --orange:    #ffb86c;
  --yellow:    #f1fa8c;
  --purple:    #bd93f9;
  --red:       #ff5555;
  --green:     #50fa7b;
  --blue:      #8be9fd;
  --white:     #f8f8f2;
  --comment:   #6272a4;
  --border:    #333333;
  --font:      "Courier New", "Courier", "Liberation Mono", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-size: 15px;
  --line-height: 1.5;
  --font-weight: 600;
  --card-padding: 1.2em;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--font-size);
  line-height: var(--line-height);
  font-weight: var(--font-weight);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── App Layout ───────────────────────────────────── */

#app {
  height: 100%;
}

/* ── Nav Dropdown (top-right) ─────────────────────── */

#nav-dropdown {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 100;
}

#nav-toggle {
  background: var(--bg-light);
  color: var(--fg-dim);
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 13px;
  padding: 5px 14px;
  cursor: pointer;
  border-radius: 3px;
  transition: color 0.15s, border-color 0.15s;
}

#nav-toggle:hover {
  color: var(--fg);
  border-color: var(--cyan-dim);
}

#nav-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 3px;
  min-width: 180px;
  padding: 6px 0;
  display: none;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

#nav-menu.open {
  display: flex;
}

#nav-menu button {
  background: none;
  border: none;
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  padding: 8px 18px;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}

#nav-menu button:hover {
  background: var(--border);
  color: var(--cyan);
}

#nav-menu hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* ── A11y Toggle ──────────────────────────────────── */

#a11y-toggle {
  position: fixed;
  top: 10px;
  right: 110px;
  z-index: 100;
  background: var(--bg-light);
  color: var(--fg-dim);
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 3px;
  opacity: 0.5;
  transition: opacity 0.15s;
}

#a11y-toggle:hover {
  opacity: 1;
}

/* ── Terminal ─────────────────────────────────────── */

#terminal {
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  height: 100%;
}

#terminal-body {
  overflow-y: auto;
  min-height: 0;
  padding: 16px 20px 0;
  scrollbar-width: none;
}

#terminal-body::-webkit-scrollbar {
  display: none;
}

#output {
  padding-bottom: 56px;
}

/* ── Input Line ───────────────────────────────────── */

#input-line {
  display: flex;
  align-items: center;
  background: var(--bg);
  font-family: var(--font);
  font-size: var(--font-size);
  line-height: var(--line-height);
  min-height: 1.6em;
  padding: 8px 20px 12px;
  border-top: 1px solid var(--border);
}

/* ── About Card (text + cycling face) ─────────────── */

.about-layout {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

.about-text {
  flex: 0 1 auto;
  min-width: 0;
}

.about-face {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
}


.about-text p {
  white-space: normal;
  word-break: normal;
}
.about-face-frame {
  width: 100%;
}

.about-face-frame .output-line.ascii {
  font-size: 2.8px;
  line-height: 0.725;
  color: var(--white);
}

/* Make card snug, not full width */
.content-card.about-card {
  display: table;
  width: auto;
}

@media (min-width: 900px) {
  .content-card.about-card {
    max-width: 70%;
  }
}

@media (max-width: 768px) {
  .about-layout {
    flex-direction: column;
  }

  .about-face {
    order: -1;
    flex: 0 0 auto;
  }


}
.output-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.output-line.system {
  color: var(--comment);
}

.output-line.tool-call {
  color: var(--yellow);
}

.output-line.file-header {
  color: var(--cyan);
}

.output-line.error {
  color: var(--red);
}

.output-line.info {
  color: var(--blue);
}

.output-line.heading {
  color: var(--purple);
  font-weight: bold;
}

.output-line a,
.output-line .link {
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
}

.output-line a:hover,
.output-line .link:hover {
  color: var(--fg-dim);
}

.output-line .bold {
  font-weight: bold;
  color: var(--white);
}

.output-line .dim {
  color: var(--comment);
}


.output-line.ascii {
  color: var(--white);
  font-size: 6px;
  line-height: 1.05;
  overflow-x: auto;
  white-space: pre;
}

/* ── Clickable Links ──────────────────────────────── */

.clickable-link {
  color: var(--green);
  text-decoration: underline;
  cursor: pointer;
}

.clickable-link.dir {
  color: var(--green);
  text-decoration: underline;
  cursor: pointer;
}

.clickable-link.dir:hover {
  color: var(--cyan);
  text-decoration: underline;
}
.clickable-link.dir:hover {
  text-decoration: underline;
  color: var(--fg-dim);
}

/* ── External Links (URLs) — subdued ─────────────── */

.external-link {
  color: var(--comment);
  text-decoration: none;
  cursor: pointer;
}

.external-link:hover {
  color: var(--fg-dim);
  text-decoration: underline;
}

.output-line a.external-link {
  color: var(--comment);
  text-decoration: none;
}

.output-line a.external-link:hover {
  color: var(--fg-dim);
  text-decoration: underline;
}
/* ── Content Card ─────────────────────────────────── */

.content-card {
  border: 1px solid var(--cyan-dim);
  border-radius: 3px;
  margin: 6px 0 10px;
  padding: var(--card-padding);
  background: rgba(80, 250, 123, 0.03);
  max-width: 100%;
  overflow-x: auto;
}

.content-card .card-header {
  color: var(--cyan);
  margin-bottom: 8px;
  font-size: 0.9em;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
}

.content-card .card-body {
  color: var(--fg);
}


#prompt {
  color: var(--green);
  white-space: pre;
  flex-shrink: 0;
}

#input-display {
  color: var(--fg);
  white-space: pre;
  min-width: 2px;
}

#cursor {
  color: var(--cyan);
  display: inline-block;
  width: 0.6em;
  text-align: center;
  animation: blink 1s step-end infinite;
}

#cursor.hidden {
  visibility: hidden;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

#hidden-input {
  position: absolute;
  left: -9999px;
  opacity: 0;
  width: 0;
  height: 0;
}

/* ── Enter Hint ────────────────────────────────────── */

#enter-hint {
  color: var(--comment);
  opacity: 0;
  transition: opacity 0.2s;
  margin-left: 6px;
  pointer-events: none;
  user-select: none;
}

#enter-hint.visible {
  opacity: 0.7;
}

/* ── Credits Roll Overlay ─────────────────────────── */

#credits-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  display: none;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
}

#credits-overlay.active {
  display: flex;
}

#credits-roll {
  font-family: var(--font);
  color: var(--fg);
  text-align: center;
  width: 100%;
  max-width: 700px;
  height: 100%;
  overflow-y: auto;
  padding: 10vh 20px;
}

#credits-roll::-webkit-scrollbar {
  display: none;
}

#credits-roll .credit-title {
  color: var(--white);
  font-size: 1.4em;
  font-weight: bold;
  margin: 20px 0 4px;
}

#credits-roll .credit-role {
  color: var(--cyan);
  margin-bottom: 2px;
}

#credits-roll .credit-year {
  color: var(--comment);
  font-size: 0.85em;
  margin-bottom: 2px;
}

#credits-roll .credit-anecdote {
  color: var(--fg-dim);
  font-style: italic;
  font-size: 0.85em;
  margin-bottom: 16px;
}

#credits-roll .credit-section-header {
  color: var(--purple);
  font-size: 1.1em;
  font-weight: bold;
  margin: 32px 0 12px;
  letter-spacing: 0.3em;
}

#credits-overlay .credits-close {
  position: fixed;
  top: 16px;
  right: 20px;
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-family: var(--font);
  font-size: 13px;
  padding: 4px 12px;
  cursor: pointer;
  z-index: 210;
  border-radius: 3px;
}

/* ── Mobile Thumb Bar ─────────────────────────────── */

#mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9;
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  padding: 8px 10px;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

#mobile-bar button {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-family: var(--font);
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

#mobile-bar button:active,
#mobile-bar button:hover {
  color: var(--cyan);
  border-color: var(--cyan-dim);
}

/* ── Normal Site (Accessibility Mode) ─────────────── */

#plain-site {
  display: none;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  padding: 40px 24px 80px;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
}

#plain-site.active {
  display: flex;
}

#plain-site .plain-nav {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

#plain-site .plain-nav a {
  color: var(--cyan);
  text-decoration: none;
  font-size: 1em;
}

#plain-site .plain-nav a:hover {
  text-decoration: underline;
}

#plain-site .plain-nav a.active {
  color: var(--white);
  text-decoration: underline;
  font-weight: 600;
}

#plain-site .plain-section {
  display: none;
  max-width: 640px;
  margin-bottom: 48px;
}

#plain-site h1 {
  font-size: 2em;
  color: var(--white);
  margin-bottom: 6px;
}

#plain-site h2 {
  font-size: 1.3em;
  color: var(--cyan);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

#plain-site h3 {
  font-size: 1.05em;
  color: var(--purple);
  margin: 16px 0 4px;
}

#plain-site p {
  margin-bottom: 10px;
  line-height: 1.7;
}

#plain-site a {
  color: var(--cyan);
}

#plain-site .plain-back {
  position: fixed;
  top: 14px;
  right: 20px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-family: var(--font);
  font-size: 13px;
  padding: 5px 12px;
  cursor: pointer;
  border-radius: 3px;
}

/* ── Responsive ───────────────────────────────────── */

@media (max-width: 768px) {
  :root {
    --font-size: 14px;
  }

  #terminal {
    height: calc(100% - 48px);
  }

  #terminal-body {
    padding: 12px 12px 0;
  }

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

  #mobile-bar {
    display: flex;
  }

  #nav-toggle {
    font-size: 14px;
    padding: 8px 16px;
  }

  #a11y-toggle {
    right: 100px;
    font-size: 14px;
    padding: 8px 12px;
  }

  .output-line.ascii {
    font-size: 4px;
  }
}

@media (max-width: 400px) {
  :root {
    --font-size: 13px;
  }

  #terminal {
    height: calc(100% - 48px);
  }

  #terminal-body {
    padding: 8px 8px 0;
  }

  #mobile-bar {
    gap: 3px;
    padding: 5px 5px;
  }

  #mobile-bar button {
    font-size: 10px;
    padding: 4px 6px;
  }

  .output-line.ascii {
    font-size: 3px;
  }
}
