/* Remote Controller — site styles
   Space Grotesk for UI/headings, Newsreader (serif) for long-form legal prose.
   Signal-wave motif echoes the app icon. */

:root {
  color-scheme: light; /* render as designed; don't let browsers auto-darken the page */
  --ink: #1b1d24;
  --ink-soft: #4b5060;
  --paper: #ffffff;
  --wash: #f6f7fb;
  --indigo: #4b46e5;
  --blue: #3d6ef7;
  --coral: #ff5a5f;
  --line: #e6e8f0;
  --ok: #159a6a;
  --err: #d33241;
  --maxw: 64rem;
  --prose: 40rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--indigo); }

:where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 42%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---- Top bar --------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 700; letter-spacing: -.015em; font-size: 1.02rem;
  color: var(--ink); text-decoration: none;
}
.brand svg { display: block; }
.nav { display: flex; gap: clamp(.9rem, 3vw, 1.9rem); font-size: .95rem; }
.nav a { color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--indigo); }
.nav a[aria-current="page"] { color: var(--indigo); }

/* ---- Shell + document head ------------------------------------------------- */
.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }

.pagehead {
  position: relative;
  padding: clamp(2.6rem, 7vw, 4.5rem) 0 clamp(1.4rem, 4vw, 2.4rem);
  border-bottom: 1px solid var(--line);
}
.pagehead h1 {
  font-size: clamp(2.1rem, 6.4vw, 3.3rem);
  line-height: 1.02; letter-spacing: -.035em; font-weight: 700;
  margin: 0; max-width: 20ch;
}
.pagehead .sub { margin: 1rem 0 0; color: var(--ink-soft); max-width: 54ch; font-size: 1.05rem; }
.effective {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: 1.4rem; font-size: .9rem; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.effective b { color: var(--ink); font-weight: 500; }
.effective::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }

/* signal-wave graphic, top-right of the head */
.signal { position: absolute; right: 0; top: clamp(1.5rem, 5vw, 3rem); width: clamp(96px, 22vw, 180px); height: auto; pointer-events: none; }
.signal .arc { fill: none; stroke: var(--blue); stroke-width: 6; stroke-linecap: round; opacity: .85; }
.signal .arc:nth-of-type(2) { stroke: var(--indigo); opacity: .6; }
.signal .arc:nth-of-type(3) { stroke: var(--indigo); opacity: .38; }
.signal .dot { fill: var(--coral); }
@media (max-width: 620px) { .signal { opacity: .5; width: 84px; } }

/* draw-in on load — one orchestrated moment */
@media (prefers-reduced-motion: no-preference) {
  .signal .arc { stroke-dasharray: 240; stroke-dashoffset: 240; animation: draw .9s ease forwards; }
  .signal .arc:nth-of-type(2) { animation-delay: .12s; }
  .signal .arc:nth-of-type(3) { animation-delay: .24s; }
  .signal .dot { transform-box: fill-box; transform-origin: center; scale: 0; animation: pop .4s ease .34s forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes pop { to { scale: 1; } }
}

/* ---- Long-form legal prose ------------------------------------------------- */
.prose {
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 1.15rem; line-height: 1.72; color: #23262f;
  max-width: var(--prose);
  padding: clamp(1.6rem, 4vw, 2.6rem) 0 3.5rem;
}
.prose > p:first-child { font-size: 1.24rem; line-height: 1.6; color: #2b2f3a; }
.prose h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.16rem; line-height: 1.25; letter-spacing: -.01em; font-weight: 600;
  color: var(--ink); margin: 2.6rem 0 .5rem;
}
.prose p { margin: .75rem 0; }
.prose ul { padding-left: 1.15rem; margin: .6rem 0; }
.prose li { margin: .4rem 0; }
.prose code {
  font-family: "Space Grotesk", ui-monospace, monospace;
  font-size: .86em; background: var(--wash); padding: .1em .4em; border-radius: 5px;
}

/* device-spec note: coral hairline, not a filled card */
.note {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem; line-height: 1.55; color: #2c313d;
  border-left: 3px solid var(--coral);
  padding: .2rem 0 .2rem 1.1rem;
  margin: 1.6rem 0;
}
.note b { color: var(--ink); }

.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.6rem; font-family: "Space Grotesk", sans-serif; font-size: .98rem; }
.prose th, .prose td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ink-soft); font-weight: 600; }
.prose tr:first-child th { border-bottom-color: #d7dae6; }

.crosslink {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: "Space Grotesk", sans-serif; font-weight: 500; font-size: 1rem;
  text-decoration: none; margin-top: 1.8rem;
}
.crosslink:hover { text-decoration: underline; }

/* ---- Contact form ---------------------------------------------------------- */
.contact-grid {
  display: grid; grid-template-columns: 1fr; gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.6rem, 4vw, 2.6rem) 0 3.5rem;
}
@media (min-width: 860px) { .contact-grid { grid-template-columns: 1fr 1.25fr; } }

.contact-aside p { color: var(--ink-soft); max-width: 34ch; margin: 0 0 1.4rem; font-size: 1.05rem; }
.contact-aside .direct { font-size: .95rem; }
.contact-aside .direct a { font-weight: 500; }
.contact-aside dl { margin: 1.6rem 0 0; }
.contact-aside dt { font-size: .82rem; color: var(--ink-soft); margin-top: 1rem; }
.contact-aside dd { margin: .15rem 0 0; font-weight: 500; }

form.contact { max-width: 34rem; }
.field { margin-bottom: 1.15rem; }
.field label { display: block; font-size: .92rem; font-weight: 500; margin-bottom: .4rem; }
.field .opt { color: var(--ink-soft); font-weight: 400; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: .7rem .85rem; background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: #c9cddd; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 14%, transparent);
}
.field [aria-invalid="true"],
.field [aria-invalid="true"]:focus { border-color: var(--err); }
.field [aria-invalid="true"]:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--err) 15%, transparent); }
.error { display: none; color: var(--err); font-size: .85rem; margin-top: .35rem; }
.field.invalid .error { display: block; }

.btn {
  font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer;
  color: #fff; background: var(--indigo); border: 0; border-radius: 10px;
  padding: .8rem 1.5rem; display: inline-flex; align-items: center; gap: .55rem;
  transition: background .15s ease, transform .08s ease;
}
.btn:hover { background: #3f3ad4; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn .spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color:#fff; border-radius:50%; display:none; }
.btn.loading .spin { display: inline-block; }
@media (prefers-reduced-motion: no-preference) { .btn.loading .spin { animation: spin .7s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }

.form-note { font-size: .85rem; color: var(--ink-soft); margin-top: .9rem; }

/* success confirmation replaces the form */
.sent {
  display: none;
  border: 1.5px solid color-mix(in srgb, var(--ok) 35%, var(--line));
  background: color-mix(in srgb, var(--ok) 7%, var(--paper));
  border-radius: 14px; padding: 1.6rem 1.5rem; max-width: 34rem;
}
.sent.show { display: block; }
.sent .check {
  width: 40px; height: 40px; border-radius: 50%; background: var(--ok);
  display: grid; place-items: center; margin-bottom: .9rem;
}
.sent h2 { font-size: 1.25rem; margin: 0 0 .35rem; letter-spacing: -.01em; }
.sent p { margin: 0; color: var(--ink-soft); }
.sent button {
  margin-top: 1.1rem; font: inherit; font-weight: 500; font-size: .95rem;
  background: none; border: 0; color: var(--indigo); cursor: pointer; padding: 0;
}
.sent button:hover { text-decoration: underline; }
@media (prefers-reduced-motion: no-preference) {
  .sent.show { animation: rise .35s ease; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } }
}

/* ---- Footer ---------------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--line);
  padding: 2rem clamp(1rem, 4vw, 2.5rem) 3rem;
  color: var(--ink-soft); font-size: .9rem;
}
.foot .shell { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-items: baseline; padding: 0; }
.foot a { color: var(--ink-soft); }
.foot .spacer { flex: 1; }
