/* ============================================================
   Tangled Group, Inc - design system
   Light SaaS style (reference: Preline "SaaS Startup" template)
   Fonts: Inter (body) + Domine (display headings)
   Palette: stone/neutral + blue primary (PREVIEW: spec-1 blue #3498db,
   original was Tailwind blue-600 #2563eb)
   ============================================================ */

:root {
  --font-display: "Domine", Georgia, "Times New Roman", serif;
  --font-sans:
    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --ink: #1c1917; /* stone-900 */
  --ink-soft: #57534e; /* stone-600 */
  --ink-muted: #78716c; /* stone-500 */
  --bg: #ffffff;
  --bg-alt: #fafaf9; /* stone-50 */
  --surface: #ffffff; /* card / panel backgrounds */
  --line: #e7e5e4; /* stone-200 */
  --line-strong: #d6d3d1; /* stone-300 */
  --primary: #3498db; /* spec-1 blue - links, accents */
  --primary-hover: #277fc0; /* spec-1 blue-strong */
  --primary-soft: #e8f4fd; /* spec-1 blue-soft */
  --primary-line: #a4d1ef; /* spec-1 blue at 45% in white */
  --primary-btn: #3498db; /* button background (white text) */
  --primary-btn-hover: #277fc0;
  --dark: #171717; /* neutral-900 */
  --header-bg: rgba(255, 255, 255, 0.86);
  --amber-bg: #fef3c7;
  --amber-ink: #b45309;
}

/* ---------- dark theme ----------
   The initial theme is set by a tiny inline script in each page's <head>
   (localStorage "tg-theme", else prefers-color-scheme) so the first paint
   is already correct; the header button toggles it (app.js initTheme).
   Components pick colors up through the variables above, so the few
   hard-coded component tweaks below are the only dark-specific rules. */

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f5f4; /* stone-100 */
  --ink-soft: #d6d3d1; /* stone-300 */
  --ink-muted: #a8a29e; /* stone-400 */
  --bg: #0c0a09; /* stone-950 */
  --bg-alt: #141210;
  --surface: #1c1917; /* stone-900 */
  --line: #292524; /* stone-800 */
  --line-strong: #44403c; /* stone-700 */
  --primary: #3498db; /* spec-1 blue (same as light, per spec-1) */
  --primary-hover: #67b2e4; /* spec-1 blue at 75% in white (lighter on dark) */
  --primary-soft: rgba(52, 152, 219, 0.12); /* spec-1 dark soft */
  --primary-line: rgba(52, 152, 219, 0.35);
  --primary-btn: #3498db;
  --primary-btn-hover: #67b2e4;
  --dark: #1c1917;
  --header-bg: rgba(12, 10, 9, 0.85);
  --amber-bg: rgba(251, 191, 36, 0.16);
  --amber-ink: #fbbf24;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  /* Drives native scrollbars + the overscroll canvas. Cal.com's embed
     also polls the body's computed color-scheme every 50ms and switches
     its iframe theme live, so the booking widget follows the site theme
     without any snippet changes. */
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
}

::selection {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- layout ---------- */

.tg-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (min-width: 768px) {
  .tg-container {
    padding: 0 1.5rem;
  }
}

.tg-section {
  padding: 4rem 0;
}
@media (min-width: 768px) {
  .tg-section {
    padding: 5.5rem 0;
  }
}
.tg-section--alt {
  background: var(--bg-alt);
}

.tg-section-head {
  max-width: 680px;
  margin: 0 auto 2.5rem;
  text-align: center;
}
@media (min-width: 768px) {
  .tg-section-head {
    margin-bottom: 3.5rem;
  }
}

.tg-page-head {
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}
@media (min-width: 768px) {
  .tg-page-head {
    padding: 5rem 0 3.5rem;
  }
}
.tg-page-head .tg-lead {
  max-width: 640px;
  margin: 1rem auto 0;
}

/* ---------- type ---------- */

.tg-h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.25rem, 4vw + 1.25rem, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
}
.tg-h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 2.5vw + 0.75rem, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.tg-h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
}
.tg-lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0;
}
.tg-muted {
  color: var(--ink-muted);
}
.tg-small {
  font-size: 0.875rem;
}

/* ---------- buttons & links ---------- */

.tg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 0.625rem;
  padding: 0.75rem 1.5rem;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}
.tg-btn:active {
  transform: translateY(1px);
}
.tg-btn--primary {
  background: var(--primary-btn);
  color: #fff;
}
.tg-btn--primary:hover {
  background: var(--primary-btn-hover);
}
.tg-btn--secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.tg-btn--secondary:hover {
  background: var(--bg-alt);
  border-color: var(--ink-muted);
}
.tg-btn--on-dark {
  background: #fff;
  color: #1c1917;
} /* fixed dark ink: bg is always white */
.tg-btn--on-dark:hover {
  background: #f5f5f4;
}
.tg-btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 0.5rem;
}
.tg-btn--lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

.tg-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.tg-link:hover {
  text-decoration: underline;
}

/* ---------- cards ---------- */

.tg-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.75rem;
}
.tg-card--hover {
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}
.tg-card--hover:hover {
  border-color: var(--line-strong);
  box-shadow: 0 16px 32px -20px rgba(28, 25, 23, 0.25);
  transform: translateY(-2px);
}
.tg-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.5rem;
}
.tg-card p:last-child {
  margin-bottom: 0;
}
.tg-card p {
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 0 0 1rem;
}

.tg-icon-tile {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  border-radius: 0.625rem;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}

/* ---------- checklist ---------- */

.tg-check {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.875rem;
}
.tg-check li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  color: var(--ink-soft);
  line-height: 1.55;
}
.tg-check-ico {
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  margin-top: 0.15rem;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
}
.tg-check-ico svg {
  width: 0.75rem;
  height: 0.75rem;
}

/* ---------- stats ---------- */

.tg-stats {
  border-block: 1px solid var(--line);
  background: var(--bg);
}
.tg-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem 1rem;
  padding: 2.25rem 0;
}
@media (min-width: 768px) {
  .tg-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 2.75rem 0;
  }
}
.tg-stat {
  text-align: center;
}
.tg-stat-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 2.5vw, 2.5rem);
  line-height: 1.1;
  color: var(--ink);
}
.tg-stat-cap {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* ---------- trust bar ---------- */

.tg-trust {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}
.tg-trust-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.5rem 0;
}
@media (min-width: 640px) {
  .tg-trust-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}
@media (min-width: 1024px) {
  .tg-trust-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.tg-trust-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.tg-trust-item svg {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary);
  margin-top: 0.125rem;
}
.tg-trust-item strong {
  display: block;
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 600;
}
.tg-trust-item span {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.45;
  margin-top: 0.125rem;
}

/* ---------- steps ---------- */

.tg-steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  counter-reset: tgstep;
}
@media (min-width: 768px) {
  .tg-steps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}
@media (min-width: 1024px) {
  .tg-steps-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.tg-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.5rem;
}
.tg-step-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.tg-step h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.tg-step p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0;
}

/* ---------- table ---------- */

.tg-table-wrap {
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: auto;
  background: var(--surface);
}
.tg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 640px;
}
.tg-table th,
.tg-table td {
  padding: 0.9375rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-soft);
}
.tg-table thead th {
  background: var(--bg-alt);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
}
.tg-table thead th:first-child {
  width: 30%;
}
.tg-table tbody tr:last-child td {
  border-bottom: 0;
}
.tg-table td:first-child {
  color: var(--ink);
  font-weight: 600;
}
.tg-table tbody th {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- pricing ---------- */

.tg-price-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 2rem;
  display: flex;
  flex-direction: column;
}
.tg-price-card--featured {
  border: 2px solid var(--primary);
}
.tg-price-from {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin: 0 0 0.25rem;
}
.tg-price-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: 1.1;
  color: var(--ink);
}
.tg-price-num small {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-muted);
  font-family: var(--font-sans);
}
.tg-price-desc {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0.75rem 0 1.25rem;
}
.tg-price-card .tg-check {
  margin: 0 0 1.5rem;
}
.tg-price-card .tg-btn {
  margin-top: auto;
}

/* ---------- terms box ---------- */

.tg-terms {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.5rem 1.75rem;
}
.tg-terms-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin: 0 0 1rem;
}
.tg-terms ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.625rem;
}
@media (min-width: 768px) {
  .tg-terms ul {
    grid-template-columns: 1fr 1fr;
    column-gap: 2rem;
  }
}
.tg-terms li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.tg-terms li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.5rem;
  height: 2px;
  background: var(--primary);
}

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

.tg-faq {
  max-width: 760px;
  margin: 0 auto;
}
.tg-faq-item {
  border-bottom: 1px solid var(--line);
}
.tg-faq-item:first-child {
  border-top: 1px solid var(--line);
}
.tg-faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.125rem 0;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.tg-faq-icon {
  flex: none;
  color: var(--ink-muted);
  transition: transform 0.2s ease;
}
.tg-faq-item.open .tg-faq-icon {
  transform: rotate(180deg);
}
.tg-faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}
.tg-faq-a > div {
  overflow: hidden;
}
.tg-faq-item.open .tg-faq-a {
  grid-template-rows: 1fr;
}
.tg-faq-a p {
  padding: 0 0 1.25rem;
  color: var(--ink-soft);
  line-height: 1.7;
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- CTA band ---------- */

.tg-cta-band {
  background: var(--dark);
  border: 1px solid transparent;
  border-radius: 1.5rem;
  padding: 3rem 1.5rem;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
@media (min-width: 768px) {
  .tg-cta-band {
    padding: 4rem 3rem;
  }
}
.tg-cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      600px 200px at 20% 0%,
      rgba(37, 99, 235, 0.25),
      transparent 70%
    ),
    radial-gradient(
      600px 200px at 80% 100%,
      rgba(37, 99, 235, 0.18),
      transparent 70%
    );
  pointer-events: none;
}
.tg-cta-band > * {
  position: relative;
}
.tg-cta-band h2 {
  color: #fff;
}
.tg-cta-band p {
  color: #d6d3d1;
  max-width: 560px;
  margin: 0.75rem auto 1.75rem;
  line-height: 1.7;
  font-size: 1rem;
}
.tg-cta-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
}
@media (min-width: 640px) {
  .tg-cta-actions {
    flex-direction: row;
    justify-content: center;
  }
}
.tg-risk-strip {
  margin-top: 1.75rem;
  font-size: 0.85rem;
  color: #a8a29e;
}
.tg-cta-band .tg-link {
  color: #a4d1ef;
}
/* In dark mode the page background is near-black, so the band gets a hairline. */
html[data-theme="dark"] .tg-cta-band {
  border-color: var(--line);
}

/* ---------- hero window mockup ---------- */

.tg-hero-visual {
  position: relative;
  max-width: 880px;
  margin: 3rem auto 0;
}
.tg-window {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 24px 48px -24px rgba(28, 25, 23, 0.28);
  overflow: hidden;
  text-align: left;
}
.tg-window-bar {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}
.tg-window-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--line-strong);
}
.tg-window-title {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 500;
}
.tg-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.25rem;
}
@media (max-width: 640px) {
  .tg-board {
    grid-template-columns: 1fr;
  }
}
.tg-col-title {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 0.625rem;
}
.tg-task {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 0.625rem;
  /* transform transition used by the board loop (app.js): full-board FLIP */
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.tg-task:last-child {
  margin-bottom: 0;
}
.tg-task-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex: none;
  transition: background-color 0.45s ease;
}
.tg-chip {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  margin-left: auto;
}
.tg-float {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: 0 16px 40px -16px rgba(28, 25, 23, 0.3);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  display: none;
  align-items: center;
  gap: 0.625rem;
  z-index: 2;
}
.tg-float svg {
  flex: none;
  color: var(--primary);
}
.tg-float strong {
  color: var(--ink);
  font-weight: 600;
  display: block;
  font-size: 0.8rem;
  line-height: 1.3;
}
.tg-float--1 {
  left: -1.75rem;
  top: 1.5rem;
}
.tg-float--2 {
  right: -1.75rem;
  bottom: 2rem;
}
@media (min-width: 1024px) {
  .tg-float {
    display: inline-flex;
  }
}

/* ---------- case story ---------- */

.tg-story {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .tg-story {
    grid-template-columns: 320px 1fr;
  }
}
.tg-story-num {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
}
@media (min-width: 768px) {
  .tg-story-num {
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
}
.tg-big {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3rem, 6vw, 4.5rem);
  line-height: 1;
  color: var(--primary);
}
.tg-story-num p {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
  max-width: 220px;
}
.tg-story-body {
  padding: 2rem 1.5rem;
}
@media (min-width: 768px) {
  .tg-story-body {
    padding: 2.5rem;
  }
}

/* ---------- header ---------- */

.tg-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.tg-header.is-scrolled {
  box-shadow: 0 4px 16px -8px rgba(0, 0, 0, 0.12);
}
.tg-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 64px;
}
.tg-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.0625rem;
  flex: none;
}
.tg-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: block;
}

.tg-nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tg-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}
.tg-nav-link:hover {
  color: var(--ink);
  background: var(--bg-alt);
}
.tg-nav-link.is-active {
  color: var(--ink);
  font-weight: 600;
}
.tg-chev {
  transition: transform 0.2s ease;
}
.tg-dropdown {
  position: relative;
}
.tg-dropdown.open .tg-chev {
  transform: rotate(180deg);
}
.tg-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 260px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.18);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0.15s;
  z-index: 50;
}
.tg-dropdown.open .tg-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.tg-dropdown-menu a {
  display: block;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  text-decoration: none;
}
.tg-dropdown-menu a:hover {
  background: var(--bg-alt);
}
.tg-dropdown-menu a strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
.tg-dropdown-menu a span {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-muted);
}
.tg-dropdown-menu .dd-divider {
  height: 1px;
  background: var(--line);
  margin: 0.5rem 0;
}

.tg-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
}
.tg-header-cta {
  flex: none;
}

/* theme toggle (icon button, visible at all breakpoints) */
.tg-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0.625rem;
  background: none;
  /* Icon color is deliberately literal per theme, NOT var(--ink-soft):
     when html[data-theme] flips at runtime, some browsers fail to re-resolve
     custom properties on descendants (the icon kept the previous theme's
     dark color and disappeared on the dark header). Attribute-scoped rules
     are a plain cascade switch - the same mechanism as the icon display
     swap below - and always apply. Values mirror --ink-soft / --ink:
     light #57534e / #1c1917, dark #d6d3d1 / #f5f5f4. `color` is also kept
     out of the transition list for the same reason. */
  color: #57534e;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.tg-theme-toggle:hover {
  color: var(--ink);
  background: var(--bg-alt);
  border-color: var(--line);
}
html[data-theme="dark"] .tg-theme-toggle {
  color: #d6d3d1;
}
html[data-theme="dark"] .tg-theme-toggle:hover {
  color: #f5f5f4;
}
.tg-theme-toggle svg {
  display: none;
}
.tg-theme-toggle .tg-icon-moon {
  display: block;
} /* light mode: offer dark */
html[data-theme="dark"] .tg-theme-toggle .tg-icon-moon {
  display: none;
}
html[data-theme="dark"] .tg-theme-toggle .tg-icon-sun {
  display: block;
}

/* burger + mobile menu */
.tg-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  z-index: 110;
}
.tg-burger span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 2px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}
.tg-burger.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.tg-burger.open span:nth-child(2) {
  opacity: 0;
}
.tg-burger.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.tg-mobile-menu {
  display: none;
  border-top: 1px solid var(--line);
}
.tg-mobile-menu.open {
  display: block;
}
.tg-mobile-menu nav {
  padding: 1rem 0 1.25rem;
  display: grid;
  gap: 0.25rem;
}
.tg-mobile-menu > nav > a:not(.tg-btn) {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
}
.tg-mobile-menu > nav > a:not(.tg-btn).is-active {
  color: var(--primary);
}
.tg-mm-group {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.5rem;
}
.tg-mm-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}
.tg-mm-group a {
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.25rem 0;
}
.tg-mm-group a:hover {
  color: var(--ink);
}
/* CTA in the mobile menu - full-width primary button, same styling as the
   design system buttons (blue-600, white text, centered). */
.tg-mobile-menu .tg-btn {
  display: flex;
  width: 100%;
  margin-top: 1rem;
  padding: 0.875rem 1.5rem;
  font-size: 0.95rem;
  border-radius: 0.625rem;
}

@media (max-width: 1023px) {
  .tg-nav {
    display: none;
  }
  .tg-header-cta {
    display: none;
  }
  .tg-burger {
    display: flex;
  }
  /* Nav + CTA are hidden, so space-between would park the actions group in
     the middle of the header. The auto margin absorbs the free space
     instead, keeping the theme toggle directly next to the burger on the right. */
  .tg-header-actions {
    margin-left: auto;
  }
}

/* ---------- footer ---------- */

.tg-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: auto;
}
.tg-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 3rem 0 2.5rem;
}
@media (min-width: 768px) {
  .tg-footer-grid {
    grid-template-columns: 2fr 1fr;
  }
}
@media (min-width: 1024px) {
  .tg-footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1.4fr;
    gap: 2.5rem;
  }
}
.tg-footer-blurb {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 1rem 0 1.25rem;
  max-width: 320px;
}
.tg-footer h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin: 0 0 1rem;
}
.tg-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.625rem;
}
.tg-footer-links a {
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-decoration: none;
}
.tg-footer-links a:hover {
  color: var(--primary);
}
.tg-footer-contact li {
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.55;
}
.tg-footer-contact a {
  font-size: 0.875rem;
}
.tg-footer .tg-muted {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
}
.tg-social {
  display: flex;
  gap: 0.5rem;
}
.tg-social a img {
  display: block;
}
html[data-theme="dark"] .tg-social a img {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}
.tg-social a {
  width: 34px;
  height: 34px;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-soft);
}
.tg-social a:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.tg-footer-bottom {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}
@media (min-width: 768px) {
  .tg-footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
.tg-footer-legal a {
  color: var(--ink-muted);
  text-decoration: none;
}
.tg-footer-legal a:hover {
  color: var(--primary);
}

/* ---------- form ---------- */

.tg-form {
  display: grid;
  gap: 1rem;
}
.tg-form-row {
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) {
  .tg-form-row {
    grid-template-columns: 1fr 1fr;
  }
}
.tg-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.375rem;
}
.tg-input,
.tg-select,
.tg-textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.625rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--surface);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.tg-input::placeholder,
.tg-textarea::placeholder {
  color: var(--ink-muted);
}
.tg-input:focus,
.tg-select:focus,
.tg-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.tg-textarea {
  min-height: 140px;
  resize: vertical;
}
.tg-form-note {
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0;
}
.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* Cal.com inline embed - the embed div uses height:100%, so the wrapper
   must define the height. Month view renders ~600px tall. */
.tg-cal {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--surface);
  /* height: 640px; */
}
/* The iframe only paints its own (themed) background once Cal's app
   loads - this stops a white flash behind it on dark. */
.tg-cal iframe {
  background: var(--surface);
  /* min-height: 759px !important; */
  /* height: auto !important; */
}
@media (max-width: 640px) {
  .tg-cal {
    height: auto;
  }
}

/* ---------- TODO placeholder ---------- */

.tg-todo {
  border: 2px dashed var(--line-strong);
  background: var(--bg-alt);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}
.tg-todo-label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-ink);
  background: var(--amber-bg);
  border-radius: 9999px;
  padding: 0.2rem 0.625rem;
  margin-bottom: 0.5rem;
}

/* ---------- prose (legal pages) ---------- */

.tg-prose {
  max-width: 760px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.75;
}
.tg-prose h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  color: var(--ink);
  margin: 0 0 0.5rem;
  line-height: 1.2;
}
.tg-prose .tg-prose-updated {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}
.tg-prose h2 {
  font-size: 1.25rem;
  font-weight: 650;
  color: var(--ink);
  margin: 2rem 0 0.75rem;
}
.tg-prose p {
  margin: 0 0 1rem;
}
.tg-prose ul {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
  list-style: disc;
}
.tg-prose li {
  margin-bottom: 0.375rem;
}
.tg-prose a {
  color: var(--primary);
}
.tg-prose strong {
  color: var(--ink);
}

/* ---------- misc ---------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-size: 0.875rem;
}
.skip-link:focus {
  top: 1rem;
}

.tg-main {
  flex: 1;
}

/* AI wording toggle - see app.js AI_AUDIT_PASSED flag and CLAIMS.md #16 */
.ai-wording--primary {
  display: none !important;
}
html.ai-audit-passed .ai-wording--primary {
  display: revert !important;
}
html.ai-audit-passed .ai-wording--fallback {
  display: none !important;
}

/* 404 */
.tg-404 {
  text-align: center;
  padding: 5rem 0;
}
.tg-404-code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 6rem);
  font-weight: 600;
  color: var(--line-strong);
  line-height: 1;
}

/* ---------- hero entrance (staggered fade-up on load) ----------
   Scoped to the home hero (only index.html uses .tg-section--0).
   Six direct children: pill, h1, lead, CTA row, trust line, hero visual. */

@keyframes tg-hero-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tg-section--0 > .tg-container > * {
  animation: tg-hero-in 0.55s ease-out both;
}
.tg-section--0 > .tg-container > *:nth-child(1) {
  animation-delay: 0.05s;
}
.tg-section--0 > .tg-container > *:nth-child(2) {
  animation-delay: 0.13s;
}
.tg-section--0 > .tg-container > *:nth-child(3) {
  animation-delay: 0.21s;
}
.tg-section--0 > .tg-container > *:nth-child(4) {
  animation-delay: 0.29s;
}
.tg-section--0 > .tg-container > *:nth-child(5) {
  animation-delay: 0.37s;
}
.tg-section--0 > .tg-container > *:nth-child(6) {
  animation-delay: 0.45s;
}

/* ---------- scroll reveal ----------
   JS (app.js initReveal) adds .tg-reveal on load, then .is-visible
   the first time the element enters the viewport. [data-reveal-group]
   containers get a per-child --reveal-delay set by JS for staggering.
   Uses an animation (not a transition) so it never fights the
   hover transitions on the same elements. */

@keyframes tg-reveal-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tg-reveal {
  opacity: 0;
}
.tg-reveal.is-visible {
  animation: tg-reveal-in 0.6s ease both;
  animation-delay: var(--reveal-delay, 0ms);
}

/* ---------- reduced motion ---------- */

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