/* Public-site tokens and component rules: repository DESIGN.md. */
:root {
  --tf-bg: #07111d;
  --tf-surface: #112337;
  --tf-surface-raised: #192e43;
  --tf-text: #f5faff;
  --tf-text-muted: #b9cbd9;
  --tf-accent: #9edfe9;
  --tf-accent-hover: #b8edf3;
  --tf-accent-active: #7fc8d5;
  --tf-light: #f7fafc;
  --tf-light-text: #17283b;
  --tf-light-muted: #505c6a;
  --tf-border-dark: #4c687c;
  --tf-border-light: #788b9a;
  --tf-error: #a52638;
  --tf-error-on-dark: #ffb2ba;
  --tf-success: #176b4f;
  --tf-radius-control: 12px;
  --tf-radius-card: 16px;
  --tf-radius-panel: 20px;
  --tf-space-1: 4px;
  --tf-space-2: 8px;
  --tf-space-3: 12px;
  --tf-space-4: 16px;
  --tf-space-6: 24px;
  --tf-space-8: 32px;
  --tf-space-12: 48px;
  --scene-ink: var(--tf-bg);
  --scene-mid: var(--tf-surface);
  --scene-raised: var(--tf-surface-raised);
  --scene-text: var(--tf-text);
  --scene-muted: var(--tf-text-muted);
  --scene-accent: var(--tf-accent);
}

body { background: var(--tf-bg); color: var(--tf-text); }
body.home main { background: var(--tf-bg); color: var(--tf-text); }
body.home .hero-cinematic .lead { font-size: 1rem; line-height: 1.65; }
body.home main .section .split-heading > p,
.why-heading p,
.tf-product-copy p { color: var(--tf-text-muted); font-size: 1rem; line-height: 1.65; }
body.home main .section h2 { font-size: clamp(1.875rem, 3vw, 3rem); }
.why-card h3,
.platform-audience-card h3 { font-size: 1.25rem; }
.why-card p,
.platform-audience-card p { font-size: 0.9375rem; line-height: 1.65; }

.button,
.nav-cta.button.cyan,
.tf-page-cta .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--tf-space-2);
  min-height: 48px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
body.home .hero-actions .button.dark,
.tf-page-cta .button.cyan,
.nav-cta.button.cyan {
  background: var(--tf-accent);
  border: 1px solid var(--tf-accent);
  color: var(--tf-bg);
}
body.home .hero-actions .button.dark:hover,
.tf-page-cta .button.cyan:hover,
.nav-cta.button.cyan:hover {
  background: var(--tf-accent-hover);
  border-color: var(--tf-accent-hover);
  color: var(--tf-bg);
  transform: translateY(-2px);
}
.button:active,
.nav-cta.button.cyan:active,
.tf-quick-action:active,
.menu:active,
.tf-product-tab:active { transform: translateY(1px) scale(.98); }
body.home .hero-actions .button.dark:active,
.tf-page-cta .button.cyan:active,
.nav-cta.button.cyan:active { background: var(--tf-accent-active); border-color: var(--tf-accent-active); }
.button:focus-visible,
.nav-cta.button.cyan:focus-visible,
.tf-quick-action:focus-visible,
.menu:focus-visible,
.tf-product-tab:focus-visible,
.text-link:focus-visible {
  outline: 3px solid var(--tf-accent);
  outline-offset: 3px;
}
.button:disabled,
.button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.text-link { text-decoration: underline; text-underline-offset: 4px; }
.tf-page-cta { display: flex; margin: var(--tf-space-12) 0 var(--tf-space-8); }

.why-card,
.platform-audience-card,
.tf-product-tab,
.tf-products-panels { border-radius: var(--tf-radius-card); }
.why-card,
.platform-audience-card { background: var(--tf-surface); border-color: var(--tf-border-dark); }
@media (hover: hover) {
  .why-card:hover,
  .platform-audience-card:hover { background: var(--tf-surface-raised); border-color: var(--tf-accent); color: var(--tf-text); }
  .why-card:hover p,
  .platform-audience-card:hover p { color: var(--tf-text-muted); }
  .why-card:hover .why-icon { color: var(--tf-accent); }
}
.tf-product-tab-icon,
.tf-product-tab:nth-child(4n+2) .tf-product-tab-icon,
.tf-product-tab:nth-child(4n+3) .tf-product-tab-icon,
.tf-product-tab:nth-child(4n+4) .tf-product-tab-icon { background: var(--tf-surface-raised); color: var(--tf-accent); }
.tf-product-tab-title,
.tf-product-features li { font-size: .875rem; }
#capabilities .tf-product-tab-title { font-size: .875rem; line-height: 1.5; }
#capabilities .tf-product-tab-title::after { content: none; }
#capabilities .tf-product-copy p { font-size: 1rem; line-height: 1.65; }
.tf-product-tab:hover { border-color: var(--tf-accent); }
.tf-product-tab.is-active { border-color: var(--tf-accent); }
#capabilities .tf-products-tabs { padding-top: 10px; padding-bottom: 8px; margin-top: -10px; margin-bottom: 10px; }
#capabilities .tf-product-tab:focus-visible { outline-offset: -4px; }
.tf-quick-action { border-radius: var(--tf-radius-control); background: var(--tf-surface); color: var(--tf-text); }
.tf-quick-action[aria-expanded="true"] { background: var(--tf-surface-raised); border-color: var(--tf-accent); }
.tf-quick-action:hover { background: var(--tf-surface-raised); }
.tf-wechat-panel { border-radius: var(--tf-radius-control); background: var(--tf-surface); color: var(--tf-text); }
.tf-wechat-panel:not([hidden]) { animation: tf-panel-in 180ms ease both; }
.tf-wechat-panel.is-closing { animation: tf-panel-out 180ms ease both; pointer-events: none; }
@keyframes tf-panel-in { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
@keyframes tf-panel-out { from { opacity: 1; translate: 0 0; } to { opacity: 0; translate: 0 8px; } }

.document-page,
.document-page .wp-block-post-content { min-width: 0; overflow-wrap: anywhere; }
.document-page .wp-block-post-content p { font-size: 1rem; line-height: 1.65; }
.document-page .wp-block-post-content a { text-underline-offset: 4px; }
.footer-top .text-link { display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 801px) {
  footer .footer-top,
  footer .footer-bottom:not(.footer-contact) { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: var(--tf-space-4); }
  footer .footer-top > p,
  footer .footer-bottom:not(.footer-contact) > span:nth-child(2) { justify-self: center; text-align: center; }
  footer .footer-top > .text-link,
  footer .footer-bottom:not(.footer-contact) > a:last-child { justify-self: end; }
}
@media (max-width: 800px) {
  footer.container { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  footer .footer-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--tf-space-4); }
  footer .footer-top > .brand { grid-column: 1; grid-row: 1; }
  footer .footer-top > .text-link { grid-column: 2; grid-row: 1; justify-self: end; }
  footer .footer-top > p { grid-column: 1 / -1; grid-row: 2; justify-self: center; text-align: center; }
}

@media (max-width: 980px) {
  body.home .nav,
  body:not(.home):not(.wp-admin) .nav { display: flex; width: calc(100% - 40px); gap: 12px; }
  .nav .brand,
  body.home .nav .brand { flex: 0 1 auto; min-width: 0; max-width: calc(100% - 60px); margin-right: auto; }
  .nav .brand img { max-width: 100%; }
  .menu,
  body.home .menu { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; padding: 0; border-radius: var(--tf-radius-control); cursor: pointer; }
  .menu[aria-expanded="true"] { background: var(--tf-surface-raised); color: var(--tf-accent); }
  .nav nav a,
  body.home .nav nav a { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; font-size: .9375rem; }
  .nav nav.open,
  body.home .nav nav.open { animation: tf-menu-in 180ms ease both; }
  .nav nav.is-closing,
  body.home .nav nav.is-closing { display: flex; animation: tf-menu-out 180ms ease both; pointer-events: none; }
}
@keyframes tf-menu-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes tf-menu-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 560px) {
  .nav .brand-name,
  .nav .brand-divider { display: none; }
  .nav .brand img { width: min(124px, 100%); }
  body.home .hero-actions .button.dark,
  body.home .hero-actions .text-link { min-height: 48px; font-size: .9375rem; }
  .tf-product-tab-title { font-size: .875rem; }
  #capabilities .tf-products-tabs { margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .nav-cta.button.cyan,
  .tf-quick-action,
  .menu,
  .tf-product-tab { transition: none; }
  .tf-wechat-panel:not([hidden]),
  .tf-wechat-panel.is-closing,
  .nav nav.open,
  .nav nav.is-closing,
  body.home .nav nav.open,
  body.home .nav nav.is-closing { animation: none; }
}

/* Keep the primary action in the photographed opening, including on phones. */
body.home .hero-cinematic .hero-actions { display: flex; flex-wrap: wrap; margin-top: var(--tf-space-8); gap: var(--tf-space-3); }
body.home .hero-cinematic .hero-actions .button.dark {
  min-height: 48px;
  height: auto;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--tf-accent);
  border-color: var(--tf-accent);
  color: var(--tf-bg);
  font-size: .9375rem;
}
body.home .hero-cinematic .hero-actions .text-link {
  min-height: 48px;
  height: auto;
  padding: 11px 20px;
  border-radius: 999px;
  border-color: var(--tf-border-dark);
  color: var(--tf-text);
  font-size: .9375rem;
}
body.home .hero-cinematic .hero-actions .text-link:hover { border-color: var(--tf-accent); background: var(--tf-surface-raised); }
body.home .hero-cinematic .hero-actions .text-link:active { background: var(--tf-surface); transform: translateY(1px); }

@media (max-width: 980px) {
  .nav, body.home .nav, body:not(.home):not(.wp-admin) .nav { min-width: 0; }
  .nav-cta.button.cyan { display: none; }
  .nav .brand, body.home .nav .brand { overflow: hidden; }
  .nav nav, body.home .nav nav { max-width: calc(100vw - 40px); }
  .nav nav a, body.home .nav nav a { overflow-wrap: anywhere; }
}
@media (max-width: 560px) {
  body.home .hero-cinematic .hero-inner { padding-top: 92px; padding-bottom: 52px; }
  body.home .hero-cinematic h1 { margin-bottom: var(--tf-space-4); }
  body.home .hero-cinematic h1 .hero-position { text-wrap: balance; }
  body.home .hero-cinematic .lead { font-size: 1rem; line-height: 1.65; }
  body.home .hero-cinematic .hero-actions { margin-top: var(--tf-space-6); }
}
@media (max-width: 240px) {
  .nav, body.home .nav, body:not(.home):not(.wp-admin) .nav { gap: 8px; }
  .nav .brand, body.home .nav .brand { max-width: calc(100% - 52px); }
  .nav .brand img, body.home .nav .brand img { flex: 0 1 auto; width: min(88px, 100%); }
  .menu, body.home .menu { flex-basis: 44px; width: 44px; height: 44px; }
  body.home .hero-cinematic h1 .hero-company { font-size: clamp(1.25rem, 10vw, 1.5rem); }
  body.home .hero-cinematic h1 .hero-position { font-size: 1.375rem; overflow-wrap: anywhere; }
  body.home .hero-cinematic .hero-actions .button.dark,
  body.home .hero-cinematic .hero-actions .text-link { width: 100%; }
}

/* The 404 page uses the same action language as the rest of the site. */
.tf-not-found p { max-width: 58ch; margin-bottom: var(--tf-space-6); }
.tf-not-found .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid var(--tf-accent);
  border-radius: 999px;
  background: var(--tf-accent);
  color: var(--tf-bg);
  font-size: .9375rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.tf-not-found .wp-block-button__link:hover { background: var(--tf-accent-hover); border-color: var(--tf-accent-hover); }
.tf-not-found .wp-block-button__link:active { background: var(--tf-accent-active); border-color: var(--tf-accent-active); transform: translateY(1px); }
.tf-not-found .wp-block-button__link:focus-visible { outline: 3px solid var(--tf-accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .tf-not-found .wp-block-button__link { transition: none; }
}
