/* ════════════════════════════════════════════════════════
   ADERPY · metaTOOLS shell — 1-bit mono
   ════════════════════════════════════════════════════════ */

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

:root{
  --ink:#000;
  --paper:#fff;
  --rule:2px;
  --tab-h:36px;
  --tabbar-h:52px;
  --mono:"Monaco","Geneva","Lucida Console","Courier New",monospace;
}

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

body{
  background:var(--paper);
  color:var(--ink);
  font-family:var(--mono);
  font-size:12px;
  line-height:1.4;
  -webkit-font-smoothing:none;
  font-smooth:never;
  display:flex;
  flex-direction:column;
}

a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}

/* ═══ TABBAR ════════════════════════════════════════════ */
.tabbar{
  position:relative;
  display:flex;
  align-items:flex-end;
  height:var(--tabbar-h);
  flex-shrink:0;
  padding:0 8px;
  background:var(--paper);
}
/* the "front-of-folder" edge — passes in front of inactive tabs */
.tabbar::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height:var(--rule);
  background:var(--ink);
  z-index:100;
  pointer-events:none;
}

.tab-strip{
  flex:1;
  display:flex;
  align-items:flex-end;
  overflow:hidden;
  min-width:0;
  height:100%;
}

/* Each tab is a click target containing an SVG silhouette and a label. */
.tab{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:130px;       /* fixed — no resize jitter */
  height:var(--tab-h);
  padding:0 18px;
  font-size:10px;
  letter-spacing:.16em;
  text-transform:uppercase;
  white-space:nowrap;
  cursor:pointer;
  flex-shrink:0;
  user-select:none;
  margin-right:-14px; /* overlap adjacent tabs by ~one flare-width */
}
.tab.active{
  font-weight:700;
}

.tab-bg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
  z-index:-1;
  overflow:visible;
}
.tab-bg path{
  fill:var(--paper);
  stroke:var(--ink);
  stroke-width:2;
  vector-effect:non-scaling-stroke;
}

/* cascade: earlier tabs render on top of later, so each tab's
   left flare is obscured by its left neighbour's overlap */
.tab{ z-index:var(--z,1); }
.tab.active{ z-index:999; }

/* ── Arrow buttons (only shown when strip overflows) ── */
.tab-arrows{
  display:none;
  align-items:flex-end;
  padding:0 4px 6px 4px;
  flex-shrink:0;
  z-index:4;
}
.tab-arrows.show{display:flex}

.help-btn{
  width:26px;
  height:26px;
  border:var(--rule) solid var(--ink);
  border-radius:50%;
  background:var(--paper);
  font-size:13px;
  font-weight:900;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0 0 8px 8px;
  flex-shrink:0;
  position:relative;
  z-index:110;
}
.help-btn:hover,
.help-btn.active{
  background:var(--ink);
  color:var(--paper);
}

.arrow-btn{
  width:24px;height:24px;
  border:var(--rule) solid var(--ink);
  background:var(--paper);
  font-family:var(--mono);
  font-size:13px;
  font-weight:700;
  display:flex; align-items:center; justify-content:center;
  margin-bottom:-2px; /* sit on the folder edge */
  position:relative;
  z-index:4;
}
.arrow-btn + .arrow-btn{ border-left:0; }
.arrow-btn:hover{ background:var(--ink); color:var(--paper); }
.arrow-btn:disabled{
  background:repeating-linear-gradient(45deg,var(--paper) 0 2px,var(--ink) 2px 3px);
  color:var(--paper);
  cursor:default;
}

/* ═══ CONTENT ═══════════════════════════════════════════ */
.content{
  flex:1;
  overflow:hidden;
  position:relative;
  display:flex;
  flex-direction:column;
}
.hidden{display:none!important}

/* ─── Landing ─── */
.home{
  flex:1;
  overflow:auto;
  display:grid;
  grid-template-rows:auto 1fr;
  padding:32px 32px 32px 32px;
  gap:32px;
  max-width:960px;
  width:100%;
  margin:0 auto;
}

.logo{
  display:flex;
  align-items:center;
  justify-content:center;
  border:var(--rule) solid var(--ink);
  padding:28px;
  min-height:120px;
}
.logo .mark{
  font-weight:900;
  font-size:clamp(28px,6vw,56px);
  letter-spacing:.24em;
  line-height:1;
}

.grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:0;
  border:var(--rule) solid var(--ink);
  align-self:start;
}
.cell{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  padding:18px 8px;
  border-right:var(--rule) solid var(--ink);
  border-bottom:var(--rule) solid var(--ink);
  background:var(--paper);
  cursor:pointer;
  text-align:center;
}
.cell:hover{ background:var(--ink); color:var(--paper); }
.cell:hover .ico img{ filter:invert(1); }
.cell:active{ transform:translate(1px,1px); }

.ico{
  width:56px; height:56px;
  display:flex; align-items:center; justify-content:center;
}
.ico img{
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
  image-rendering:pixelated;
}

.cell .name{
  font-size:10px;
  letter-spacing:.18em;
  text-transform:uppercase;
  font-weight:700;
}

/* ── App iframe ── */
.app-frame{
  width:100%;
  flex:1;
  border:none;
  background:var(--paper);
  display:block;
}

/* ═══ MOBILE ════════════════════════════════════════════ */
@media (max-width:600px){
  :root{--tabbar-h:44px;--tab-h:30px}
  .tab{padding:0 16px; font-size:9px; letter-spacing:.12em}
  .home{padding:16px; gap:18px}
  .grid{grid-template-columns:repeat(4,1fr)}
  .ico{width:44px;height:44px}
  .arrow-btn{width:22px;height:22px;font-size:11px}
  .help-btn{width:24px;height:24px;margin-bottom:6px;font-size:12px}
}
