/* ALICE: Arts Lab in Interfaces, Computers and Everything Else
   Folha de estilo única. Mantém a identidade original: charcoal, marfim,
   ondas cinzas e o prompt ~:>. As ondas também costuram uma página na outra
   durante a rolagem contínua. */

:root {
  --charcoal: #35405D;
  --ivory: #F1F1E6;
  --alice-blue: #F4F9FF;
  --slate: #616B8B;
  --slate-light: #909ABB;
  --ink: #2c3550;
  --cornflower: #4B90F8;
  --download: #485fc7;
  --doi: #00c4a7;
  --white: #fff;

  --dark: var(--charcoal);
  --light: var(--ivory);

  --font: "Roboto", system-ui, sans-serif;
  --side: clamp(16px, 4vw, 48px);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font: 400 1rem/1.6 var(--font);
  color: var(--alice-blue);
  background: var(--charcoal);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--cornflower); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blinking-cursor { animation: none !important; }
}

/* ---------- Cabeçalho: uma linha de shell ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 0 var(--side);
  font: 400 .95rem/1 "JetBrains Mono", ui-monospace, monospace;
  /* sem barra sólida: só um degradê para o texto ler sobre o fundo */
  background: linear-gradient(180deg, rgba(27, 33, 51, .85), rgba(27, 33, 51, 0));
}
.branding { display: flex; align-items: center; text-decoration: none; color: var(--alice-blue); white-space: nowrap; }
.branding img { width: 28px; height: 28px; margin-right: .7rem; }
.brand-name { font-weight: 700; }
.prompt-path { color: var(--slate-light); }
.branding .blinking-cursor { width: .55em; height: 1.1em; margin-left: .25em; vertical-align: middle; }
.menu { position: relative; display: flex; gap: 1.6rem; }
.menu a { color: var(--slate-light); text-decoration: none; padding: .45rem 0; transition: color .2s; }
.menu a:hover, .menu a[aria-current="page"] { color: var(--alice-blue); }
/* marcador que desliza junto com as páginas */
.menu-marker {
  position: absolute; bottom: 0; left: 0; height: 2px; width: 0;
  background: var(--ivory);
  transition: transform .7s cubic-bezier(.65, 0, .35, 1), width .7s cubic-bezier(.65, 0, .35, 1);
}
.menu-open { display: none; }

@media (max-width: 960px) {
  .menu-open {
    display: block; font: inherit; color: var(--alice-blue);
    background: none; border: 0; padding: .5rem 0; cursor: pointer;
  }
  .menu-open[aria-expanded="true"] { color: var(--slate-light); }
  /* no celular, "ls" lista os diretórios como saída de terminal */
  .menu {
    display: none; position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; padding: .5rem var(--side) 1.5rem;
    background: rgba(20, 25, 40, .96); backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(144, 154, 187, .2);
  }
  .menu.open { display: flex; }
  .menu a { padding: .75rem 0; font-size: 1.1rem; }
  .menu a[aria-current="page"]::before { content: "> "; color: var(--ivory); }
  .menu-marker { display: none; }
}
@media (max-width: 420px) { .branding img { display: none; } }

/* ---------- Páginas lado a lado ---------- */
html, body { height: 100%; overflow: hidden; }
.viewport { position: fixed; inset: 0; overflow: hidden; }
.track {
  display: flex; height: 100%;
  transform: translate3d(calc(var(--i, 0) * -100vw), 0, 0);
  transition: transform .7s cubic-bezier(.65, 0, .35, 1);
}
.track.no-anim { transition: none; }
.panel {
  flex: 0 0 100vw; height: 100%;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding-top: var(--header-h); background: var(--charcoal);
}
.panel:empty { display: grid; place-items: center; }
.panel:empty::before { content: "~:>"; font-size: 2rem; font-weight: 700; opacity: .35; animation: blink 1s step-end infinite; }
.panel-inner { min-height: 100%; display: flex; flex-direction: column; }
.panel-inner > .footer { margin-top: auto; }
.wave-top { display: block; width: 100%; height: clamp(90px, 15vw, 220px); }

.panel-next {
  display: block; align-self: flex-end; margin: 1rem var(--side) 2rem;
  color: rgba(244, 249, 255, .7); font-size: 1.05rem; text-decoration: none;
}
.panel-next::before { content: "~:> próxima: "; }
.panel-next:hover { color: var(--alice-blue); }
.panel-next::after { content: " →"; }

@media (prefers-reduced-motion: reduce) {
  .track, .menu-marker { transition: none; }
}

/* ---------- Início ---------- */
.home {
  position: relative; overflow: hidden;
  min-height: calc(100dvh - var(--header-h));
  display: flex; align-items: center;
  padding: 2rem var(--side);
  background:
    radial-gradient(1200px 500px at 85% 15%, rgba(75, 144, 248, .12), transparent 60%),
    linear-gradient(180deg, #1f263a 0%, var(--charcoal) 70%);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* a janela de terminal: o ~:> sempre foi um prompt, agora ele funciona */
.term {
  position: relative; z-index: 1;
  width: min(680px, 100%); margin-left: clamp(0px, 4vw, 80px);
  font: 400 clamp(.95rem, 1.6vw, 1.1rem)/1.65 "JetBrains Mono", ui-monospace, monospace;
  background: rgba(20, 25, 40, .78);
  border: 1px solid rgba(144, 154, 187, .28);
  border-radius: 10px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
  backdrop-filter: blur(6px);
}
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: .6rem .9rem; border-bottom: 1px solid rgba(144, 154, 187, .18);
}
.term-bar .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--slate); }
.term-bar .dot:first-child { background: #e0685f; }
.term-title { margin-left: auto; margin-right: auto; padding-right: 50px; font-size: .8rem; color: var(--slate-light); }
.term-body { padding: 0 clamp(1rem, 3vw, 1.6rem); }
.term-body { padding-top: 1.2rem; padding-bottom: 1.4rem; min-height: 14em; }
.term-body p { margin: 0 0 .15em; overflow-wrap: anywhere; }
.term-body .out { color: rgba(244, 249, 255, .82); margin-bottom: .9em; }
.term-body .big {
  font: 900 clamp(2.6rem, 8vw, 5rem)/1 var(--font); letter-spacing: -.03em;
  color: var(--alice-blue); margin: .15em 0 .35em;
}
.term-body .ok { font-weight: 700; color: var(--alice-blue); }
.term-body .hint { color: var(--slate-light); }
.term-body a { color: var(--cornflower); }
.term-body .cmd { color: var(--alice-blue); }
.ps { color: var(--slate-light); margin-right: .6ch; user-select: none; }
.term:focus-within { border-color: rgba(144, 154, 187, .5); }
.term .blinking-cursor { width: .6em; }

.blinking-cursor {
  display: inline-block; width: 10px; height: 1.2em; vertical-align: -.2em;
  background: var(--ivory); margin-left: 4px; animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { background: transparent; opacity: 0; } }

/* placa de Chladni: a areia ocupa o fundo inteiro da página inicial */
.sand { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.listen {
  position: absolute; z-index: 1; right: var(--side); bottom: clamp(16px, 5vh, 40px);
  display: inline-flex; align-items: center; gap: .6rem;
  font: 400 .85rem/1 "JetBrains Mono", ui-monospace, monospace; color: var(--alice-blue);
  background: rgba(20, 25, 40, .7); border: 1px solid rgba(144, 154, 187, .35); border-radius: 999px;
  padding: .6rem 1rem; cursor: pointer; backdrop-filter: blur(6px);
}
.listen:hover { border-color: var(--slate-light); }
.listen-icon { width: 0; height: 0; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.listen[aria-pressed="true"] .listen-icon { width: 9px; height: 10px; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.listen-note { color: var(--slate-light); }
.listen-note:empty { display: none; }

/* ---------- Pessoas: a página inteira é uma mesa de som ---------- */
.mixer {
  padding: 2.5rem var(--side) 3rem;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, #2a3248, #222839);
  min-height: 100%;
}
.mixer-head { max-width: 1400px; margin: 0 auto 2.5rem; display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem 2rem; }
.mixer-head h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 0; letter-spacing: -.02em; }
.mixer-head p { margin: 0; font: 400 .9rem "JetBrains Mono", ui-monospace, monospace; color: var(--slate-light); }

/* os buses se encaixam lado a lado, como módulos de uma mesa */
.mixer-body { max-width: 1400px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: stretch; }
.bus {
  flex: 0 1 auto;
  display: grid; grid-template-columns: 56px auto;
  background: linear-gradient(180deg, #303952, #283047);
  border: 1px solid rgba(144, 154, 187, .2); border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 48px -30px rgba(0, 0, 0, .7);
  overflow: hidden;
}
/* etiqueta do bus, em pé na lateral, como a régua de uma mesa */
.bus-label {
  margin: 0; padding: 1rem 0; writing-mode: vertical-rl; transform: rotate(180deg);
  display: flex; align-items: center; justify-content: flex-end; gap: .8rem;
  background: rgba(0, 0, 0, .22); border-left: 1px solid rgba(144, 154, 187, .15);
  font: 700 1rem/1 var(--font); letter-spacing: .02em; color: var(--alice-blue);
}
.bus-label small { font: 400 .75rem "JetBrains Mono", ui-monospace, monospace; color: var(--slate-light); }
.strips { display: flex; flex-wrap: wrap; gap: 1px; background: rgba(0, 0, 0, .28); }
.channel {
  width: 184px; flex: 1 0 184px;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  padding: 1.5rem 1rem 1.25rem; background: #2c344b; text-align: center;
}
.knob {
  position: relative; display: block; width: 124px; height: 124px; border-radius: 50%; padding: 4px;
  background: conic-gradient(from 225deg, var(--ivory) 0 calc(var(--lvl) * .75), rgba(144, 154, 187, .2) calc(var(--lvl) * .75) 75%, transparent 75%);
  transition: transform .3s;
}
a.knob:hover { transform: rotate(8deg); }
.initials {
  width: 116px; height: 116px; border-radius: 50%; display: grid; place-items: center;
  background: #232a3d; border: 3px solid #2c344b; color: var(--slate-light);
  font: 700 2rem/1 "JetBrains Mono", ui-monospace, monospace; text-transform: uppercase;
}
.alumni .initials { width: 84px; height: 84px; font-size: 1.5rem; }
@media (max-width: 600px) { .initials { width: 92px; height: 92px; } }
.knob img { position: absolute; top: 4px; left: 4px; width: 116px; height: 116px; border-radius: 50%; object-fit: cover; display: block; background: var(--charcoal); border: 3px solid #2c344b; }
a.knob:hover img { transform: rotate(-8deg); transition: transform .3s; }
/* fita crepe com o nome */
.tape {
  margin: 0; padding: .45rem .7rem; max-width: 100%;
  background: #ece6d2; color: #2c3550; transform: rotate(-1.2deg);
  font: 700 .9rem/1.3 var(--font); box-shadow: 0 2px 3px rgba(0, 0, 0, .3);
}
.channel:nth-child(3n) .tape { transform: rotate(1deg); }
.channel:nth-child(3n+1) .tape { transform: rotate(-.4deg); }
.ch-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.ch-buttons a, .ch-buttons span {
  padding: .3rem .45rem; border-radius: 3px;
  font: 700 .66rem/1 "JetBrains Mono", ui-monospace, monospace; text-decoration: none;
}
.ch-buttons a { color: #1b2133; background: var(--ivory); box-shadow: 0 0 10px rgba(241, 241, 230, .25); }
.ch-buttons a:hover { background: var(--cornflower); color: var(--white); box-shadow: 0 0 12px rgba(75, 144, 248, .5); }
.fader { display: flex; gap: 10px; height: 44px; margin-top: auto; }
.meter {
  width: 4px; border-radius: 2px;
  background: linear-gradient(0deg, var(--doi) 0 60%, var(--ivory) 60% 82%, #e0685f 82%);
  clip-path: inset(78% 0 0 0); transition: clip-path .4s ease;
}
.rail { position: relative; width: 4px; background: rgba(0, 0, 0, .5); border-radius: 2px; }
.cap {
  position: absolute; left: 50%; bottom: 20%; width: 30px; height: 15px; transform: translate(-50%, 50%);
  border-radius: 2px; background: linear-gradient(180deg, #d5d8de, #8d929c);
  box-shadow: 0 3px 5px rgba(0, 0, 0, .5);
  transition: bottom .55s cubic-bezier(.3, 1.4, .5, 1);
}
.cap::after { content: ""; position: absolute; left: 4px; right: 4px; top: 6px; height: 2px; background: #1b2133; }
.channel:hover .cap, .channel:focus-within .cap { bottom: calc(var(--lvl) + 15%); }
.channel:hover .meter, .channel:focus-within .meter { clip-path: inset(calc(92% - var(--lvl)) 0 0 0); animation: vu .5s steps(4) infinite alternate; }
.channel:hover .meter + .rail + .meter { animation-delay: -.2s; }
@keyframes vu { to { clip-path: inset(calc(100% - var(--lvl)) 0 0 0); } }

.alumni { max-width: 1400px; margin: 3rem auto 0; }
.alumni summary {
  cursor: pointer; padding: 1rem 1.25rem; border-radius: 10px;
  border: 1px dashed rgba(144, 154, 187, .35); font: 700 1.2rem var(--font); color: var(--alice-blue);
}
.alumni summary small { font: 400 .8rem "JetBrains Mono", ui-monospace, monospace; color: var(--slate-light); margin-left: .5rem; }
.alumni[open] summary { margin-bottom: 1.75rem; }
.alumni .channel { width: 150px; flex-basis: 150px; }
.alumni .mixer-body { margin-top: 0; }
.alumni .knob { width: 92px; height: 92px; }
.alumni .knob img { width: 84px; height: 84px; }
.alumni .fader { display: none; }

@media (max-width: 600px) {
  .bus { grid-template-columns: 1fr; }
  .bus-label { writing-mode: horizontal-tb; transform: none; justify-content: space-between; padding: .7rem 1rem; border: 0; border-bottom: 1px solid rgba(144, 154, 187, .15); }
  .bus { flex: 1 1 100%; }
  .channel { width: 50%; flex: 0 0 calc(50% - 1px); }
  .knob { width: 100px; height: 100px; } .knob img { width: 92px; height: 92px; }
  .fader { display: none; }
}
@media (prefers-reduced-motion: reduce) { .cap, .meter, .knob, .knob img { transition: none; } .channel:hover .meter { animation: none; } }

/* ---------- Publicações: um grep no terminal ---------- */
.publication { padding: 2rem var(--side) 3rem; }
.pterm {
  max-width: 1200px; margin: 0 auto;
  font: 400 .95rem/1.6 "JetBrains Mono", ui-monospace, monospace;
  background: rgba(20, 25, 40, .82); border: 1px solid rgba(144, 154, 187, .28); border-radius: 10px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
}
.pterm-bar { display: flex; align-items: center; gap: 7px; padding: .6rem .9rem; border-bottom: 1px solid rgba(144, 154, 187, .18); }
.pterm-bar .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--slate); }
.pterm-bar .dot:first-child { background: #e0685f; }
.pterm-title { margin: 0 auto; padding-right: 50px; font-size: .8rem; color: var(--slate-light); }
.pterm-prompt {
  position: sticky; top: var(--header-h); z-index: 2;
  padding: 1rem clamp(1rem, 3vw, 1.6rem) .8rem; background: #171c2b;
  border-bottom: 1px solid rgba(144, 154, 187, .15);
}
.pline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .6ch; }
.pline .kw { color: var(--alice-blue); }
.pline .str { color: var(--ivory); }
#inputSearch {
  flex: 1; min-width: 12ch; padding: 0; font: inherit; color: var(--ivory); caret-color: var(--ivory);
  background: none; border: 0; border-bottom: 1px dashed rgba(144, 154, 187, .4); outline: none;
}
#inputSearch::placeholder { color: var(--slate); }
.flags { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .7rem; font-size: .78rem; }
.flag {
  font: inherit; color: var(--slate-light); cursor: pointer;
  background: rgba(0, 0, 0, .25); border: 1px solid rgba(144, 154, 187, .25); border-radius: 4px; padding: .25rem .5rem;
}
.flag[aria-pressed="true"], select.flag.on { color: #1b2133; background: var(--ivory); border-color: var(--ivory); }
.keys { margin-left: auto; color: var(--slate); font-size: .75rem; }
.pub-count { margin: .6rem 0 0; font-size: .8rem; color: var(--slate-light); }

#article { padding: .6rem 0 1.2rem; }
#article h2.bibliography, #article h2.section-divider {
  margin: 0; padding: .9rem clamp(1rem, 3vw, 1.6rem) .2rem;
  font: 700 .8rem/1.6 "JetBrains Mono", ui-monospace, monospace; color: var(--alice-blue);
}
#article h2.bibliography::before { content: "── "; color: var(--slate); }
#article h2.bibliography small { font-weight: 400; color: var(--slate-light); }
#article h2.section-divider { margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px dashed rgba(144, 154, 187, .3); color: var(--slate-light); }
#article ol.bibliography { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 5ch 7ch minmax(0, 1fr) auto; gap: 0 1.2ch;
  padding: .18rem clamp(1rem, 3vw, 1.6rem); cursor: pointer; border-left: 3px solid transparent;
}
.row:hover, .row.sel, .row[aria-expanded="true"] { background: rgba(144, 154, 187, .1); border-left-color: var(--ivory); }
.row:focus-visible { outline: none; border-left-color: var(--cornflower); }
.row .y { color: var(--slate); }
.row .t { color: var(--slate-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .ti { color: var(--alice-blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .perm { color: var(--slate); font-size: .8rem; letter-spacing: .05em; }
.row .perm b { color: var(--doi); font-weight: 400; }
.row .ve { grid-column: 3 / 5; color: var(--slate); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#article mark { background: var(--ivory); color: #1b2133; padding: 0 .1em; }

.cat {
  margin: .2rem clamp(1rem, 3vw, 1.6rem) .9rem calc(clamp(1rem, 3vw, 1.6rem) + 13.2ch);
  padding: .8rem 1rem; border-left: 1px solid rgba(144, 154, 187, .3); font-size: .88rem;
}
.cat .cmd { color: var(--slate-light); margin-bottom: .4rem; }
.cat h3 { margin: .2rem 0 .5rem; font: 700 1.15rem/1.35 var(--font); color: var(--alice-blue); }
.cat .ref { font: 400 .92rem/1.55 var(--font); color: rgba(244, 249, 255, .75); overflow-wrap: anywhere; }
.cat .ref b { font-weight: 400; }
.cat .abs { max-width: 80ch; margin: .8rem 0 0; font: 400 .95rem/1.65 var(--font); color: rgba(244, 249, 255, .82); }
.acts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.btn {
  display: inline-flex; align-items: center; padding: .45rem .7rem; cursor: pointer; text-decoration: none;
  font: 700 .75rem/1 "JetBrains Mono", ui-monospace, monospace; color: #1b2133;
  background: var(--ivory); border: 1px solid var(--ivory); border-radius: 3px;
}
.btn:hover { background: var(--cornflower); border-color: var(--cornflower); color: var(--white); }
.btn.dl { background: var(--cornflower); border-color: var(--cornflower); color: var(--white); }
.btn.dl:hover { background: var(--ivory); border-color: var(--ivory); color: #1b2133; }
.btn.ghost { background: none; color: var(--ivory); border-color: rgba(241, 241, 230, .45); }
.btn.ghost[aria-expanded="true"] { background: var(--ivory); color: #1b2133; }
.bib { position: relative; margin-top: .9rem; }
.bib .cmd { margin-bottom: .3rem; }
.bib pre {
  margin: 0; padding: .9rem 1rem; max-height: 22em; overflow: auto;
  font: 400 .8rem/1.55 "JetBrains Mono", ui-monospace, monospace; color: var(--ivory);
  white-space: pre-wrap; overflow-wrap: anywhere;
  background: #11151f; border: 1px solid rgba(144, 154, 187, .2); border-radius: 6px;
}
.bib .copy { position: absolute; right: .6rem; top: 2rem; }
.pub-none { padding: 1rem clamp(1rem, 3vw, 1.6rem); color: var(--slate-light); }
@media (max-width: 640px) {
  .row { grid-template-columns: 5ch minmax(0, 1fr) auto; }
  .row .t { display: none; }
  .row .ve { grid-column: 2 / 4; }
  .cat { margin-left: 1rem; }
  .keys { display: none; }
}

.button {
  display: inline-flex; align-items: center; padding: .45rem 1rem;
  font: 400 1rem var(--font); color: #363636; text-decoration: none; cursor: pointer;
  background: var(--white); border: 1px solid #dbdbdb; border-radius: 4px;
}
.button:hover { border-color: #b5b5b5; }
.button[aria-expanded="true"] { border-color: var(--charcoal); }
.button-download, .button-primary { background: var(--download); border-color: transparent; color: var(--white); }
.button-doi { background: var(--doi); border-color: transparent; color: var(--white); }
.button-download:hover, .button-doi:hover, .button-primary:hover { filter: brightness(.93); border-color: transparent; }
.collapse { display: none; flex-basis: 100%; margin: .5rem 0 0; padding: 1rem; font-size: .95rem; line-height: 1.6; background: var(--alice-blue); border: 1px solid rgba(53, 64, 93, .2); border-radius: 4px; }
pre.collapse { white-space: pre-wrap; word-break: break-word; font-size: .85rem; }
.collapse.show { display: block; }

/* ---------- Sobre e Oficinas ---------- */
.prose { max-width: 820px; padding: 2.5rem var(--side) 3rem; font-size: 1.05rem; }
.prose h1, .prose h2 { font-size: 1.75rem; font-weight: 900; margin: 2rem 0 .75rem; }
.prose h1:first-child { margin-top: 0; }
.prose ul { list-style: circle; padding-left: 1.4em; }
.prose a { color: #9fc3ff; }
.prose hr { border: 0; border-top: 1px solid rgba(244, 249, 255, .25); margin: 2.5rem 0; }
.prose address { font-style: normal; }

/* ---------- Trens / Wonderland: índice lateral + lista ---------- */
.trens {
  color: var(--ink); background: var(--light); flex: 1;
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 3rem;
  padding: 2.5rem max(var(--side), (100% - 1216px) / 2) 3rem;
}
.trens-side { position: sticky; top: calc(var(--header-h) + 1.5rem); align-self: start; }
.trens-side h1 { font-size: clamp(2rem, 4vw, 2.6rem); color: var(--slate); margin: 0 0 .5rem; }
.trens-side > p { font-size: 1rem; font-weight: 300; line-height: 1.55; color: var(--slate); margin: 0 0 1.5rem; }
.trens-toc ol { list-style: none; margin: 0 0 1.5rem; padding: 0; border-left: 2px solid rgba(53, 64, 93, .12); }
.trens-toc li.sep { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid rgba(53, 64, 93, .1); }
.trens-toc a {
  display: flex; justify-content: space-between; gap: 1rem; margin-left: -2px; padding: .35rem 0 .35rem .9rem;
  color: var(--slate); text-decoration: none; border-left: 2px solid transparent; transition: color .2s, border-color .2s;
}
.trens-toc a span { font: 400 .78rem "JetBrains Mono", ui-monospace, monospace; color: var(--slate-light); }
.trens-toc a:hover { color: var(--ink); }
.trens-toc a.on { color: var(--ink); font-weight: 500; border-left-color: var(--charcoal); }
.trens-wiki { display: inline-block; font-size: .95rem; color: var(--download); }
.trens-main { min-width: 0; }
.trens-group { scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.trens-group + .trens-group { margin-top: 2.5rem; }
.trens-group h2 { font-size: 1.4rem; color: var(--ink); margin: 0 0 .9rem; }
.services { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.services a {
  display: flex; align-items: center; gap: .9rem; height: 100%;
  padding: .9rem 1rem; background: var(--white); border-radius: 6px; text-decoration: none; color: var(--ink);
  box-shadow: 0 .5em 1em -.125em rgba(10, 10, 10, .08), 0 0 0 1px rgba(10, 10, 10, .03);
}
.services a:hover strong { text-decoration: underline; }
.services img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.services strong { display: block; font-weight: 500; font-size: 1.05rem; }
.services small { display: block; color: var(--slate); font-size: .9rem; line-height: 1.4; }
.icon-fallback { flex: none; width: 40px; text-align: center; font-weight: 700; color: var(--slate-light); }
.obras a { min-height: 4.5rem; }
.trens-admin { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(53, 64, 93, .15); scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.trens-admin summary { cursor: pointer; font-size: 1.1rem; font-weight: 500; color: var(--slate); }
.trens-admin summary:hover { color: var(--ink); }
.trens-admin .note { color: var(--slate); font-size: .95rem; margin: .75rem 0; }
@media (max-width: 860px) {
  .trens { grid-template-columns: 1fr; gap: 1.5rem; }
  .trens-side { position: static; }
  .trens-toc ol { display: flex; flex-wrap: wrap; gap: .4rem; border: 0; }
  .trens-toc li.sep { margin: 0; padding: 0; border: 0; }
  .trens-toc a { margin: 0; padding: .3rem .7rem; border: 1px solid rgba(53, 64, 93, .2); border-radius: 999px; gap: .5rem; }
  .trens-toc a.on { border-color: var(--charcoal); }
}

/* páginas claras: o fundo alterna entre as páginas (Trens e Oficinas são claras) */
.light-page { flex: 1; background: var(--light); color: var(--ink); }
.light-page .prose { margin: 0 auto; }
.light-page .prose a { color: var(--download); }
.light-page .prose hr { border-top-color: rgba(53, 64, 93, .2); }
.light-page .prose h1, .light-page .prose h2 { color: var(--slate); }

/* ---------- Orquídea: patch do Pure Data ---------- */
.orquestra { padding: 3rem max(var(--side), (100% - 1100px) / 2) 4rem; }
.orq-hero { display: grid; grid-template-columns: 5fr 6fr; gap: 3rem; align-items: center; }
.orquestra img { width: 100%; display: block; object-fit: cover; border-radius: 4px; }
.orq-hero img { aspect-ratio: 4 / 5; }
.orq-title h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); margin: 0; line-height: 1; }
.orq-sub { font: 400 1rem "JetBrains Mono", ui-monospace, monospace; color: var(--alice-blue); margin: .6rem 0 1.4rem; }
.orq-title p:not(.orq-sub) { font-size: 1.15rem; font-weight: 300; line-height: 1.6; max-width: 36ch; }
/* caixas no estilo do Pd: objeto = retângulo, mensagem = bandeirinha */
.pd-obj, .pd-msg { font: 400 1rem "JetBrains Mono", ui-monospace, monospace; display: inline-block; padding: .35rem .8rem; }
.pd-obj { border: 1.5px solid var(--ivory); position: relative; background: var(--charcoal); }
.pd-obj::before, .pd-obj::after { content: ""; position: absolute; left: -1.5px; width: 12px; height: 3px; background: var(--ivory); }
.pd-obj::before { top: -1.5px; } .pd-obj::after { bottom: -1.5px; }
.pd-msg {
  color: var(--charcoal); background: var(--ivory); text-decoration: none; margin-top: 1rem; padding-right: 1.3rem;
  clip-path: polygon(0 0, 100% 0, calc(100% - .6rem) 50%, 100% 100%, 0 100%);
}
.pd-msg:hover, .pd-msg:focus-visible { background: var(--white); }
.pd-msg:active { background: var(--alice-blue); }
.orq-patch { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin: 5rem 0 1rem; }
.cords { position: absolute; top: 0; left: 0; width: 100%; height: 2.4rem; overflow: visible; pointer-events: none; }
.cords path { fill: none; stroke: rgba(244, 249, 255, .35); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.role { position: relative; text-align: center; }
.role p { font-weight: 300; line-height: 1.55; margin: 1.1rem auto 0; max-width: 30ch; }
.orq-note { text-align: center; font-weight: 300; font-style: italic; max-width: 60ch; margin: 2rem auto 0; color: var(--alice-blue); }
.orq-feature { margin: 4rem 0 0; }
.orq-feature img { aspect-ratio: 21 / 9; }
.orq-actions { margin-top: 3.5rem; }
.orq-actions h2 { font-size: 1.6rem; margin: 0 0 .5rem; }
.orq-actions p { font-weight: 300; margin: 0; }
@media (max-width: 760px) {
  .orq-hero, .orq-patch { grid-template-columns: 1fr; gap: 1.75rem; }
  .cords { display: none; }
  .orq-patch { margin-top: 3rem; }
}

/* ---------- Oficinas: fichas com pasta de arquivos ---------- */
.oficinas { padding: 2.5rem max(var(--side), (100% - 1100px) / 2) 4rem; }
.of-head h1 { font-size: clamp(2rem, 4vw, 2.6rem); color: var(--slate); margin: 0; }
.of-head p { color: var(--slate); font-weight: 300; font-size: 1.1rem; margin: .3rem 0 2rem; }
.of-card {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2.5rem;
  padding: 2rem 0; border-top: 1px solid rgba(53, 64, 93, .18);
}
.of-tool { font: 700 .85rem "JetBrains Mono", ui-monospace, monospace; color: var(--slate-light); margin: 0; }
.of-card h2 { font-size: 1.6rem; color: var(--ink); margin: .2rem 0 .7rem; }
.of-info p { line-height: 1.65; max-width: 62ch; }
.of-req { color: var(--slate); font-size: .95rem; }
.of-files { list-style: none; margin: 0; padding: 0; align-self: start; background: var(--white); border-radius: 6px; box-shadow: 0 0 0 1px rgba(10, 10, 10, .05), 0 .5em 1em -.4em rgba(10, 10, 10, .12); }
.of-files li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .7rem; padding: .7rem 1rem; }
.of-files li + li { border-top: 1px solid rgba(53, 64, 93, .08); }
.of-files .ext { flex: none; width: 6ch; font: 400 .75rem "JetBrains Mono", ui-monospace, monospace; color: var(--slate-light); }
.of-files a { color: var(--download); }
.of-files a.alt { font-size: .85rem; }
.of-files code { font: 400 .78rem "JetBrains Mono", ui-monospace, monospace; color: var(--slate); background: var(--light); padding: .1rem .4rem; border-radius: 3px; }
@media (max-width: 760px) { .of-card { grid-template-columns: 1fr; gap: 1.25rem; } }

/* ---------- Rodapé ---------- */
.footer { padding: 1.5rem var(--side) 1.5rem; background: var(--charcoal); border-top: 1px solid rgba(244, 249, 255, .1); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem; }
.footer h2 { font-size: 1.25rem; margin: 0 0 .3rem; }
.footer p { font-size: .8rem; margin: 0; }
.social { display: flex; gap: 1.4rem; align-items: center; }
.social a { color: var(--alice-blue); display: block; }
.social a[aria-label="YouTube"] { color: red; }
.social a:hover { opacity: .75; }
.partners { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem; margin-top: 1.5rem; }
.partners a { display: block; }
.partners img { height: 48px; width: auto; display: block; }

/* "Alice está online" fica realçado como um trecho selecionado no terminal */
.term .selected { background: var(--ivory); color: #1b2133; padding: .05em .25em; margin-left: -.25em; }


/* ---------- Sobre: man alice ---------- */
.man { padding: 2rem var(--side) 3rem; }
.man-term {
  max-width: 1100px; margin: 0 auto;
  background: rgba(20, 25, 40, .82); border: 1px solid rgba(144, 154, 187, .28); border-radius: 10px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
}
.man-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 0 2.5rem; padding: 1.4rem clamp(1rem, 3vw, 2rem) 2rem; }
.man-cmd { grid-column: 1 / -1; margin: 0 0 1rem; font: 400 .95rem "JetBrains Mono", ui-monospace, monospace; color: var(--alice-blue); }
.man-cmd .ps { color: var(--slate-light); }
.man-header {
  grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 1.5rem;
  font: 700 .8rem "JetBrains Mono", ui-monospace, monospace; color: var(--slate-light);
}
.man-toc { position: sticky; top: calc(var(--header-h) + 1rem); align-self: start; font: 400 .82rem/1.9 "JetBrains Mono", ui-monospace, monospace; }
.man-toc ol { list-style: none; margin: 0; padding: 0; }
.man-toc a { color: var(--slate-light); text-decoration: none; }
.man-toc a:hover { color: var(--alice-blue); }
.man-toc a::before { content: "  "; white-space: pre; }
.man-toc a:hover::before { content: "> "; color: var(--ivory); }
.man-sec { scroll-margin-top: calc(var(--header-h) + 1rem); margin-bottom: 2rem; }
.man-sec h2 {
  margin: 0 0 .7rem; font: 700 .95rem "JetBrains Mono", ui-monospace, monospace; letter-spacing: .04em; color: var(--alice-blue);
}
.man-sec > :not(h2) { margin-left: clamp(0rem, 3vw, 2rem); }
.man-sec p { max-width: 72ch; margin-top: 0; margin-bottom: 1em; font-size: 1.05rem; line-height: 1.7; color: rgba(244, 249, 255, .86); }
.man-sec em { color: var(--ivory); }
.man-sec a { color: var(--ivory); text-underline-offset: 3px; text-decoration-color: rgba(241, 241, 230, .45); }
.man-sec a:hover { text-decoration-color: currentColor; }
.man-sec .name { font: 400 1rem/1.7 "JetBrains Mono", ui-monospace, monospace; }
.man-sec .name b { color: var(--ivory); }
.man-opts { margin-top: 0; max-width: 72ch; }
.man-opts dt { font: 700 .9rem "JetBrains Mono", ui-monospace, monospace; color: var(--ivory); }
.man-opts dd { margin: 0 0 .8rem 2.5rem; font-size: 1.05rem; line-height: 1.6; color: rgba(244, 249, 255, .82); }
.man-sec address { font: 400 .95rem/1.8 "JetBrains Mono", ui-monospace, monospace; font-style: normal; color: rgba(244, 249, 255, .86); }
.man-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; margin-top: 1rem; font: 400 .8rem "JetBrains Mono", ui-monospace, monospace; color: var(--slate); }
@media (max-width: 760px) {
  .man-body { grid-template-columns: 1fr; }
  .man-toc { position: static; margin-bottom: 1.5rem; }
  .man-toc ol { display: flex; flex-wrap: wrap; gap: 0 1rem; }
  .man-toc a::before { content: none; }
  .man-header span:nth-child(2) { display: none; }
}
.man-term .pterm-bar { font-family: "JetBrains Mono", ui-monospace, monospace; }
