@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Branding */
  --header-bg: #24579a;
  --brand-yellow: #ffe000;

  /* Terminal surfaces */
  --terminal-bg: #101820;
  --terminal-panel: #17232d;
  --terminal-panel-raised: #1d2d38;
  --terminal-border: #42515b;

  /* Text */
  --text-primary: #d7e2e8;
  --text-muted: #8195a3;

  /* Accents */
  --accent-cyan: #55dde0;
  --accent-magenta: #e58ac7;
  --accent-green: #75d69a;
  --accent-red: #f08a8a;

  --font-main: "IBM Plex Mono", "DejaVu Sans Mono", "Liberation Mono", monospace;
  --content-width: 920px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--header-bg);
}

body {
  margin: 0;
  color: var(--text-primary);
  background: var(--header-bg);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.65;
}

a { color: var(--brand-yellow); text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent-cyan); text-decoration: underline; }

.masthead {
  min-height: 300px;
  padding: 30px 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: var(--header-bg);
}

.brand { display: block; width: min( min(78vw, 420px), 100%); }
.brand img { display: block; width: 100%; height: auto; }
.masthead-caption {
  color: #f4f6fb;
  font-size: 11px;
  letter-spacing: .12em;
  text-align: center;
}
.masthead-caption span { color: var(--brand-yellow); padding: 0 .35em; }


.terminal-shell {
  width: min(calc(100% - 32px), var(--content-width));
  margin: 0 auto 48px;
  margin-top: 30px;
  background: var(--terminal-bg);
  border: 1px solid #0a1117;
  box-shadow: 0 12px 38px rgb(0 0 0 / 25%);
}

.window-bar {
  min-height: 36px;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--terminal-panel);
  border-bottom: 1px solid var(--terminal-border);
  color: var(--text-muted);
  font-size: 11px;
}
.window-dots { display: flex; gap: 5px; }
.window-dots i { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-magenta); }
.window-dots i:nth-child(2) { background: var(--brand-yellow); }
.window-dots i:nth-child(3) { background: var(--accent-green); }
.window-title { flex: 1; }
.window-version { color: var(--text-muted); }

.terminal-content { padding: 26px clamp(16px, 4vw, 38px) 30px; }

.system-status {
  padding: 12px 15px;
  margin-bottom: 28px;
  background: var(--terminal-panel);
  border: 1px solid var(--terminal-border);
  font-size: 11px;
}


.status-heading { display: flex; justify-content: space-between; gap: 12px; color: var(--accent-cyan); font-weight: 600; letter-spacing: .08em; }
.online { color: var(--accent-green); }
.status-grid {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 2px 12px;
  margin-top: 8px;
  color: var(--text-muted);

}
.fetch-grid {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2px 12px;
  margin-top: 8px;

  float:left;
}
.status-grid strong { color: var(--text-primary); font-weight: 500; }

.intro { margin: 0 0 34px; }
.terminal-line { color: var(--text-primary); font-weight: 600; }
.prompt-prefix, .prompt-label { color: var(--accent-green); }
.typed-command { color: var(--brand-yellow); }
.intro-copy { padding-left: 0; max-width: 120ch; color: var(--text-primary); }
.intro-copy p { margin: 9px 0;}
.intro-copy strong { color: var(--accent-magenta); }
.muted { color: var(--text-muted); }

.ascii-heading { overflow-x: auto; margin: 0 0 8px; }
.ascii-main {
  display: inline-block;
  margin: 0;
  background: linear-gradient(
    to bottom,
    var(--accent-cyan),
    var(--accent-magenta)

  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font: 500 12px/1.15 var(--font-main);
  white-space: pre;
}
.section-title {
  margin: 0;
  color: var(--brand-yellow);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .08em;
}
.section-hint { margin: 3px 0 15px; color: var(--text-muted); font-size: 12px; }

/* Terminal directory listings */
.directory-screen {
  margin: 12px 0 4px;
  padding: 14px 16px 12px;
  background: var(--terminal-panel);
  border: 1px solid var(--terminal-border);
}

.directory-heading {
  margin: 0 0 10px;
  background: linear-gradient(
    to bottom,
    var(--accent-cyan),
    var(--accent-magenta)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font: 500 11px/1.15 var(--font-main);
  white-space: pre;
  overflow-x: auto;
}

.directory-title {
  margin: 0 0 10px;
  color: var(--brand-yellow);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
}

.directory-entry {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 5px 8px;
  border: 0;
  color: var(--text-primary);
  background: transparent;
  font: 500 13px/1.55 var(--font-main);
  text-align: left;
  cursor: pointer;
}

.directory-entry:hover,
.directory-entry:focus-visible {
  color: var(--accent-cyan);
  background: var(--terminal-panel-raised);
  outline: none;
}

.directory-number {
  flex: 0 0 4.5em;
  color: var(--brand-yellow);
}

.directory-entry-label {
  flex: 1;
}

.directory-entry::after {
  content: "↵";
  color: var(--text-muted);
  opacity: 0;
}

.directory-entry:hover::after,
.directory-entry:focus-visible::after {
  opacity: 1;
}

/* Shared navigation control added below every non-root page. */
.page-navigation {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--terminal-border);
}

.page-up-entry {
  color: var(--accent-cyan);
}

.directory-hint {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 11px;
}

.directory-breadcrumb {
  margin: 0 0 7px;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: .06em;
}

.command-output .directory-screen {
  margin: 10px 0 14px;
}

.command-output .directory-entry {
  font-size: 12px;
}

.command-output .directory-title {
  font-size: 12px;
}


.command-area {
  margin-top: 34px;
  #padding: 14px 15px 10px;
  #background: #0b1218;
  #border: 1px solid var(--terminal-border);
}
.command-output {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 12px;
}
.command-output p { margin: 3px 0; overflow-wrap: anywhere; }
.command-output .command-echo { color: var(--text-primary); }
.command-output .command-echo .prompt-prefix { color: var(--accent-green); }
.command-output .output-success { color: var(--accent-cyan); }
.command-output .output-error { color: var(--accent-magenta); }
.command-output .output-note { color: var(--text-muted); }
.command-output code { color: var(--brand-yellow); font-family: inherit; }
.command-form { display: flex; align-items: center; gap: 9px; }
.prompt-label { flex: 0 0 auto; white-space: nowrap; font-weight: 600; }
#command-input {
  flex: 1;
  min-width: 0;
  padding: 3px 0;
  border: 0;
  outline: 0;
  color: var(--brand-yellow);
  background: transparent;
  font: inherit;
  caret-color: var(--accent-cyan);
}
.submit-command {
  border: 1px solid var(--terminal-border);
  padding: 2px 9px;
  color: var(--accent-cyan);
  background: var(--terminal-panel);
  font: inherit;
  cursor: pointer;
}
.submit-command:hover { border-color: var(--accent-cyan); }
.command-footnote { margin: 7px 0 0; color: var(--text-muted); font-size: 10px; text-align: right; }
.command-footnote span { padding: 0 5px; }
kbd { padding: 1px 4px; border: 1px solid var(--terminal-border); border-radius: 2px; font: inherit; }

.terminal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--terminal-border);
  background: var(--terminal-panel);
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: .06em;
  text-align: center;
}

@media (max-width: 600px) {
  .masthead { min-height: 220px; padding: 22px 16px; }
  .brand { width: min(86vw, 360px); }
  .terminal-shell { width: calc(100% - 16px); margin-bottom: 20px; }
  .terminal-content { padding: 18px 13px 22px; }
  .status-grid { grid-template-columns: 72px 1fr; }
  .fetch-grid { grid-template-columns: 400px 1fr;}
  .directory-screen { padding: 11px 9px; }
  .directory-entry { gap: 6px; padding: 6px 4px; font-size: 11px; }
  .directory-number { flex-basis: 4em; }
  .directory-heading { font-size: 9px; }
  .prompt-label { font-size: 10px; }
  .command-form { gap: 6px; }
  .command-footnote { text-align: left; }
}

@media (prefers-reduced-motion: no-preference) {
  .intro-copy p { animation: terminal-reveal .28s steps(18, end) both; color: var(--terminal-line); }
  .intro-copy p:nth-child(2) { animation-delay: .18s; }
  .intro-copy p:nth-child(3) { animation-delay: .36s; }
  .intro-copy p:nth-child(4) { animation-delay: .54s; }
  @keyframes terminal-reveal {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Full-screen splash / entry transition */
body.splash-active {
  min-height: 100vh;
  overflow: hidden;
}

.masthead {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding: 30px 20px;
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  transition: opacity .65s ease;
}

.splash-prompt {
  margin: 18px 0 0;
  color: #f4f6fb;
  font-size: 11px;
  letter-spacing: .14em;
  text-align: center;
  animation: splash-pulse 1.8s ease-in-out infinite;
}

.splash-prompt span {
  display: inline-block;
  margin-left: .5em;
  color: var(--brand-yellow);
  font-size: 15px;
}

.masthead:focus-visible {
  outline: 3px solid var(--brand-yellow);
  outline-offset: -8px;
}

.masthead.is-leaving {
  opacity: 0;
  pointer-events: none;
}

/* Keep the terminal rendered so opacity and transform can animate. */
.terminal-shell {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity .85s ease,
    transform .85s cubic-bezier(.2, .75, .25, 1);
}

body.splash-active .terminal-shell {
  opacity: 0;
  transform: translateY(32px);
  pointer-events: none;
}

body.site-entered .terminal-shell {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@keyframes splash-pulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .masthead,
  .terminal-shell {
    transition-duration: .01ms;
    transform: none;
  }

  .splash-prompt {
    animation: none;
  }
}


/* Loaded page fragments */
#page-view {
  min-width: 0;
}

.project-page {
  margin: 12px 0 4px;
  padding: 16px;
  background: var(--terminal-panel);
  border: 1px solid var(--terminal-border);
}

.project-page > p:not(.directory-breadcrumb):not(.directory-hint) {
  max-width: 78ch;
  margin: 10px 0;
  color: var(--text-primary);
}

.project-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  padding: 10px 0;
  border-top: 1px solid var(--terminal-border);
}

.project-link-label {
  min-width: 180px;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: .08em;
}

.project-link a,
.project-coming-soon {
  color: var(--accent-cyan);
  overflow-wrap: anywhere;
}

.project-list {
  padding-left: 22px;
  color: var(--text-primary);
}

.project-list li {
  margin: 7px 0;
}

.site-tree {
  margin-top: 10px;
  color: var(--accent-cyan);
}

@media (max-width: 600px) {
  .project-page {
    padding: 12px 10px;
  }

  .project-link {
    display: block;
  }

  .project-link-label {
    display: block;
    margin-bottom: 4px;
  }
}
