/* TAMAX base: reset, document rhythm, layout primitives, utilities. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--tx-header-h) + 1rem);
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--tx-midnight);
  color: var(--tx-ink);
  font-family: var(--tx-font-sans);
  font-size: var(--tx-fs-base);
  line-height: var(--tx-lh-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--tx-3);
  font-family: var(--tx-font-display);
  font-weight: 700;
  line-height: var(--tx-lh-snug);
  letter-spacing: -0.02em;
  color: var(--tx-text);
  text-wrap: balance;
}

h1 {
  font-size: var(--tx-fs-h1);
  line-height: var(--tx-lh-tight);
  letter-spacing: -0.03em;
}
h2 {
  font-size: var(--tx-fs-h2);
  letter-spacing: -0.025em;
}
h3 {
  font-size: var(--tx-fs-h3);
}
h4 {
  font-size: var(--tx-fs-h4);
}

p,
ul,
ol,
dl,
figure,
table,
blockquote {
  margin: 0 0 var(--tx-4);
}

p:last-child,
ul:last-child,
ol:last-child {
  margin-bottom: 0;
}

p {
  color: var(--tx-text-muted);
  text-wrap: pretty;
}

strong,
b {
  font-weight: 700;
  color: var(--tx-text);
}

small {
  font-size: var(--tx-fs-sm);
}

a {
  color: var(--tx-blue-700);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--tx-dur-fast) var(--tx-ease);
}

a:hover {
  color: var(--tx-blue);
}

/* Buttons keep their own foreground; only real links turn cyan. */
.tx-on-dark a:not(.tx-btn) {
  color: var(--tx-cyan);
}
.tx-on-dark a:not(.tx-btn):hover {
  color: var(--tx-sky);
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Icons carry their own fill and stroke attributes. A global fill rule would
   override them, because CSS beats SVG presentation attributes. */

fieldset {
  min-width: 0;
}

legend {
  padding: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--tx-surface-border);
  margin: var(--tx-6) 0;
}

ul,
ol {
  padding-left: 1.25rem;
}

li {
  margin-bottom: var(--tx-2);
  color: var(--tx-text-muted);
}

li::marker {
  color: var(--tx-accent);
}

code,
kbd,
samp {
  font-family: var(--tx-font-mono);
  font-size: 0.9em;
  background: var(--tx-bg-2);
  border: 1px solid var(--tx-border);
  border-radius: var(--tx-r-sm);
  padding: 0.1em 0.35em;
  color: var(--tx-ink);
  overflow-wrap: anywhere;
}

pre {
  background: var(--tx-midnight);
  color: var(--tx-on-dark);
  padding: var(--tx-4);
  border-radius: var(--tx-r);
  overflow-x: auto;
  font-family: var(--tx-font-mono);
  font-size: var(--tx-fs-sm);
  line-height: 1.55;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}

/* ---------- Focus ---------- */

:focus-visible {
  outline: var(--tx-focus);
  outline-offset: var(--tx-focus-offset);
  border-radius: var(--tx-r-sm);
}

:target {
  scroll-margin-top: calc(var(--tx-header-h) + 1.5rem);
}

/* ---------- Layout primitives ---------- */

.tx-container {
  width: 100%;
  max-width: var(--tx-container);
  margin-inline: auto;
  padding-inline: var(--tx-gutter);
}

.tx-container--narrow {
  max-width: var(--tx-container-narrow);
}

.tx-section {
  padding-block: var(--tx-section);
  position: relative;
}

.tx-section--tight {
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
}

.tx-section--light {
  background: var(--tx-bg);
}

/* Section transitions: a hairline of brand colour where a dark band meets a
   light one, so the page reads as one continuous surface rather than as a
   stack of unrelated blocks. */
.tx-section--dark::after,
.tx-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(41, 184, 238, 0.55) 30%,
    rgba(86, 217, 249, 0.55) 70%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 4;
}

.tx-section--dark {
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(11, 123, 208, 0.35) 0%, rgba(11, 123, 208, 0) 60%),
    linear-gradient(160deg, var(--tx-navy) 0%, var(--tx-midnight) 100%);
  color: var(--tx-on-dark);
  overflow: hidden;
  isolation: isolate;
}

.tx-section--dark::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(41, 184, 238, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 184, 238, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 78%);
  pointer-events: none;
}

.tx-on-dark h1,
.tx-on-dark h2,
.tx-on-dark h3,
.tx-on-dark h4,
.tx-on-dark strong {
  color: var(--tx-on-dark);
}

.tx-on-dark p,
.tx-on-dark li {
  color: var(--tx-on-dark-muted);
}

.tx-stack > * + * {
  margin-top: var(--tx-4);
}

.tx-grid {
  display: grid;
  gap: var(--tx-5);
}

@media (min-width: 40em) {
  .tx-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tx-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tx-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 62em) {
  .tx-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .tx-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- Section headers ---------- */

.tx-section-head {
  max-width: 46rem;
  margin-bottom: clamp(2rem, 1.2rem + 2.5vw, 3.25rem);
}

.tx-section-head--center {
  margin-inline: auto;
  text-align: center;
}

.tx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--tx-2);
  margin: 0 0 var(--tx-3);
  font-family: var(--tx-font-sans);
  font-size: var(--tx-fs-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tx-blue-700);
}

.tx-on-dark .tx-eyebrow {
  color: var(--tx-sky);
}

.tx-eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  flex: none;
}

.tx-section-head--center .tx-eyebrow::before {
  display: none;
}

.tx-lead {
  font-size: var(--tx-fs-lg);
  color: var(--tx-text-muted);
  max-width: 42rem;
}

.tx-section-head--center .tx-lead {
  margin-inline: auto;
}

/* ---------- Utilities ---------- */

.tx-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.tx-skip-link {
  position: absolute;
  left: var(--tx-4);
  top: var(--tx-2);
  z-index: 200;
  transform: translateY(-160%);
  background: var(--tx-navy);
  color: var(--tx-white);
  padding: 0.75rem 1.25rem;
  border-radius: var(--tx-r);
  text-decoration: none;
  font-weight: 700;
  box-shadow: var(--tx-shadow-lg);
  transition: transform var(--tx-dur) var(--tx-ease);
}

.tx-skip-link:focus {
  transform: translateY(0);
  color: var(--tx-white);
}

.tx-center {
  text-align: center;
}

.tx-flow-tight > * + * {
  margin-top: var(--tx-2);
}

.tx-muted {
  color: var(--tx-text-muted);
}

.tx-nowrap {
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

/* ---------- Motion ---------- */

/* Content is never hidden on the strength of an assumption.
   The hidden state is scoped to .js, which main.js sets on <html> as its first
   statement. If the module fails to load for any reason at all - a blocked
   script, a network error, a file:// URL, a syntax error in a future edit -
   the class is never set, the rule never applies, and the page is simply
   readable. The entrance animation is the enhancement; the text is not. */
.tx-reveal {
  transition: opacity var(--tx-dur-slow) var(--tx-ease), transform var(--tx-dur-slow) var(--tx-ease);
}

.js .tx-reveal {
  opacity: 0;
  transform: translateY(18px);
  will-change: opacity, transform;
}

.tx-reveal.is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* Stagger siblings so a grid of cards arrives in sequence. Eight steps cover
   the widest grid on the page; anything beyond that shares the last delay. */
.tx-reveal:nth-child(2) {
  transition-delay: 60ms;
}
.tx-reveal:nth-child(3) {
  transition-delay: 120ms;
}
.tx-reveal:nth-child(4) {
  transition-delay: 180ms;
}
.tx-reveal:nth-child(5) {
  transition-delay: 240ms;
}
.tx-reveal:nth-child(6) {
  transition-delay: 300ms;
}
.tx-reveal:nth-child(n + 7) {
  transition-delay: 360ms;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .tx-reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .tx-header,
  .tx-footer,
  .tx-skip-link,
  .tx-finder,
  .tx-wizard-nav {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .tx-section--dark {
    background: #fff !important;
    color: #000 !important;
  }
}
