/* Shared controls, retained project interactions, browser demos and study pages. */
:root {
  color-scheme: dark;
}
button,
input,
select {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}
.button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
/* Project walkthroughs and source inspector */
.study-link {
  display: block;
  width: fit-content;
  margin-top: 16px;
  font-size: 13px;
  color: var(--accent);
}
.shell-stages {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 25px 0;
  color: var(--muted);
}
[data-shell-stage] {
  padding: 4px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
[data-shell-stage][data-active='true'] {
  color: var(--ink);
  background: #6a369a55;
  border-color: var(--accent);
}
.terminal-content {
  padding: 30px 22px;
}
.terminal-muted {
  min-height: 60px;
}
pre {
  overflow-x: auto;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 18px;
  font:
    12px/1.7 ui-monospace,
    monospace;
}
/* Browser lab */
.lab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}
.demo-panel {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  padding: 30px;
  min-width: 0;
}
.demo-panel h3 {
  font: 500 30px/1.2 var(--display);
  letter-spacing: -0.035em;
  margin: 17px 0;
}
.demo-panel > p {
  font-size: 14px;
  color: var(--muted);
}
.card-tech {
  font:
    12px ui-monospace,
    monospace;
  color: var(--accent);
}
.demo-panel > a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
}
/* Lab layout */
.lab-section {
  padding: 75px 0;
}
.lab-section .section-head h2 {
  font-size: clamp(42px, 5.5vw, 74px);
}
.demo-panel h3 {
  margin-top: 12px;
}
.demo-panel label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.demo-panel input,
.demo-panel select,
.irc-demo input {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
  min-width: 0;
  width: 100%;
}
.input-row {
  display: flex;
  gap: 8px;
  margin-top: 7px;
}
.input-row .button {
  flex-shrink: 0;
}
.stack-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 25px 0;
}
.stack-columns h4 {
  font:
    12px ui-monospace,
    monospace;
  margin-bottom: 15px;
}
.stack-columns h4 span {
  color: var(--muted);
  font-size: 10px;
}
.stack-values {
  min-height: 200px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.stack-bar {
  width: var(--bar-width);
  flex-shrink: 0;
  text-align: center;
  border: 1px solid #a676d155;
  border-radius: 3px;
  background: #bb92fa25;
  color: var(--ink);
  font:
    12px/22px ui-monospace,
    monospace;
}
.demo-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.demo-panel .demo-status {
  margin: 15px 0;
  min-height: 48px;
  font:
    12px/1.7 ui-monospace,
    monospace;
  color: var(--accent);
}
.demo-panel .demo-caption {
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
.demo-panel > a {
  font-size: 12px;
  color: var(--accent);
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.philosopher-settings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.philosopher-settings input,
.philosopher-settings select {
  margin-top: 7px;
  padding: 9px 6px;
  font-size: 12px;
}
.philosopher-settings .button {
  grid-column: 1 / -1;
  width: fit-content;
}
#philosopher-canvas {
  display: block;
  width: 100%;
  height: 280px;
}
.philosopher-states {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 13px;
  font:
    11px/1.8 ui-monospace,
    monospace;
  color: var(--muted);
}
/* Contact */
.email-actions {
  display: flex;
  align-items: center;
  gap: 25px;
  flex-wrap: wrap;
}
.email,
.contact-linkedin {
  font-size: clamp(18px, 2vw, 24px);
}
.contact-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 25px;
  color: var(--accent);
}
.contact-linkedin svg {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}
.site-status {
  min-height: 26px;
  margin-top: 15px;
  font-size: 13px;
  color: var(--accent);
}
/* Project study pages */
.article-layout {
  max-width: 850px;
  padding: 75px 0;
}
.article-layout h1 {
  font: 500 clamp(38px, 6vw, 75px) / 1.1 var(--display);
  letter-spacing: -0.045em;
  margin: 22px 0;
}
.article-lead {
  font-size: 21px;
  color: var(--muted);
}
.article-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 30px 0 55px;
}
.article-layout section {
  margin: 40px 0;
}
.article-layout h2 {
  font: 500 28px var(--display);
  letter-spacing: -0.025em;
  margin: 0 0 18px;
}
.article-layout section > p {
  color: var(--muted);
}
.article-layout section a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.article-layout code {
  font:
    12px/1.7 ui-monospace,
    monospace;
  overflow-wrap: anywhere;
}
.article-layout table {
  border-collapse: collapse;
  width: 100%;
  margin: 25px 0;
}
.article-layout th,
.article-layout td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.article-layout caption {
  text-align: left;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 12px;
}
/* Responsive layouts */
@media (max-width: 1000px) {
  .demo-panel {
    padding: 22px;
  }
}
@media (max-width: 760px) {
  .lab-grid {
    grid-template-columns: 1fr;
  }
  .lab-section {
    padding: 55px 0;
  }
  .article-layout {
    padding: 45px 0;
  }
  .article-lead {
    font-size: 18px;
  }
  .email-actions {
    gap: 18px;
  }
  .philosopher-settings {
    grid-template-columns: repeat(2, 1fr);
  }
  .shell-stages {
    gap: 5px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

/* LeakLens live project preview */
.leaklens-preview {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #202b33;
}
.leaklens-preview img {
  display: block;
  width: 100%;
  height: auto;
}
.leaklens-preview > span {
  display: block;
  padding: 18px 20px;
  font-size: 13px;
  color: var(--text);
  background: #111018;
}

/* Two-client IRC channel simulation */
.irc-demo {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #100e15;
  padding: 24px;
}
.irc-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.irc-header strong {
  color: var(--accent);
}
.irc-header span,
.irc-caption,
.irc-connection {
  color: var(--muted);
  font-size: 12px;
}
.irc-clients {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.irc-client {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #09080e;
}
.irc-client h4 {
  font: 500 13px var(--sans);
  margin: 0;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.irc-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #85c9ac;
}
.irc-messages {
  list-style: none;
  height: 145px;
  overflow-y: auto;
  padding: 12px;
  margin: 0;
  font-size: 13px;
}
.irc-messages li {
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.irc-messages strong {
  display: block;
  color: var(--accent);
  font-size: 11px;
}
.irc-notice {
  color: var(--muted);
  font-size: 11px;
}
.irc-local strong {
  color: var(--muted);
}
#irc-form {
  margin-top: 20px;
}
#irc-form label {
  font-size: 12px;
  color: var(--muted);
}
#irc-sender {
  margin-left: 8px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px;
}
.irc-message-label {
  display: block;
  margin: 12px 0 8px;
}
#irc-message {
  width: 100%;
  min-width: 0;
}
.irc-wire pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
}
.irc-wire p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.irc-connection {
  min-height: 38px;
  line-height: 1.6;
}
.irc-caption {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  line-height: 1.6;
}
@media (max-width: 600px) {
  .irc-demo {
    padding: 16px;
  }
  .irc-header {
    flex-wrap: wrap;
  }
  .irc-clients {
    gap: 8px;
  }
  .irc-messages {
    padding: 8px;
  }
}
