/* =========================================================
   PepperGrid - Shared Styles (Revised / Deduped)
   Notes:
   - Removed duplicate .submenu blocks and conflicting rules
   - Fixed desktop submenu hover gap (submenu no longer disappears)
   - Kept mobile drawer submenu support (<details>/<summary>)
   - Removed the old @media(720px) rule that forced desktop submenu "static"
========================================================= */

/* =========================================================
   Section 0 - Theme + Base
========================================================= */

:root{
  --bg0: #070A12;
  --bg1: #0B1020;

  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.08);

  --text: rgba(255,255,255,0.90);
  --muted: rgba(255,255,255,0.70);
  --faint: rgba(255,255,255,0.55);
  --line: rgba(255,255,255,0.12);

  --accent: #ff5a3a;
  --accent2: #ff8a00;
  --ok: #39d98a;

  --shadow: 0 16px 60px rgba(0,0,0,0.55);
  --radius: 18px;
  --radius2: 22px;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 20% 10%, rgba(255,90,58,0.12), transparent 55%),
    radial-gradient(900px 650px at 85% 20%, rgba(255,138,0,0.10), transparent 55%),
    radial-gradient(1000px 900px at 50% 95%, rgba(57,217,138,0.07), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

.container{
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

/* =========================================================
   Section 1 - Topbar (Unified)
========================================================= */

.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7,10,18,0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  overflow: visible;
}

.topbar-inner{
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  overflow: visible;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  user-select: none;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.brand-mark{
  font-size: 20px;
  line-height: 1;
}

.brand-name{
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-badge{
  margin-left: 6px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,90,58,0.14);
  border: 1px solid rgba(255,90,58,0.25);
  color: rgba(255,255,255,0.88);
}

.brand-badge.pulse{
  box-shadow: 0 0 0 6px rgba(255,90,58,0.06);
}

/* Pepper mark used by the reusable header */
.pepper-dot{
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 22px rgba(255,90,58,0.35);
}

/* Legacy simple nav (kept for landing if used) */
.nav{
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-link{
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.nav-link:hover{
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.nav-link.is-disabled{
  opacity: 0.55;
  pointer-events: none;
}

.topbar-actions{
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Buttons */
.btn{
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
}

.btn:disabled{
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ghost{ background: transparent; }

.btn-primary{
  border-color: rgba(255,90,58,0.40);
  background: linear-gradient(135deg, rgba(255,90,58,0.30), rgba(255,138,0,0.18));
}

/* =========================================================
   Section 1.1 - Reusable DB Menu (Desktop)
========================================================= */

nav{ margin-left: auto; }

.menu{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 10px;
  align-items: center;
}

.menu > li{
  position: relative;
}

/* Hover bridge to prevent submenu disappearing */
.menu > li::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
}

.menu a,
.menu button{
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}

.menu a:hover,
.menu button:hover{
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
}

/* Desktop submenu (single authoritative definition) */
.submenu{
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  min-width: 220px;
  background: rgba(15, 20, 28, 0.92);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
  padding: 8px;
  display: none;
  z-index: 100;
}

.submenu a{
  width: 100%;
  padding: 10px 10px;
  border-radius: 10px;
  display: block;
}

/* Hover + keyboard focus */
.menu > li:hover .submenu,
.menu > li:focus-within .submenu{
  display: block;
}

/* =========================================================
   Section 1.2 - Global Mobile Hamburger Menu
========================================================= */

.pg-mobile-toggle{ display: none; }

/* Drawer elements (hidden by default, enabled on mobile) */
.pg-drawer-backdrop,
.pg-drawer{
  display: none;
}

@media (max-width: 900px){

  html, body{
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Hide desktop nav on mobile */
  header nav,
  .topbar nav,
  .menu{
    display: none !important;
  }

  /* Show hamburger on mobile */
  .pg-mobile-toggle{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.92);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    line-height: 0;
  }

  .pg-mobile-toggle:focus{
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,90,58,0.25);
  }

  .pg-burger{
    width: 18px;
    height: 14px;
    position: relative;
    display: inline-block;
  }

  .pg-burger span{
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255,255,255,0.92);
    border-radius: 2px;
  }

  .pg-burger span:nth-child(1){ top: 0; }
  .pg-burger span:nth-child(2){ top: 6px; }
  .pg-burger span:nth-child(3){ top: 12px; }

  /* Backdrop */
  .pg-drawer-backdrop{
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 9998;
  }

  /* Drawer */
  .pg-drawer{
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(86vw, 360px);
    background: rgba(18,18,20,0.98);
    border-left: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 30px 90px rgba(0,0,0,0.65);
    transform: translateX(102%);
    transition: transform 180ms ease;
    z-index: 9999;
    padding: 14px;
    box-sizing: border-box;
    overflow-y: auto;
  }

  .pg-drawer-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
  }

  .pg-drawer-title{
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.70);
    margin: 0;
  }

  .pg-drawer-close{
    appearance: none;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.92);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
  }

  /* Drawer list (supports <details><summary> submenus) */
  .pg-drawer > ul{
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
  }

  .pg-drawer li{
    list-style: none;
    margin: 0;
    padding: 0;
  }

  /* Top-level links */
  .pg-drawer > ul > li > a{
    display: block;
    padding: 12px 12px;
    border-radius: 14px;
    text-decoration: none;
    color: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);
  }

  /* Details container (menu items with children) */
  .pg-drawer details{
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    overflow: hidden;
  }

  .pg-drawer summary{
    cursor: pointer;
    padding: 12px 12px;
    color: rgba(255,255,255,0.92);
    font-weight: 600;
    user-select: none;
    list-style: none;
  }

  .pg-drawer summary::-webkit-details-marker{ display: none; }

  .pg-drawer details > summary::after{
    content: "▾";
    float: right;
    opacity: 0.85;
  }

  .pg-drawer details[open] > summary::after{ content: "▴"; }

  /* Submenu list (no grid, indented) */
  .pg-drawer details > ul{
    list-style: none;
    margin: 0;
    padding: 6px 0 10px 14px;
    display: block;
  }

  .pg-drawer details > ul > li{
    margin: 6px 0 0 0;
  }

  .pg-drawer details > ul > li > a{
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(255,255,255,0.90);
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.03);
  }

  .pg-drawer a:hover,
  .pg-drawer summary:hover{
    background: rgba(255,90,58,0.14);
    border-color: rgba(255,90,58,0.22);
  }

  .pg-drawer details[open] > summary{
    border-bottom: 1px solid rgba(255,255,255,0.10);
  }

  /* Open state */
  body.pg-drawer-open .pg-drawer-backdrop{
    opacity: 1;
    pointer-events: auto;
  }

  body.pg-drawer-open .pg-drawer{
    transform: translateX(0);
  }
}

/* =========================================================
   Section 2 - Hero
========================================================= */

.hero{ padding: 56px 0 40px; }

.hero-grid{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: start;
}

.kicker{
  margin: 0 0 10px;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
}

.hero-title{
  margin: 0 0 12px;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.08;
}

.hero-tagline{
  margin: 0 0 10px;
  color: rgba(255,255,255,0.82);
  font-size: 16px;
}

.hero-body{
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 62ch;
}

.hero-cards{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.card{
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  padding: 14px 14px 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.30);
}

.card h3{
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing: 0.2px;
}

.card p{
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.cta-row{
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.mini-note{
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}

.dot{
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(57,217,138,0.10);
}

/* =========================================================
   Section 3 - Visual Panel
========================================================= */

.hero-visual{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.visual-frame{
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.visual-inner{ padding: 14px; }

.visual-img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.20);
}

.visual-fallback{
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.18);
}

.fallback-badge{
  display: inline-block;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.82);
  margin-bottom: 10px;
}

.visual-fallback h2{
  margin: 0 0 6px;
  font-size: 18px;
}

.visual-fallback p{
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.5;
}

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  color: rgba(255,255,255,0.84);
}

.grid-preview{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.gp{
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

.grid9{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  grid-auto-flow: dense;
}

/* =========================================================
   Section 3.1 - Page Block Text Spacing (Deduped)
========================================================= */

.article-content p{
  margin: 0 0 10px 0;
}

.article-content p:first-child{ margin-top: 0; }
.article-content p:last-child{ margin-bottom: 0; }

.block .label{
  margin-bottom: 6px;
}

.block .article-content{
  margin-top: 0;
  padding-top: 0;
}

.block .article-content p:first-child{
  margin-top: 0;
}

/* Strong override for stubborn layouts */
.block .article-content{
  padding-top: 0 !important;
  margin-top: 0 !important;
}

.block .article-content p{
  margin-top: 0 !important;
}

.block .label{
  margin-bottom: 4px !important;
  padding-bottom: 0 !important;
}

/* Pills */
.visual-footer .pill{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.78);
  font-size: 13px;
}

.pill-dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(255,90,58,0.10);
}

/* =========================================================
   Section 4 - Footer (Global)
========================================================= */

.footer{
  padding: 26px 0 34px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  background: rgba(0,0,0,0.10);
}

.footer-inner{
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.pg-footer{
  margin-top: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
}

.pg-footer-inner{
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.pg-footer-text{
  margin: 0;
  color: rgba(255,255,255,0.72);
  line-height: 1.55;
  font-size: 13px;
}

.pg-footer-meta{
  text-align: right;
  white-space: nowrap;
}

/* =========================================================
   Section 5 - Responsive
========================================================= */

@media (max-width: 980px){
  .hero-grid{ grid-template-columns: 1fr; }
  .hero-cards{ grid-template-columns: 1fr; }
  .topbar-actions{ display: none; }

  .pg-footer-inner{
    flex-direction: column;
    align-items: flex-start;
  }

  .pg-footer-meta{
    text-align: left;
    white-space: normal;
  }
}

@media (max-width: 640px){
  .footer-inner{ flex-direction: column; }
  .footer-meta{ text-align: left; }
}
