/* yako.dev contact band: the "Let's talk" heading + contact form at the bottom of every page.
   Markup: tools/contact_band.py. Behaviour: js/contact.v1.js.
   Works on the new pages (home, /cases: light + dark themes) and on the older dark pages built by
   tools/build_pages.py: every rule is scoped to .cband and uses its own --cb-* colors.
   Versioned file name: firebase.json caches .css for a year, so a change goes into contact.v2.css
   and every page that uses it points to the new name.
   Theme: <html data-theme="light|dark"> when the page has a theme switch; otherwise the system
   setting. data-scheme="dark" on the band keeps it dark (pages that have no light theme). */

/* ── Colors ── */
.cband {
  --cb-bg: #0B1220;
  --cb-sub: #A9B1BE;
  --cb-eyebrow: #38B4EA;
  --cb-form-bg: #FFFFFF;
  --cb-form-border: #FFFFFF;
  --cb-form-shadow: rgba(0, 0, 0, 0.35);
  --cb-ink: #0B1220;
  --cb-muted: #596273;
  --cb-label: #2A3240;
  --cb-field: #EEF1F5;
  --cb-placeholder: #5F6878;
  --cb-line: #D5DAE2;
  --cb-switch-off: #C3C9D3;
  --cb-attach-bg: #FFFFFF;
  --cb-err: #B42318;
  --cb-err-bg: #FEF3F2;
  --cb-acc: #0397D7;
  --cb-acct: #026E9C;
  --cb-b1: #026F9F;
  --cb-b2: #027CB0;
  --cb-soft: rgba(3, 151, 215, 0.12);
  --cb-glow: rgba(3, 151, 215, 0.14);
  --cb-shadow: rgba(3, 151, 215, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cband {
    --cb-bg: #03060E;
    --cb-sub: #9AA1AD;
    --cb-form-bg: #111723;
    --cb-form-border: rgba(255, 255, 255, 0.08);
    --cb-form-shadow: rgba(0, 0, 0, 0.5);
    --cb-ink: #FFFFFF;
    --cb-muted: #858B96;
    --cb-label: #D8DCE3;
    --cb-field: #1B2230;
    --cb-placeholder: #8E95A2;
    --cb-line: rgba(255, 255, 255, 0.14);
    --cb-switch-off: #3A4352;
    --cb-attach-bg: #111723;
    --cb-err: #FDA29B;
    --cb-err-bg: rgba(240, 68, 56, 0.12);
    --cb-acct: #0397D7;
    --cb-soft: rgba(3, 151, 215, 0.14);
    --cb-glow: rgba(3, 151, 215, 0.22);
    --cb-shadow: rgba(3, 151, 215, 0.45);
  }
}

:root[data-theme="dark"] .cband,
.cband[data-scheme="dark"] {
  --cb-bg: #03060E;
  --cb-sub: #9AA1AD;
  --cb-form-bg: #111723;
  --cb-form-border: rgba(255, 255, 255, 0.08);
  --cb-form-shadow: rgba(0, 0, 0, 0.5);
  --cb-ink: #FFFFFF;
  --cb-muted: #858B96;
  --cb-label: #D8DCE3;
  --cb-field: #1B2230;
  --cb-placeholder: #8E95A2;
  --cb-line: rgba(255, 255, 255, 0.14);
  --cb-switch-off: #3A4352;
  --cb-attach-bg: #111723;
  --cb-err: #FDA29B;
  --cb-err-bg: rgba(240, 68, 56, 0.12);
  --cb-acct: #0397D7;
  --cb-soft: rgba(3, 151, 215, 0.14);
  --cb-glow: rgba(3, 151, 215, 0.22);
  --cb-shadow: rgba(3, 151, 215, 0.45);
}

/* ── Band ── */
.cband {
  position: relative;
  overflow: hidden;
  background: var(--cb-bg);
  border: 0;
  padding: 110px 60px 120px;
  color: #FFFFFF;
  text-align: left;
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.6;
}

/* Small reset that works next to any page stylesheet. :where() keeps it weaker than the rules below. */
:where(.cband) *,
:where(.cband) *::before,
:where(.cband) *::after {
  box-sizing: border-box;
}

:where(.cband) :where(h2, h3, p) {
  margin: 0;
}

:where(.cband) :where(button, input, textarea) {
  font: inherit;
}

:where(.cband) svg {
  display: block;
}

:where(.cband) a {
  color: inherit;
}

.cband-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  width: 1000px;
  height: 640px;
  max-width: 100%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--cb-glow) 0%, transparent 65%);
  pointer-events: none;
}

.cband-inner {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
}

.cband-eyebrow {
  margin-bottom: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cb-eyebrow);
}

.cband-h2 {
  margin-bottom: 14px;
  font-weight: 700;
  font-size: clamp(36px, 5vw, 60px);
  letter-spacing: -0.03em;
  line-height: 1.04;
  color: #FFFFFF;
  text-wrap: balance;
}

.cband-sub {
  margin-bottom: 36px;
  max-width: 720px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--cb-sub);
}

/* ── Form card ── */
.cband .cform {
  background: var(--cb-form-bg);
  border: 1px solid var(--cb-form-border);
  border-radius: 20px;
  padding: clamp(20px, 4vw, 44px);
  box-shadow: 0 30px 80px var(--cb-form-shadow);
  color: var(--cb-ink);
}

.cband .cform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 22px 24px;
}

.cband .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--cb-label);
  min-width: 0;
}

.cband .field.full {
  grid-column: 1 / -1;
}

.cband .req {
  color: var(--cb-acct);
}

.cband .input {
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 400;
  color: var(--cb-ink);
  background: var(--cb-field);
  border: 0;
  border-radius: 10px;
  transition: box-shadow 0.2s ease;
}

.cband .input::placeholder {
  color: var(--cb-placeholder);
  opacity: 1;
}

.cband .input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--cb-acc);
}

.cband .input[aria-invalid="true"] {
  box-shadow: 0 0 0 2px var(--cb-err);
}

.cband textarea.input {
  resize: vertical;
  line-height: 1.55;
  padding-bottom: 60px;
  min-height: 160px;
}

.cband .have {
  grid-column: 1 / -1;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.cband .have legend {
  padding: 0;
  margin-bottom: 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--cb-label);
}

.cband .have-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cband .chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--cb-line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--cb-ink);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.cband .chip:hover {
  border-color: var(--cb-acc);
}

.cband .chip input {
  accent-color: var(--cb-acc);
  margin: 0;
  width: 16px;
  height: 16px;
}

.cband .chip:has(input:checked) {
  border-color: var(--cb-acc);
  background: var(--cb-soft);
}

.cband .chip:has(input:focus-visible) {
  outline: 2px solid var(--cb-acc);
  outline-offset: 2px;
}

.cband .desc-wrap {
  position: relative;
}

.cband .cf-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cband .attach-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 0;
  background: var(--cb-attach-bg);
  color: var(--cb-acct);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cband .attach-btn:hover {
  filter: brightness(0.97);
}

.cband .attach-btn[hidden] {
  display: none;
}

.cband .file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-top: 4px;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--cb-line);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--cb-ink);
}

.cband .file-chip[hidden] {
  display: none;
}

.cband .file-chip .fname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cband .file-chip .fsize {
  color: var(--cb-muted);
  white-space: nowrap;
}

.cband .file-remove {
  width: 36px;
  height: 36px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cb-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cband .file-remove:hover {
  color: var(--cb-ink);
}

.cband .field-note {
  font-size: 13px;
  font-weight: 500;
  color: var(--cb-err);
}

.cband .field-note:empty {
  display: none;
}

.cband .cform-foot {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}

.cband .toggles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cband .toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 14.5px;
  color: var(--cb-ink);
  cursor: pointer;
}

.cband .toggle a {
  color: var(--cb-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cband .toggle .opt {
  color: var(--cb-muted);
}

.cband .switch {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  margin: 0;
  flex: none;
  position: relative;
  border-radius: 999px;
  background: var(--cb-switch-off);
  cursor: pointer;
  transition: background 0.2s ease;
}

.cband .switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform 0.2s ease;
}

.cband .switch:checked {
  background: var(--cb-b2);
}

.cband .switch:checked::before {
  transform: translateX(16px);
}

.cband .switch:focus-visible {
  outline: 2px solid var(--cb-acc);
  outline-offset: 2px;
}

.cband .switch[aria-invalid="true"] {
  box-shadow: 0 0 0 2px var(--cb-err);
}

/* ── Send button ── */
.cband .send-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 220px;
  min-height: 56px;
  padding: 15px 36px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cb-b1) 0%, var(--cb-b2) 100%);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 30px var(--cb-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
}

.cband .send-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.cband .send-btn:focus-visible {
  outline: 2px solid var(--cb-acc);
  outline-offset: 3px;
}

.cband .send-btn[disabled] {
  cursor: progress;
  opacity: 0.75;
  transform: none;
  filter: none;
}

.cband .send-btn .spin {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: cb-spin 0.8s linear infinite;
}

.cband .send-btn.busy .spin {
  display: block;
}

.cband .send-btn.busy .i-mail {
  display: none;
}

@keyframes cb-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Errors, honeypot, thank-you ── */
.cband .form-error {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--cb-err-bg);
  color: var(--cb-err);
  font-size: 14.5px;
  font-weight: 500;
}

.cband .form-error:empty {
  display: none;
}

.cband .form-error a {
  text-decoration: underline;
}

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

.cband .form-done {
  text-align: center;
  padding: 24px 8px;
}

.cband .form-done[hidden] {
  display: none;
}

.cband .form-done:focus {
  outline: none;
}

.cband .done-ico {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--cb-soft);
  color: var(--cb-acct);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cband .form-done h3 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 8px;
  color: var(--cb-ink);
}

.cband .form-done p {
  color: var(--cb-muted);
  font-size: 15.5px;
}

.cband .cform.sent .cform-body {
  display: none;
}

/* ── Phones ── */
@media (max-width: 640px) {
  .cband {
    padding: 72px 20px 80px;
  }

  .cband-sub {
    font-size: 16px;
    margin-bottom: 28px;
  }

  .cband .cform {
    border-radius: 16px;
  }

  .cband .cform-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .cband .send-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cband *,
  .cband *::before,
  .cband *::after {
    transition-duration: 0.01ms !important;
  }

  .cband .send-btn:hover {
    transform: none;
  }

  .cband .send-btn.busy .spin {
    animation: cb-spin 1.6s linear infinite !important;
  }
}

@media print {
  .cband {
    display: none !important;
  }
}
