/* ============================================================
   T2 Digital Advisors — theme + layout
   Dark mode is the default; [data-theme="light"] overrides it.
   ============================================================ */

:root,
[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-alt: #0f1623;
  --surface: #131c2b;
  --border: #233146;
  --text: #e7eef7;
  --text-muted: #9fb0c6;
  --heading: #f4f8ff;
  --accent: #4f9cf9;
  --accent-strong: #6fb0ff;
  --accent-contrast: #04111f;
  --accent-2: #22d3ee;
  --ok-bg: #0e2a1f;
  --ok-border: #1f6f4d;
  --ok-text: #7ee2b8;
  --err-bg: #2c1417;
  --err-border: #7f2b34;
  --err-text: #ffb3bd;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  --ring: 0 0 0 3px rgba(79, 156, 249, 0.45);
}

[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-alt: #eef2f9;
  --surface: #ffffff;
  --border: #d8e0ec;
  --text: #1f2a3a;
  --text-muted: #56657c;
  --heading: #0c1525;
  --accent: #1f6feb;
  --accent-strong: #1559c4;
  --accent-contrast: #ffffff;
  --accent-2: #0a8aa0;
  --ok-bg: #e6f6ee;
  --ok-border: #9bd8b6;
  --ok-text: #1c7a4d;
  --err-bg: #fdeaec;
  --err-border: #f0adb6;
  --err-text: #b22634;
  --shadow: 0 18px 40px -28px rgba(15, 30, 60, 0.35);
  --ring: 0 0 0 3px rgba(31, 111, 235, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  color: var(--heading);
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1rem; }

a {
  color: var(--accent-strong);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.container {
  width: min(1120px, 100% - 3rem);
  margin-inline: auto;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover { background: var(--accent-strong); }

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

.btn-block { width: 100%; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 8px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--heading);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent-contrast);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 700; }
.brand-sub { font-size: 0.74rem; color: var(--text-muted); }

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.4rem;
}
.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
}
.site-nav a:hover { color: var(--heading); text-decoration: none; }
.nav-cta {
  color: var(--accent-strong) !important;
  font-weight: 600;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-strong); }
.theme-toggle .icon { width: 20px; height: 20px; }
.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 8vw, 7rem) 0 clamp(2.5rem, 5vw, 4rem);
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% 0 auto -10%;
  height: 520px;
  background: radial-gradient(60% 60% at 30% 30%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
              radial-gradient(50% 50% at 80% 10%, color-mix(in srgb, var(--accent-2) 24%, transparent), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
.lede {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text-muted);
  max-width: 60ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 1.75rem 0 2.5rem;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 0;
  border-top: 1px solid var(--border);
  padding-top: 1.75rem;
}
.hero-stats dt { font-size: 1.35rem; font-weight: 700; color: var(--heading); }
.hero-stats dd { margin: 0.15rem 0 0; color: var(--text-muted); font-size: 0.92rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 680px; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
.section-sub { color: var(--text-muted); font-size: 1.05rem; }

/* ---------- Service cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: var(--shadow);
}
.card h3 { font-size: 1.15rem; }
.card p { margin: 0; color: var(--text-muted); }

/* ---------- Steps ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  counter-reset: step;
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}
.step-num {
  display: inline-block;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}
.step h3 { font-size: 1.1rem; }
.step p { margin: 0; color: var(--text-muted); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.about-grid p { color: var(--text-muted); }
.values {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}
.values li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  color: var(--text-muted);
}
.values strong { color: var(--heading); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2.5rem;
  align-items: start;
}
.contact-intro p { color: var(--text-muted); }
.contact-direct { font-size: 0.95rem; }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
  color: var(--heading);
}
.optional { color: var(--text-muted); font-weight: 400; }
.field input,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.field textarea { resize: vertical; min-height: 120px; }

/* Honeypot stays in the DOM but out of sight and out of the tab order. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status:empty { display: none; }
.form-result {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid;
  margin-bottom: 1.1rem;
  font-size: 0.95rem;
}
.form-result strong { font-weight: 700; }
.form-result--ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.form-result--err { background: var(--err-bg); border-color: var(--err-border); color: var(--err-text); }
.form-result a { color: inherit; text-decoration: underline; }

/* htmx request-state spinner on the submit button */
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent-contrast) 55%, transparent);
  border-top-color: var(--accent-contrast);
  animation: spin 0.7s linear infinite;
}
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.btn .btn-label { opacity: 0.7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 2.5rem 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.8rem; }
.footer-name { margin: 0; font-weight: 700; color: var(--heading); }
.footer-tag { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.footer-nav { display: flex; gap: 1.2rem; margin-left: auto; }
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--heading); text-decoration: none; }
.footer-copy {
  width: 100%;
  margin: 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .about-grid,
  .contact-grid { grid-template-columns: 1fr; }
  .site-nav { gap: 1rem; }
  .brand-sub { display: none; }
}
@media (max-width: 620px) {
  .site-nav a:not(.nav-cta) { display: none; }
  .hero-stats { grid-template-columns: 1fr; gap: 0.75rem; }
  .footer-nav { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto; }
  .btn:hover, .card:hover { transform: none; }
}
