/* ====== MOBILE ESSENTIALS (place at end of main CSS) ====== */

/* Base mobile breakpoint (phones & small tablets) */
@media (max-width: 900px) {

  /* Page spacing and prevent horizontal overflow */
  body {
    padding: 12px;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
  }

  /* ---------------------------
     Disable desktop interaction system
     (magnifier, blur, semantic layers)
     --------------------------- */
  #stage,
  #layer-blur,
  #semantic-layer,
  .magnifier-wrapper,
  #lens-ui,
  #lens-frame,
  #lens-handle,
  .lens-style-panel,
  #skin-panel {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* ---------------------------
     Mobile-only clean resume preview
     --------------------------- */
  .mobile-resume-only {
    display: block;
    width: 100%;
    max-width: 920px;
    margin: 12px auto;
  }

  .mobile-resume-preview {
    width: 100%;
    height: 280px;               /* intentional preview crop */
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.22);
    background: #fff;
  }

  .mobile-resume-preview img {
    display: block;
    width: 100%;
    height: auto;
    transform: translateY(-8%);  /* show top portion of resume */
    -webkit-transform: translateY(-8%);
    image-rendering: auto;
  }

  .resume-cta {
    display: inline-block;
    margin-top: 10px;
    color: #fff;
    text-decoration: underline;
  }

  /* ---------------------------
     Mobile highlights (accordion)
     --------------------------- */
  #mobile-resume-highlights {
    display: block;
    margin: 18px 0;
  }

  .mobile-highlights-wrapper {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
  }

  .desc-toggle {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    background: transparent;
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
  }

  .chart-description {
    display: none; /* toggled via JS when desc-toggle is clicked */
    background: #0f1724;
    color: #e6eef8;
    padding: 12px 14px;
    border-radius: 8px;
    margin-top: 6px;
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .highlight-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .highlight-list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
  }

  .highlight-list li p {
    margin: 6px 0 0;
    color: #cbd5e1;
    font-size: 0.95rem;
  }

  /* Small visual and touch improvements */
  .desc-toggle,
  .resume-cta {
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
  }

  /* Footer adjustments */
  .footer-section {
    padding: 1.5rem 1rem;
  }
  .footer-nav {
    flex-direction: column;
    gap: 0.6rem;
    align-items: center;
  }
  .footer-link {
    font-size: 0.8rem;
  }
}

/* Hide mobile preview on desktop */
@media (min-width: 901px) {
  .mobile-resume-only { display: none; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}



/* ===========================
   SIGNAL EXTRACTION - MOBILE VIEW
   (Paste at end of mobile.css / after mobile essentials)
   =========================== */

@media (max-width: 900px) {

  /* Container: full-bleed friendly, tighter padding */
  .signal-container {
    width: 100%;
    max-width: 100%;
    margin: 12px auto 32px;
    padding: 18px;
    border-radius: 12px;
    background: #0d0d12;
    box-shadow: none;
    overflow: visible;
  }
  .signal-container::before {
    height: 3px;
  }

  /* Header */
  .page-header {
    padding: 6px 4px 18px;
    margin-bottom: 8px;
  }
  .page-header h1 {
    font-size: 1.6rem;
    line-height: 1.15;
    text-align: center;
    margin-bottom: 8px;
  }
  .page-header .subtitle {
    font-size: 1rem;
    color: #9ca3af;
    margin: 0 auto;
    max-width: 100%;
  }

  /* Part container: stack and reduce padding */
  .part-container {
    margin: 18px 0;
    padding: 16px;
  }

  /* Move part-number into normal flow and convert to badge */
  .part-number {
    position: relative;
    top: auto;
    left: auto;
    display: inline-block;
    margin: 0 0 12px 0;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    background: linear-gradient(90deg,#06d6a0 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: none;
  }

  .part-title {
    font-size: 1.15rem;
    margin-bottom: 10px;
    color: #93c5fd;
  }

  .part-content {
    font-size: 0.98rem;
    color: #cbd5e1;
    line-height: 1.5;
  }

  /* Signal matrix layout: stacked columns and smaller gaps */
  .signal-matrix-container {
    padding: 14px;
    margin: 14px 0;
  }

  .signal-matrix-container > div[style] {
    /* the inline flex row used in the HTML sample */
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .signal-matrix-container .flex-item,
  .signal-matrix-container > div[style] > div {
    width: 100% !important;
  }

  /* Prompt box: shrink padding and improve scroll */
  .prompt-box {
    padding: 16px;
    margin: 14px 0;
  }

  .prompt-content {
    font-size: 0.9rem;
    max-height: 220px;
    overflow: auto;
    padding: 12px;
    background: rgba(0,0,0,0.2);
  }

  /* AI can list -> single column */
  .ai-can-list {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .ai-can-item {
    font-size: 0.95rem;
    padding: 14px;
  }

  /* Benefits grid -> single column stacked */
  .benefits-grid {
    grid-template-columns: 1fr !important;
  }

  .benefit-item {
    padding: 14px;
    margin-bottom: 8px;
  }

  /* Scan table: allow horizontal scroll, reduce paddings */
  .scan-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    margin: 16px 0;
  }
  .scan-table thead,
  .scan-table tbody,
  .scan-table tr {
    display: table; /* keep table semantics while allowing scroll wrapper */
    width: 100%;
    table-layout: fixed;
  }
  .scan-table th,
  .scan-table td {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  /* Highlight lists and toggles */
  #mobile-resume-highlights { margin: 12px 0; }
  .desc-toggle { padding: 12px; font-size: 0.98rem; }
  .chart-description { font-size: 0.95rem; }

  /* Protects list -> stacked */
  .protects-list {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }
  .protects-item { min-width: 0; padding: 12px 16px; }

  /* Final takeaway: compress padding and font-size */
  .final-takeaway {
    padding: 22px;
    margin: 30px 0;
  }
  .final-takeaway h2 { font-size: 1.2rem; }
  .final-takeaway p { font-size: 0.98rem; line-height: 1.45; }

  /* Smaller screens (phones) extra tweaks */
  @media (max-width: 420px) {
    .page-header h1 { font-size: 1.4rem; }
    .part-title { font-size: 1rem; }
    .part-content { font-size: 0.95rem; }
    .prompt-content { font-size: 0.88rem; }
    .scan-table th, .scan-table td { padding: 8px 10px; font-size: 0.85rem; }
  }
}
