/* ══════════════════════════════════════════
   shared.css  —  adb.renoloty.net
   Design language: renoloty.net
══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;600;700&family=Barlow+Condensed:wght@400;600;700;800&display=swap');

/* ── Tokens dark (default) ── */
:root {
  --bg:        #080608;
  --surface:   #110a0a;
  --surface2:  #1a0e0e;
  --surface3:  #221212;
  --accent:    #ff6b35;
  --accent-h:  #ff8555;
  --accent2:   #e8521a;
  --accent3:   #ff9a5c;
  --ts:        #c0392b;
  --text:      #f0e0d6;
  --text2:     #b89080;
  --text3:     #6b4040;
  --success:   #4caf50;
  --warn:      #ff9800;
  --err:       #ff4757;
  --border:    #2d1515;
  --radius:    8px;
  --radius-sm: 6px;
  --shadow:    0 4px 20px rgba(0,0,0,0.5);
  --nav-h:     56px;
  --log-bg:    #050303;
  --cmd-bg:    #080404;
  --cmd-border:#2d1515;
  --cmd-color: #ff9a5c;
}

/* ── Tokens light (warm paper) ── */
[data-theme="light"] {
  --bg:        #f5ede6;
  --surface:   #fff8f4;
  --surface2:  #f0e4da;
  --surface3:  #e6d0c4;
  --text:      #2a1008;
  --text2:     #7a4030;
  --text3:     #a06050;
  --border:    #d4a898;
  --shadow:    0 2px 12px rgba(0,0,0,0.1);
  --log-bg:    #1a0808;
  --cmd-bg:    #1a0808;
  --cmd-border:#3a1818;
  --cmd-color: #ff9a5c;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Body ── */
body {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: var(--nav-h);
  line-height: 1.5;
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(192,57,43,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 80%, rgba(255,107,53,0.07) 0%, transparent 50%);
}

/* ── Scanline overlay ── */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.022) 2px, rgba(0,0,0,0.022) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

a { color: var(--accent3); text-decoration: none; }
a:hover { color: var(--accent); }

/* ── Nav ── */
#site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  background: rgba(8,6,8,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 clamp(14px, 3vw, 28px);
  gap: 4px;
}
[data-theme="light"] #site-nav { background: rgba(245,237,230,0.93); }

.nav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; font-weight: 700;
  color: var(--text); text-decoration: none;
  margin-right: 14px; flex-shrink: 0;
  display: inline-flex; align-items: center;
  letter-spacing: -0.02em;
}
.nav-logo:hover { color: var(--text); text-decoration: none; }
.nav-logo .accent { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 1px; flex: 1; }

.nav-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text3); padding: 5px 9px;
  border-radius: 4px; text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap; position: relative;
}
.nav-link::after {
  content: '';
  position: absolute; bottom: 0; left: 9px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.28s;
}
.nav-link:hover { color: var(--text2); text-decoration: none; }
.nav-link:hover::after { width: calc(100% - 18px); }
.nav-link.active { color: var(--text2); }
.nav-link.active::after { width: calc(100% - 18px); }

.nav-right { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }

.nav-ctrl-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; letter-spacing: 0.06em;
  color: var(--text3); cursor: pointer;
  background: none; border: 1px solid var(--border);
  border-radius: 4px; padding: 4px 9px;
  transition: border-color 0.2s, color 0.2s;
}
.nav-ctrl-btn:hover { border-color: var(--accent); color: var(--accent3); }

/* ── Page wrap ── */
.page-wrap {
  width: 100%; max-width: 780px; margin: 0 auto;
  padding: 32px 16px 72px;
  display: flex; flex-direction: column; align-items: center;
}

/* ── Card (panel) ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  width: 100%; margin-bottom: 14px;
  position: relative; overflow: hidden;
  transition: border-color 0.25s;
}

/* Moving grid */
.card::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(192,57,43,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(192,57,43,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  animation: gridMove 16s linear infinite;
  pointer-events: none;
}
@keyframes gridMove {
  0%   { background-position: 0 0; }
  100% { background-position: 24px 24px; }
}

/* Left accent bar */
.card::after {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 2px; height: 100%;
  background: linear-gradient(180deg, var(--ts), var(--accent));
  border-radius: var(--radius) 0 0 var(--radius);
  opacity: 0; transition: opacity 0.25s;
}
.card:hover::after { opacity: 1; }

/* All children above pseudo-elements */
.card > * { position: relative; z-index: 1; }

.card h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text2); margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}

/* ── Section label ── */
.section-label {
  font-size: 0.65rem; color: var(--text3);
  letter-spacing: 0.14em; text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 6px;
}

/* ── Badge ── */
.badge {
  background: var(--ts); color: #fff;
  border-radius: 4px; width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 700; flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}
.badge.done  { background: var(--success); }
.badge.phase { background: var(--surface3); color: var(--text3); }

/* ── Buttons ── */
.btn {
  cursor: pointer; border: none; border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  padding: 9px 20px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.3; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--ts), var(--accent));
  color: var(--text);
  border: 1px solid rgba(255,107,53,0.3);
}
.btn-primary:not(:disabled):hover {
  box-shadow: 0 4px 16px rgba(255,107,53,0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border);
}
.btn-secondary:not(:disabled):hover {
  border-color: var(--accent); color: var(--accent3);
}

.btn-adb {
  background: linear-gradient(135deg, #0d2a52, #1565c0);
  color: #90caf9;
  border: 1px solid rgba(21,101,192,0.3);
}
.btn-adb:not(:disabled):hover {
  box-shadow: 0 4px 14px rgba(21,101,192,0.3);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent; color: var(--text3);
  border: 1px solid var(--border);
}
.btn-ghost:not(:disabled):hover {
  border-color: var(--accent); color: var(--accent3);
}

.btn-sm { font-size: 0.67rem; padding: 6px 12px; }

/* ── Dot ── */
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text3); flex-shrink: 0;
}
.dot.connected { background: var(--success); box-shadow: 0 0 6px var(--success); }
.dot.busy      { background: var(--warn); animation: pulse 1s infinite; }
.dot.error     { background: var(--err); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.status-row {
  font-size: 0.72rem; color: var(--text3);
  display: flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}

.device-chip {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px 10px;
  font-size: 0.66rem; color: var(--text2);
  font-family: 'JetBrains Mono', monospace;
  display: none; letter-spacing: 0.04em;
}

/* ── Inputs ── */
.input {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem; padding: 8px 12px; outline: none;
  transition: border-color 0.15s; width: 100%;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text3); }
.input-row { display: flex; gap: 8px; align-items: center; }

/* ── Cmd block ── */
.cmd-block {
  background: var(--cmd-bg); border: 1px solid var(--cmd-border);
  border-left: 2px solid var(--ts);
  border-radius: var(--radius-sm); padding: 9px 13px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem; color: var(--cmd-color);
  margin-bottom: 11px; word-break: break-all; user-select: all;
  position: relative; z-index: 1;
}

/* ── Progress ── */
.progress-wrap { height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 14px; }
.progress-bar  { height: 100%; background: linear-gradient(90deg, var(--ts), var(--accent)); border-radius: 2px; width: 0%; transition: width 0.4s ease; }

/* ── Log ── */
.log-container {
  background: var(--log-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  height: 220px; overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.71rem; line-height: 1.75;
  position: relative; z-index: 1;
}
.log-line { display: flex; gap: 10px; }
.log-time  { color: var(--text3); flex-shrink: 0; }
.log-info  { color: var(--text3); }
.log-ok    { color: var(--success); }
.log-warn  { color: var(--warn); }
.log-err   { color: var(--err); }
.log-cmd   { color: var(--accent3); }
.log-out   { color: var(--text2); }

/* ── Step card ── */
.step-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px;
  position: relative; z-index: 1;
  transition: border-color 0.2s;
}
.step-card:last-of-type { margin-bottom: 0; }
.step-card:hover { border-color: rgba(255,107,53,0.2); }
.step-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; gap: 8px; flex-wrap: wrap; }
.step-title  { font-size: 0.78rem; font-weight: 600; color: var(--text2); letter-spacing: 0.02em; }
.step-status { font-size: 0.68rem; color: var(--text3); white-space: nowrap; font-family: 'JetBrains Mono', monospace; }
.step-status.ok      { color: var(--success); }
.step-status.running { color: var(--warn); }
.step-status.err     { color: var(--err); }
.step-footer { display: flex; justify-content: flex-end; margin-top: 8px; }

/* ── Checklist ── */
.checklist { list-style: none; display: flex; flex-direction: column; gap: 9px; position: relative; z-index: 1; }
.checklist li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.74rem; color: var(--text2); line-height: 1.65;
  font-family: 'JetBrains Mono', monospace;
}
.checklist li::before {
  content: '//'; color: var(--ts);
  flex-shrink: 0; font-weight: 700;
  font-size: 0.66rem; margin-top: 2px;
  letter-spacing: 0.04em;
}

/* ── Hint / note ── */
.hint {
  background: rgba(21,101,192,0.05); border: 1px solid rgba(21,101,192,0.14);
  border-left: 2px solid #1565c0;
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 0.73rem; color: #90caf9; line-height: 1.65; margin-bottom: 12px;
  font-family: 'JetBrains Mono', monospace; position: relative; z-index: 1;
}
.note {
  background: rgba(255,107,53,0.04); border: 1px solid rgba(255,107,53,0.14);
  border-left: 2px solid var(--accent2);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 0.73rem; color: var(--accent3); line-height: 1.65;
  font-family: 'JetBrains Mono', monospace; position: relative; z-index: 1;
}
.note strong, .hint strong { font-weight: 700; }
.note code, .hint code {
  background: var(--surface3); border-radius: 3px;
  padding: 1px 5px; color: var(--cmd-color); font-size: 0.9em;
}

/* ── Alert ── */
.alert {
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 0.73rem; line-height: 1.65; display: none; margin-bottom: 12px;
  font-family: 'JetBrains Mono', monospace; position: relative; z-index: 1;
}
.alert-err  { background: rgba(255,71,87,0.05);  border: 1px solid rgba(255,71,87,0.2);  border-left: 2px solid var(--err);     color: #ff9898; }
.alert-warn { background: rgba(255,152,0,0.05);  border: 1px solid rgba(255,152,0,0.2);  border-left: 2px solid var(--warn);    color: #ffcc80; }
.alert-ok   { background: rgba(76,175,80,0.05);  border: 1px solid rgba(76,175,80,0.2);  border-left: 2px solid var(--success); color: #a5d6a7; }

/* ── Phase label ── */
.phase-label {
  width: 100%; display: flex; align-items: center; gap: 10px;
  color: var(--text3); font-size: 0.66rem; font-weight: 600;
  margin: 6px 0 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.phase-label::before, .phase-label::after { content:''; flex:1; height:1px; background:var(--border); }

/* ── Tab bar ── */
.tab-bar {
  display: flex; gap: 3px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 3px; margin-bottom: 14px; position: relative; z-index: 1;
}
.tab-btn {
  flex: 1; cursor: pointer; border: none; border-radius: 4px;
  background: transparent; color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 0; transition: background 0.15s, color 0.15s;
}
.tab-btn.active {
  background: var(--surface); color: var(--accent3);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Footer ── */
footer {
  color: var(--text3); font-size: 0.63rem;
  text-align: center; margin-top: 16px;
  padding: 0 16px; width: 100%;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.07em;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--ts); }
