/* ============================================================
   7TRIBES GLOBAL RESPONSIVE DESIGN SYSTEM
   ============================================================
   Single source of truth for responsive behavior across 7trb.com.
   Link this file in every page:
   <link rel="stylesheet" href="css/global-responsive.css">
   
   Any new page that includes this file + nav.js will automatically
   be mobile-friendly without needing page-specific responsive CSS.
   ============================================================ */

/* ============================================================
   1. RESET & FOUNDATION
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  max-width: 100vw;
  overflow-x: clip;
  margin: 0;
  line-height: 1.6;
}

img, video, iframe, embed, object, svg {
  max-width: 100%;
  height: auto;
}

pre, code, .address, .hash, .contract-address, [class*="address"] {
  word-break: break-all;
  overflow-wrap: break-word;
}

input, select, textarea, button {
  max-width: 100%;
  font: inherit;
}

/* ============================================================
   2. LAYOUT CONTAINERS
   ============================================================ */
.wrap, .container, [class*="wrap"]:not(.flex-wrap) {
  max-width: min(1160px, calc(100vw - 32px));
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ============================================================
   3. TYPOGRAPHY SCALE (fluid)
   ============================================================ */
h1, .h1 {
  font-size: clamp(28px, 5vw + 1rem, 56px);
  line-height: 1.1;
}

h2, .h2 {
  font-size: clamp(22px, 3.5vw + 0.5rem, 40px);
  line-height: 1.2;
}

h3, .h3 {
  font-size: clamp(18px, 2.5vw + 0.5rem, 28px);
  line-height: 1.3;
}

h4, .h4 {
  font-size: clamp(16px, 2vw + 0.25rem, 22px);
  line-height: 1.35;
}

body {
  font-size: clamp(15px, 1vw + 0.5rem, 18px);
}

small, .text-sm {
  font-size: max(13px, 0.8rem);
}

/* ============================================================
   4. NAVIGATION — HEADER & HAMBURGER
   ============================================================ */
.top-nav, nav[class*="top-nav"] {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 5, 2, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 215, 122, 0.18);
}

.top-nav-inner, .header-inner {
  max-width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}

.nav-brand, .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand img, .brand img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.main-nav, .nav-links {
  display: flex;
  gap: 14px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
}
nav.mainNav .mobile-platform-brand { display:none !important; }

.main-nav a, .nav-links a {
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
}

/* UNITY MOBILE NAV: official brand symbol and wordmark lead the header;
   drawer remains compact, clearly grouped, and safely touch-accessible. */
/* Hamburger button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gold-bright, #ffdd7a);
  font-size: 0;
  cursor: pointer;
  padding: 9px;
  line-height: 1;
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hamburger-icon { display:flex; width:30px; flex-direction:column; gap:5px; }
.hamburger-icon > span { display:block; width:100%; height:3px; border-radius:99px; background:var(--gold-bright, #ffdd7a); box-shadow:0 0 8px rgba(255,215,122,.22); }

/* Mobile overlay */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.menu-overlay.active {
  display: block;
  opacity: 1;
}

/* Mobile drawer */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 0; right: 0;
  width: min(80vw, 360px);
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(ellipse 80% 35% at 100% 0%, rgba(184,131,27,.22), transparent 70%), linear-gradient(155deg, rgba(35,20,9,.99), rgba(11,8,7,.99) 58%, rgba(30,18,10,.99));
  border-left: 1px solid rgba(255, 215, 122, 0.42);
  box-shadow: -22px 0 55px rgba(0,0,0,.42);
  z-index: 999;
  overflow-y: auto;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}
.mobile-drawer.active {
  display: flex;
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height:72px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 215, 122, 0.15);
  flex-shrink: 0;
}
.drawer-header img { width:40px; height:40px; border-radius:50%; }
.drawer-header span {
  color: #e7b852;
  font-weight: 900;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.close-btn {
  background: none; border: none;
  color: #ffdd7a; font-size: 34px;
  cursor: pointer; padding: 4px;
  min-width: 48px; min-height: 48px;
  display: flex; align-items: center; justify-content: center;
}

.drawer-links {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}
.drawer-links a {
  display: block;
  padding: 14px 0;
  color: #f5e6c8;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 215, 122, 0.08);
  text-decoration: none;
  transition: color 0.2s ease;
}
.drawer-links a:hover {
  color: #e7b852;
}

.drawer-content, .drawer-links { flex:1; overflow-y:auto; padding:12px 18px; }
.drawer-section { margin:0 0 14px; }
.drawer-section-title { display:block; margin:0 0 5px; color:var(--unity-muted, #c9b898); font-size:10px; font-weight:900; letter-spacing:.16em; text-transform:uppercase; }
.drawer-section a { display:block; margin:1px 0; padding:8px 10px; border-radius:9px; color:#f5e6c8; font-size:14px; font-weight:700; line-height:1.2; text-decoration:none; }
.drawer-section a[aria-current="page"] { color:#ffdd7a; background:linear-gradient(90deg, rgba(231,184,82,.20), rgba(231,184,82,.03)); box-shadow:inset 2px 0 0 #e7b852; }
.drawer-footer { padding:12px 18px 16px; border-top:1px solid rgba(255,215,122,.15); background:linear-gradient(180deg, rgba(8,6,4,.02), rgba(8,6,4,.32)); }
.drawer-cta { display:flex; width:100%; min-height:48px; align-items:center; justify-content:center; border:1px solid rgba(255,221,122,.62); border-radius:12px; background:linear-gradient(108deg, #ffdd7a, #e7b852 52%, #b8831b); color:#170d03; font-size:13px; font-weight:900; letter-spacing:.07em; text-align:center; text-decoration:none; text-transform:uppercase; }

body.menu-open {
  overflow: hidden;
}

/* Show hamburger at 992px */
@media (max-width: 992px) {
  .main-nav, .nav-links, .mainNav {
    display: none !important;
  }
  .menu-toggle {
    display: flex !important;
  }
  .top-nav-inner, .header-inner {
    min-height:70px;
    padding:12px 18px;
    gap:12px;
  }
  .nav-brand img, .brand img {
    width:42px; height:42px;
  }
  .nav-brand, .brand { gap:10px; }
  .nav-brand span, .brand span { color:var(--gold-bright, #ffdd7a); font-size:18px; font-weight:900; letter-spacing:.11em; }
  nav.mainNav { display:flex !important; min-height:72px; align-items:center; justify-content:space-between; padding:12px 18px; border-bottom:1px solid rgba(255,215,122,.22); background:linear-gradient(105deg, rgba(8,9,13,.98), rgba(39,20,8,.98)); }
  nav.mainNav > a { display:none !important; }
  nav.mainNav .mobile-platform-brand { display:flex !important; align-items:center; gap:10px; color:var(--gold-bright, #ffdd7a); font-size:18px; font-weight:900; letter-spacing:.11em; text-decoration:none; }
  nav.mainNav .mobile-platform-brand img { width:42px; height:42px; border-radius:50%; }
}

/* ============================================================
   5. HERO SECTIONS
   ============================================================ */
.hero-banner, .hero, [class*="hero-section"] {
  position: relative;
}

/* Dark overlay for text readability */
.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.45) 40%,
    rgba(0, 0, 0, 0.70) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.hero-banner > *:not(.hero-bg):not(.scroll-indicator), .hero > *:not(.hero-bg):not(.scroll-indicator), .banner-text, .hero-content {
  position: relative;
  z-index: 2;
}

@media (max-width: 992px) {
  .hero-banner, .hero, [class*="hero-section"] {
    min-height: 240px;
    height: auto;
    padding: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .hero-banner h1, .hero-headline, .banner-text h1 {
    font-size: clamp(26px, 7vw, 40px) !important;
    line-height: 1.15;
  }
  .hero-banner p, .hero-subheadline, .banner-text p {
    font-size: clamp(14px, 3.5vw, 18px) !important;
    line-height: 1.5;
  }
}

@media (max-width: 430px) {
  .hero-banner, .hero {
    padding: 0;
    min-height: 200px;
    width: 100%;
  }
  .hero-banner h1, .banner-text h1, .hero-headline {
    font-size: clamp(22px, 6.5vw, 32px) !important;
  }
}

/* ============================================================
   6. SECTION SPACING
   ============================================================ */
@media (max-width: 992px) {
  section, .section, [class*="section"]:not(.hero-banner):not([class*="nav"]) {
    padding-top: 36px;
    padding-bottom: 36px;
  }
}

@media (max-width: 430px) {
  section, .section, [class*="section"]:not(.hero-banner):not([class*="nav"]) {
    padding-top: 28px;
    padding-bottom: 28px;
  }
}

/* ============================================================
   7. BUTTONS
   ============================================================ */
.btn, a.btn, button:not(.menu-toggle):not(.close-btn),
[class*="btn"]:not(.menu-toggle):not(.close-btn),
input[type="submit"] {
  min-height: 44px;
  padding: 12px 24px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.16s cubic-bezier(0.23, 1, 0.32, 1);
}

.btn:active, button:active, [class*="btn"]:active {
  transform: scale(0.97);
}

@media (max-width: 992px) {
  .btn, a.btn, button:not(.menu-toggle):not(.close-btn),
  [class*="btn"]:not(.menu-toggle):not(.close-btn),
  input[type="submit"] {
    display: block;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    min-height: 48px;
    padding: 14px 20px;
    font-size: 14px;
    text-align: center;
  }

  .hero-actions, .btn-group, [class*="actions"] {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    width: 100%;
  }
  .hero-actions .btn, .btn-group .btn {
    width: 100%;
    max-width: none;
  }
}

/* ============================================================
   8. CARDS & GRIDS
   ============================================================ */
@media (max-width: 768px) {
  [class*="grid"]:not(.detroit-stats),
  [class*="cards"],
  [class*="columns"] {
    grid-template-columns: 1fr !important;
    display: grid;
  }
  .detroit-stats {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 430px) {
  .card, [class*="card"] {
    padding: 16px;
    margin-bottom: 12px;
  }
  .detroit-stats {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   9. FORMS
   ============================================================ */
@media (max-width: 992px) {
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="url"], input[type="tel"],
  input[type="search"], select, textarea {
    width: 100%;
    max-width: 100%;
    font-size: 16px; /* prevents iOS zoom */
    padding: 12px;
  }
}

/* ============================================================
   10. TABLES
   ============================================================ */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

@media (max-width: 768px) {
  table {
    font-size: 13px;
  }
  td, th {
    padding: 8px 6px;
  }
}

@media (max-width: 430px) {
  table {
    font-size: 12px;
  }
  td, th {
    padding: 6px 4px;
  }
}

/* ============================================================
   11. FOOTER
   ============================================================ */
@media (max-width: 768px) {
  footer, [class*="footer"] {
    text-align: center;
  }
  footer .wrap, footer > div, footer > * {
    flex-direction: column;
    gap: 12px;
  }
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
}

/* ============================================================
   12. SAFE AREA SUPPORT
   ============================================================ */
@supports (padding: env(safe-area-inset-top)) {
  .top-nav, nav[class*="top-nav"] {
    padding-top: env(safe-area-inset-top);
  }
  .mobile-drawer {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ============================================================
   13. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   14. PRINT STYLES
   ============================================================ */
@media print {
  .top-nav, .menu-toggle, .mobile-drawer, .menu-overlay,
  .drawer-header, .drawer-links, .close-btn {
    display: none !important;
  }
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
}
