/* 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: 240px;
  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;
    padding-inline: 7px;
    font-size: 9px;
  }

  .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;
  }
}


/* WIC final responsive quality pass — readable mobile type, stable grids, and no clipped controls. */
@media (max-width: 600px) {
  .hero-lede,
  .intro-copy p,
  .story-copy > p:not(.eyebrow),
  .section-heading > p:last-child,
  .section-heading > div > p:last-child,
  .philosophy-card p,
  .ecosystem-tile p,
  .risk-grid small,
  .execution-steps small,
  .journey-list p,
  .module-card p,
  .community-panel p:not(.eyebrow),
  .inside-note p,
  .membership-card p,
  .faq-answer p,
  .page-hero p:not(.eyebrow),
  .exchange-card p,
  .notice-card p,
  .steps-grid p,
  .join-path p,
  .guide-path p,
  .faq-side-card p,
  .guide-note p:not(.eyebrow),
  .bottom-cta p:not(.eyebrow),
  .footer-column a,
  .footer-risk {
    font-size: max(12px, 1em);
    line-height: 1.65;
  }

  .philosophy-card small,
  .ecosystem-tile > b,
  .hero-scroll,
  .footer-column h3 {
    font-size: 10px;
  }

  .comparison-table,
  .academy-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .site-header,
  .site-header.is-scrolled {
    max-width: calc(100% - 20px);
  }

  .header-cta {
    flex-shrink: 0;
  }

  .hero-home,
  .page-hero,
  .final-cta-panel,
  .community-panel,
  .faq-side-card,
  .guide-note {
    overflow: hidden;
  }
}

@media (max-width: 380px) {
  .hero-lede,
  .intro-copy p,
  .story-copy > p:not(.eyebrow),
  .section-heading > p:last-child,
  .philosophy-card p,
  .ecosystem-tile p,
  .risk-grid small,
  .execution-steps small,
  .journey-list p,
  .module-card p,
  .membership-card p,
  .faq-answer p,
  .page-hero p:not(.eyebrow),
  .exchange-card p,
  .notice-card p,
  .steps-grid p,
  .join-path p,
  .guide-path p,
  .faq-side-card p,
  .guide-note p:not(.eyebrow),
  .bottom-cta p:not(.eyebrow),
  .footer-column a {
    font-size: 12px;
  }

  .steps-grid,
  .exchange-grid,
  .pricing-grid,
  .join-path-grid,
  .guide-paths {
    grid-template-columns: 1fr;
  }

  .exchange-card:last-child,
  .pricing-card:last-child {
    grid-column: auto;
  }
}

@media (hover: none) and (pointer: coarse) {
  .button:hover,
  .academy-lesson-card:hover,
  .academy-page-link:hover {
    transform: none;
  }
}

/* Final cross-device pass: compact viewports, safe areas and fixed UI sizing. */
:root {
  /* calc() is the fallback; .shell still caps the content at 1240px. */
  --shell: calc(100% - 64px);
}

.site-header {
  width: calc(100% - 44px);
  max-width: 1460px;
}

.site-header.is-scrolled {
  width: calc(100% - 56px);
  max-width: 1420px;
}

.scroll-progress {
  left: 0;
  right: 0;
  width: auto;
}

.wic-toast {
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100% - 24px);
  overflow-wrap: anywhere;
}

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

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

  .site-header.is-scrolled {
    width: calc(100% - 120px);
    max-width: 1500px;
  }
}

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

  .site-header { width: calc(100% - 44px); }

  .hero-home {
    grid-template-columns: minmax(0, 1fr) minmax(0, .95fr);
    padding-left: 32px;
    padding-right: 32px;
  }

  .hero-deck-wrap {
    transform: scale(.78);
    transform-origin: center;
  }
}

@media (min-width: 821px) and (max-width: 980px) {
  .site-header,
  .site-header.is-scrolled {
    width: calc(100% - 32px);
    max-width: none;
  }
}

/* A tablet-width hero needs room for its illustration instead of squeezing it. */
@media (min-width: 821px) and (max-width: 900px) {
  .hero-home {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 150px;
  }

  .hero-copy {
    width: var(--shell);
    max-width: none;
    margin-inline: auto;
  }

  .hero-deck-wrap {
    width: 100%;
    max-width: 600px;
    margin: 8px auto 0;
    transform: scale(.88);
  }
}

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

  .site-header,
  .site-header.is-scrolled,
  .site-header.academy-header {
    left: calc(10px + env(safe-area-inset-left, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px));
    width: auto;
    max-width: none;
    transform: none;
  }

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

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

  .primary-nav {
    max-height: calc(100vh - 100px);
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

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

@supports (height: 100dvh) {
  @media (max-width: 820px) {
    .primary-nav { max-height: calc(100dvh - 100px); }
  }
}

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

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

  .site-header,
  .site-header.is-scrolled,
  .site-header.academy-header {
    left: calc(10px + env(safe-area-inset-left, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px));
    width: auto;
    max-width: none;
    padding-inline: 8px;
    gap: 6px;
    transform: none;
  }

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

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

  .brand-copy { min-width: 0; }
  .brand-copy strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

  .header-cta {
    min-width: 0;
    min-height: 44px;
    flex: 0 0 auto;
    padding-inline: 9px;
    white-space: nowrap;
  }

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

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

  .comparison-table-wrap,
  .comparison-table,
  .academy-table-wrap,
  .academy-filter-row {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
  }

  .comparison-table-wrap,
  .academy-table-wrap,
  .academy-filter-row {
    touch-action: pan-x pan-y;
  }
}

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

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

  .site-header,
  .site-header.is-scrolled,
  .site-header.academy-header {
    left: calc(6px + env(safe-area-inset-left, 0px));
    right: calc(6px + env(safe-area-inset-right, 0px));
    padding-inline: 6px;
    gap: 5px;
  }

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

  .brand-mark img { width: 23px; height: 23px; }
  .brand-copy small { display: none; }
  .brand-copy strong { font-size: 8px; letter-spacing: 0; }

  .header-cta {
    min-width: 0;
    padding-inline: 6px;
    font-size: 8px;
    gap: 4px;
  }

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

  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button { width: 100%; }

  .notice-card { gap: 10px; padding: 14px; }
  .notice-icon { width: 38px; height: 38px; flex: 0 0 38px; }
  .inside-window-body { grid-template-columns: 70px minmax(0, 1fr); }
  .inside-side { padding-inline: 8px; }
  .inside-content { min-width: 0; padding: 12px; }

  .hero-deck-wrap {
    transform: scale(.58);
    transform-origin: center;
    height: 290px;
    margin-inline: -8px;
  }

  .education-collage {
    transform: scale(.72);
    transform-origin: center;
    margin-inline: -12px;
  }

  .fundamental-visual,
  .mind-visual {
    transform: scale(.72);
    transform-origin: center;
    margin-block: -35px;
    min-height: 260px;
  }

  .deck-stage {
    transform: scale(.62);
    transform-origin: center;
    margin-inline: -14px;
  }

  .playing-fan {
    transform: scale(.58);
    transform-origin: center;
    height: 245px;
    margin-block: -22px;
  }

  .poker-stage {
    transform: scale(.62);
    transform-origin: center;
    margin: -20px -12px;
  }

  .community-orbit {
    transform: scale(.76);
    transform-origin: center;
    margin-block: -20px;
  }
}

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

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

  .site-header,
  .site-header.is-scrolled,
  .site-header.academy-header {
    left: calc(4px + env(safe-area-inset-left, 0px));
    right: calc(4px + env(safe-area-inset-right, 0px));
    padding-inline: 5px;
    gap: 4px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .brand-mark img { width: 21px; height: 21px; }
  .brand-copy strong { font-size: 7.5px; }
  .header-cta { padding-inline: 5px; font-size: 7.5px; }

  .hero-deck-wrap { transform: scale(.50); height: 260px; }
  .education-collage { transform: scale(.64); }
  .fundamental-visual,
  .mind-visual { transform: scale(.62); min-height: 235px; margin-block: -45px; }
  .deck-stage { transform: scale(.54); }
  .playing-fan { transform: scale(.46); height: 220px; }
  .poker-stage { transform: scale(.54); }
  .community-orbit { transform: scale(.68); }

  .section-pad { padding-block: 54px; }
  .final-cta-panel { padding-inline: 16px; }
  .community-panel { padding-inline: 14px; }
}

@media (max-width: 280px) {
  .hero-deck-wrap { transform: scale(.44); height: 235px; }
  .education-collage { transform: scale(.58); }
  .fundamental-visual,
  .mind-visual { transform: scale(.56); min-height: 215px; }
  .deck-stage { transform: scale(.48); }
  .playing-fan { transform: scale(.40); height: 205px; }
  .poker-stage { transform: scale(.48); }
  .community-orbit { transform: scale(.62); }
}

@media (max-height: 520px) and (orientation: landscape) {
  .site-header,
  .site-header.is-scrolled {
    top: calc(5px + env(safe-area-inset-top, 0px));
  }

  .primary-nav { max-height: calc(100vh - 76px); }
  .hero-home { padding-top: 105px; }
}

@media (hover: none) and (pointer: coarse) {
  .button,
  .header-cta,
  .menu-toggle,
  .nav-dropdown-trigger,
  .academy-filter,
  .academy-print-button {
    min-height: 44px;
  }

  .button:hover,
  .academy-lesson-card:hover,
  .academy-page-link:hover,
  .exchange-card:hover .exchange-cta {
    transform: none;
  }
}

/* Old WebViews can ignore clamp()/min()/max(); retain a readable base scale. */
@supports not (font-size: clamp(1px, 2vw, 3px)) {
  .hero-title { font-size: 56px; }
  .page-hero h1 { font-size: 52px; }
  .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: 42px; }

  @media (max-width: 600px) {
    .hero-title,
    .page-hero h1 { font-size: 38px; }
    .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: 34px; }
  }
}


/* Restore the intended single-column hero flow on all phone and portrait-tablet widths. */
@media (max-width: 820px) {
  .hero-home {
    grid-template-columns: minmax(0, 1fr);
    padding: 145px 0 70px;
  }

  .hero-copy {
    width: var(--shell);
    max-width: none;
    margin-inline: auto;
  }

  .hero-deck-wrap {
    width: 100%;
    max-width: 600px;
    height: 480px;
    margin: 5px auto 0;
    transform: scale(.88);
  }
}

@media (max-width: 600px) {
  .hero-home { padding: 125px 0 55px; }
  .hero-deck-wrap {
    height: 350px;
    margin: 0 -20px;
    transform: scale(.76);
  }
}

/* Keep the hero deck inside very narrow phone viewports after the flow reset. */
@media (max-width: 380px) {
  .hero-deck-wrap {
    height: 290px;
    margin-inline: -8px;
    transform: scale(.58);
  }
}

@media (max-width: 320px) {
  .hero-deck-wrap {
    height: 260px;
    transform: scale(.50);
  }
}

@media (max-width: 280px) {
  .hero-deck-wrap {
    height: 235px;
    transform: scale(.44);
  }

  .header-cta span { display: none; }
  .header-cta { padding-inline: 5px; }
  .brand-copy strong { font-size: 7px; }
}

/* Prevent mobile text auto-inflation while preserving browser zoom controls. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (max-width: 600px) {
  input,
  select,
  textarea {
    max-width: 100%;
    min-width: 0;
    font-size: 16px;
  }
}
