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

:root {
  --bg: #0c0c0c;
  --bg-panel: #111111;
  --border: #2a2a2a;
  --border-active: #3d3d3d;
  --text: #c8c8c8;
  --text-dim: #5a5a5a;
  --accent: #7ee787;
  --accent-dim: #3d6b45;
  --font: "IBM Plex Mono", "SF Mono", "Fira Code", "Consolas", monospace;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* subtle scanline texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 100;
}

.terminal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.5rem;
  gap: 2rem;
}

.terminal--embed {
  align-items: stretch;
  justify-content: stretch;
  padding: 1rem;
  gap: 0;
  height: 100vh;
  min-height: 100vh;
  cursor: pointer;
}

.terminal--embed .embed {
  cursor: default;
}

/* ── menu panel ── */

.menu {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  border-radius: 2px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02),
    0 8px 32px rgba(0, 0, 0, 0.4);
}

.menu__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.menu__list {
  list-style: none;
  padding: 0.5rem 0;
}

.menu__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  outline: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text-dim);
}

.menu__item:hover,
.menu__item:focus-visible {
  background: rgba(126, 231, 135, 0.04);
  color: var(--text);
}

.menu__item--selected {
  background: rgba(126, 231, 135, 0.08);
  color: var(--accent);
}

.menu__item--selected .menu__arrow {
  opacity: 1;
  animation: arrow-pulse 3s ease-in-out infinite;
}

.menu__arrow {
  flex-shrink: 0;
  width: 1rem;
  opacity: 0;
  color: var(--accent);
  transition: opacity 0.12s ease;
}

@keyframes arrow-pulse {
  0%, 100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

.menu__label {
  flex: 1;
}

.menu__hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.menu__item--selected .menu__hint {
  opacity: 1;
}

/* ── footer hints ── */

.hints {
  display: flex;
  gap: 1.5rem;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.hints kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-family: var(--font);
  font-size: 0.65rem;
  color: var(--text);
  background: var(--bg-panel);
  margin-right: 0.35rem;
}

/* ── embed view ── */

.embed {
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  height: 100%;
  margin: 0 auto;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  border-radius: 2px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02),
    0 8px 32px rgba(0, 0, 0, 0.4);
}

.embed__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.embed__path {
  flex: 1;
  letter-spacing: 0.02em;
}

.embed__path span {
  color: var(--accent);
}

.embed__back,
.embed__tab {
  font-family: var(--font);
  font-size: 0.75rem;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.embed__back:hover,
.embed__back:focus-visible,
.embed__tab:hover,
.embed__tab:focus-visible {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: rgba(126, 231, 135, 0.04);
  outline: none;
}

.embed__frame-wrap {
  flex: 1;
  min-height: 0;
  background: var(--bg);
}

.embed__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  background: var(--bg);
}

