/* ============================================================
   Ditto-inspired design system — warm paper, one indigo accent
   ============================================================ */

:root {
  /* canvas & ink */
  --bg:        #FBF9F5;   /* warm paper */
  --surface:   #FFFFFF;
  --ink:       #11150F;   /* near-black headings */
  --ink-soft:  #4A5248;   /* body */
  --ink-mute:  #8B948A;   /* hints / labels */
  --line:      #ECE7DD;   /* warm hairline */

  /* one accent + semantic pair */
  --accent:      #4C49F5; /* electric indigo */
  --accent-dark: #3a37d6;
  --accent-ink:  #FFFFFF;
  --accent-soft: #ECEBFE;
  --good:        #1F9D6B;
  --good-soft:   #E6F6EE;
  --bad:         #E5533C;
  --bad-soft:    #FCEAE6;

  /* geometry */
  --r-sm: 8px; --r-md: 14px; --r-lg: 20px; --r-pill: 999px;
  --shadow: 0 1px 2px rgba(17,21,15,.04), 0 10px 30px rgba(17,21,15,.06);
  --maxw: 1040px;

  --font: "Plus Jakarta Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink-soft);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 4rem 1.5rem 6rem; }
.container-narrow { max-width: 640px; }

/* ---------------------------------------------------------- hero */
.hero { text-align: center; margin-bottom: 3rem; }
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.1;
}
.hero h1 code { font-size: 0.7em; vertical-align: middle; }
.tagline {
  color: var(--ink-soft);
  font-size: 1.1rem;
  margin: 0.85rem auto 0;
  max-width: 52ch;
}

.badge {
  display: inline-block; margin-top: 1rem; padding: 0.3rem 0.85rem;
  border-radius: var(--r-pill); font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.01em;
}
.badge-fake { background: var(--accent-soft); color: var(--accent-dark); }

.flash {
  background: var(--bad-soft); color: var(--bad); padding: 0.75rem 1.1rem;
  border-radius: var(--r-sm); margin-bottom: 1.25rem; font-weight: 500;
}

/* ---------------------------------------------------------- panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2.5rem;
}
.panel h2 { font-size: 1.3rem; font-weight: 700; color: var(--ink); margin-bottom: 0.85rem; letter-spacing: -0.01em; }

.muted { color: var(--ink-mute); font-size: 0.88rem; }
code {
  background: #F4F1EA; color: var(--ink);
  padding: 0.12em 0.4em; border-radius: 6px; font-size: 0.88em;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
}

/* ---------------------------------------------------------- stat cards */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem; margin: 1.5rem 0;
}
.card {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 1.15rem 1.25rem; background: var(--surface);
}
.card-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-mute); font-weight: 600;
}
.card-value { font-size: 1.5rem; font-weight: 700; color: var(--ink); margin: 0.3rem 0 0.15rem; }
.card-hint { font-size: 0.82rem; color: var(--ink-mute); }
.card-bad .card-value { color: var(--bad); }

/* ---------------------------------------------------------- tables */
.ext-table { border-collapse: collapse; font-size: 0.86rem; margin-top: 0.75rem; width: 100%; max-width: 380px; }
.ext-table th {
  text-align: left; color: var(--ink-mute); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
.ext-table td, .ext-table th { padding: 0.4rem 1rem 0.4rem 0; border-bottom: 1px solid var(--line); }
.ext-table td { color: var(--ink-soft); }

/* ---------------------------------------------------------- upload */
.panel-upload { border: 1px solid var(--line); }
.panel-upload p { margin-bottom: 0.5rem; }
.upload-form {
  display: flex; gap: 0.85rem; flex-wrap: wrap; align-items: center;
  margin: 1.5rem 0 1rem;
  padding: 1.25rem; border: 1.5px dashed var(--line); border-radius: var(--r-md);
  background: var(--bg); transition: border-color .15s, background .15s;
}
.upload-form:focus-within { border-color: var(--accent); background: var(--accent-soft); }
input[type="file"] {
  border: 0; padding: 0.4rem; flex: 1; min-width: 240px;
  font-family: var(--font); color: var(--ink-soft); font-size: 0.9rem;
}
input[type="file"]::file-selector-button {
  font-family: var(--font); font-weight: 600; font-size: 0.85rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 0.5rem 1rem; border-radius: var(--r-pill); margin-right: 0.85rem; cursor: pointer;
}

/* ---------------------------------------------------------- buttons */
.btn {
  display: inline-block; border: 0; border-radius: var(--r-pill); cursor: pointer;
  padding: 0.7rem 1.6rem; font-size: 0.95rem; font-weight: 600; text-decoration: none;
  font-family: var(--font); transition: transform .12s ease, background .15s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-vercel { background: #000; color: #fff; margin-left: 0.5rem; }
.btn-vercel:hover { background: #333; transform: translateY(-1px); }
.btn-vercel:disabled { opacity: 0.6; cursor: default; transform: none; }

/* ---------------------------------------------------------- progress branch */
.progress-track { background: var(--line); border-radius: var(--r-pill); height: 8px; overflow: hidden; }
.progress-fill { background: var(--accent); height: 100%; width: 0; transition: width 0.6s ease; }

.stages { list-style: none; position: relative; margin: 1.75rem 0 1rem; padding-left: 0; }
.stages::before {
  content: ""; position: absolute; left: 8px; top: 1.1rem; bottom: 1.1rem;
  width: 2px; background: var(--line);
}
.stages li {
  position: relative; color: var(--ink-mute);
  display: flex; align-items: center; gap: 0.85rem; padding: 0.5rem 0;
  transition: color .2s;
}
.stage-dot {
  width: 18px; height: 18px; border-radius: 50%; flex: none; z-index: 1;
  background: var(--surface); border: 2px solid var(--line);
  transition: background .2s, border-color .2s;
}
.stages li.done { color: var(--ink); }
.stages li.done .stage-dot { background: var(--accent); border-color: var(--accent); }
.stages li.active { color: var(--ink); font-weight: 600; }
.stages li.active .stage-dot {
  border-color: var(--accent); background: var(--surface);
  box-shadow: 0 0 0 0 rgba(76,73,245,.45); animation: ring 1.3s infinite;
}
@keyframes ring { to { box-shadow: 0 0 0 9px rgba(76,73,245,0); } }
.meter { margin-top: 1rem; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- result deltas */
.deltas { display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }
.delta {
  background: var(--accent-soft); border: 1px solid #DAD8FD;
  border-radius: var(--r-lg); padding: 1.5rem 2rem; text-align: center; min-width: 170px;
}
.delta-value { font-size: 2.4rem; font-weight: 800; color: var(--accent-dark); letter-spacing: -0.03em; line-height: 1; }
.delta-label { font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.5rem; }

/* ---------------------------------------------------------- before / after */
.compare { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .compare { grid-template-columns: 1fr 1fr; } }
.panel-before { border-top: 3px solid var(--bad); }
.panel-after { border-top: 3px solid var(--good); }

.statlist { list-style: none; margin-bottom: 1rem; }
.statlist li {
  display: flex; justify-content: space-between; padding: 0.5rem 0;
  border-bottom: 1px solid var(--line); font-size: 0.92rem;
}
.statlist span { color: var(--ink-soft); }
.statlist strong { color: var(--ink); }

.panel-after .btn { margin-top: 1.25rem; }
.cost p { margin-bottom: 0.4rem; }
.cost strong { color: var(--ink); }

/* ---------------------------------------------------------- github import */
.gh-controls { display: flex; gap: 0.85rem; flex-wrap: wrap; align-items: center; margin: 1.25rem 0 0.75rem; }
input[type="search"]#gh-q {
  flex: 1; min-width: 240px; padding: 0.65rem 1.1rem;
  border: 1.5px solid var(--line); border-radius: var(--r-pill);
  font-family: var(--font); font-size: 0.92rem; color: var(--ink);
  background: var(--bg); outline: none; transition: border-color .15s, background .15s;
}
input[type="search"]#gh-q:focus { border-color: var(--accent); background: var(--surface); }

.gh-sort {
  display: inline-flex; border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 3px; background: var(--bg); flex: none;
}
.gh-sort-btn {
  border: 0; background: transparent; cursor: pointer;
  padding: 0.4rem 1rem; border-radius: var(--r-pill);
  font-family: var(--font); font-size: 0.82rem; font-weight: 600;
  color: var(--ink-mute); transition: background .15s, color .15s;
}
.gh-sort-btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.gh-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin: 0 0 0.85rem; }
.gh-chips-label { font-size: 0.78rem; color: var(--ink-mute); font-weight: 600; margin-right: 0.25rem; }
.gh-chip {
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  padding: 0.3rem 0.85rem; border-radius: var(--r-pill);
  font-family: var(--font); font-size: 0.8rem; font-weight: 600; color: var(--ink-soft);
  transition: border-color .15s, background .15s, color .15s;
}
.gh-chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.gh-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }

.gh-status { min-height: 1.4em; }

.repo-list { list-style: none; margin-top: 0.75rem; padding: 0; }
.repo-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 0.25rem; border-bottom: 1px solid var(--line);
}
.repo-item:last-child { border-bottom: 0; }
.repo-avatar { width: 36px; height: 36px; border-radius: var(--r-sm); flex: none; background: var(--bg); }
.repo-main { flex: 1; min-width: 0; }
.repo-name { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.repo-name a { font-size: 0.95rem; }
.repo-stars { color: var(--ink-mute); font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.repo-desc {
  font-size: 0.85rem; color: var(--ink-soft); margin: 0.1rem 0 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.repo-meta { font-size: 0.76rem; color: var(--ink-mute); margin-top: 0.1rem; }
.btn-sm { padding: 0.45rem 1.1rem; font-size: 0.85rem; flex: none; }
.btn-sm:disabled { opacity: 0.55; cursor: default; transform: none; }

/* ---------------------------------------------------------- links */
a { color: var(--accent); text-decoration: none; font-weight: 600; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
