/* Shared layout and components for the TrussLE site family. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
  letter-spacing: -0.015em;
}
h1 { font-weight: 700; }
h2 { font-weight: 700; font-size: var(--text-2xl); }
h3 { font-weight: 600; font-size: var(--text-lg); line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; border-radius: 4px; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.container--narrow { width: min(100% - 2.5rem, var(--container-narrow)); margin-inline: auto; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--navy); color: var(--white); padding: var(--space-3) var(--space-4); z-index: 100; }
.skip-link:focus { left: var(--space-4); top: var(--space-4); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Eyebrow label */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
  display: inline-flex; align-items: center; gap: var(--space-2);
}
.eyebrow::before { content: ""; width: 18px; height: 3px; background: var(--teal); border-radius: 2px; }
.on-navy .eyebrow { color: var(--on-navy-muted); }

.lede { font-size: var(--text-lg); color: var(--slate); line-height: 1.55; max-width: 60ch; }
.muted { color: var(--slate); }

/* Buttons: teal with navy label, navy with white label, outline */
.btn {
  --btn-bg: var(--teal); --btn-fg: var(--navy); --btn-border: var(--teal);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-display); font-weight: 500; font-size: var(--text-sm);
  padding: 0.8rem 1.25rem; min-height: 44px;
  border-radius: var(--radius-sm); border: 1.5px solid var(--btn-border);
  background: var(--btn-bg); color: var(--btn-fg); text-decoration: none; cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
  white-space: nowrap;
}
.btn:hover { --btn-bg: var(--teal-600); --btn-border: var(--teal-600); }
.btn:active { transform: translateY(1px); }
.btn--navy { --btn-bg: var(--navy); --btn-fg: var(--white); --btn-border: var(--navy); }
.btn--navy:hover { --btn-bg: var(--navy-700); --btn-border: var(--navy-700); }
.btn--outline { --btn-bg: transparent; --btn-fg: var(--navy); --btn-border: var(--navy-a12); }
.btn--outline:hover { --btn-bg: var(--navy-a06); --btn-border: var(--navy); }
.on-navy .btn--outline { --btn-fg: var(--white); --btn-border: rgb(255 255 255 / 0.35); }
.on-navy .btn--outline:hover { --btn-bg: rgb(255 255 255 / 0.08); --btn-border: var(--white); }
.btn--lg { font-size: var(--text-base); padding: 0.95rem 1.5rem; }
.btn i, .btn svg { width: 18px; height: 18px; }

.text-link {
  font-family: var(--font-display); font-weight: 500; color: var(--navy);
  text-decoration: none; display: inline-flex; align-items: center; gap: var(--space-2);
  border-bottom: 2px solid var(--teal); padding-bottom: 2px;
}
.text-link:hover { color: var(--navy-700); }
.text-link svg { width: 16px; height: 16px; transition: transform 0.2s var(--ease); }
.text-link:hover svg { transform: translateX(3px); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--color-border); box-shadow: var(--shadow-sm); }
.site-header__inner { display: flex; align-items: center; gap: var(--space-8); min-height: 76px; }
.site-header__logo { display: block; flex-shrink: 0; padding-block: var(--space-2); }
.site-header__logo img { width: 150px; height: auto; } /* min digital size 120px */
.site-nav { display: flex; gap: var(--space-6); margin-left: auto; }
.site-nav a {
  font-size: var(--text-sm); font-weight: 500; color: var(--navy); text-decoration: none;
  padding-block: var(--space-2); border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--teal); }
.site-header__actions { display: flex; gap: var(--space-3); align-items: center; }
.nav-toggle { display: none; background: none; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); width: 44px; height: 44px; color: var(--navy); cursor: pointer; align-items: center; justify-content: center; }
.mobile-nav { display: none; }

@media (max-width: 980px) {
  .site-nav, .site-header__actions .btn--outline { display: none; }
  .site-header__actions { margin-left: auto; }
  .nav-toggle { display: inline-flex; }
  .mobile-nav { display: none; border-top: 1px solid var(--color-border); padding: var(--space-4) 0 var(--space-6); }
  .mobile-nav.is-open { display: block; }
  .mobile-nav a { display: block; padding: var(--space-3) 0; font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--color-border); }
  .mobile-nav .btn { margin-top: var(--space-4); width: 100%; }
}
@media (max-width: 520px) {
  .site-header__actions .btn--sales-short { padding-inline: 0.9rem; }
  .site-header__logo img { width: 128px; }
}

/* Sections */
.section { padding-block: clamp(var(--space-16), 9vw, var(--space-32)); }
.section--tight { padding-block: clamp(var(--space-12), 6vw, var(--space-20)); }
.section--cloud { background: var(--cloud); }
.section--navy { background: var(--navy); color: var(--white); }
.section--navy h2, .section--navy h3 { color: var(--white); }
.section-head { display: grid; gap: var(--space-4); margin-bottom: clamp(var(--space-10), 5vw, var(--space-16)); max-width: 720px; }

/* Cards */
.card {
  background: var(--white); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: clamp(var(--space-6), 3vw, var(--space-10));
}

/* Forms */
.form { display: grid; gap: var(--space-5); }
.form-row { display: grid; gap: var(--space-5); grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: var(--space-2); }
.field label, .field legend { font-size: var(--text-sm); font-weight: 600; color: var(--navy); }
.field .hint { font-size: var(--text-xs); color: var(--slate); }
.field input, .field select, .field textarea {
  font: inherit; font-size: var(--text-base); color: var(--navy);
  background: var(--white); border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; min-height: 48px; width: 100%;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-a15); }
.field [aria-invalid="true"] { border-color: var(--color-error); }
.field .error { font-size: var(--text-xs); color: var(--color-error); min-height: 1em; }
fieldset.field { border: 0; padding: 0; margin: 0; }
.choice-grid { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.55rem 1rem;
  border: 1.5px solid var(--slate-200); border-radius: 999px; font-size: var(--text-sm); font-weight: 500;
  transition: all 0.2s var(--ease); background: var(--white);
}
.choice input:checked + span { border-color: var(--navy); background: var(--navy); color: var(--white); }
.choice input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }
.consent { display: flex; gap: var(--space-3); align-items: flex-start; font-size: var(--text-sm); color: var(--slate); }
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--navy); flex-shrink: 0; }
.form-status { font-size: var(--text-sm); padding: var(--space-4); border-radius: var(--radius-sm); background: var(--cloud); border: 1px solid var(--color-border); display: none; }
.form-status.is-visible { display: block; }

/* Footer */
.site-footer { background: var(--navy-900); color: var(--on-navy-muted); padding-block: var(--space-16) var(--space-8); font-size: var(--text-sm); }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-decoration-color: var(--teal); text-underline-offset: 4px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--space-10); }
.footer-grid h4 { color: var(--white); font-family: var(--font-display); font-weight: 500; font-size: var(--text-sm); margin-bottom: var(--space-4); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.footer-brand img { width: 150px; margin-bottom: var(--space-4); }
.footer-bottom { margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid rgb(255 255 255 / 0.1); display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; font-size: var(--text-xs); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
