/* Reusable branded components */

/* ---------- Brand mark ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand__badge { width: 44px; height: 44px; flex: none; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}
.brand__name span { color: var(--copper-bright); }
.brand__sub {
  margin-top: 5px;
  font-size: 0.62rem;
  letter-spacing: 0.55em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(14, 16, 18, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav__link {
  position: relative;
  padding: 8px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.site-nav__link:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.site-nav__link[aria-current="page"] { color: var(--text); }
.site-nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  background: var(--copper);
  border-radius: 2px;
}
.site-nav__cta { margin-left: 10px; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px var(--gutter) 24px;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
  }
  .site-nav.is-open { opacity: 1; transform: none; visibility: visible; }
  .site-nav__link { padding: 14px 12px; font-size: 1.05rem; }
  .site-nav__link[aria-current="page"]::after { left: 0; right: auto; top: 12px; bottom: 12px; width: 3px; height: auto; }
  .site-nav__cta { margin: 12px 0 0; }
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--panel-2);
  --btn-fg: var(--text);
  --btn-border: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 22px;
  font: 600 0.98rem/1.2 var(--font-body);
  letter-spacing: 0.01em;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { color: var(--btn-fg); border-color: var(--steel-dim); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }

.btn--primary {
  --btn-bg: linear-gradient(180deg, #db8749 0%, #b9662f 100%);
  --btn-fg: #fff;
  --btn-border: #e0915a;
  background: var(--btn-bg);
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, var(--shadow-copper);
  text-shadow: 0 1px 1px rgba(0,0,0,0.25);
}
.btn--primary:hover { border-color: #f2a974; box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 10px 34px rgba(207,123,63,0.35); }

.btn--ghost { --btn-bg: transparent; --btn-border: var(--line-strong); }
.btn--quiet { --btn-bg: transparent; --btn-border: transparent; color: var(--text-muted); padding-inline: 12px; }
.btn--quiet:hover { color: var(--text); border-color: transparent; }
.btn--danger { --btn-bg: transparent; --btn-fg: var(--danger); --btn-border: rgba(226,104,93,0.45); }
.btn--sm { min-height: 36px; padding: 7px 14px; font-size: 0.88rem; }
.btn--lg { min-height: 54px; padding: 14px 28px; font-size: 1.05rem; }
.btn--block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Eyebrow / labels ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper-bright);
}
.eyebrow::before {
  content: "";
  width: 28px; height: 2px;
  background: linear-gradient(90deg, var(--copper) 70%, transparent 70%, transparent 80%, var(--copper) 80%);
}

.section-head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.badge--copper { color: var(--copper-bright); border-color: rgba(207,123,63,0.4); background: rgba(207,123,63,0.08); }
.badge--success { color: var(--success); border-color: rgba(98,185,142,0.4); background: rgba(98,185,142,0.08); }
.badge--warning { color: var(--warning); border-color: rgba(226,180,80,0.4); background: rgba(226,180,80,0.08); }
.badge--danger { color: var(--danger); border-color: rgba(226,104,93,0.4); background: rgba(226,104,93,0.08); }
.badge--info { color: var(--info); border-color: rgba(106,167,216,0.4); background: rgba(106,167,216,0.08); }

/* ---------- Cards ---------- */
.card {
  position: relative;
  padding: clamp(22px, 3vw, 30px);
  background: linear-gradient(180deg, var(--panel) 0%, #16191d 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card--link { text-decoration: none; color: inherit; transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
.card--link:hover { color: inherit; border-color: rgba(207,123,63,0.55); transform: translateY(-2px); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-muted); }
.card--accent { border-color: rgba(207,123,63,0.35); }
.card--accent::before {
  content: "";
  position: absolute;
  left: -1px; top: 18px; bottom: 18px;
  width: 3px;
  background: var(--copper);
  border-radius: 0 3px 3px 0;
}

/* Corner ticks — a small "drafting frame" detail */
.framed { position: relative; }
.framed::after {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(var(--copper), var(--copper)) top left / 14px 2px,
    linear-gradient(var(--copper), var(--copper)) top left / 2px 14px,
    linear-gradient(var(--copper), var(--copper)) bottom right / 14px 2px,
    linear-gradient(var(--copper), var(--copper)) bottom right / 2px 14px;
  background-repeat: no-repeat;
  opacity: 0.85;
}

.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 48px; height: 48px;
  margin-bottom: 18px;
  color: var(--copper-bright);
  background: radial-gradient(circle at 30% 25%, rgba(232,149,90,0.18), rgba(207,123,63,0.04) 70%);
  border: 1px solid rgba(207,123,63,0.35);
  border-radius: 12px;
}
.icon-tile svg { width: 24px; height: 24px; }

.icon { width: 20px; height: 20px; flex: none; }

/* Check list */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  position: relative;
  padding-left: 28px;
  color: var(--text-muted);
}
.checklist li + li { margin-top: 10px; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 2px; top: 0.55em;
  width: 12px; height: 6px;
  border-left: 2px solid var(--copper-bright);
  border-bottom: 2px solid var(--copper-bright);
  transform: rotate(-45deg);
}
.checklist--plain li::before {
  width: 7px; height: 7px; top: 0.6em; left: 4px;
  border: 0; transform: none;
  background: var(--copper);
  border-radius: 1px;
}

/* ---------- Circuit-trace decoration ---------- */
.grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center top;
}
.trace {
  position: absolute;
  pointer-events: none;
  color: var(--copper);
  opacity: 0.55;
}
.trace path, .trace line, .trace polyline { stroke: currentColor; fill: none; stroke-width: 1.5; }
.trace circle { stroke: currentColor; fill: var(--bg); stroke-width: 1.5; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 20px; }
.form-row { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.field { display: grid; gap: 8px; }
.field label, .field .label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}
.field .optional { font-weight: 400; color: var(--text-dim); }
.field .hint { font-size: 0.86rem; color: var(--text-dim); margin: 0; }

.input, .textarea, .select {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: #0f1215;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: #5f6872; }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 3px var(--copper-glow);
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.textarea--lg { min-height: 200px; font-size: 1.05rem; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23a7afb8' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.field--error .input, .field--error .textarea, .field--error .select { border-color: var(--danger); }
.field-error { font-size: 0.86rem; color: var(--danger); margin: 0; }

.checkbox {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
}
.checkbox input {
  appearance: none;
  flex: none;
  width: 20px; height: 20px;
  margin: 2px 0 0;
  background: #0f1215;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.checkbox input:checked { background: var(--copper); border-color: var(--copper); }
.checkbox input:checked::after {
  content: "";
  width: 10px; height: 5px;
  margin-top: -2px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}
.checkbox input:focus-visible { outline: 2px solid var(--copper-bright); outline-offset: 2px; }

/* Selectable option cards (radio) */
.choices { display: grid; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #11151a;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.choice span::before {
  content: "";
  flex: none;
  width: 18px; height: 18px;
  border: 2px solid var(--steel-dim);
  border-radius: 50%;
  transition: border 0.15s var(--ease);
}
.choice:hover span { border-color: var(--steel-dim); }
.choice input:checked + span { border-color: var(--copper); background: rgba(207,123,63,0.08); }
.choice input:checked + span::before { border: 6px solid var(--copper-bright); }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px var(--copper-glow); }

.char-count { font-size: 0.8rem; color: var(--text-dim); text-align: right; }
.char-count.is-near { color: var(--warning); }

.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.error-summary {
  padding: 14px 16px;
  border: 1px solid rgba(226,104,93,0.45);
  background: rgba(226,104,93,0.07);
  border-radius: var(--radius-sm);
  color: #f2b0a9;
  font-size: 0.95rem;
}
.error-summary ul { margin: 6px 0 0; }

/* ---------- Flash ---------- */
.flash-stack { position: relative; z-index: 40; }
.flash {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  font-size: 0.95rem;
}
.flash svg { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.flash--notice { border-color: rgba(98,185,142,0.45); background: rgba(98,185,142,0.08); }
.flash--notice svg { color: var(--success); }
.flash--alert { border-color: rgba(226,104,93,0.45); background: rgba(226,104,93,0.08); }
.flash--alert svg { color: var(--danger); }

/* ---------- Callouts ---------- */
.callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--copper);
  background: rgba(207,123,63,0.05);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-muted);
}
.callout svg { width: 20px; height: 20px; flex: none; color: var(--copper-bright); margin-top: 3px; }
.callout--warning { border-left-color: var(--warning); background: rgba(226,180,80,0.06); }
.callout--warning svg { color: var(--warning); }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  padding: clamp(36px, 6vw, 64px);
  background:
    radial-gradient(600px 300px at 85% 0%, rgba(207,123,63,0.22), transparent 60%),
    linear-gradient(180deg, #1a1e23, #14171b);
  border: 1px solid rgba(207,123,63,0.3);
  border-radius: var(--radius-lg);
}
.cta-band h2 { margin-bottom: 12px; }
.cta-band p { color: var(--text-muted); max-width: 56ch; }
.cta-band .btn-row { margin-top: 26px; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  padding: 56px 0 28px;
  background: #0b0d0f;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--text-muted);
}
.site-footer__grid {
  display: grid;
  gap: 36px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .site-footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
}
.site-footer h4 {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li + li { margin-top: 8px; }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--copper-bright); }
.site-footer__tagline { margin-top: 16px; max-width: 36ch; }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* ---------- Misc ---------- */
.divider-label {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.kbd-copper { color: var(--copper-bright); font-family: var(--font-display); }

.spinner {
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  border-top-color: var(--copper-bright);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
