/*!
 * andrewfry.dev — original stylesheet. © Andrew Fry.
 * authorship signature: afdev-fp-8878090b-5c47-4e14-ad9f-a675f11cee8f
 */
:root {
  --page-bg: #1e1e1e;
  --bg: #0c0c0c;
  --chrome: #181818;
  --border: #2e2e2e;
  --ink: #cccccc;
  --bright: #ffffff;
  --dim: #7a7a85;
  --surface: #1c1c22;
  --warn: #ffb4ab;
  /* theme: campbell (default) */
  --accent: #3a96dd;
  --accent-ink: #00121f;
}

[data-theme="lime"]     { --accent: #cdf200; --accent-ink: #181e00; }
[data-theme="amber"]    { --accent: #ffb000; --accent-ink: #1f1400; }
[data-theme="matrix"]   { --accent: #39ff7a; --accent-ink: #001f0a; }

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

html { scroll-behavior: smooth; }

body {
  background: var(--page-bg);
  color: var(--ink);
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  padding: 24px;
  min-height: 100vh;
}

.accent { color: var(--accent); }
.bright { color: var(--bright); }
.dim { color: var(--dim); }
.ok { color: var(--accent); font-weight: 700; }
.code { color: var(--accent); font-size: 0.92em; }

/* Windows Terminal window */
.terminal {
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  /* clip (not hidden): hidden would break position:sticky for the diagram rail */
  overflow: clip;
}

/* Tab bar */
.tabbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  background: var(--chrome);
  padding: 8px 0 0 8px;
  user-select: none;
}

.tabs { display: flex; align-items: flex-end; gap: 4px; min-width: 0; }

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 8px 8px 0 0;
  padding: 7px 12px;
  font-size: 12px;
  color: var(--bright);
  white-space: nowrap;
  overflow: hidden;
}

.tab-icon { color: var(--accent); font-weight: 700; }

.tab-close { color: var(--dim); padding: 0 2px; border-radius: 4px; }

.tab-close:hover { background: var(--border); color: var(--bright); }

.tab-new, .tab-chevron {
  align-self: center;
  color: var(--ink);
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 4px;
}

.tab-new:hover, .tab-chevron:hover { background: #2a2a2a; }

.win-controls { display: flex; align-items: stretch; }

.win-btn {
  display: flex;
  align-items: center;
  padding: 0 17px;
  font-size: 11px;
  color: var(--ink);
}

.win-btn:hover { background: #2a2a2a; }

.win-btn.win-close:hover { background: #c42b1c; color: #fff; }

/* Screen */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 32px;
  gap: 48px;
}

/* Boot sequence */
.boot-prompt { margin-top: 1.4em; }

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

.cursor.hidden { display: none; }

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

/* Boot output lines + section reveals: visible by default (no-JS, crawlers);
   JS hides them on load, then staggers them back in. */
.js .boot-line,
.js .reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.js .boot-line.on,
.js .reveal.on {
  opacity: 1;
  transform: none;
}

/* Navigation flash when a console command jumps to a section */
.js .flash { animation: flashfade 1.4s ease; }

@keyframes flashfade {
  0% { outline: 2px solid var(--accent); outline-offset: 10px; }
  70% { outline: 2px solid var(--accent); outline-offset: 10px; }
  100% { outline: 2px solid transparent; outline-offset: 10px; }
}

/* Static command echo at the top of subpages */
.static-echo .back-link { color: var(--dim); }

.static-echo .back-link:hover { color: var(--accent); }

/* Boxes — flat modern cards */
.af-box, .menu-box {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px 24px 24px;
}

.box-label {
  position: absolute;
  top: -10px;
  left: 16px;
  background: var(--bg);
  padding: 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.af-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.owl {
  color: var(--bright);
  font-weight: 700;
  line-height: 1.25;
  font-size: 14px;
  flex-shrink: 0;
}

.owl-af { color: var(--accent); }

.af-text h1 {
  color: var(--bright);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.subtitle {
  color: var(--accent);
  margin-bottom: 16px;
}

.af-text p + p { margin-top: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

.chip {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}

.chip-solid {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.chip-warn {
  background: var(--warn);
  border-color: var(--warn);
  color: #3d0a05;
}

.stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--dim);
}

.stat-num { color: var(--accent); font-weight: 800; font-size: 16px; margin-right: 4px; }

/* Directory sections */
.dir-label {
  display: inline-block;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 6px;
  margin-bottom: 24px;
}

.dir-intro { max-width: 720px; margin-bottom: 24px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.card:hover { border-color: var(--accent); transform: translateY(-2px); }

.card h3 { color: var(--bright); font-size: 14px; margin-bottom: 16px; }

.tree {
  list-style: none;
  padding-left: 24px;
  border-left: 1px solid var(--border);
}

.tree li { position: relative; padding: 4px 0; }

.tree li + li { margin-top: 12px; }

.tree-tick {
  position: absolute;
  left: -25px;
  color: var(--dim);
}

.item-name { color: var(--bright); font-weight: 700; }

.card:hover .item-name { color: var(--accent); }

.item-link { text-decoration: none; }

.item-link:hover .item-name { text-decoration: underline; }

.item-desc { font-size: 12px; color: var(--dim); margin-top: 4px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.tags span, .tags a.tag-link {
  font-size: 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #121218;
  padding: 1px 4px;
}

.tags .tag-warn { color: var(--warn); border-color: var(--warn); }
.tags .tag-ok   { color: #4ec9b0; border-color: #4ec9b0; }
.tags .tag-done { color: #3a96dd; border-color: #3a96dd; }
.tags .tag-poc  { color: #d7ba7d; border-color: #d7ba7d; }

.tags a.tag-link { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.tags a.tag-link:hover { background: var(--accent); color: var(--accent-ink); }

.see-all { margin-top: 24px; }

.see-all a { color: var(--ink); text-decoration: none; }

.see-all a:hover { color: var(--accent); }

/* Projects overview page */
.project-card { display: flex; flex-direction: column; position: relative; }

.project-name { margin-bottom: 4px; }

.project-name a { color: var(--bright); text-decoration: none; }

.project-name a:hover { color: var(--accent); text-decoration: underline; }

/* Stretch the title link over the whole card so anywhere on it is clickable */
.project-name a::after { content: ''; position: absolute; inset: 0; }

.card-cta { position: relative; z-index: 1; }

.project-context { font-size: 11px; color: var(--dim); margin-bottom: 10px; }

.project-card .item-desc { flex: 1; }

.card-cta {
  display: block;
  margin-top: 16px;
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
}

a.card-cta:hover { color: var(--accent); }

.card-cta.pending { color: var(--dim); cursor: default; }

/* Project detail (GAF) page */
.project-header h1 { color: var(--bright); font-size: 28px; font-weight: 800; }

.project-header .subtitle { margin-bottom: 4px; }

.header-tags { margin-top: 14px; }

.impact-bar {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.gaf-layout { display: block; }

.article { max-width: 760px; min-width: 0; }

.article section + section { margin-top: 48px; }

.article h2 {
  color: var(--bright);
  font-size: 17px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.article p + p, .article p + ul, .article ul + p { margin-top: 10px; }

.article ul { list-style: none; padding-left: 4px; }

.article ul li { padding-left: 18px; position: relative; }

.article ul li::before { content: '-'; position: absolute; left: 0; color: var(--accent); }

.callout {
  border-left: 2px solid var(--accent);
  padding: 8px 14px;
  margin-top: 14px;
  background: var(--surface);
  border-radius: 0 4px 4px 0;
}

.next-nav { margin-top: 48px; }

.next-nav a { color: var(--ink); text-decoration: none; }

.next-nav a:hover { color: var(--accent); }

/* ASCII flowcharts */
.diagram {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.diagram figcaption {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.diagram pre {
  font-family: inherit;
  font-size: 11px;
  line-height: 1.35;
  color: var(--ink);
  padding: 14px;
  overflow-x: auto;
}

/* Sticky diagram rail — desktop only */
.diagram-rail { display: none; }

@media (min-width: 1100px) {
  .gaf-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
  }

  /* Diagrams live in the rail on desktop; inline copies hide */
  .js .article .diagram { display: none; }

  .js .diagram-rail {
    display: block;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
  }

  .rail-head { font-size: 11px; margin-bottom: 10px; }

  .panel-diagram { display: none; }

  .panel-diagram.show { display: block; animation: panelfade 0.35s ease; }

  @keyframes panelfade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
  }
}

/* System menu */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px 32px;
}

.menu-item {
  display: flex;
  gap: 12px;
  align-items: baseline;
  text-decoration: none;
  color: inherit;
  padding: 4px 8px;
  margin: 0 -8px;
  border-radius: 4px;
}

.menu-item:hover { background: var(--surface); }

.menu-item:hover .menu-desc { color: var(--accent); }

.menu-desc { color: var(--ink); transition: color 0.2s ease; }

.menu-tip { font-size: 12px; margin-top: 20px; }

/* Syslinks */
.links-box {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 24px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.syslink {
  text-decoration: none;
  color: var(--ink);
  padding: 4px 8px;
  margin: 0 -8px;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.syslink:hover { background: var(--surface); color: var(--accent); }

/* Interactive console */
.spacer { flex: 1; }

.console {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.console-output { margin-bottom: 4px; }

.console-output > div {
  white-space: pre-wrap;
  word-break: break-word;
}

.console-output .out-cmd { color: var(--bright); margin-top: 8px; }

.console-output .out-cmd .accent { font-weight: 700; }

.console-output .out-text { color: var(--ink); }

.console-output .out-dim { color: var(--dim); }

.console-output .out-err { color: var(--warn); }

.console-output pre {
  font-family: inherit;
  line-height: 1.35;
  color: var(--ink);
  margin: 4px 0;
}

.console-form {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
}

.console-prompt { white-space: nowrap; font-weight: 700; }

#console-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--bright);
  font-family: inherit;
  font-size: 14px;
  caret-color: var(--accent);
}

#console-input::placeholder { color: var(--dim); opacity: 0.7; }

.footer-seo { font-size: 11px; margin-top: 20px; }

/* Responsive */
@media (max-width: 768px) {
  body { padding: 8px; }
  .screen { padding: 20px 16px; gap: 36px; }
  .af-layout { flex-direction: column; gap: 24px; }
  .owl { font-size: 12px; }
  .boot { font-size: 12px; }
  .tab-title { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
  #console-input { font-size: 16px; } /* prevents iOS zoom-on-focus */
  .console-output pre { font-size: 10px; }
  .diagram pre { font-size: 9px; }
}

/* Work request form */
.pitch-text { max-width: 720px; margin-top: 16px; }

.pitch-list {
  list-style: none;
  margin-top: 12px;
  padding-left: 4px;
}

.pitch-list li { padding-left: 18px; position: relative; }

.pitch-list li::before { content: '-'; position: absolute; left: 0; color: var(--accent); }

.form-box { max-width: 760px; }

.work-form { display: grid; gap: 20px; }

.field label {
  display: block;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--bright);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  caret-color: var(--accent);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}

.field input::placeholder,
.field textarea::placeholder { color: var(--dim); opacity: 0.7; }

.field textarea { resize: vertical; min-height: 160px; }

.field select option { background: var(--surface); }

.field input.input-validation-error,
.field textarea.input-validation-error,
.field select.input-validation-error { border-color: var(--warn); }

.field-error, .validation-summary { color: var(--warn); font-size: 12px; }

.field-error { display: block; margin-top: 4px; }

/* Honeypot: visually removed, still in the DOM for bots to find */
.hp-field { position: absolute; left: -9999px; top: -9999px; }

.form-actions { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }

.btn-submit {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 22px;
  cursor: pointer;
}

.btn-submit:hover { filter: brightness(1.15); }

.inline-link { color: var(--ink); }

.inline-link:hover { color: var(--accent); }

/* Sent confirmation */
.sent-box { max-width: 760px; }

.sent-message { margin-top: 16px; }

.sent-nav { margin-top: 16px; }

/* Reduced motion: no blinking, no transitions */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
  .js .boot-line, .js .reveal { transition: none; }
  .js .flash { animation: none; }
  .card, .card:hover { transform: none; }
  .panel-diagram.show { animation: none; }
}
