/* Shared final layout rules. Keep after the legacy and page-specific styles. */
:root { --site-header-height: clamp(72px, 5.365vw, 112px); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-width: 0; }
img, video { max-width: 100%; }
*, *::before, *::after { box-sizing: border-box; }
:where(main, section, article, .shell, .product-info, .founder-info) { min-width: 0; }
:where(a, button):focus-visible { outline: 2px solid #8e3517; outline-offset: 3px; }
:where(#about, #features, #footer, #top) { scroll-margin-top: calc(var(--site-header-height) + 16px); }

.psd-home-header {
  position: fixed;
  inset: 0 0 auto;
  width: 100%;
  height: var(--site-header-height) !important;
  aspect-ratio: auto !important;
  z-index: 1000;
}
.psd-home-header .psd-header-artwork {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100% !important;
  object-fit: cover;
}
.psd-home-header .psd-home-nav {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  max-width: 100%;
  height: 100% !important;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)) !important;
  display: flex;
  flex-wrap: nowrap !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 0 !important;
}
.psd-home-header .psd-home-nav .nav-text {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  font-size: clamp(16px, 1.15vw, 22px) !important;
  padding: 10px clamp(8px, .94vw, 18px) !important;
  line-height: 1.4;
}
.psd-home-header .psd-home-nav .nav-divider { flex: 0 0 1px; }
.psd-home-header .psd-home-nav .nav-join-img {
  flex: 0 0 auto !important;
  height: clamp(36px, 2.5vw, 48px) !important;
  margin-left: clamp(10px, 1.04vw, 20px) !important;
}
.psd-home-header .nav-join-img img { width: auto; height: 100%; object-fit: contain; }
.hero-section { margin-top: var(--site-header-height); }
.hero-content-inner > * { min-width: 0; }
.hero-desc p { overflow-wrap: anywhere; }
.site-footer .contact-value { overflow-wrap: anywhere; }
.site-footer { padding-bottom: env(safe-area-inset-bottom); }

@media (max-width: 1439px) {
  .hero-content-inner {
    width: min(1100px, calc(100% - 48px));
    display: grid;
    grid-template-columns: minmax(220px, 30%) minmax(0, 1fr);
    align-items: start;
    gap: clamp(24px, 4vw, 48px);
  }
  .hero-bottom-content { padding: 48px 0; }
  .founder-card-wrapper {
    width: 100%;
    min-width: 0;
    margin: 0;
    transform: none;
  }
  .hero-text-wrapper { max-width: none; margin: 0; transform: none; }
  .hero-heading { gap: 12px; }
  .hero-heading h2 { font-size: clamp(21px, 2.5vw, 28px); letter-spacing: 2px; }
  .hero-desc p { font-size: 17px; line-height: 1.9; }
  .hero-action { margin-top: 24px; }
}

@media (max-width: 1023px) {
  :root { --site-header-height: calc(64px + env(safe-area-inset-top)); }
  .psd-home-header .psd-home-nav {
    display: flex;
    flex-direction: row;
    gap: clamp(2px, .5vw, 6px) !important;
    padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)) !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .psd-home-header .psd-home-nav .nav-divider {
    display: block !important;
    flex: 0 0 1px;
    width: 1px !important;
    height: 14px !important;
    margin: 0 !important;
  }
  .psd-home-header .psd-home-nav .nav-text {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    padding: 8px 0 !important;
    font-size: clamp(10px, 2.8vw, 16px) !important;
    font-weight: 600 !important;
    text-shadow: none !important;
  }
  .psd-home-header .psd-home-nav .nav-join-img {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    height: 44px !important;
    width: clamp(52px, 16vw, 112px);
    margin: 0 !important;
  }
  .psd-home-header .nav-join-img img { height: auto; width: 100%; max-width: 100%; }
  .hero-section { margin-top: var(--site-header-height); }
  .founder-page .founder-main { grid-template-columns: minmax(260px, 38%) minmax(0, 1fr); gap: 28px; }
  .founder-page .founder-wrapper { padding-inline: 24px; }
}

@media (max-width: 359px) {
  .psd-home-header .psd-home-nav .nav-divider { display: none !important; }
}

@media (max-width: 760px) {
  .hero-bg-wrapper { height: auto; min-height: 0; }
  .hero-bg-wrapper picture { display: block; }
  .hero-bg-wrapper .hero-bg-img { display: block; width: 100%; height: auto; object-fit: contain; }
  .hero-content-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(100% - 32px);
    gap: 28px;
  }
  .hero-bottom-content { padding: 28px 0 36px; }
  .hero-text-wrapper { order: 1; width: 100%; margin: 0; transform: none !important; flex: initial; }
  .founder-card-wrapper { order: 2; width: min(100%, 320px); max-width: 320px; margin: 0; transform: none !important; flex: initial; }
  .hero-heading { gap: 10px; margin: 0 0 16px; }
  .hero-heading h2 { margin: 0; font-size: clamp(19px, 5.3vw, 25px); letter-spacing: 1px; }
  .hero-heading .line { min-width: 12px; max-width: 64px; }
  .hero-desc p { font-size: 16px; line-height: 1.85; margin: 0 0 16px; text-align: start; }
  .hero-action { margin-top: 20px; }
  .features-section { padding: 36px 0 !important; }
  .features-section .section-heading h2 { font-size: clamp(22px, 6vw, 28px); }
  .site-footer .footer-container { width: 100%; padding: 28px 16px !important; gap: 24px !important; }
  .site-footer .footer-contact-info { align-items: stretch; width: 100% !important; gap: 12px !important; padding: 0 !important; }
  .site-footer .contact-line {
    display: grid !important;
    grid-template-columns: 5.5em minmax(0, 1fr);
    justify-content: start !important;
    align-items: start !important;
    white-space: normal !important;
    text-align: left;
    gap: 4px;
    font-size: 14px !important;
    line-height: 1.7 !important;
    letter-spacing: 0 !important;
    width: 100% !important;
  }
  .site-footer .contact-label, .site-footer .contact-value { font-size: inherit !important; white-space: normal !important; }
  .site-footer .footer-nav-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 4px 8px; }
  .site-footer .footer-nav-links a { min-height: 44px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
  .founder-page .founder-main { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .founder-page .founder-wrapper { padding: 24px 16px 36px; }
  .founder-page .founder-portrait { width: min(100%, 420px); }
  .founder-page .cert-stage { overflow: hidden; }
  .founder-page .cert-header-bar { flex-wrap: wrap; gap: 8px; }
  .founder-page .cert-header-bar h3 { font-size: 17px; overflow-wrap: anywhere; }
  .founder-page .cert-lightbox-img-wrapper { min-width: 0; max-width: calc(100vw - 24px); }
  .detail-page { padding: 24px 16px 40px; }
  .detail-title { font-size: 28px; margin-bottom: 28px; }
  .detail-title small { display: block; margin-left: 0; }
  .product, .product:nth-child(even) { flex-direction: column; gap: 20px; padding: 20px 16px; }
  .product-img, .product-info { width: 100%; min-width: 0; flex: auto; }
  .product-name { font-size: 25px; padding-left: 12px; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 20px; }
  .product-info p { font-size: 16px; overflow-wrap: anywhere; }
  .product-info h3 { font-size: 21px; }
  .case-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .case-quotes { grid-template-columns: minmax(0, 1fr); }
  .reward-feature-grid, .earn-points-grid { grid-template-columns: minmax(0, 1fr); }
}
