/* Truley Sentinel — support site shared styles
   Plain CSS. No build step, no framework, no JS dependency.

   Design tokens mirror the truley.AI marketing site
   (customer-support-solutions/src/index.css + tailwind.config.ts)
   so this site reads as part of the same product family. */

/* ---------------------------------------------------------------
   Tokens
   --------------------------------------------------------------- */
:root {
  /* Base — HSL triplets, same values as the marketing site :root */
  --background: 0 0% 100%;
  --foreground: 0 0% 3%;

  --primary: 217 91% 60%;
  --primary-foreground: 0 0% 100%;
  --primary-dark: 224 76% 48%;

  /* Same hue/saturation as --primary, one lightness step down. Used only where
     the blue carries text (links, nav, the active language chip): --primary at
     60% is 3.6:1 on white, which fails WCAG AA. Decorative uses of the blue
     (hero glow, markers, borders, focus ring) keep the exact --primary value so
     the page still reads as the marketing site. */
  --link: 217 91% 50%;

  --secondary: 180 86% 70%;

  --muted: 0 0% 96%;
  /* Marketing site uses 45%; darkened to 42% so secondary text clears WCAG AA
     (4.5:1) on the muted footer / note-box surfaces too, not just on white. */
  --muted-foreground: 0 0% 42%;

  --accent: 217 91% 95%;
  --border: 0 0% 90%;

  --radius: 0.75rem;

  --gradient-brand: linear-gradient(
    135deg,
    hsl(var(--primary)),
    hsl(var(--secondary))
  );

  --shadow-card: 0 1px 3px 0 hsl(var(--primary) / 0.1),
    0 1px 2px 0 hsl(var(--primary) / 0.06);

  --transition-standard: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --container: 80rem; /* max-w-7xl */
  --prose: 56rem; /* max-w-4xl */
  --header-height: 4.25rem;
}

/* ---------------------------------------------------------------
   Reset / base
   --------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: "Jost", "Noto Sans TC", system-ui, -apple-system,
    "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Chinese text optimisation — matches the marketing site */
:lang(zh) {
  letter-spacing: 0.02em;
}

h1,
h2,
h3 {
  color: hsl(var(--foreground));
  letter-spacing: -0.02em;
}

h1 {
  font-weight: 700;
  line-height: 1.1;
}

h2 {
  font-weight: 700;
  line-height: 1.25;
}

h3 {
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: normal;
}

p {
  line-height: 1.65;
}

a {
  color: hsl(var(--link));
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:focus-visible,
:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Anchor targets clear the sticky header */
[id] {
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 1024px) {
  .container {
    padding: 0 3rem;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.625rem 1.25rem;
  background: hsl(var(--link));
  color: hsl(var(--primary-foreground));
  font-weight: 500;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
  text-decoration: none;
}

/* ---------------------------------------------------------------
   Header
   --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsl(var(--background) / 0.85);
  border-bottom: 1px solid hsl(var(--primary) / 0.1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header {
    background: hsl(var(--background) / 0.98);
  }
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-height);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
  color: hsl(var(--link));
}

.brand picture {
  display: flex;
  flex: none;
}

/* Fixed height, intrinsic width — the <picture> swaps the full truley.AI
   lockup for the square mark on narrow screens. */
.brand__logo {
  display: block;
  height: 1.625rem;
  width: auto;
  flex: none;
}

.brand__divider {
  width: 1px;
  height: 1.125rem;
  background: hsl(var(--border));
  flex: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  transition: color var(--transition-standard),
    background-color var(--transition-standard);
}

.site-nav a:hover {
  color: hsl(var(--link));
  background: hsl(var(--accent) / 0.8);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: hsl(var(--link));
  background: hsl(var(--accent));
}

/* Language switch pill */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.1875rem 0.5rem 0.1875rem 0.6875rem;
  border: 1px solid hsl(var(--primary) / 0.3);
  border-radius: 9999px;
  background: hsl(var(--primary) / 0.05);
  color: hsl(var(--link));
  white-space: nowrap;
}

.lang-switch__icon {
  width: 1rem;
  height: 1rem;
  margin-right: 0.25rem;
  flex: none;
}

.lang-switch__current,
.lang-switch a {
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
}

.lang-switch__current {
  background: hsl(var(--link));
  color: hsl(var(--primary-foreground));
}

.lang-switch a {
  color: hsl(var(--muted-foreground));
  transition: color var(--transition-standard),
    background-color var(--transition-standard);
}

.lang-switch a:hover {
  color: hsl(var(--link));
  background: hsl(var(--primary) / 0.1);
  text-decoration: none;
}

/* ---------------------------------------------------------------
   Page hero — mirrors PageHero.tsx (secondary variant)
   --------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 46vh;
  padding: 5rem 0 4.5rem;
  text-align: center;
  background: radial-gradient(
      36rem 36rem at 50% 50%,
      hsl(var(--primary) / 0.09),
      transparent 70%
    ),
    hsl(var(--background));
}

/* Dot grid overlay */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle,
    hsl(var(--foreground) / 0.12) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
  opacity: 0.4;
  pointer-events: none;
}

/* Hairline divider at the bottom edge */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    hsl(var(--border)),
    transparent
  );
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  animation: hero-fade-in 0.5s ease-out both;
}

.hero h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 5vw, 3.75rem);
}

.hero__subtitle {
  max-width: 42rem;
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: 1.7;
  color: hsl(var(--muted-foreground));
}

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

/* ---------------------------------------------------------------
   Content
   --------------------------------------------------------------- */
.content {
  padding: 4rem 0 5rem;
}

@media (min-width: 1024px) {
  .content {
    padding: 6rem 0 7rem;
  }
}

.prose {
  max-width: var(--prose);
  margin: 0 auto;
}

.prose > section + section {
  margin-top: 2.5rem;
}

.prose h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}

.prose h3 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.125rem;
}

.prose p {
  margin: 0 0 1rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.8;
}

.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.5rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.8;
}

.prose li::marker {
  color: hsl(var(--primary));
}

.prose a {
  font-weight: 500;
}

.prose a:hover {
  text-decoration: underline;
}

.lede {
  font-size: 1.125rem;
}

.meta-line {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.contact-email {
  font-weight: 600;
}

.note-box {
  margin: 2rem 0 0;
  padding: 1rem 1.25rem;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

.note-box p {
  margin: 0;
  font-size: 0.9375rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.back-link svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.prose__footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--border));
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.site-footer {
  background: hsl(var(--muted));
  border-top: 1px solid hsl(var(--border));
  padding: 3rem 0;
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}

.site-footer__brand p {
  margin: 0.5rem 0 0;
  max-width: 24rem;
  color: hsl(var(--muted-foreground));
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.site-footer__links a {
  color: hsl(var(--muted-foreground));
  transition: color var(--transition-standard);
}

.site-footer__links a:hover {
  color: hsl(var(--link));
}

.site-footer__bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--border));
}

.site-footer__bottom p {
  margin: 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (max-width: 780px) {
  .site-header__inner {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin-left: -0.5rem;
  }

  .site-nav a {
    padding: 0.375rem 0.5rem;
  }

  .hero {
    min-height: 0;
    padding: 3.5rem 0 3rem;
  }

  .hero__subtitle {
    font-size: 1.0625rem;
  }

  .content {
    padding: 3rem 0 4rem;
  }

  .prose h2 {
    font-size: 1.3125rem;
  }
}

/* Keep the brand and the language pill on one row down to 320px. */
@media (max-width: 400px) {
  .container {
    padding: 0 1.125rem;
  }

  .brand {
    gap: 0.5rem;
    font-size: 0.9375rem;
  }

  .brand__logo {
    height: 1.5rem;
  }

  .lang-switch {
    padding-left: 0.5rem;
  }

  .lang-switch__icon {
    margin-right: 0.125rem;
  }

  .lang-switch__current,
  .lang-switch a {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
