/* My Projects — the workbench. Layout only; every colour, space and radius
   comes from the shared layer. */

@import url('../components.css?v=3d84a222');

html, body { height: 100%; }
body { overflow: hidden; }

.ide {
  display: grid;
  grid-template-columns: 96px 324px 1fr;
  height: calc(100vh - 30px);
  min-height: 0;
}


/* ---------- aurora ----------
   The glass needs something behind it: backdrop-filter over a flat colour does
   nothing.

   The line PERIOD is set against the frost radius, and the first version got
   this wrong. The panes blur their backdrop by 18-26px; a grating with a 47px
   period is erased by a blur that wide, so the depth arrived as a flat wall.
   At 150px the frost softens the lines instead of eating them. */

body { background: var(--study-ground); }

.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.au {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.9;
}
.au-1 {
  left: -12%; top: -18%;
  width: 62vw; height: 52vh;
  background: radial-gradient(circle, rgba(46, 56, 85, 1), transparent 68%);
  animation: drift-1 28s ease-in-out infinite alternate;
}
.au-2 {
  left: 6%; bottom: -24%;
  width: 54vw; height: 56vh;
  background: radial-gradient(circle, rgba(65, 77, 97, 0.82), transparent 66%);
  animation: drift-2 34s ease-in-out infinite alternate;
}
.au-3 {
  left: -6%; top: 34%;
  width: 38vw; height: 38vh;
  background: radial-gradient(circle, rgba(255, 77, 216, 0.26), transparent 70%);
  animation: drift-3 31s ease-in-out infinite alternate;
}
/* the lifelines are drawn by eco.js on the #lifelines canvas: always on,
   edge to edge behind the interface; when the ecosystem is called they
   converge into her form. */
.lifelines {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
/* while she is present the canvas rises above the receded interface,
   still under the conversation UI at z-index 30 */
body.eco-open .lifelines { z-index: 25; }


@keyframes drift-1 { to { transform: translate3d(14vw, 12vh, 0) scale(1.25); } }
@keyframes drift-2 { to { transform: translate3d(18vw, -10vh, 0) scale(1.18); } }
@keyframes drift-3 { to { transform: translate3d(16vw, -18vh, 0) scale(1.3); } }

@media (prefers-reduced-motion: reduce) {
  .au { animation: none; }
}

.ide, .statusbar { position: relative; z-index: 1; }

/* ---------- rail ----------
   Geometry from the MyelinOES SIDEBAR (Figma 479:1059) — 80 wide, two panels
   8px apart, the menu block inside the top one, the orb inside the bottom.
   Surface from the Milkinside study (5EJTy0DLiVg021JDS2eDfX, 3:2): #020202
   ground, cool glows, hairlines in muted steel. The pearl was white against a
   black app, which is what made it read as pasted in. */

:root {
  --study-ground: #020202;
  --study-panel: #08080B;
  --study-glow-top: #2E3855;
  --study-glow-peak: #414D61;
  --study-glow-violet: #0C0913;
  --study-steel: rgba(99, 102, 122, 0.5);
  --study-text-2: rgba(255, 255, 255, 0.6);
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 8px 8px;
  min-height: 0;
}

.pearl {
  position: relative;
  width: 80px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25);
  overflow: clip;
}
/* the glow sits behind the content, the way the hero holds its ellipses */
.pearl::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.1), transparent 42%);
  pointer-events: none;
}

.pearl-top {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 40px;
}

.menu-bg {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 60px;
  flex: 1;
  min-height: 0;
  padding: 16px 8px;
  background: rgba(2, 2, 2, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 18px rgba(0, 0, 0, 0.4);
}

.logo {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  flex: none;
  border: 1px solid rgba(99, 102, 122, 0.45);
  border-radius: 8px;
  color: var(--study-text-2);
  transition: color 200ms ease, border-color 200ms ease;
}
.logo:hover { color: var(--primary); border-color: rgba(255, 77, 216, 0.55); }

.rule { width: 24px; height: 1px; background: var(--study-steel); flex: none; }
.rule.wide { width: 32px; }

.menu-list { display: flex; flex-direction: column; align-items: center; gap: 20px; }

.act {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--study-text-2);
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}
.act:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.05); }
.act[aria-selected="true"] {
  background: linear-gradient(180deg, rgba(65, 77, 97, 0.55), rgba(255, 77, 216, 0.12));
  color: var(--primary);
  box-shadow: inset 0 -1px 0 rgba(255, 77, 216, 0.55);
}

.act:focus-visible,
.logo:focus-visible,
.orb-button:focus-visible,
.item:focus-visible,
.tab:focus-visible,
.pn-toggle:focus-visible,
.st-key:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.ex-search input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* 40px is the size drawn in Figma; the touch area is grown around it. */
.act, .logo { position: relative; }
.act::after, .logo::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 10px;
}

.stamp { display: flex; flex-direction: column; align-items: center; gap: 32px; flex: none; }

/* The label runs up the rail, as it does in the file. */
.vtext {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--study-text-2);
}

.pearl-bottom {
  flex: none;
  height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 28px;
  padding-bottom: 16px;
}
.pearl-bottom::before {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.1), transparent 42%),
    radial-gradient(48% 34% at 50% 88%, rgba(255, 77, 216, 0.18), transparent 72%);
}

.orb { position: relative; width: 60px; height: 60px; flex: none; }
.halo-iri { position: absolute; left: -30px; top: -30px; width: 120px; height: 120px; opacity: 0.5; pointer-events: none; }
.halo-core { display: none; }

.orb-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 60px; height: 60px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(13px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease;
}
.orb-button img { filter: invert(1) opacity(0.7); }
.orb-button:hover { transform: translateY(-2px); border-color: rgba(255, 77, 216, 0.55); }
.orb-button:hover img { filter: invert(1) opacity(1); }

/* ---------- explorer ---------- */

.explorer {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: transparent;
}
.ex-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--space-2) 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.ex-count { color: var(--fg); }
.ex-search { padding: 0 var(--space-2) 10px; }
.ex-search input {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
}
.ex-search input:focus { outline: none; border-color: var(--line-strong); }

.ex-tree { flex: 1; overflow-y: auto; padding-bottom: var(--space-3); }
.ex-tree:focus-visible { outline: 1px solid var(--line-strong); outline-offset: -1px; }

.grp {
  padding: 14px 2px 8px;
  color: var(--study-text-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.ex-tree { padding: 0 12px var(--space-3); }

.item {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 11px 13px 12px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--study-text-2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    linear-gradient(90deg,
      rgba(2, 2, 2, 0.62) 0%,
      rgba(2, 2, 2, 0.56) 46%,
      rgba(2, 2, 2, 0.14) 76%,
      rgba(2, 2, 2, 0.06) 100%);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.item:hover { border-color: rgba(255, 255, 255, 0.2); }
.item:hover { transform: translateY(-2px); }
.item[aria-current="true"] {
  border-color: rgba(255, 77, 216, 0.5);
  background: linear-gradient(180deg, rgba(255, 77, 216, 0.12), rgba(255, 255, 255, 0.03) 62%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 24px rgba(255, 77, 216, 0.08);
}

.i-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.item .n {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.55);
}
.item[aria-current="true"] .n { color: var(--primary); }
.item .mark { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); flex: none; }

.i-name {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--fg);
}
.i-sub {
  margin: 0 0 8px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--study-text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.i-foot {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item[aria-current="true"] .i-foot { color: var(--fg); }

/* ---------- pane, tabs, document ---------- */

.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: rgba(2, 2, 2, 0.5);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.tabs {
  display: flex;
  align-items: stretch;
  gap: 1px;
  height: 36px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  flex: none;
}
.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 230px;
  padding: 0 12px;
  background: var(--bg-elev);
  border: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
}
.tab[aria-selected="true"] { background: rgba(255, 255, 255, 0.04); color: var(--fg); box-shadow: inset 0 1px 0 var(--primary); }
.tab .x { color: var(--muted); padding: 0 2px; border-radius: 4px; }
.tab .x:hover { color: var(--fg); background: var(--surface-active); }

.doc { flex: 1; overflow-y: auto; padding: var(--space-4) var(--space-4) var(--space-5); }
.doc:focus-visible { outline: none; }

.empty {
  max-width: 46ch;
  margin-top: var(--space-5);
  color: var(--muted);
}
.empty h2 { font-family: var(--font-display); font-weight: 500; font-size: 26px; color: var(--fg); margin: 0 0 var(--space-2); letter-spacing: -0.02em; }
.empty kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--fg);
}

.case { max-width: 78ch; }
.case .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.case h1 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
  line-height: 1.12;
}
.case .who { margin: 0 0 var(--space-4); color: var(--muted); }

.sec { margin-bottom: var(--space-4); }
.sec > h2 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 500;
}
.sec p { margin: 0 0 10px; }
.sec .lead { font-size: 17px; }
.sec .sub { color: var(--muted); }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 1px;
  margin: var(--space-2) 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.metric { padding: 12px 14px; background: var(--bg-elev); }
.metric .m-l {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}
.metric .m-v {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}
.metric.none .m-v { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}

table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  text-align: left;
}
table.grid thead th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
table.grid td.num, table.grid th.num {
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.dim { color: var(--muted); }

/* ---------- bottom panel ---------- */

.panel {
  flex: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.pn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px var(--space-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.pn-toggle {
  background: none; border: 0; color: var(--muted);
  font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer;
}
.pn-toggle:hover { color: var(--fg); }
.pn-body {
  max-height: 132px;
  overflow-y: auto;
  padding: 0 var(--space-3) 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}
.pn-body[hidden] { display: none; }
.pn-body b { color: var(--fg); font-weight: 500; }

/* ---------- status bar ---------- */

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 0 var(--space-2);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(2, 2, 2, 0.62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.st-left, .st-right { display: flex; align-items: center; gap: var(--space-2); }
.st-key {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 7px;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.st-key:hover { color: var(--fg); border-color: var(--line-strong); }

/* ---------- command palette ---------- */

.palette {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: start center;
  padding-top: 14vh;
  background: rgba(6, 6, 8, 0.66);
  backdrop-filter: blur(3px);
}
.palette[hidden] { display: none; }
.pal-box {
  width: min(620px, calc(100vw - 32px));
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.pal-box input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13px;
}
.pal-box input:focus { outline: none; }
.pal-list { max-height: 46vh; overflow-y: auto; margin: 0; padding: 6px; list-style: none; }
.pal-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
}
.pal-list li .kind {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: auto;
}
.pal-list li[aria-selected="true"] { background: var(--surface-active); color: var(--fg); }

@media (max-width: 900px) {
  body { overflow: auto; }
  .ide { grid-template-columns: 96px 1fr; height: auto; }
  .pane { grid-column: 1 / -1; border-top: 1px solid var(--line); min-height: 70vh; }
  .panel { display: none; }
}


/* ---------- ecosystem ----------
   The door in the orb. Opening it is "opening the glass": the whole IDE keeps
   its place but recedes — blurred, dimmed, pushed back — and the stream that
   was running behind it comes forward as her form. The form itself is drawn
   on canvas by eco.js: the same lifelines, converging into a band that moves
   when she speaks. */

.ide, .statusbar {
  transition: filter 600ms cubic-bezier(0.645, 0.045, 0.355, 1),
              opacity 600ms cubic-bezier(0.645, 0.045, 0.355, 1),
              transform 600ms cubic-bezier(0.645, 0.045, 0.355, 1);
}
body.eco-open .ide,
body.eco-open .statusbar {
  filter: blur(18px);
  opacity: 0.22;
  transform: scale(0.985);
  pointer-events: none;
}
.eco {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 500ms ease;
}
.eco.is-open { opacity: 1; }

.eco-say {
  position: relative;
  z-index: 1;
  max-width: 560px;
  min-height: 52px;
  margin: 0 24px 26vh;
  text-align: center;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
  text-shadow: 0 1px 12px rgba(2, 2, 2, 0.8);
}

.eco-ask {
  position: absolute;
  left: 50%;
  bottom: 9vh;
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 48px));
  z-index: 1;
}
.eco-ask input {
  width: 100%;
  height: 46px;
  padding: 0 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14.5px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.eco-ask input:focus {
  outline: none;
  border-color: rgba(255, 77, 216, 0.45);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14),
              0 0 0 3px rgba(255, 77, 216, 0.12);
}
.eco-ask input::placeholder { color: rgba(255, 255, 255, 0.4); }

.eco-close {
  position: absolute;
  top: 22px;
  right: 26px;
  z-index: 1;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  cursor: pointer;
}
.eco-close:hover { color: var(--fg); border-color: rgba(255, 255, 255, 0.3); }
