/* PacYard — Americana.
   The register is civic rather than patriotic-kitsch: deep navy, barn red, a brass
   accent, and warm paper instead of white. Ornament (stars, stripes, rosettes) is
   drawn with gradients and text glyphs, so the whole theme costs zero requests. */

:root {
  color-scheme: light dark;

  /* The background the card floats on, and the card itself. */
  --page: #ece6d9;
  --paper: #fffdf8;
  --paper-raised: #f8f4ea;
  --ink: #111f38;
  --muted: #55617a;
  --line: #ded7c7;
  --navy: #10233f;
  --red: #b3202e;
  --brass: #96762f;
  --accent: var(--navy);

  --radius: 4px;
  --card-radius: 18px;
  --shadow: 0 1px 2px rgba(16, 35, 63, 0.06), 0 12px 32px -8px rgba(16, 35, 63, 0.18);
  --wrap: 60rem;
  --measure: 40rem;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Helvetica, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #090e18;
    --paper: #111a2b;
    --paper-raised: #182236;
    --ink: #eceff5;
    --muted: #97a3b9;
    --line: #25314a;
    --navy: #8fb4e4;
    --red: #e2596a;
    --brass: #d2ac5f;
    --accent: var(--navy);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 1rem 3rem;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 14px 36px -10px rgba(0, 0, 0, 0.7);
  }
}

/* The sheet everything sits on. */
.shell {
  max-width: var(--wrap);
  margin: 2rem auto 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

@media (max-width: 40rem) {
  body { padding-inline: 0.65rem; }
  .shell { margin-top: 0.9rem; border-radius: 14px; }
}

/* A thin flag-derived rule across the top of the card. Thirteen stripes would be
   noise at this size, so it reads as three bands: red, brass, navy. */
.shell::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(
    to right,
    var(--red) 0 33.333%,
    var(--brass) 33.333% 66.666%,
    var(--navy) 66.666% 100%
  );
}

h1, h2, h3 {
  font-family: var(--serif);
  line-height: 1.15;
  letter-spacing: -0.012em;
  font-weight: 600;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 3.3rem); margin: 0 0 0.6rem; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); margin: 0 0 0.8rem; }
h3 { font-size: 1.08rem; margin: 0 0 0.35rem; font-weight: 650; }

p { margin: 0 0 0.9rem; }
a { color: var(--accent); text-underline-offset: 0.16em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* ---------- nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1.1rem 2rem;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 40rem) { .nav { padding-inline: 1.15rem; } }
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--serif); font-size: 1.16rem; font-weight: 650;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
}
/* Shield: navy field, red stripes below, a brass star centred. */
.mark {
  width: 1.1rem; height: 1.25rem; flex: none;
  background:
    radial-gradient(circle at 50% 30%, var(--brass) 0 0.14rem, transparent 0.14rem),
    linear-gradient(to bottom, var(--navy) 0 45%, transparent 45%),
    repeating-linear-gradient(to bottom, var(--red) 0 0.14rem, var(--paper) 0.14rem 0.28rem);
  border-radius: 2px 2px 45% 45% / 2px 2px 60% 60%;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent);
}
.nav nav { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 0.93rem; }
.nav nav a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 0.68rem 1.2rem;
  border: 1px solid var(--navy); border-radius: var(--radius);
  background: var(--navy); color: var(--paper);
  font-family: var(--sans); font-weight: 600; font-size: 0.95rem;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 20%, transparent);
}
.btn:hover { background: color-mix(in srgb, var(--navy) 88%, var(--ink)); }
.btn-ghost { background: transparent; color: var(--navy); box-shadow: none; }
.btn-ghost:hover { background: color-mix(in srgb, var(--navy) 8%, transparent); }
.btn-sm { padding: 0.42rem 0.78rem; font-size: 0.87rem; }

/* ---------- sections ---------- */
.hero, .band, .page-head, .plans, .grid, .form {
  padding: 1.6rem 2rem;
}
.hero { padding: 2.8rem 2rem 2rem; }
@media (max-width: 40rem) {
  .hero, .band, .page-head, .plans, .grid, .form { padding-inline: 1.15rem; }
}
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.13em; font-size: 0.73rem;
  font-weight: 700; color: var(--red); margin: 0 0 0.7rem;
}
.lede { font-size: 1.12rem; color: var(--muted); max-width: var(--measure); margin: 0 0 1.4rem; }
.row { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.85rem; }
.band { border-top: 1px solid var(--line); padding-block: 2rem; }
.page-head { padding-block: 2.4rem 0.4rem; }
.cta-band { text-align: center; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
}
.swatch { height: 0.45rem; border-radius: 99px; background: var(--accent); margin-bottom: 0.9rem; }

/* ---------- steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.95rem; }
.steps li { display: flex; gap: 0.9rem; align-items: flex-start; }
.step-num {
  flex: 0 0 1.75rem; height: 1.75rem; border-radius: 99px; display: grid; place-items: center;
  background: var(--navy); color: var(--paper);
  font-family: var(--serif); font-size: 0.88rem; font-weight: 650;
}
.steps p { margin: 0.15rem 0 0; }

/* ---------- plans ---------- */
.plans { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); align-items: start; }
.plan { display: flex; flex-direction: column; gap: 0.5rem; position: relative; }
.plan-popular { border-color: var(--navy); box-shadow: inset 0 3px 0 var(--red); }
.tag {
  align-self: flex-start; font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.11em; font-weight: 700;
  background: var(--red); color: #fff; padding: 0.18rem 0.5rem; border-radius: 2px;
}
.price { font-family: var(--serif); font-size: 1.95rem; font-weight: 650; margin: 0; }
.price span { font-family: var(--sans); font-size: 0.92rem; font-weight: 400; }
.ticks { list-style: none; margin: 0.35rem 0 1.1rem; padding: 0; display: grid; gap: 0.38rem; }
.ticks li { padding-left: 1.3rem; position: relative; font-size: 0.92rem; }
.ticks li::before {
  content: "★"; position: absolute; left: 0; top: -0.05em;
  color: var(--brass); font-size: 0.72rem;
}
.plan .btn { margin-top: auto; text-align: center; }

/* ---------- faq ---------- */
.faq { margin: 0; max-width: var(--measure); }
.faq dt { font-weight: 650; margin-top: 1rem; }
.faq dd { margin: 0.2rem 0 0; color: var(--muted); }

/* ---------- forms ---------- */
.form { max-width: 40rem; padding-bottom: 3.5rem; }
fieldset {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem; margin: 0 0 1.25rem; background: var(--paper-raised);
}
legend {
  font-family: var(--serif); font-size: 1.05rem; font-weight: 650;
  padding: 0 0.45rem;
}
label { display: block; margin-bottom: 1rem; font-weight: 600; font-size: 0.92rem; }
input[type="text"], input[type="email"], input:not([type]) {
  display: block; width: 100%; margin-top: 0.34rem; padding: 0.6rem 0.7rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); font: inherit; font-weight: 400;
}
input:focus-visible { outline: 2px solid var(--navy); outline-offset: 1px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.83rem; margin-top: 0.3rem; }
.err { display: block; color: var(--red); font-size: 0.85rem; font-weight: 600; margin-top: 0.3rem; }
.addr { display: flex; align-items: stretch; gap: 0.4rem; }
.addr input { flex: 1; }
.addr-suffix { align-self: center; color: var(--muted); font-size: 0.9rem; font-weight: 400; margin-top: 0.34rem; }
.choice {
  display: flex; gap: 0.7rem; align-items: flex-start; font-weight: 400;
  padding: 0.6rem 0; border-top: 1px solid var(--line); margin: 0;
}
.choice:first-of-type { border-top: 0; }
.choice > span { display: grid; gap: 0.15rem; }
.choice input { margin-top: 0.36rem; flex: none; }
.choice:hover { background: color-mix(in srgb, var(--navy) 4%, transparent); }
.sample { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }
.notice {
  color: var(--muted); border-left: 3px solid var(--brass);
  padding-left: 0.85rem; margin-bottom: 1.2rem;
}

/* ---------- theme picker ---------- */
.theme-choice { align-items: center; }
/* Three bars: paper, accent, ink — enough to judge a palette at a glance. */
.theme-swatch {
  flex: none; width: 3.2rem; height: 2.1rem; border-radius: 3px;
  border: 1px solid var(--line); overflow: hidden;
  display: grid; grid-template-rows: 1fr 1fr 1fr;
  margin-top: 0.1rem;
}
.theme-swatch i { display: block; }

/* ---------- alerts + status ---------- */
.alert {
  background: color-mix(in srgb, var(--red) 10%, transparent);
  border: 1px solid var(--red); color: var(--red);
  padding: 0.7rem 0.9rem; border-radius: var(--radius); font-weight: 500;
}
.alert-ok {
  background: color-mix(in srgb, var(--brass) 14%, transparent);
  border-color: var(--brass); color: var(--ink);
}
.status {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700;
  padding: 0.18rem 0.5rem; border-radius: 2px; border: 1px solid var(--line); color: var(--muted);
}
.status-live { color: var(--paper); background: var(--navy); border-color: var(--navy); }
.status-failed { color: #fff; background: var(--red); border-color: var(--red); }

/* ---------- job list ---------- */
.joblist { list-style: none; margin: 0 0 1rem; padding: 0; }
.job-step {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.8rem; align-items: center;
  padding: 0.62rem 0; border-bottom: 1px solid var(--line);
}
.job-step p { margin: 0.1rem 0 0; }
.dot { width: 0.62rem; height: 0.62rem; border-radius: 99px; background: var(--line); flex: none; }
.job-running .dot { background: var(--brass); animation: pulse 1s ease-in-out infinite; }
.job-succeeded .dot { background: var(--navy); }
.job-failed .dot { background: var(--red); }
@keyframes pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .job-running .dot { animation: none; } }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1.1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: 0.89rem; }
.kv dd { margin: 0; font-size: 0.93rem; }

/* ---------- footer ---------- */
.footer {
  padding: 1.8rem 2rem 2rem;
  border-top: 1px solid var(--line);
  background: var(--paper-raised);
  display: grid; gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
@media (max-width: 40rem) { .footer { padding-inline: 1.15rem; } }
.footer strong { font-family: var(--serif); font-size: 1.05rem; }
.footer p { margin: 0.35rem 0 0; font-size: 0.86rem; }
.footer-note { max-width: 36rem; }

/* Theme preview strip on the themes gallery: four bands of the palette. */
.theme-preview {
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: 2.4rem; border: 1px solid var(--line); border-radius: 3px;
  overflow: hidden; margin-bottom: 0.9rem;
}
.theme-preview span { display: block; }
