/* ============================================================
   FIKRA — run-it-locally guide
   Reuses the variables and components from ../style.css
   ============================================================ */

.run-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(52px, 7vw, 88px) 0 clamp(44px, 5vw, 64px);
  background: var(--blue);
  color: var(--paper);
}

.run-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(244, 241, 234, 0.4) 1.3px, transparent 1.4px);
  background-size: 16px 16px;
  opacity: 0.22;
  -webkit-mask-image: radial-gradient(circle at 82% 30%, #000 0%, transparent 64%);
  mask-image: radial-gradient(circle at 82% 30%, #000 0%, transparent 64%);
}

.run-hero .wrap {
  position: relative;
  z-index: 1;
}

.run-hero h1 {
  margin: 16px 0 16px;
  font-size: clamp(48px, 7.2vw, 104px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.run-hero .lead {
  max-width: 72ch;
  color: rgba(244, 241, 234, 0.92);
}

.run-hero .lead strong { color: var(--paper); font-weight: 600; }

.run-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 24px;
  color: rgba(244, 241, 234, 0.84);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.run-facts span::before {
  content: "◆";
  margin-right: 8px;
  color: var(--pink);
}

.run-note {
  margin: 18px 0 0;
  color: rgba(244, 241, 234, 0.86);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

/* ---------- shared section shells ---------- */

.run-intro,
.run-mobile,
.run-download,
.run-trouble,
.run-share {
  padding: clamp(56px, 7vw, 96px) 0;
  background: var(--paper);
  color: var(--ink);
}

.run-device,
.run-offline,
.run-advanced {
  padding: clamp(56px, 7vw, 96px) 0;
  background: var(--ink);
  color: var(--paper);
}

.run-device .lead { color: rgba(244, 241, 234, 0.8); }

/* ---------- before you start ---------- */

.need-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 32px;
  border: 1px solid var(--line-dark);
  background: var(--line-dark);
}

.need-card {
  padding: 24px;
  background: var(--paper);
}

.need-n {
  display: block;
  margin-bottom: 18px;
  color: var(--blue);
  font-family: var(--pixel);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.need-card h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.need-card p {
  margin: 0;
  color: rgba(5, 5, 7, 0.76);
  font-size: 13.5px;
  line-height: 1.6;
}

.model-table-wrap {
  margin-top: 32px;
  overflow-x: auto;
  border: 1px solid var(--line-dark);
}

.model-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}

.model-table th {
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
}

.model-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-dark);
}

.model-table tr:last-child td { border-bottom: 0; }

.model-table a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- device tabs ---------- */

.device-tabs {
  display: flex;
  gap: 8px;
  margin: 28px 0 20px;
  padding-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.device-tab {
  flex: none;
  padding: 12px 18px;
  border: 1px solid var(--line-light);
  border-radius: 999px;
  background: transparent;
  color: rgba(244, 241, 234, 0.8);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.device-tab:hover {
  border-color: var(--paper);
  color: var(--paper);
}

.device-tab[aria-selected="true"] {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--ink);
}

.device-tab:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 3px;
}

.os-panel {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line-light);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.os-panel[hidden] { display: none; }

.os-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.os-head h3 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.os-need {
  margin: 0;
  color: rgba(5, 5, 7, 0.7);
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.os-tag {
  flex: none;
  padding: 5px 8px;
  border: 1px solid rgba(5, 5, 7, 0.3);
  font-family: var(--pixel);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ---------- progress ---------- */

.run-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.run-progress-track {
  flex: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(5, 5, 7, 0.12);
}

.run-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width 0.25s var(--ease);
}

.run-progress-label {
  min-width: 100px;
  color: rgba(5, 5, 7, 0.72);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  text-align: right;
  white-space: nowrap;
}

/* ---------- steps ---------- */

.step-list {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--line-dark);
  background: var(--line-dark);
}

.step {
  display: grid;
  grid-template-columns: 22px 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 14px 16px;
  background: var(--paper);
  cursor: pointer;
}

.step:hover { background: #f7f5ee; }

.step:has(input:checked) { background: rgba(232, 64, 42, 0.06); }

.step input {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  border: 2px solid rgba(5, 5, 7, 0.55);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.step input::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.12s var(--ease);
}

.step input:checked {
  border-color: var(--red-deep);
  background: var(--red-deep);
}

.step input:checked::after { transform: rotate(45deg) scale(1); }

.step input:focus-visible {
  outline: 2px solid var(--red-deep);
  outline-offset: 2px;
}

.step::before {
  content: counter(step);
  counter-increment: step;
  color: var(--blue);
  font-family: var(--pixel);
  font-size: 9px;
  line-height: 1.8;
}

.step-body {
  color: rgba(5, 5, 7, 0.86);
  font-size: 13.5px;
  line-height: 1.55;
}

.step-body strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-weight: 600;
}

.step-body code {
  padding: 1px 4px;
  border: 1px solid rgba(5, 5, 7, 0.18);
  background: rgba(5, 5, 7, 0.05);
  font-family: var(--mono);
  font-size: 11.5px;
}

.run-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.run-actions .btn { padding: 12px 18px; }

.step-reset {
  margin-left: auto;
  padding: 4px 0;
  border: 0;
  background: none;
  color: rgba(5, 5, 7, 0.7);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.step-reset:hover { color: var(--ink); }

.os-note {
  margin: 16px 0 0;
  color: rgba(5, 5, 7, 0.72);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ---------- downloads ---------- */

.download-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  margin-top: 32px;
}

.download-card {
  padding: 26px;
  border: 1px solid var(--line-dark);
  background: var(--paper);
}

.download-card.primary {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.download-tag {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 7px;
  border: 1px solid rgba(5, 5, 7, 0.3);
  color: var(--ink);
  font-family: var(--pixel);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.download-card.primary .download-tag {
  border-color: var(--blue);
  color: var(--blue);
}

.download-tag.muted { color: rgba(5, 5, 7, 0.7); }

.download-card h3 {
  margin-bottom: 8px;
  font-size: clamp(24px, 3vw, 32px);
}

.download-desc {
  margin: 0 0 16px;
  color: rgba(5, 5, 7, 0.76);
  font-size: 13.5px;
  line-height: 1.6;
}

.download-specs {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  color: rgba(5, 5, 7, 0.74);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.7;
}

.download-specs li::before {
  content: "◆";
  margin-right: 8px;
  color: var(--blue);
}

.download-card .btn {
  width: 100%;
  justify-content: center;
}

.download-note {
  margin: 14px 0 0;
  color: rgba(5, 5, 7, 0.72);
  font-size: 12px;
  line-height: 1.55;
}

.download-note a {
  color: var(--red-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mobile-grid {
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

.mobile-grid .download-card {
  display: flex;
  flex-direction: column;
}

.mobile-grid .download-card .btn { margin-top: auto; }

.download-desc code {
  font-family: var(--mono);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.mobile-apps {
  margin: 24px 0 0;
  color: rgba(5, 5, 7, 0.78);
  font-size: 13.5px;
  line-height: 1.6;
}

.mobile-apps strong { color: var(--ink); }

.gguf-note {
  margin-top: 24px;
  padding: 20px;
  border-left: 4px solid var(--blue);
  background: rgba(232, 64, 42, 0.06);
}

.gguf-note strong {
  display: block;
  margin-bottom: 6px;
  color: var(--blue);
  font-family: var(--pixel);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gguf-note p {
  margin: 0;
  color: rgba(5, 5, 7, 0.8);
  font-size: 13.5px;
  line-height: 1.6;
}

.gguf-note code {
  padding: 1px 4px;
  border: 1px solid rgba(5, 5, 7, 0.18);
  background: rgba(5, 5, 7, 0.05);
  font-family: var(--mono);
  font-size: 11.5px;
}

/* ---------- offline test ---------- */

.offline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 32px;
  border: 1px solid var(--line-light);
  background: var(--line-light);
}

.offline-card {
  padding: 24px;
  background: var(--ink);
}

.offline-n {
  display: block;
  margin-bottom: 18px;
  color: var(--pink);
  font-family: var(--pixel);
  font-size: 10px;
  font-weight: 400;
}

.offline-card h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.offline-card p {
  margin: 0;
  color: rgba(244, 241, 234, 0.8);
  font-size: 13.5px;
  line-height: 1.6;
}

.offline-note {
  margin: 20px 0 0;
  color: rgba(244, 241, 234, 0.72);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.5;
}

/* ---------- troubleshooting ---------- */

.trouble-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 32px;
  border: 1px solid var(--line-dark);
  background: var(--line-dark);
}

.trouble-item {
  padding: 22px;
  background: var(--paper);
}

.trouble-item h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.trouble-item p {
  margin: 0;
  color: rgba(5, 5, 7, 0.76);
  font-size: 13.5px;
  line-height: 1.6;
}

.trouble-item code {
  padding: 1px 4px;
  border: 1px solid rgba(5, 5, 7, 0.18);
  background: rgba(5, 5, 7, 0.05);
  font-family: var(--mono);
  font-size: 11.5px;
}

/* ---------- advanced ---------- */

.advanced-box {
  margin-top: 28px;
  border: 1px solid var(--line-light);
  background: rgba(244, 241, 234, 0.04);
}

.advanced-box summary {
  padding: 18px 20px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.advanced-box[open] summary { border-bottom: 1px solid var(--line-light); }

.advanced-box > p,
.advanced-box > h3,
.advanced-box > pre {
  margin-left: 20px;
  margin-right: 20px;
}

.advanced-box > p {
  color: rgba(244, 241, 234, 0.78);
  font-size: 13.5px;
  line-height: 1.6;
}

.advanced-box h3 {
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--pink);
  font-family: var(--pixel);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.advanced-box pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--line-light);
  background: #0b0b10;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
}

.advanced-box code { font-family: var(--mono); }

.advanced-box a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.advanced-box > p:last-child { padding-bottom: 20px; }

/* ---------- share / QR ---------- */

.share-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 28px;
  padding: 28px;
  border: 1px solid var(--line-dark);
  background: var(--paper);
}

.share-card h2 {
  margin-bottom: 12px;
  font-size: clamp(32px, 4vw, 52px);
}

.share-card p {
  max-width: 56ch;
  margin: 0 0 18px;
  color: rgba(5, 5, 7, 0.76);
  font-size: 14px;
  line-height: 1.6;
}

.qr-wrap {
  justify-self: center;
  padding: 14px;
  border: 1px solid var(--line-dark);
  background: #fff;
}

.qr-wrap img {
  display: block;
  width: 185px;
  height: 185px;
}

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .need-grid { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .offline-grid { grid-template-columns: 1fr; }
  .trouble-grid { grid-template-columns: 1fr; }
  .share-card { grid-template-columns: 1fr; }
  .qr-wrap { justify-self: start; }
}

@media (max-width: 680px) {
  .run-hero h1 { font-size: clamp(42px, 13vw, 68px); }
  .os-head { flex-direction: column; }
  .os-tag { align-self: flex-start; }
  .step { grid-template-columns: 22px 24px minmax(0, 1fr); padding: 13px; }
  .run-actions .btn { width: 100%; justify-content: center; }
  .step-reset { margin-left: 0; }
  .run-progress { flex-wrap: wrap; }
  .run-progress-label { min-width: 0; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .run-progress-track span { transition: none; }
}

/* ---------- contrast fixes for the red / paper palette ---------- */

.run-hero { color: #fff; }
.run-hero .lead { color: rgba(255, 255, 255, 0.94); }
.run-facts { color: rgba(255, 255, 255, 0.92); }
.run-note { color: rgba(255, 255, 255, 0.92); }
.run-hero .btn-outline-light { color: #fff; border-color: rgba(255, 255, 255, 0.7); }
.run-hero .btn-outline-light:hover { border-color: #fff; background: rgba(255, 255, 255, 0.12); }

.need-n { color: var(--red-deep); }
.download-card.primary .download-tag { color: var(--red-deep); }
.gguf-note strong { color: var(--red-deep); }
.step::before { color: var(--red-deep); }
.download-specs li::before { color: var(--red-deep); }
