/* Adaptive layout: stable navigation, natural scrolling, readable diagrams. */
:root { --header-height: 72px; --section-space: clamp(40px, 5vh, 72px); }
html { scroll-padding-top: calc(var(--header-height) + 12px); }
.section { scroll-margin-top: 0; padding-block: var(--section-space); }
.container { width: min(1200px, calc(100% - 64px)); }
.site-header { backdrop-filter: none; background: #122638; box-shadow: 0 3px 14px rgba(13,27,42,.07); }
.header-inner, .site-header.is-scrolled .header-inner { height: var(--header-height); min-height: var(--header-height); transition: none; }
.primary-nav > a { min-height: 44px; display: inline-flex; align-items: center; }
.primary-nav .nav-cta { min-height: 44px; }
.primary-nav > a.nav-cta:hover, .primary-nav > a.nav-cta:focus-visible { color: #fff; }
.hero-grid { padding-block: var(--section-space); grid-template-columns: minmax(0,1.08fr) minmax(0,.92fr); gap: clamp(28px,4vw,56px); }
.hero-copy h1 { font-size: clamp(40px,3.65vw,54px); line-height: 1.16; margin-bottom: 22px; }
.hero-lead { font-size: 16px; line-height: 1.65; margin-bottom: 12px; }
.hero-secondary { font-size: 14px; line-height: 1.65; margin-bottom: 24px; }
.hero-visual { min-height: 0; padding: 20px; }
.visual-network { height: 344px; }
.network-node { min-width: 116px; padding: 12px; }
.network-node strong { font-size: 11px; }
.visual-foot { flex-wrap: wrap; gap: 6px; }
.section-intro { grid-template-columns: minmax(0,1fr) minmax(0,.85fr); gap: 7%; margin-bottom: 28px; }
.section-intro h2 { font-size: clamp(34px,3.15vw,44px); }
.section-intro > p { font-size: 15px; line-height: 1.65; }
.eyebrow { margin-bottom: 20px; }
.product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.product-card { padding: 24px; }
.card-bottom { margin-top: 0; flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.card-bottom .card-link { margin-top: auto; }
.hero::before, .products::after { display: none; }
.card-visual { min-height: 138px; margin: 14px 0 18px; }
.card-bottom h3 { font-size: 36px; }
.card-bottom .product-subtitle { font-size: 16px; }
.card-bottom p:not(.product-subtitle) { font-size: 14px; line-height: 1.65; margin-bottom: 16px; }
.card-link { min-height: 40px; }
.detail-grid, .detail-reverse { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: clamp(32px,4.4vw,64px); }
.detail-copy h2 { font-size: clamp(34px,3.1vw,44px); margin-bottom: 20px; }
.detail-copy > p:not(.eyebrow) { font-size: 15px; line-height: 1.65; margin-bottom: 12px; }
.capabilities { margin: 20px 0; gap: 7px; }
.capabilities span { padding: 6px 10px; font-size: 12px; }
.value-block { padding: 17px 20px; margin-bottom: 22px; }
.value-block p { font-size: 14px; }
.actions { gap: 14px 22px; }
.button { min-height: 46px; padding: 11px 17px; gap: 18px; }
.button-text { padding-inline: 0; }
.data-board, .customs-flow { width: 100%; min-width: 0; padding: 22px; }
.board-heading { flex-wrap: wrap; gap: 8px; }
.source-row { grid-template-columns: repeat(3,minmax(0,1fr)); }
.board-main { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); }
.flow-inputs { grid-template-columns: repeat(3,minmax(0,1fr)); }
.flow-output > div { flex-wrap: wrap; }
.c-values { margin-block: 20px 24px; }
.c-values > div { min-width: 0; padding: 12px; }
.c-values strong { letter-spacing: .025em; }
.contact { padding-bottom: max(var(--section-space), 96px); }
.contact-grid { grid-template-columns: minmax(0,.92fr) minmax(0,1.08fr); gap: clamp(32px,5vw,72px); align-items: center; }
.contact-copy h2 { font-size: clamp(34px,3.1vw,44px); }
.contact-link { margin-bottom: 32px; }
.contact-form { padding: 26px; }
.contact-form h3 { font-size: 25px; }
.contact-form > p:first-of-type { margin-bottom: 20px; color: #5f7382; }
.contact-form label { margin-bottom: 14px; }
.contact-form input, .contact-form select, .contact-form textarea { padding: 10px 12px; margin-top: 6px; }
.contact-form textarea { min-height: 104px; }
.contact-form .form-hint { color: #5f7382; }
.footer-grid { grid-template-columns: minmax(0,1.5fr) minmax(0,1fr) minmax(0,.75fr) minmax(0,1fr); gap: 32px; }
.footer-bottom { flex-wrap: wrap; }
.contact[hidden] { display: none !important; }
.footer-contact { scroll-margin-top: calc(var(--header-height) + 24px); }
.contact::after, .footer::before { display: none; }
.footer { border-top: 0; background: linear-gradient(180deg, #eaf4f8, #dceaf0); color: #445e70; }
.footer-about strong { color: #17354f; }
.footer-about p, .footer-column a, .footer-bottom { color: #496375; }
.footer-column h2 { color: #246f7c; }
.footer-column a:hover, .footer-bottom a:hover { color: #1b6ad2; }
.footer-contact a span { color: #536e80; }
.footer-bottom { border-top-color: #c5dbe5; }
.footer-bottom a { color: #245e7c; }
.hero-copy, .detail-copy, .contact-copy, .card-bottom, .form-grid > label { min-width: 0; }

/* Diagrams use compositor motion; content never waits for a reveal animation. */
.bars i { transform: none; transition: none; }
.network-line::after { left: 0; animation: signal-pulse 3.5s ease-in-out 2; animation-play-state: paused; }
.board-bridge span::after, .flow-connector span::after { animation-iteration-count: 2; animation-play-state: paused; }
.is-active .network-line::after, .is-active .board-bridge span::after, .is-active .flow-connector span::after { animation-play-state: running; }
@keyframes signal-pulse { 0%,100% { opacity: .25; transform: scale(.65); } 50% { opacity: 1; transform: scale(1); } }
@media (hover: none) { .product-card:hover, .button:hover { transform: none; } }

/* A complete section fits a roomy desktop view; short screens keep natural flow. */
@media (min-width: 1100px) and (min-height: 720px) {
  .hero, .products, .product-detail { min-height: calc(100svh - var(--header-height)); display: flex; align-items: center; }
  .hero-grid { padding-block: 0; }
  .hero { padding-block: var(--section-space); }
}
@media (min-width: 1100px) and (max-height: 820px) {
  :root { --section-space: 32px; }
  .hero-copy h1 { font-size: 46px; }
  .hero-visual { padding: 18px; }
  .visual-network { height: 318px; }
  .section-intro h2, .detail-copy h2, .contact-copy h2 { font-size: 38px; }
  .card-visual { min-height: 124px; margin-block: 10px 14px; }
  .product-card { padding: 22px; }
  .contact-form { padding: 22px 26px; }
}
@media (max-width: 1099px) {
  .container { width: calc(100% - 48px); }
  .hero-grid, .detail-grid, .detail-reverse, .contact-grid { grid-template-columns: minmax(0,1fr); gap: 32px; }
  .hero-copy, .detail-copy, .contact-copy { max-width: 740px; }
  .hero-visual, .data-board, .customs-flow { max-width: 680px; justify-self: center; }
  .detail-reverse .detail-copy { grid-row: 1; }
  .detail-reverse .customs-flow { grid-row: 2; }
  .contact-form { width: 100%; max-width: 740px; }
  .section-intro { gap: 32px; }
  .card-c-visual i { width: 12px; }
  .card-c-visual span { padding: 10px 6px; font-size: 9px; }
  .mini-system { width: 68px; }
  .mini-dashboard { min-width: 0; width: 54%; }
  .card-s-visual { gap: 10px; }
  .footer-grid { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 32px; }
}
@media (max-width: 900px) {
  :root { --header-height: 64px; }
  .menu-toggle { display: block; min-width: 44px; min-height: 44px; }
  .primary-nav { display: none; position: absolute; top: var(--header-height); left: 0; right: 0; padding: 12px 24px 20px; flex-direction: column; align-items: stretch; gap: 0; background: #122638; box-shadow: 0 12px 20px rgba(13,27,42,.1); }
  .primary-nav.is-open { display: flex; }
  .primary-nav > a:not(.nav-cta) { min-height: 48px; border-bottom: 1px solid #2a4861; }
  .nav-cta { margin-top: 12px; justify-content: space-between; }
  .section-intro { grid-template-columns: minmax(0,1fr); gap: 16px; }
}
@media (max-width: 700px) {
  :root { --section-space: 44px; }
  .container { width: calc(100% - 32px); }
  .hero-copy h1 { font-size: clamp(32px,7.5vw,44px); }
  .hero-grid { gap: 30px; padding-bottom: 24px; }
  .hero-lead { font-size: 15px; }
  .product-grid { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .product-card { padding: 22px; }
  .card-visual { min-height: 142px; }
  .card-bottom h3 { font-size: 34px; }
  .section-intro h2, .detail-copy h2, .contact-copy h2 { font-size: clamp(30px,7vw,38px); }
  .data-board, .customs-flow { padding: 16px; }
  .board-status { font-size: 10px; }
  .contact { padding-bottom: 84px; }
  .contact-form { padding: 24px 18px; }
  .footer-grid { gap: 30px 20px; }
  .footer-about, .footer-contact { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .visual-network { height: auto; min-height: 324px; }
  .network-node { min-width: 0; }
  .network-node strong { font-size: 10px; }
  .c-values { grid-template-columns: minmax(0,1fr); }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .actions { row-gap: 10px; }
  .actions .button { white-space: normal; }
}
@media (max-width: 380px) {
  .product-index { font-size: 10px; letter-spacing: .06em; }
  .board-main { grid-template-columns: minmax(0,1fr); }
  .board-bars { min-height: 190px; }
  .board-insights { min-height: 0; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .board-insights > span { width: 100%; }
  .board-insights b { font-size: 11px; border: 0; padding: 0; }
  .flow-inputs { grid-template-columns: minmax(0,1fr); }
  .flow-inputs span { min-height: 40px; }
  .source-row small { font-size: 10px; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .network-line::after, .board-bridge span::after, .flow-connector span::after { animation: none; }
}

/* Match both visual rows so titles stay aligned despite different copy lengths. */
.card-visual { height: 156px; min-height: 156px; flex-shrink: 0; }
@media (min-width: 701px) and (max-width: 900px) {
  .card-bottom .product-subtitle { min-height: 3.2em; }
}
