/* Shared cross-page consistency, responsive navigation, and mobile CTA enhancements. */

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

button,
input,
optgroup,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  background: transparent;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

.article-card picture,
.tab-media picture {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip: rect(0, 0, 0, 0);
}

.nav {
  position: fixed;
  inset: 18px 0 auto;
  z-index: 30;
  transition: all 0.35s var(--ease);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  border: 1px solid rgba(11, 47, 107, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 52px -36px rgba(11, 47, 107, 0.32);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.nav.scrolled .nav-inner {
  border-color: rgba(11, 47, 107, 0.16);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 22px 58px -34px rgba(11, 47, 107, 0.38);
}

.dark .nav.scrolled .nav-inner {
  background: rgba(13, 20, 27, 0.78);
  box-shadow: 0 18px 52px -34px rgba(0, 0, 0, 0.8);
}

.dark .nav-inner {
  border-color: rgba(98, 182, 240, 0.16);
  background: rgba(13, 20, 27, 0.7);
  box-shadow: 0 22px 62px -38px rgba(0, 0, 0, 0.86);
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 1px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.logo .tms {
  color: var(--deep, var(--brand-deep));
}

.logo .first {
  color: var(--bright, var(--brand-bright));
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 0;
  color: var(--muted, var(--text-mute));
  font-size: 14px;
  font-weight: 650;
  list-style: none;
}

.nav-links a {
  transition: color 0.25s var(--ease);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--bright, var(--brand-bright));
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card, var(--bg-card));
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.theme-toggle .sun {
  display: none;
}

.theme-toggle .moon {
  display: block;
}

.dark .theme-toggle .sun {
  display: block;
}

.dark .theme-toggle .moon {
  display: none;
}

.signin {
  color: var(--muted, var(--text-mute));
  font-size: 14px;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.btn .arrow {
  display: inline-block;
  transition: transform 0.25s var(--ease);
}

.btn:hover .arrow,
.btn:focus-visible .arrow {
  transform: translateX(4px);
}

.btn-primary {
  background: linear-gradient(135deg, #0b2f6b, #1e90d8);
  color: #fff;
  box-shadow: 0 18px 36px -22px rgba(30, 144, 216, 0.7);
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  background: var(--card, var(--bg-card));
  color: var(--text);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.display {
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.section-title,
h2.section-title {
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -0.055em;
}

.value-card h3,
.bento-card h3,
.cap-body h3,
.contact-card h3,
.faq-card h3 {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.footer {
  padding: 40px 0 28px;
  color: var(--muted, var(--text-mute));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.25fr repeat(4, 1fr);
  gap: 14px;
  align-items: start;
}

.footer h3,
.footer-title {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer p,
.footer a,
.footer span {
  font-size: 14px;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--bright, var(--brand-bright));
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.dot.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
  animation: pulse 2s infinite;
}

.anchor-target {
  position: relative;
  top: -120px;
  display: block;
  height: 0;
  overflow: hidden;
}

html:not(.dark) .theme-toggle {
  border-color: rgba(11, 47, 107, 0.18) !important;
  background: rgba(11, 47, 107, 0.08) !important;
  color: #0b2f6b !important;
}

html:not(.dark) .theme-toggle .sun {
  display: none !important;
}

html:not(.dark) .theme-toggle .moon {
  display: block !important;
}

html.dark .theme-toggle {
  border-color: rgba(250, 204, 21, 0.38) !important;
  background: rgba(250, 204, 21, 0.14) !important;
  color: #facc15 !important;
}

html.dark .theme-toggle .sun {
  display: block !important;
}

html.dark .theme-toggle .moon {
  display: none !important;
}

.nav .wrap.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  line-height: 0;
}

.logo img {
  display: block;
  width: 148px;
  height: 40px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 0;
  line-height: 1.25;
  white-space: nowrap;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.nav-actions .signin {
  padding: 0;
  white-space: nowrap;
}

.nav-actions .btn {
  white-space: nowrap;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: -18% -10% -8%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(520px 320px at 14% 18%, rgba(30, 144, 216, 0.16), transparent 68%),
    radial-gradient(620px 360px at 86% 8%, rgba(98, 182, 240, 0.13), transparent 66%),
    radial-gradient(760px 420px at 52% 0%, rgba(11, 47, 107, 0.08), transparent 72%),
    repeating-radial-gradient(circle at 50% 46%, rgba(11, 47, 107, 0.026) 0 1px, transparent 1px 7px);
  opacity: 0.82;
  transform: translate3d(0, 0, 0);
  animation: hero-aurora-drift 18s var(--ease) infinite alternate;
}

.dark .hero::after {
  background:
    radial-gradient(560px 340px at 16% 14%, rgba(98, 182, 240, 0.18), transparent 68%),
    radial-gradient(620px 380px at 84% 8%, rgba(30, 144, 216, 0.16), transparent 66%),
    radial-gradient(760px 460px at 52% 0%, rgba(11, 47, 107, 0.34), transparent 72%),
    repeating-radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 7px);
  opacity: 0.74;
}

.hero > .wrap {
  position: relative;
  z-index: 1;
}

.hero > .hero-art {
  z-index: 1;
}

@keyframes hero-aurora-drift {
  from {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }

  to {
    transform: translate3d(1.5%, 1%, 0) scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero::after {
    animation: none;
    transform: none;
  }
}

.mobile-menu-backdrop,
.mobile-menu-cta {
  display: none;
}

.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card, var(--panel, rgba(255, 255, 255, 0.78)));
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.sticky-mobile-cta {
  display: none;
}

@media (max-width: 1080px) {
  .nav-links {
    display: none;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .nav.open .nav-links {
    position: absolute;
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    justify-content: stretch;
    gap: 4px;
    left: 40px;
    right: 40px;
    top: 74px;
    z-index: 40;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card, var(--panel, rgba(255, 255, 255, 0.92)));
    box-shadow: var(--shadow, 0 18px 52px -34px rgba(11, 47, 107, 0.3));
    list-style: none;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
  }

  .nav.open .nav-links a {
    display: flex;
    min-height: 48px;
    padding: 0 10px;
    border-radius: 10px;
  }

  .nav.open .nav-links a:hover,
  .nav.open .nav-links a:focus-visible {
    background: rgba(30, 144, 216, 0.08);
  }
}

@media (max-width: 700px) {
  .wrap {
    padding-left: 24px;
    padding-right: 24px;
  }

  .nav {
    inset: 10px 0 auto;
  }

  .nav-inner {
    min-height: 58px;
  }

  .nav-actions .signin,
  .nav-actions .btn {
    display: none;
  }

  .display {
    font-size: clamp(46px, 15vw, 72px);
  }

  .section-title,
  h2.section-title {
    font-size: clamp(32px, 12vw, 52px);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .logo img {
    width: 132px;
    height: auto;
  }

  .nav.open .nav-links {
    left: 24px;
    right: 24px;
    top: 68px;
  }

  .mobile-menu-toggle {
    min-height: 44px;
    padding: 0 12px;
  }
}

@media (max-width: 1080px) {
  .nav .wrap.nav-inner {
    position: relative;
    z-index: 42;
  }

  .nav-actions .signin,
  .nav-actions .btn {
    display: none;
  }

  .mobile-menu-toggle {
    min-height: 44px;
    padding: 0 16px;
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(8, 16, 30, 0.92);
    color: #fff;
    font-size: 14px;
  }

  .mobile-menu-toggle:hover,
  .mobile-menu-toggle:focus-visible {
    border-color: rgba(137, 206, 255, 0.65);
    background: rgba(11, 47, 107, 0.96);
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 31;
    border: 0;
    background: rgba(3, 7, 18, 0.66);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
  }

  .nav.open .mobile-menu-backdrop {
    display: block;
  }

  .nav.open .nav-links {
    left: 40px;
    right: 40px;
    top: 74px;
    z-index: 43;
    gap: 8px;
    padding: 16px;
    border-color: rgba(137, 206, 255, 0.26);
    background: linear-gradient(145deg, rgba(8, 16, 30, 0.98), rgba(11, 47, 107, 0.96));
    box-shadow: 0 28px 90px -30px rgba(0, 0, 0, 0.72);
    color: #fff;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }

  .nav.open .nav-links a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
  }

  .nav.open .nav-links a:hover,
  .nav.open .nav-links a:focus-visible {
    background: rgba(255, 255, 255, 0.11);
    outline: 2px solid rgba(137, 206, 255, 0.9);
    outline-offset: 2px;
  }

  .nav.open .nav-links .mobile-menu-cta {
    display: block;
    margin-top: 8px;
  }

  .nav.open .nav-links .mobile-menu-primary {
    justify-content: center;
    min-height: 50px;
    background: linear-gradient(135deg, #0b2f6b, #126eae);
    color: #fff;
    box-shadow: 0 18px 34px -22px rgba(98, 182, 240, 0.85);
  }

  .nav.open .nav-links .mobile-menu-secondary {
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.07);
    color: #eaf4ff;
  }

  body {
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }

  .sticky-mobile-cta {
    position: fixed;
    left: 24px;
    right: 24px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 28;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0b2f6b, #1e90d8);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: -0.01em;
    box-shadow: 0 20px 44px -20px rgba(11, 47, 107, 0.72);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  }

  .sticky-mobile-cta:hover,
  .sticky-mobile-cta:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 24px 52px -20px rgba(30, 144, 216, 0.82);
    outline: 2px solid rgba(137, 206, 255, 0.92);
    outline-offset: 3px;
  }

  .nav.open + .sticky-mobile-cta,
  .sticky-cta-hidden .sticky-mobile-cta {
    opacity: 0;
    pointer-events: none;
    transform: translateY(14px);
  }

  .footer {
    padding-bottom: calc(118px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 700px) {
  .nav.open .nav-links {
    left: 24px;
    right: 24px;
    top: 68px;
  }

  .mobile-menu-toggle {
    min-height: 44px;
    padding: 0 14px;
  }
}

@media (max-width: 430px) {
  .sticky-mobile-cta {
    left: 18px;
    right: 18px;
    min-height: 54px;
    font-size: 16px;
  }
}
