:root {
  --accent: #7CF2A6;
  --bg: #07090F;
  --panel: #0C0F18;
  --rule: #1A1E2B;
  --rule-strong: #3A4058;
  --fg: #D6DAE3;
  --fg-strong: #FFFFFF;
  --muted: #8A91A6;
  --body: #B4BACB;
  --err: #FF8A7A;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Unbounded', var(--mono);
  --size: 15px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: var(--size);
  line-height: 1.6;
}

a { color: var(--accent); }
a:hover { color: var(--fg-strong); }
::selection { background: var(--accent); color: var(--bg); }
kbd { padding: 0 4px; background: var(--fg); color: var(--bg); font: inherit; }

.app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── top bar + key bar ───────────────────────────────── */
.top {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 clamp(12px, 2vw, 24px);
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}
.top-mid { color: rgba(7, 9, 15, 0.7); font-weight: 500; }
.top-clock { font-variant-numeric: tabular-nums; }

.keys {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 4px clamp(12px, 2vw, 24px);
  border-top: 1px solid var(--rule);
  background: var(--panel);
  font-size: 13px;
  color: var(--muted);
}
.keys .status { margin-left: auto; color: var(--accent); }

/* ── panes ───────────────────────────────────────────── */
.panes {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  padding: clamp(8px, 1.5vw, 16px);
}
.pane {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule-strong);
}
.pane:focus-within { border-color: var(--accent); }
.pane + .pane { margin-left: -1px; }
.pane-title, .pane-foot {
  position: absolute;
  padding: 0 4px;
  background: var(--bg);
  color: var(--muted);
  line-height: 1.6;
}
.pane-title { top: -0.8em; left: 12px; font-weight: 700; }
.pane-foot { bottom: -0.8em; right: 12px; font-size: 12px; }
.pane:focus-within .pane-title { color: var(--accent); }

/* menu */
.pane-menu { flex: 0 0 240px; }
.menu { list-style: none; margin: 0; padding: 20px 0 12px; }
.menu-item {
  width: 100%;
  min-height: 36px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.menu-item .k, .menu-item .arrow { color: var(--muted); }
.menu-item .arrow { margin-left: auto; }
.menu-item[aria-current="true"], .menu-item[aria-current="true"] .k { color: var(--accent); }
.menu-item:focus, .menu-item:hover { outline: none; background: var(--accent); color: var(--bg); }
.menu-item:focus .k, .menu-item:focus .arrow,
.menu-item:hover .k, .menu-item:hover .arrow { color: var(--bg); }

/* main */
.pane-main { flex: 1 1 auto; min-width: 0; }
.main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 24px clamp(16px, 3vw, 40px);
}

/* ── text lines ──────────────────────────────────────── */
.line { white-space: pre-wrap; word-break: break-word; color: var(--body); min-height: 1.6em; }
.line.dim { color: var(--muted); }
.line.head { color: var(--fg-strong); font-weight: 700; }
.line.banner {
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(44px, 7vw, 104px);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--fg-strong);
}

/* ── ventures ────────────────────────────────────────── */
.rows { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr) auto;
  gap: 4px 24px;
  align-items: baseline;
  padding: 14px 12px;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px dashed var(--rule);
}
.row .name { color: var(--fg-strong); font-weight: 700; }
.row .tagline { color: var(--fg-strong); }
.row .desc { grid-column: 2; color: var(--body); }
.row .go { grid-column: 3; grid-row: 1; color: var(--muted); }
.row:focus, .row:hover { outline: none; background: var(--accent); }
.row:focus *, .row:hover * { color: var(--bg) !important; }

/* ── contact composer ────────────────────────────────── */
.compose { display: flex; flex-direction: column; gap: 18px; max-width: 880px; }
.compose[hidden] { display: none; }
.compose-intro { display: flex; flex-direction: column; }
.compose-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; color: var(--muted); }
.compose-row .compose-label { flex: 0 0 120px; }
.compose-col { display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.compose-col .compose-label { display: flex; gap: 8px; min-width: 0; white-space: nowrap; }
.rule { flex: 1 1 0; min-width: 0; overflow: hidden; }
.rule::before { content: '────────────────────────────────────────────────────────────────────────────────────────────────'; }
.field {
  flex: 1 1 280px;
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px dashed var(--rule-strong);
  border-radius: 0;
  background: transparent;
  color: var(--fg-strong);
  font: inherit;
  outline: none;
}
textarea.field { min-height: 180px; padding: 8px; border: 1px dashed var(--rule-strong); resize: vertical; }
.field::placeholder { color: #5C6378; }
.field:focus { border-color: var(--accent); border-style: solid; background: #0F1420; }
.field.invalid { border-color: var(--err); border-style: solid; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.compose-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; }
.compose-status { margin-right: auto; color: var(--muted); }
.compose-status[data-kind="err"] { color: var(--err); }
.compose-status[data-kind="ok"] { color: var(--accent); }
.key {
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}
.key-primary { color: var(--accent); font-weight: 700; }
.key:hover, .key:focus { outline: none; background: var(--accent); color: var(--bg); }
.key:disabled { opacity: 0.5; cursor: wait; }

/* ── splash ──────────────────────────────────────────── */
.splash {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 300ms ease;
}
.splash.gone { opacity: 0; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.splash-banner {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(48px, 10vw, 128px);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--fg-strong);
}
.splash-bar { color: var(--accent); letter-spacing: 0.05em; }
.splash-msg { color: var(--muted); }

.noscript { padding: 24px; }

/* ── small screens ───────────────────────────────────── */
@media (max-width: 720px) {
  :root { --size: 14px; }
  .field { font-size: 16px; } /* stops iOS zoom on focus */
  .top-mid { display: none; }
  .panes { flex-direction: column; }
  .pane-menu { flex: 0 0 auto; }
  .pane + .pane { margin-left: 0; margin-top: 16px; }
  .menu { display: flex; overflow-x: auto; padding: 16px 4px 8px; }
  .menu li { flex: 0 0 auto; }
  .menu-item .arrow { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row .tagline, .row .desc { grid-column: 1 / -1; }
  .row .go { grid-column: 2; }
  .keys span:not(.status) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .splash { transition: none; }
}
