/* =====================================================================
   TimeTech design system: one type scale, one button system, calm motion.
   Loaded LAST on every page, so it overrides the older page stylesheets.
   To change a size site-wide, change the token here, not in a page file.
   ===================================================================== */

:root {
  /* Type scale (16px base). Headline sizes shrink smoothly on small screens. */
  --fs-xs: 0.8125rem;                                   /* 13px  labels, badges        */
  --fs-sm: 0.9375rem;                                   /* 15px  card text, captions   */
  --fs-base: 1rem;                                      /* 16px  body text             */
  --fs-long: 1.0625rem;                                 /* 17px  article reading text  */
  --fs-md: 1.125rem;                                    /* 18px  lead / subtitles      */
  --fs-lg: 1.25rem;                                     /* 20px  card titles           */
  --fs-xl: 1.5rem;                                      /* 24px  article h2            */
  --fs-2xl: clamp(1.75rem, 1.45rem + 1.2vw, 2.25rem);   /* 28→36 section titles        */
  --fs-3xl: clamp(2rem, 1.5rem + 2.2vw, 3rem);          /* 32→48 page titles (h1)      */

  --lh-tight: 1.2;
  --lh-snug: 1.35;
  --lh-body: 1.65;

  /* Weights: light for big display text (brand look), regular for reading, medium for UI */
  --fw-display: 300;
  --fw-body: 400;
  --fw-ui: 500;
  --fw-strong: 600;

  /* Buttons */
  --btn-h: 48px;
  --btn-h-lg: 52px;
  --btn-h-sm: 38px;
  --btn-radius: 999px;

  /* Motion: short and decisive. Never animate layout properties. */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 150ms;
  --dur-med: 220ms;
}

/* ---------- Base text ---------- */
body {
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

p, li {
  font-weight: var(--fw-body);
}

/* ---------- Page and section headings ---------- */
.hero-title,
.article-title {
  font-size: var(--fs-3xl) !important;
  font-weight: var(--fw-display) !important;
  line-height: var(--lh-tight) !important;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hero-subtitle,
.article-subtitle,
.article-body > p.lead,
.article-text > p.lead {
  font-size: var(--fs-md) !important;
  line-height: 1.6 !important;
  font-weight: var(--fw-body) !important;
}

.section-title,
.category-title,
.cta-content h2,
.form-header h2 {
  font-size: var(--fs-2xl) !important;
  font-weight: var(--fw-display) !important;
  line-height: var(--lh-tight) !important;
  text-wrap: balance;
}

.section-subtitle,
.category-description,
.cta-content p,
.form-header p {
  font-size: var(--fs-md) !important;
  line-height: 1.6 !important;
  font-weight: var(--fw-body) !important;
}

/* ---------- Long-form reading (articles, privacy, terms) ---------- */
.article-body h2,
.article-text h2,
.privacy-section h2,
.terms-section h2,
.toc-section h2 {
  font-size: var(--fs-xl) !important;
  font-weight: var(--fw-ui) !important;
  line-height: var(--lh-snug) !important;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-body h3,
.article-text h3,
.privacy-section h3,
.terms-section h3 {
  font-size: var(--fs-lg) !important;
  font-weight: var(--fw-ui) !important;
  line-height: var(--lh-snug) !important;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.article-body p,
.article-body li,
.article-text p,
.article-text li,
.privacy-section p,
.privacy-section li,
.terms-section p,
.terms-section li,
.testimonial-quote p,
.impact-list li,
.about-description,
.location-description {
  font-size: var(--fs-long) !important;
  line-height: var(--lh-body) !important;
  font-weight: var(--fw-body) !important;
}

.article-body td,
.article-body th,
.article-text td,
.article-text th {
  font-size: var(--fs-sm) !important;
  line-height: 1.5;
}

/* ---------- Card titles (all card types share one size) ---------- */
.solution-title,
.industry-title,
.product-content h3,
.project-content h3,
.reference-content h3,
.partner-content h3,
.sidebar-card h3,
.form-title,
.offices-title,
.form-section h3,
.modal-header h3 {
  font-size: var(--fs-lg) !important;
  font-weight: var(--fw-ui) !important;
  line-height: var(--lh-snug) !important;
}

.article-list-title {
  font-size: var(--fs-md) !important;
  font-weight: var(--fw-ui) !important;
  line-height: var(--lh-snug) !important;
}

.feature-item h4,
.office-info h4 {
  font-size: var(--fs-md) !important;
  font-weight: var(--fw-ui) !important;
  line-height: var(--lh-snug) !important;
}

.step-content h4,
.related-content h4 {
  font-size: var(--fs-base) !important;
  font-weight: var(--fw-ui) !important;
  line-height: var(--lh-snug) !important;
}

/* ---------- Card text ---------- */
.solution-description,
.industry-description,
.product-content p,
.project-content p,
.reference-content p,
.partner-content p,
.feature-item p,
.contact-item p,
.detail-item p,
.step-content p,
.related-content p,
.article-list-excerpt,
.form-description,
.partner-tagline,
.benefits-list li,
.client-list li,
.sidebar-card p,
.sidebar-card li,
.toc-list li {
  font-size: var(--fs-sm) !important;
  line-height: 1.6 !important;
  font-weight: var(--fw-body) !important;
}

.feature-tag,
.article-badge-small,
.article-date-small,
.article-date,
.article-category {
  font-size: var(--fs-xs) !important;
  font-weight: var(--fw-ui) !important;
}

/* ---------- Buttons: one shape, three sizes ---------- */
.btn-primary,
.btn-secondary,
.btn-hero-primary,
.btn-hero-secondary,
.btn-learn-more,
.btn-submit,
.btn-contact,
.btn-download,
.btn-download-pdf,
.btn-view-specs,
.btn-specs,
.filter-btn,
.btn-data-request,
.btn-data-delete,
.home-announcement-btn,
.btn-read-more {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem;
  text-align: center !important;
  font-family: var(--font-family-base) !important;
  font-weight: var(--fw-ui) !important;
  line-height: 1.2 !important;
  letter-spacing: 0;
  border-radius: var(--btn-radius) !important;
  white-space: normal;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition-property: background-color, color, border-color, box-shadow, transform, opacity !important;
  transition-duration: var(--dur-fast) !important;
  transition-timing-function: var(--ease-out) !important;
}

/* Default size: every standard button */
.btn-primary,
.btn-secondary,
.btn-submit,
.btn-contact,
.btn-download,
.btn-download-pdf {
  min-height: var(--btn-h) !important;
  padding: 0.75rem 1.5rem !important;
  font-size: var(--fs-base) !important;
}

/* Large: main calls to action in heroes and CTA bands */
.btn-hero-primary,
.btn-hero-secondary,
.hero-buttons .btn-primary,
.hero-buttons .btn-secondary,
.cta-buttons .btn-primary,
.cta-buttons .btn-secondary {
  min-height: var(--btn-h-lg) !important;
  padding: 0.875rem 2rem !important;
  font-size: var(--fs-base) !important;
}

/* Card: actions inside product, solution and article cards (all the same size) */
.btn-specs,
.btn-view-specs,
.btn-learn-more,
.btn-read-more,
.product-card .btn-download-pdf {
  min-height: 42px !important;
  padding: 0.625rem 1.25rem !important;
  font-size: var(--fs-sm) !important;
}

/* Small: filters and chips */
.filter-btn,
.btn-data-request,
.btn-data-delete {
  min-height: var(--btn-h-sm) !important;
  padding: 0.5rem 1rem !important;
  font-size: 0.875rem !important;
}

.home-announcement-text {
  font-size: 0.875rem !important;
  font-weight: var(--fw-body) !important;
}

.home-announcement-btn {
  min-height: 32px !important;
  padding: 0.375rem 0.875rem !important;
  font-size: var(--fs-xs) !important;
}

/* Icons inside buttons line up with the text */
.btn-primary i, .btn-secondary i, .btn-hero-primary i, .btn-hero-secondary i,
.btn-learn-more i, .btn-submit i, .btn-contact i, .btn-download i, .btn-download-pdf i,
.btn-view-specs i, .btn-specs i, .filter-btn i, .btn-read-more i {
  font-size: 1em;
  line-height: 1;
  margin: 0 !important;
}

/* Press feedback: buttons give way slightly when clicked */
.btn-primary:active, .btn-secondary:active, .btn-hero-primary:active, .btn-hero-secondary:active,
.btn-learn-more:active, .btn-submit:active, .btn-contact:active, .btn-download:active,
.btn-download-pdf:active, .btn-view-specs:active, .btn-specs:active, .filter-btn:active,
.btn-read-more:active, .home-announcement-btn:active {
  transform: scale(0.97) !important;
}

/* Button rows: consistent spacing and wrapping */
.hero-buttons,
.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.cta-buttons { justify-content: center; }

/* Keyboard focus that is actually visible */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* ---------- Motion: cards respond quickly, nothing animates layout ---------- */
.solution-card,
.industry-card,
.product-card,
.project-card,
.reference-card,
.partner-card,
.feature-item,
.sidebar-card,
.article-card,
.article-list-item,
.contact-item,
.client-logo {
  transition-property: transform, box-shadow, border-color, background-color, opacity !important;
  transition-duration: var(--dur-med) !important;
  transition-timing-function: var(--ease-out) !important;
}

/* Endless background-gradient animation repainted the whole hero/CTA every frame.
   Keep the gradient, stop the movement. */
@keyframes gradientShift {
  from, to { background-position: 0% 50%; }
}

/* Only animate on devices that can hover; touch screens get no sticky hover lift */
@media (hover: none) {
  .solution-card:hover, .industry-card:hover, .product-card:hover, .project-card:hover,
  .reference-card:hover, .partner-card:hover, .feature-item:hover, .article-card:hover {
    transform: none !important;
  }
}

/* Respect the system "reduce motion" setting */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Small screens ---------- */
@media (max-width: 575.98px) {
  .hero-buttons .btn-hero-primary,
  .hero-buttons .btn-hero-secondary,
  .hero-buttons .btn-primary,
  .hero-buttons .btn-secondary,
  .cta-buttons .btn-primary,
  .cta-buttons .btn-secondary {
    width: 100%;
  }
}
