/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #fff;
  color: #111;
  line-height: 1.6;
}

/* ── Nav ── */
nav {
  padding: 14px 40px;
  border-bottom: 1px solid #e5e5e5;
  font-size: 0.9rem;
}
nav a {
  color: #444;
  text-decoration: none;
}
nav a:hover { color: #111; text-decoration: underline; }

/* ── Page Header ── */
.page-header {
  background: white;
  border-bottom: 1px solid #e5e5e5;
  padding: 40px 0 32px;
}
.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.subtitle {
  color: #444;
  font-size: 1rem;
}

/* ── Container ── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ── Main Layout ── */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  padding-top: 40px;
  padding-bottom: 60px;
  align-items: start;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

/* ── Terminal Window ── */
.terminal-window {
  background: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
}

.terminal-titlebar {
  background: #2d2d2d;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }

.terminal-label {
  font-family: 'Menlo', 'Monaco', monospace;
  font-size: 0.75rem;
  color: #888;
  margin-left: 8px;
}

.terminal-output {
  font-family: 'Menlo', 'Monaco', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #e5e5e5;
  padding: 16px 16px 8px;
  min-height: 320px;
  max-height: 460px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Output color classes */
.terminal-output .out-green  { color: #4ade80; }
.terminal-output .out-cyan   { color: #67e8f9; }
.terminal-output .out-red    { color: #f87171; }
.terminal-output .out-yellow { color: #fde047; }
.terminal-output .out-dim    { color: #888; }
.terminal-output .out-prompt { color: #4ade80; }

/* ── Input line ── */
.terminal-input-line {
  display: flex;
  align-items: center;
  padding: 4px 16px 16px;
  gap: 4px;
  flex-shrink: 0;
}

.prompt {
  font-family: 'Menlo', 'Monaco', monospace;
  font-size: 0.82rem;
  color: #4ade80;
  white-space: nowrap;
  flex-shrink: 0;
}

.cmd-input {
  font-family: 'Menlo', 'Monaco', monospace;
  font-size: 0.82rem;
  background: transparent;
  border: none;
  outline: none;
  color: #e5e5e5;
  flex: 1;
  caret-color: transparent; /* hide default caret — use custom */
}

.cursor-blink {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: #e5e5e5;
  animation: blink 1s step-end infinite;
  flex-shrink: 0;
  align-self: center;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Cheat Sheet ── */
.cheatsheet-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cmd-card {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 14px 16px;
  background: white;
}

.cmd-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cmd-code {
  font-family: 'Menlo', 'Monaco', monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 2px 8px;
}

.cmd-desc {
  font-size: 0.85rem;
  color: #444;
  line-height: 1.5;
}

.cmd-eng {
  font-size: 0.78rem;
  color: #888;
  font-style: italic;
}

/* ── Copy Button ── */
.copy-btn {
  font-size: 0.75rem;
  font-family: system-ui, -apple-system, sans-serif;
  padding: 3px 10px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  background: #fff;
  color: #444;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.copy-btn:hover { background: #f0f0f0; }
.copy-btn.copied {
  background: #dcfce7;
  border-color: #16a34a;
  color: #16a34a;
}

/* ── Tip box ── */
.tip-box {
  margin-top: 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #1e40af;
  line-height: 1.6;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  nav { padding: 14px 20px; }
  .container { padding: 0 20px; }
  .main-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 28px;
    padding-bottom: 40px;
  }
  .terminal-output { min-height: 240px; max-height: 320px; }
}
