/*
 * `updatechi` — Updatechi, the sanctions-free update gateway, on its own site.
 * Fetched, not compiled.
 *
 * Subject and visitor: a WordPress site owner or a developer in Iran whose
 * update, `docker pull` or `npm install` answers 403, looking for a way that
 * needs no VPN on the server.
 * Tone: warm and plain-spoken — a helpful service, not a security product.
 * The one detail: the path of one update. The front page is built around it:
 * a token, one changed address, the update; then which sources it opens and
 * which are still «soon», and what a gigabyte costs.
 *
 * Sand paper with a warm orange glow, glassy cards with a 28px radius and a
 * soft shadow, orange for the calls and the step numbers, pine green for the
 * checks and what is ready. In the dark, the sand turns to roasted coffee.
 * Headings and body in Estedad; never letter-spaced.
 *
 * Plain CSS; it selects only the hooks the builder publishes (`sb-*`,
 * `data-*`) and the `tc-*` markup of this design's own front page.
 *
 * @see specs/themes
 */

:root.theme-updatechi {
  --background: #fffaf2;
  --foreground: #221815;
  --card: rgb(255 255 255 / 0.78);
  --card-foreground: #221815;
  --popover: #fffdf9;
  --popover-foreground: #221815;
  --primary: var(--brand-primary, #ec6f3c);
  --primary-foreground: var(--brand-primary-foreground, #ffffff);
  --ring: var(--brand-primary, #ec6f3c);
  --secondary: #f8efe3;
  --secondary-foreground: #221815;
  --muted: #f8efe3;
  --muted-foreground: #6b5546;
  --accent: #f8efe3;
  --accent-foreground: #221815;
  --destructive: #b42318;
  --destructive-foreground: #ffffff;
  --border: rgb(113 86 66 / 0.14);
  --input: rgb(113 86 66 / 0.22);
  --radius: 1.25rem;

  --brand-accent: var(--brand-secondary, #2d7d56);
  --brand-accent-foreground: var(--brand-secondary-foreground, #ffffff);

  --tc-glow: #ffb866;
  --tc-sand-1: #fffaf2;
  --tc-sand-2: #f8efe3;
  --tc-sand-3: #efe2d1;
  --tc-surface: rgb(255 255 255 / 0.78);
  --tc-soft: rgb(248 239 227 / 0.88);
  --tc-toned: rgb(34 24 21 / 0.78);
  --tc-muted: rgb(34 24 21 / 0.6);
  --tc-shadow: 0 24px 70px rgb(34 24 21 / 0.1);
  --tc-pine: var(--brand-secondary, #2d7d56);
  --tc-pine-deep: oklch(from var(--brand-secondary, #2d7d56) calc(l - 0.14) c h);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light).theme-updatechi {
    color-scheme: dark;
    --background: #221815;
    --foreground: #f8efe3;
    --card: rgb(255 255 255 / 0.06);
    --card-foreground: #f8efe3;
    --popover: #2e211c;
    --popover-foreground: #f8efe3;
    --secondary: #3a2a22;
    --secondary-foreground: #f8efe3;
    --muted: #2e211c;
    --muted-foreground: #cdb8a6;
    --accent: #3a2a22;
    --accent-foreground: #f8efe3;
    --border: rgb(248 239 227 / 0.12);
    --input: rgb(248 239 227 / 0.18);
    --tc-glow: #ec6f3c;
    --tc-sand-1: #221815;
    --tc-sand-2: #2b1e19;
    --tc-sand-3: #3a2a22;
    --tc-surface: rgb(255 255 255 / 0.06);
    --tc-soft: rgb(255 255 255 / 0.07);
    --tc-toned: rgb(248 239 227 / 0.8);
    --tc-muted: rgb(248 239 227 / 0.62);
    --tc-shadow: 0 20px 50px rgb(0 0 0 / 0.18);
  }
}

:root.dark.theme-updatechi {
  color-scheme: dark;
  --background: #221815;
  --foreground: #f8efe3;
  --card: rgb(255 255 255 / 0.06);
  --card-foreground: #f8efe3;
  --popover: #2e211c;
  --popover-foreground: #f8efe3;
  --secondary: #3a2a22;
  --secondary-foreground: #f8efe3;
  --muted: #2e211c;
  --muted-foreground: #cdb8a6;
  --accent: #3a2a22;
  --accent-foreground: #f8efe3;
  --border: rgb(248 239 227 / 0.12);
  --input: rgb(248 239 227 / 0.18);
  --tc-glow: #ec6f3c;
  --tc-sand-1: #221815;
  --tc-sand-2: #2b1e19;
  --tc-sand-3: #3a2a22;
  --tc-surface: rgb(255 255 255 / 0.06);
  --tc-soft: rgb(255 255 255 / 0.07);
  --tc-toned: rgb(248 239 227 / 0.8);
  --tc-muted: rgb(248 239 227 / 0.62);
  --tc-shadow: 0 20px 50px rgb(0 0 0 / 0.18);
}

/* The page: sand under a warm glow from the top corner. */
.theme-updatechi body {
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--tc-glow) 32%, transparent), transparent 28%),
    radial-gradient(circle at left 18%, color-mix(in srgb, var(--tc-pine) 10%, transparent), transparent 26%),
    linear-gradient(180deg, var(--tc-sand-1) 0%, var(--tc-sand-2) 48%, var(--tc-sand-3) 100%);
}

.theme-updatechi .sb-frame[data-part='header'],
.theme-updatechi [data-part='header'] {
  background: color-mix(in srgb, var(--tc-sand-1) 72%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.theme-updatechi .sb-heading {
  font-weight: 800;
  line-height: 1.3;
}

.theme-updatechi .sb-button {
  border-radius: 14px;
  font-weight: 700;
}

.theme-updatechi .sb-section[data-sb-background='muted'] {
  background: var(--tc-soft);
}

.theme-updatechi .sb-column[data-sb-border] {
  border-radius: 28px;
  background: var(--tc-surface);
  box-shadow: var(--tc-shadow);
}

/* The front page (design/theme/code/home.tsx). */
.tc-landing {
  max-width: 1180px;
  margin-inline: auto;
  padding: 32px 20px 72px;
  color: var(--foreground);
}

.tc-landing h1,
.tc-landing h2,
.tc-landing h3,
.tc-landing p {
  margin: 0;
}

.tc-card {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--tc-surface);
  box-shadow: var(--tc-shadow);
  backdrop-filter: blur(10px);
}

.tc-hero {
  display: grid;
  gap: 28px;
  padding-bottom: 56px;
}

.tc-badge {
  display: inline-block;
  margin-bottom: 18px !important;
  padding: 6px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: oklch(from var(--primary) calc(l - 0.12) c h);
  font-size: 0.875rem;
  font-weight: 700;
}

.dark .tc-badge {
  color: oklch(from var(--primary) 0.82 calc(c * 0.6) h);
}

.tc-title {
  max-width: 16ch;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.25;
  font-weight: 900;
}

.tc-intro {
  max-width: 60ch;
  margin-top: 20px !important;
  font-size: 1.05rem;
  line-height: 2;
  color: var(--tc-toned);
}

.tc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.tc-benefits {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.tc-benefits li,
.tc-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--tc-toned);
}

.tc-check {
  flex: none;
  width: 22px;
  height: 22px;
  fill: color-mix(in srgb, var(--tc-pine) 16%, transparent);
  stroke: var(--tc-pine);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tc-showcase {
  display: grid;
  gap: 16px;
}

.tc-card-flow {
  padding: 24px;
}

.tc-eyebrow {
  font-size: 0.85rem;
  color: var(--tc-muted);
}

.tc-card-flow h2 {
  margin-top: 10px !important;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.7;
}

.tc-flow {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.tc-flow li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--tc-soft);
}

.tc-flow span {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--tc-glow) 100%);
  color: #fff;
  font-weight: 800;
}

.tc-card-pills {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.tc-pill {
  padding: 14px 16px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--tc-sand-1) 92%, white);
}

.dark .tc-pill {
  background: rgb(255 255 255 / 0.09);
}

.tc-band {
  padding-block: 28px;
}

.tc-heading p {
  color: var(--primary);
  font-weight: 700;
}

.tc-heading h2 {
  margin-top: 8px !important;
  font-size: clamp(1.55rem, 3.2vw, 2.35rem);
  font-weight: 800;
  line-height: 1.3;
}

.tc-heading span {
  display: block;
  max-width: 62ch;
  margin-top: 10px;
  line-height: 1.9;
  color: var(--tc-muted);
}

.tc-sources,
.tc-steps,
.tc-price-row {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.tc-source,
.tc-step,
.tc-price-row .tc-card {
  padding: 22px;
}

.tc-source div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tc-source h3,
.tc-step h3,
.tc-price-row h3 {
  font-size: 1.05rem;
  font-weight: 800;
}

.tc-source em {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--tc-soft);
  color: var(--tc-muted);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 700;
}

.tc-source[data-ready='true'] {
  border-color: color-mix(in srgb, var(--tc-pine) 40%, transparent);
}

.tc-source[data-ready='true'] em {
  background: linear-gradient(135deg, var(--tc-pine-deep) 0%, var(--tc-pine) 100%);
  color: #fff;
}

.tc-source p,
.tc-step p,
.tc-price-row p,
.tc-cta p {
  margin-top: 10px !important;
  line-height: 1.9;
  color: var(--tc-toned);
}

.tc-landing code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--tc-soft);
  font-size: 0.85em;
}

.tc-step > span {
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--tc-pine);
}

.tc-step h3 {
  margin-top: 12px !important;
}

.tc-price-row .tc-card:first-child {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 16%, var(--tc-surface)), var(--tc-surface));
}

.tc-cta {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 22%, transparent), color-mix(in srgb, var(--tc-glow) 10%, transparent)),
    var(--tc-surface);
}

.tc-cta h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  font-weight: 800;
}

.tc-cta .tc-actions {
  margin-top: 8px;
}

@media (min-width: 900px) {
  .tc-landing {
    padding-inline: 32px;
  }

  .tc-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    align-items: center;
    padding-bottom: 72px;
  }

  .tc-sources,
  .tc-steps,
  .tc-price-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tc-cta {
    grid-template-columns: 1fr auto;
    padding: 36px;
  }
}
