/* ide-code-landing.css — Phase 11 Code landing styles.
 *
 * Tier 3 shipped the minimum masthead scaffold.
 * Tier 4 fills in the full Hybrid H treatment, feature rail, and CTA card states.
 *
 * CSS variables used: all from base.css / themes.css — no hardcoded hex.
 */

/* ─── Root container ──────────────────────────────────────────────── */

.code-landing {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

/* ─── Masthead ────────────────────────────────────────────────────── */

.code-masthead {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 288px;
}

/* Subtle warm ambient glow — matches mockup ::before */
.code-masthead::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 90% at 50% 60%, rgba(201,168,76,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 30% 50% at 20% 40%, rgba(74,138,90,0.02) 0%, transparent 70%);
  pointer-events: none;
}

.code-masthead-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 48px 24px 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0; /* gaps set per-element as margin-bottom per mockup */
}

/* Eyebrow */
.code-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Gold rule */
.code-rule {
  width: 80px;
  height: 1px;
  background: color-mix(in srgb, transparent 80%, var(--accent));
}

.code-rule-top    { margin-bottom: 18px; }
.code-rule-bottom { margin-top: 0; }

/* Title */
.code-title {
  font-family: var(--font-serif);
  font-size: 100px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.92;
  color: var(--text-primary);
  margin: 0 0 22px;
}

/* Subtitle */
.code-subtitle {
  font-family: var(--font-serif);
  font-size: 19px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 640px;
  margin: 0 0 20px;
}

/* ─── Desk body — bridge chip row + two-column grid ──────────────── */

.code-landing-body {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
}

/* Loading / error states */
.code-landing-detecting,
.code-landing-state {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  text-align: center;
  padding: 48px 0;
}

/* Bridge status chip row */
.bridge-chip-row {
  display: flex;
  justify-content: flex-end;
  padding: 14px 0 0;
}

.bridge-chip {
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
  border-radius: 20px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.bridge-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bridge-chip-dot--muted  { background: var(--text-muted); opacity: 0.55; }
.bridge-chip-dot--online {
  background: var(--success);
  box-shadow: 0 0 6px color-mix(in srgb, transparent 50%, var(--success));
}

/* Two-column desk grid */
.desk-grid {
  display: grid;
  grid-template-columns: 36% 1fr;
  gap: 0 4%;
}

/* ─── Left: sticky vertical feature rail ─────────────────────────── */

.desk-left {
  padding: 36px 0 60px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 48px; /* CivNode topbar is 48px */
  align-self: start;
}

.desk-left-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ── Feature cards ── */

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.feature-card:last-child { margin-bottom: 0; }
.feature-card:hover { box-shadow: var(--shadow-md); }

/* Illustration area */
.fc-illus {
  width: 100%;
  height: 140px;
  position: relative;
  overflow: hidden;
}

.fc-illus-diag { background: #0c1220; }
.fc-illus-pair { background: #0b1610; }
.fc-illus-heat { background: #180c0c; }

/* ── Diagnostics illustration ── */

.diag-code {
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.diag-err-line { position: relative; }

.diag-squiggle {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0, transparent 2px,
    var(--error) 2px, var(--error) 4px,
    transparent 4px, transparent 5px
  );
  opacity: 0.85;
}

.diag-arrow {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.diag-arr-body {
  width: 1px;
  height: 30px;
  background: var(--accent);
  opacity: 0.55;
}

.diag-arr-head {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid var(--accent);
  opacity: 0.65;
}

.diag-diff {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.75;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

.diff-del { color: color-mix(in srgb, var(--error) 85%, var(--text-primary)); }
.diff-add { color: color-mix(in srgb, var(--success) 80%, var(--text-primary)); }

/* ── Pair programming illustration ── */

.pair-editor {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.65;
  color: var(--text-muted);
}

.pair-line {
  position: relative;
  height: 15px;
  display: flex;
  align-items: center;
}

.cursor-a {
  display: inline-block;
  width: 1.5px;
  height: 13px;
  background: color-mix(in srgb, var(--accent) 30%, #5b9bd5);
  margin: 0 1px;
  vertical-align: middle;
}

.cursor-b {
  display: inline-block;
  width: 1.5px;
  height: 13px;
  background: color-mix(in srgb, var(--accent) 20%, #b07cd5);
  margin: 0 1px;
  vertical-align: middle;
}

.cursor-chip {
  position: absolute;
  top: -13px;
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 1px 5px;
  border-radius: 2px;
  white-space: nowrap;
  letter-spacing: 0;
}

.chip-a {
  background: color-mix(in srgb, var(--bg-elevated) 40%, #2a5a8a);
  left: 48px;
}

.chip-b {
  background: color-mix(in srgb, var(--bg-elevated) 40%, #6a3a8a);
  left: 144px;
}

.sel-a {
  display: inline-block;
  background: color-mix(in srgb, transparent 78%, #5b9bd5);
  height: 13px;
  width: 52px;
  border-radius: 1px;
  vertical-align: middle;
}

.sel-b {
  display: inline-block;
  background: color-mix(in srgb, transparent 78%, #b07cd5);
  height: 13px;
  width: 42px;
  border-radius: 1px;
  vertical-align: middle;
}

/* ── Complexity heatmap illustration ── */

.heat-tree {
  position: absolute;
  top: 18px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
}

.ht-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  width: 188px;
}

.ht-row-green {
  background: color-mix(in srgb, transparent 80%, var(--success));
  color: color-mix(in srgb, var(--success) 70%, var(--text-primary));
}

.ht-row-amber {
  background: color-mix(in srgb, transparent 76%, var(--accent));
  color: color-mix(in srgb, var(--accent) 65%, var(--text-primary));
}

.ht-row-red {
  background: color-mix(in srgb, transparent 76%, var(--error));
  color: color-mix(in srgb, var(--error) 65%, var(--text-primary));
}

.ht-row-grey {
  background: color-mix(in srgb, transparent 86%, var(--text-muted));
  color: var(--text-muted);
}

.ht-indent {
  color: var(--text-muted);
  margin-right: 2px;
}

/* Card text body */
.fc-body {
  padding: 14px 16px 16px;
}

.fc-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}

.fc-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.fc-desc {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ─── Right column: CTA card + projects slot ─────────────────────── */

.desk-right {
  padding: 36px 0 80px;
  /* Ensure the grid parent is always taller than the sticky left rail
     so position:sticky has room to engage during scroll.
     Left rail is typically ~1000px; add the full viewport height as buffer. */
  min-height: calc(100vh + 400px);
}

/* ── CTA card ── */

.cta-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
  border-radius: 8px;
  padding: 30px 32px;
  margin-bottom: 52px;
  box-shadow: var(--shadow-sm);
}

/* Each state area hidden by default; the active one is shown via JS */
.cta-area { display: none; }
.cta-area.cta-active { display: block; }

/* Button row */
.cta-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.cta-quiet {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* Primary action button */
.cta-btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  padding: 11px 24px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  letter-spacing: 0.02em;
  display: inline-block;
  text-decoration: none;
}

.cta-btn-primary:hover { background: var(--accent-hover); }

/* Secondary button */
.cta-btn-secondary {
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-block;
  text-decoration: none;
}

.cta-btn-secondary:hover {
  border-color: color-mix(in srgb, var(--border) 50%, var(--text-muted));
  background: var(--bg-elevated);
}

.cta-btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Setup state: terminal block ── */

.setup-heading {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.terminal-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 440px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: border-color var(--transition);
}

.terminal-block:hover { border-color: color-mix(in srgb, var(--border) 50%, var(--accent)); }

.terminal-prompt { color: var(--success); user-select: none; }
.terminal-cmd    { color: var(--text-primary); }
.terminal-copied {
  margin-left: auto;
  font-size: 10px;
  color: var(--success);
  opacity: 0;
  transition: opacity var(--transition);
}
.terminal-copied.visible { opacity: 1; }

/* Platform download pills */
.download-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.btn-dl {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
  text-decoration: none;
  display: inline-block;
}

.btn-dl:hover { color: var(--text-primary); border-color: color-mix(in srgb, var(--border) 50%, var(--text-muted)); }

.btn-dl[aria-disabled="true"] {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Setup state: pairing code ── */

.pairing-heading {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.pairing-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pairing-code {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.22em;
  background: var(--accent-subtle);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, transparent 80%, var(--accent));
  cursor: default;
  user-select: all;
}

.pairing-hint {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 7px;
}

/* ── Recent projects section ── */

.projects-section {
  display: none;
}

.projects-section.visible {
  display: block;
}

.section-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.section-header-label {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  font-variant: small-caps;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: lowercase;
}

.section-header-label::first-letter { text-transform: uppercase; }

.section-header-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, transparent 85%, var(--accent)) 0%,
    transparent 100%
  );
  border: none;
  opacity: 0.65;
}

.recent-projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* Empty state shown when there are no projects yet */
.projects-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
}

/* ─── New-project modal form ─────────────────────────────────────── */

.new-project-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.new-project-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-top: 10px;
}

.new-project-label:first-child { margin-top: 0; }

.new-project-input,
.new-project-textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 8px 10px;
  transition: border-color var(--transition);
  box-sizing: border-box;
}

.new-project-input:focus,
.new-project-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.new-project-textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

.new-project-error {
  color: var(--error);
  font-family: var(--font-sans);
  font-size: 12px;
  margin-top: 4px;
}

/* ─── Folder fallback dialog ─────────────────────────────────────── */

.folder-fallback {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.folder-fallback-lede {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 18px;
}

.folder-fallback-rule {
  width: 56px;
  height: 1px;
  background: color-mix(in srgb, transparent 75%, var(--accent));
  margin: 0 0 22px;
}

.folder-fallback-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.folder-fallback-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 11px 14px;
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.folder-fallback-input::placeholder {
  color: var(--text-muted);
  opacity: 0.55;
}

.folder-fallback-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, transparent 85%, var(--accent));
}

.folder-fallback-hint {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 14px 0 0;
}
