/* ==========================================================================
   Artisan Hosting — components.css
   Reusable pieces. Nothing here knows what page it is on.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn.primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: 0 14px 40px var(--shadow-color);
}
.btn.primary:hover { background: var(--btn-primary-hover); }

.btn.secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border-color: var(--btn-secondary-border);
}
.btn.secondary:hover { background: var(--btn-secondary-hover); }

.btn.ghost {
  background: transparent;
  color: var(--btn-ghost-text);
  border-color: var(--border);
}
.btn.ghost:hover { background: var(--btn-ghost-hover); }

.btn.small { padding: 7px 12px; font-size: 0.9rem; border-radius: 10px; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-5);
}

/* --------------------------------------------------------------------------
   Theme toggle — a dot in a halo, no icon asset needed.
   -------------------------------------------------------------------------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-1);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.theme-toggle:hover { border-color: var(--border-strong); }

.theme-toggle::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--wine);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--wine) 24%, transparent);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

:root[data-theme='dark'] .theme-toggle::before {
  background: var(--warm);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warm) 24%, transparent);
}

/* --------------------------------------------------------------------------
   Eyebrow / badge / pill
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface-2) 65%, transparent);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge.ok   { color: var(--ok);   background: var(--ok-soft);   border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.badge.bad  { color: var(--bad);  background: var(--bad-soft);  border-color: color-mix(in srgb, var(--bad) 35%, transparent); }

.badge-rail { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* --------------------------------------------------------------------------
   Card

   Deliberately NOT grouped with .plan/.bundle/.block/details/.app-card the
   way the old sheet grouped them — editing .card there silently restyled
   every <details> on the site.
   -------------------------------------------------------------------------- */

.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-1) 92%, transparent), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: clamp(18px, 2.4vw, 26px);
}

.card > :first-child { margin-top: 0; }
.card p, .card li { color: var(--text-2); }

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.card-link:hover,
.card-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: color-mix(in srgb, var(--sky) 60%, var(--border));
}

.card-link h3 { color: var(--text-strong); }

/* Image-as-card. Was a pile of inline styles on about.html. */
.card--media { padding: 0; overflow: hidden; }
.card--media img { width: 100%; height: 100%; max-height: 520px; object-fit: cover; object-position: center; }

.card--flush { background: none; border: 0; box-shadow: none; padding: 0; }

/* --------------------------------------------------------------------------
   Hero — boxed, with a layered radial wash.
   The wash uses tokens so it inverts properly in dark mode; the old rule
   baked raw rgba and stayed light-tinted on a navy background.
   -------------------------------------------------------------------------- */

header.hero { padding-block: var(--section-space); }

header.hero .wrap {
  position: relative;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 8px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-1) 88%, transparent), var(--surface-2));
  box-shadow: var(--shadow);
  overflow: hidden;
}

header.hero .wrap::before {
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  background:
    radial-gradient(600px 220px at 15% 10%, var(--wash-hero-a), transparent 62%),
    radial-gradient(520px 220px at 85% 0%, var(--wash-hero-b), transparent 60%);
}

header.hero .wrap > * { position: relative; }
header.hero h1 { margin-bottom: var(--space-4); }

.hero-split {
  display: grid;
  gap: clamp(20px, 4vw, 44px);
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

@media (max-width: 899.98px) {
  .hero-split { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   Steps — numbered process flow with an "Output:" terminal line.
   -------------------------------------------------------------------------- */

.steps { counter-reset: step; display: grid; gap: var(--grid-gap); }

.step { position: relative; padding-left: 56px; }

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--wine);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
}

:root[data-theme='dark'] .step::before { background: var(--sky); color: var(--navy); }

/* Every step on the process page ends with a concrete deliverable. That is a
   content pattern, not a caption — it gets its own treatment. */
.step-output {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-2);
}

.step-output strong { color: var(--text-strong); letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.78rem; }

/* --------------------------------------------------------------------------
   Band — full-width diagonal CTA strip
   -------------------------------------------------------------------------- */

.band {
  margin-top: var(--space-8);
  padding-block: clamp(32px, 6vw, 56px);
  background: linear-gradient(135deg, color-mix(in srgb, var(--sky) 24%, transparent),
    color-mix(in srgb, var(--wine) 12%, transparent));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.band .cta-row { justify-content: center; }

/* --------------------------------------------------------------------------
   Callout pair — "good fit" vs "not a fit"
   -------------------------------------------------------------------------- */

.callout { border-left: 4px solid var(--border-strong); }
.callout--yes .icon-list svg { color: var(--ok); }
.callout--no .icon-list svg { color: var(--bad); }
.callout--yes { border-left-color: color-mix(in srgb, var(--sky) 90%, var(--navy)); background: linear-gradient(180deg, var(--info-soft), transparent 70%), var(--surface-1); }
.callout--no  { border-left-color: var(--wine); background: linear-gradient(180deg, var(--accent-soft), transparent 70%), var(--surface-1); }

/* --------------------------------------------------------------------------
   Audience router — "which door is yours"
   -------------------------------------------------------------------------- */

.audience-grid {
  display: grid;
  gap: var(--grid-gap);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.audience-card { display: flex; flex-direction: column; gap: var(--space-3); height: 100%; }
.audience-card .audience-kicker { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent); }
.audience-card p { flex: 1; }
.audience-card .audience-go { font-weight: 600; color: var(--link); }

/* --------------------------------------------------------------------------
   Icon list — replaces the emoji bullets the old pages used
   -------------------------------------------------------------------------- */

.icon-list { list-style: none; margin: 0; padding: 0; }
.icon-list li { display: flex; gap: var(--space-3); align-items: flex-start; margin-top: var(--space-3); color: var(--text-2); }
.icon-list li:first-child { margin-top: 0; }
.icon-list svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 3px; color: var(--accent); }

/* --------------------------------------------------------------------------
   Pricing
   -------------------------------------------------------------------------- */

.price-grid { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.price-card { display: flex; flex-direction: column; height: 100%; }
.price-card .price { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 500; color: var(--text-strong); margin: var(--space-3) 0; }
.price-card .price span { font-size: 0.9rem; font-weight: 400; color: var(--text-3); }
.price-card ul { flex: 1; }

.price-card.featured {
  border-color: color-mix(in srgb, var(--wine) 55%, var(--border));
  box-shadow: 0 22px 62px color-mix(in srgb, var(--wine) 16%, transparent);
}

.price-card.featured .price-flag {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: var(--space-2);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--wine);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Comparison table — the old sheet styled exactly one property of this. */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

.table { width: 100%; border-collapse: collapse; font-size: 0.94rem; min-width: 560px; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table thead th { background: var(--surface-2); color: var(--text-strong); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }
.table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td:first-child, .table th:first-child { font-weight: 600; color: var(--text-1); }

/* --------------------------------------------------------------------------
   Portfolio preview cards.
   Pair with <img data-server-preview-url="https://…"> and the server
   rewrites src to a cached /__preview/<hash>.webp screenshot.
   -------------------------------------------------------------------------- */

.preview-grid { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.project-preview-link {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-1);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.project-preview-link:hover,
.project-preview-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: color-mix(in srgb, var(--sky) 60%, var(--border));
}

.project-preview-link img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top center;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

/* The server swaps in our lockup when a site is down or its screenshot came
   back blank. A logo is not a screenshot: it gets letterboxed and centered
   rather than cropped to fill the frame. */
.project-preview-link img[data-preview-state='placeholder'] {
  object-fit: contain;
  object-position: center;
  padding: var(--space-6);
  background: var(--surface-2);
}

.project-preview-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4) 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-3);
}

.project-preview-title { padding: 6px var(--space-4) var(--space-4); color: var(--text-2); font-size: 0.94rem; }

/* --------------------------------------------------------------------------
   Status page service cards.
   Colors come from tokens now instead of hardcoded hexes that vanished
   against a light background.
   -------------------------------------------------------------------------- */

.svc {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
}

.svc-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.svc-name { font-weight: 700; color: var(--text-1); }
.svc-meta { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-3); }

/* Compact state legend. Sits under the hero, so it stays a single quiet row
   of badge + gloss rather than competing with the service grid below it. */
.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-5);
  font-size: 0.85rem;
  color: var(--text-3);
}

.status-legend > span { display: inline-flex; align-items: center; gap: var(--space-2); }

/* Uptime figures, coloured by the thresholds quoted on the status page. The
   number carries the meaning and the colour only agrees with it, so nothing
   here is the sole signal. */
.svc-uptime { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.svc-uptime .uptime { display: inline-flex; align-items: baseline; gap: 0.4em; }
.svc-uptime .uptime-window { color: var(--text-3); }

.uptime-value { font-weight: 700; }
.uptime-value.ok   { color: var(--ok); }
.uptime-value.warn { color: var(--warn); }
.uptime-value.bad  { color: var(--bad); }

/* The strip is a fixed 30 bars in a card whose width is set by the grid, so
   the bars flex rather than sit at a fixed width: at four cards across they
   would otherwise be wider than the card they live in. */
.svc-spark { display: flex; gap: 2px; }
.svc-spark i { flex: 1 1 6px; min-width: 2px; max-width: 6px; height: 20px; border-radius: 2px; }
.svc-spark i.warn { background: var(--warn); }
.svc-spark i.bad { background: var(--bad); }
.svc-spark i.ok { background: var(--ok); }

/* A day with no probe data. Neutral rather than a faint green: with a gap in
   the record, a tinted-healthy bar would read as a quiet claim we can't back
   up. Mixed from --text-3 so it follows the theme without a new token. */
.svc-spark i,
.spark-key { background: color-mix(in srgb, var(--text-3) 28%, transparent); }

/* Key for the history strip, using the strip's own shapes. */
.spark-key { display: inline-block; width: 6px; height: 14px; border-radius: 2px; }
.spark-key.ok   { background: var(--ok); }
.spark-key.warn { background: var(--warn); }
.spark-key.bad  { background: var(--bad); }

.spark-legend { margin: var(--space-4) 0 0; }

/* Standing note above the reference text, set like a markdown blockquote.
   The rule is the same neutral as a no-data bar, because that is what the
   note is there to explain. */
.note {
  margin-top: var(--space-5);
  padding: var(--space-1) 0 var(--space-1) var(--space-4);
  border-left: 3px solid color-mix(in srgb, var(--text-3) 45%, transparent);
  color: var(--text-2);
}

.note p { font-size: 0.92rem; line-height: 1.6; }

/* How-this-page-works notes. Reference text, read once, so it runs in two
   columns on a wide screen rather than as one long measure with half the
   page empty beside it. Multi-column keeps the reading order down and then
   across; a two-column grid would read the paragraphs sideways. */
.status-notes { margin-top: var(--space-5); }
.status-notes h2 { font-size: 1.05rem; margin-bottom: var(--space-3); }
.status-notes p + p { margin-top: var(--space-3); }
.status-notes b { color: var(--text-2); }

@media (min-width: 900px) {
  .status-notes { columns: 2; column-gap: var(--space-7); }
  .status-notes h2 { column-span: all; }
  /* Splitting a paragraph across the fold costs more than a ragged column. */
  .status-notes p { break-inside: avoid; }
  .status-notes p:first-of-type { margin-top: 0; }
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form { display: grid; gap: var(--space-4); }

.field { display: grid; gap: 6px; }
.field > span { font-size: 0.9rem; font-weight: 600; color: var(--text-1); }
.field .field-hint { font-size: 0.82rem; font-weight: 400; color: var(--text-3); }

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='url'],
input[type='number'],
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  background: color-mix(in srgb, var(--surface-2) 42%, var(--surface-1));
  color: var(--text-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

textarea { min-height: 150px; resize: vertical; }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--sky) 65%, var(--border));
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.captcha-slot { min-height: 0; }
.captcha-slot:not(:empty) { margin-block: var(--space-2); }

.form-error {
  margin: 0;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 0.9rem;
}

.form-success {
  margin: 0;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 0.9rem;
}

/* Conditional field groups revealed by the interest selector. */
.field-group[hidden] { display: none; }
.field-group {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-2) 45%, transparent);
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  padding: var(--space-4);
}

.faq details + details { margin-top: var(--space-3); }
.faq summary { cursor: pointer; font-weight: 700; color: var(--text-1); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; font-family: var(--font-mono); color: var(--text-3); }
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { margin-bottom: var(--space-3); }

/* --------------------------------------------------------------------------
   Testimonial / pull quote
   -------------------------------------------------------------------------- */

.testimonial figcaption { margin-top: var(--space-3); font-size: 0.9rem; color: var(--text-3); }

/* --------------------------------------------------------------------------
   Client logo row — static, not a marquee. With three logos a marquee reads
   as padding, not as proof.
   -------------------------------------------------------------------------- */

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 5vw, 56px);
}

.logo-row img {
  height: clamp(30px, 4vw, 44px);
  width: auto;
  padding: 8px 14px;
  border-radius: 10px;
  background: #fff;
  box-sizing: content-box;
  opacity: 0.78;
  filter: grayscale(1);
  transition: opacity var(--dur) var(--ease), filter var(--dur) var(--ease);
}

.logo-row a:hover img,
.logo-row a:focus-visible img { opacity: 1; filter: grayscale(0); }

/* --------------------------------------------------------------------------
   Radical-transparency source block (privacy page)
   -------------------------------------------------------------------------- */

.privacy-block + .privacy-block { margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--border); }

.privacy-verbatim {
  background: color-mix(in srgb, var(--navy) 92%, #000);
  color: #dbe4f5;
  border-color: transparent;
  max-height: 460px;
}
