/* WIC responsive hardening — progressive enhancement, fluid media and touch-safe controls. */
:root {
  --shell: min(1240px, calc(100% - 64px));
}

html {
  width: 100%;
  max-width: 100%;
  scroll-padding-top: calc(110px + env(safe-area-inset-top, 0px));
}

body {
  width: 100%;
  max-width: 100%;
  min-width: 280px;
  overflow-x: hidden;
  background: #fff;
  overflow-wrap: break-word;
}

img,
video,
canvas,
svg,
iframe {
  max-width: 100%;
}

img {
  height: auto;
}

picture {
  display: block;
  max-width: 100%;
}

video {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

iframe {
  border: 0;
}

main,
header,
footer,
section,
article,
nav,
.shell,
[class*="grid"],
[class*="inner"],
[class*="layout"] > * {
  min-width: 0;
}

h1,
h2,
h3,
h4,
p,
li,
a,
button {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--blue, #155cff);
  outline-offset: 3px;
}

button,
[role="button"] {
  max-width: 100%;
}

table {
  max-width: 100%;
}

.comparison-table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.site-header {
  top: calc(16px + env(safe-area-inset-top, 0px));
}

.hero-home,
.hero-deck-wrap,
.deck-stage,
.playing-fan,
.poker-stage,
.education-collage,
.community-orbit,
.inside-window,
.market-visual,
.chart-window {
  max-width: 100%;
  min-width: 0;
}

.exchange-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@media (min-width: 1440px) {
  :root {
    --shell: min(1240px, calc(100% - 96px));
  }
}

@media (min-width: 1920px) {
  .site-header {
    width: min(1540px, calc(100% - 120px));
  }
}

/* Compact tablet navigation: avoids squeezing desktop links on iPad landscape. */
@media (min-width: 821px) and (max-width: 980px) {
  .site-header {
    width: calc(100% - 32px);
    height: 68px;
    gap: 12px;
    padding-inline: 14px;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .menu-toggle {
    display: flex;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    margin-left: 0;
  }

  .primary-nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    display: flex;
    height: auto;
    max-height: min(70vh, 560px);
    overflow-y: auto;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    background: #0a203b;
    box-shadow: var(--shadow-lg);
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }

  .js-enabled .primary-nav {
    display: none;
  }

  .js-enabled .primary-nav.is-open {
    display: flex;
  }

  .primary-nav > a,
  .nav-dropdown-trigger {
    width: 100%;
    height: auto;
    min-height: 46px;
    padding: 0 10px;
    font-size: 12px;
    border-bottom: 1px solid rgba(255,255,255,.1);
  }

  .nav-dropdown {
    display: block;
    height: auto;
  }

  .nav-dropdown-menu {
    position: static;
    display: block;
    width: auto;
    margin: 5px 0 8px;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: rgba(255,255,255,.06);
  }

  .js-enabled .nav-dropdown-menu {
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .js-enabled .nav-dropdown.is-open .nav-dropdown-menu {
    display: block;
  }

  .header-cta {
    min-height: 44px;
    flex: 0 0 auto;
  }
}

/* Tablet and mobile: the menu remains scrollable and all touch targets stay usable. */
@media (max-width: 820px) {
  html {
    scroll-padding-top: 88px;
  }

  .site-header {
    top: calc(10px + env(safe-area-inset-top, 0px));
  }

  .menu-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .primary-nav {
    max-height: min(72vh, 620px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  .primary-nav > a,
  .nav-dropdown-trigger {
    min-height: 46px;
  }

  .nav-dropdown-menu a {
    min-height: 42px;
    display: flex;
    align-items: center;
  }

  .hero-home > *,
  .section-pad > *,
  .page-hero > *,
  .bottom-cta > * {
    min-width: 0;
  }

  .hero-deck-wrap,
  .education-collage,
  .playing-fan,
  .poker-stage,
  .community-orbit {
    margin-inline: auto;
  }
}

@media (max-width: 600px) {
  :root {
    --shell: calc(100% - 32px);
  }

  .shell {
    width: var(--shell);
  }

  .site-header {
    width: calc(100% - 20px);
    padding-inline: 10px;
    gap: 8px;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
    gap: 8px;
  }

  .brand-copy {
    min-width: 0;
  }

  .brand-copy strong {
    max-width: 100%;
    font-size: clamp(8px, 2.5vw, 10px);
    letter-spacing: .025em;
  }

  .brand-copy small {
    font-size: clamp(7px, 2vw, 9px);
  }

  .header-cta {
    min-height: 40px;
    padding-inline: 10px;
    white-space: nowrap;
  }

  .hero-title,
  .page-hero h1 {
    max-width: 100%;
    overflow-wrap: normal;
  }

  .hero-actions {
    flex-wrap: wrap;
  }

  .hero-actions .button {
    min-height: 44px;
  }

  .exchange-card,
  .pricing-card,
  .membership-card,
  .philosophy-card,
  .ecosystem-tile,
  .module-card,
  .guide-path,
  .join-path {
    min-width: 0;
    max-width: 100%;
  }

  .exchange-logo {
    max-width: 100%;
  }

  .exchange-logo img {
    width: auto;
    max-width: min(115px, 100%);
    height: auto;
    margin-inline: auto;
  }

  .footer-main > *,
  .footer-column,
  .footer-brand-block,
  .footer-risk {
    min-width: 0;
  }
}

@media (max-width: 380px) {
  :root {
    --shell: calc(100% - 24px);
  }

  .shell {
    width: var(--shell);
  }

  .brand-copy small {
    display: none;
  }

  .brand-copy strong {
    font-size: 8px;
    letter-spacing: 0;
  }

  .header-cta {
    padding-inline: 8px;
    font-size: 8px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .button {
    width: 100%;
  }

  .philosophy-grid,
  .ecosystem-grid,
  .module-cards,
  .steps-grid,
  .footer-main {
    grid-template-columns: 1fr;
  }

  .module-card:last-child,
  .footer-brand-block,
  .footer-risk {
    grid-column: auto;
  }

  .footer-main {
    gap: 22px;
  }

  .principles-strip {
    grid-template-columns: 1fr;
  }

  .principles-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .principles-strip > div:last-child {
    border-bottom: 0;
  }

  .community-panel {
    padding-inline: 18px;
  }
}

@media (max-width: 320px) {
  .site-header {
    width: calc(100% - 12px);
    padding-inline: 7px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }

  .header-cta {
    min-width: 0;
    font-size: 7px;
  }

  .hero-title,
  .page-hero h1 {
    font-size: clamp(34px, 11vw, 42px);
  }

  .section-heading h2,
  .intro-grid h2,
  .story-copy h2,
  .execution-heading h2,
  .module-heading h2,
  .poker-copy h2,
  .membership-overview h2,
  .community-panel h2,
  .difference-inner h2 {
    font-size: clamp(30px, 9vw, 38px);
  }
}

/* Short landscape phones: keep the first screen and navigation usable. */
@media (max-height: 520px) and (orientation: landscape) {
  .site-header {
    height: 56px;
  }

  .site-header.is-scrolled {
    height: 52px;
  }

  .primary-nav {
    max-height: 68vh;
  }

  .hero-home {
    min-height: 0;
    padding-top: 105px;
    padding-bottom: 40px;
  }

  .page-hero {
    min-height: 360px;
    padding-top: 110px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
