/* PERSON.TEES POD Platform · Editorial DNA + Interactions
   Layer 1: Linear DNA — 1px subtle dividers, monochrome surface, strategic accent
   Layer 2: Scroll-reveal (fade-up sections)
   Layer 3: Sticky CTA bottom (mobile)
   Layer 4: WhatsApp float
   Layer 5: FAQ accordion */

@layer editorial-dna {

  /* Editorial DNA · Linear-inspired typography rhythm */
  .display {
    font-feature-settings: "ss01", "cv11", "calt";
    text-wrap: balance;
    text-underline-position: from-font;
  }
  .lede {
    text-wrap: pretty;
    max-width: 60ch;
  }

  /* 1px hairline divider as visual rhythm */
  .editorial-hr {
    height: 1px;
    background: var(--border-subtle);
    border: none;
    margin: 64px 0;
  }

  /* Subtle gradient on dark BG → monoline with single accent */
  .editorial-section {
    padding: 96px 0;
    border-top: 1px solid var(--border-subtle);
  }

  /* Tag · linear-style micro-label */
  .lin-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 9999px;
    font: 700 10px/1 ui-monospace, "JetBrains Mono", monospace;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--pt-accent);
    background: rgba(11, 15, 31, 0.5);
  }

  /* Stats row · editorial large-number treatment */
  .stats-row {
    display: grid; gap: 24px;
    grid-template-columns: 1fr;
    padding: 48px 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
  }
  @media (min-width: 768px) { .stats-row { grid-template-columns: repeat(4, 1fr); } }
  .stat-item {
    text-align: left;
    padding: 0 16px;
    border-left: 1px solid var(--border-subtle);
  }
  .stat-item:first-child { border-left: none; padding-left: 0; }
  .stat-num {
    font-family: var(--font-h1);
    font-size: clamp(40px, 5vw, 56px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
    color: white;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, #FFFFFF, rgba(255,255,255,0.6));
    -webkit-background-clip: text;
    background-clip: text;
  }
  .stat-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 8px;
  }
  .stat-desc {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 4px;
    line-height: 1.5;
  }
}

/* FAQ accordion */
@layer faq {
  .faq-list {
    display: flex; flex-direction: column;
    border-top: 1px solid var(--border-subtle);
  }
  .faq-item {
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 200ms;
  }
  .faq-item[open] { background: rgba(35, 35, 255, 0.04); }
  .faq-summary {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 0;
    cursor: pointer;
    list-style: none;
    transition: color 200ms;
  }
  .faq-summary::-webkit-details-marker { display: none; }
  .faq-q {
    font-family: var(--font-h1);
    font-size: 17px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.01em;
    flex: 1;
    padding-right: 24px;
  }
  .faq-icon {
    display: inline-grid; place-items: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    color: var(--pt-accent);
    transition: transform 300ms cubic-bezier(0.2, 0, 0, 1);
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
  }
  .faq-item[open] .faq-icon { transform: rotate(45deg); background: var(--pt-accent); color: white; border-color: var(--pt-accent); }
  .faq-a {
    padding: 0 0 24px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 65ch;
  }
}

/* Sticky CTA bottom (mobile + desktop) */
@layer sticky-cta {
  .sticky-cta {
    position: fixed; left: 16px; right: 16px; bottom: 16px;
    z-index: 60;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px 12px 20px;
    border-radius: 9999px;
    background: rgba(11, 15, 31, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-strong);
    box-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 74, 133, 0.2);
    transform: translateY(120%);
    opacity: 0;
    transition: transform 400ms cubic-bezier(0.2, 0, 0, 1), opacity 300ms;
  }
  .sticky-cta.is-visible {
    transform: translateY(0);
    opacity: 1;
  }
  .sticky-cta-text {
    display: flex; flex-direction: column;
    margin-right: 12px;
  }
  .sticky-cta-title {
    font-family: var(--font-h1);
    font-size: 14px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.01em;
  }
  .sticky-cta-sub {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
  }
  .sticky-cta-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--pt-accent), var(--pt-accent-orange));
    color: white;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 24px -4px rgba(255, 74, 133, 0.5);
    transition: transform 200ms;
    border: none;
    cursor: pointer;
    text-decoration: none;
  }
  .sticky-cta-btn:hover { transform: scale(1.05); }
  @media (min-width: 1024px) {
    .sticky-cta {
      left: auto; right: 24px; bottom: 24px;
      max-width: 380px;
    }
  }
}

/* WhatsApp float · separate from sticky CTA */
@layer whatsapp-float {
  .wa-float {
    position: fixed; right: 20px; bottom: 92px;
    z-index: 55;
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 20px 14px 16px;
    border-radius: 9999px;
    background: #25D366;
    color: white;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 12px 32px -8px rgba(37, 211, 102, 0.5),
                0 0 0 4px rgba(37, 211, 102, 0.2);
    transition: transform 250ms cubic-bezier(0.2, 0, 0, 1);
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  .wa-float.is-visible { opacity: 1; transform: translateY(0) scale(1); }
  .wa-float:hover { transform: scale(1.05); }
  .wa-float-icon {
    display: inline-grid; place-items: center;
    width: 28px; height: 28px;
    background: white;
    border-radius: 50%;
    color: #25D366;
    font-size: 16px;
    font-weight: 900;
  }
  .wa-float-pulse {
    position: absolute; inset: 0;
    border-radius: 9999px;
    background: #25D366;
    opacity: 0.4;
    animation: waPulse 2s ease-out infinite;
    pointer-events: none;
    z-index: -1;
  }
  @keyframes waPulse {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.4); opacity: 0; }
  }
  @media (min-width: 1024px) {
    .wa-float { right: 24px; bottom: 96px; }
  }
}

/* Scroll-driven reveal · fade-up + fade-in */
@layer scroll-reveal {
  .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 700ms cubic-bezier(0.2, 0, 0, 1),
                transform 700ms cubic-bezier(0.2, 0, 0, 1);
    will-change: opacity, transform;
  }
  .reveal.is-revealed {
    opacity: 1;
    transform: translateY(0);
  }
  .reveal-stagger-1 { transition-delay: 80ms; }
  .reveal-stagger-2 { transition-delay: 160ms; }
  .reveal-stagger-3 { transition-delay: 240ms; }
  .reveal-stagger-4 { transition-delay: 320ms; }

  /* Trust pill grid · 香港 B2B 客戶類型 */
  .trust-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(2, 1fr);
  }
  @media (min-width: 768px) { .trust-grid { grid-template-columns: repeat(3, 1fr); } }
  .trust-pill {
    display: flex; align-items: center; gap: 12px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(11, 15, 31, 0.4));
    transition: border-color 250ms, transform 250ms cubic-bezier(0.2, 0, 0, 1);
  }
  .trust-pill:hover {
    border-color: rgba(255, 74, 133, 0.4);
    transform: translateY(-2px);
  }
  .trust-emoji {
    font-size: 22px;
    width: 40px; height: 40px;
    display: inline-grid; place-items: center;
    border-radius: 10px;
    background: rgba(35, 35, 255, 0.12);
    flex-shrink: 0;
  }
  .trust-pill b {
    display: block;
    font-family: var(--font-h1);
    font-size: 14px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.01em;
  }
  .trust-pill span {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
  }

  /* Trust quote · single hero quote */
  .trust-quote {
    margin-top: 32px;
    padding: 28px 32px;
    border-radius: 16px;
    border: 1px solid var(--border-strong);
    background: linear-gradient(135deg, rgba(35, 35, 255, 0.06), rgba(255, 74, 133, 0.04));
    position: relative;
  }
  .trust-quote::before {
    content: "“";
    position: absolute; top: 8px; left: 16px;
    font: 900 80px/1 var(--font-h1);
    color: var(--pt-accent);
    opacity: 0.15;
  }
  .trust-quote blockquote {
    margin: 0;
  }
  .trust-quote p {
    font-family: var(--font-h1);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    color: white;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
  }
  .trust-quote figcaption {
    display: flex; align-items: center; gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
    font-size: 13px;
    color: var(--text-secondary);
  }
  .quote-emoji {
    font-size: 18px;
    width: 36px; height: 36px;
    display: inline-grid; place-items: center;
    border-radius: 8px;
    background: rgba(255, 74, 133, 0.15);
  }
  .trust-quote figcaption b {
    display: block;
    font-family: var(--font-h1);
    font-size: 13px;
    font-weight: 700;
    color: white;
  }
  .trust-quote figcaption span {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
  }

  /* Reduce motion · respect user preference */
  @media (prefers-reduced-motion: reduce) {
    .reveal {
      opacity: 1;
      transform: none;
      transition: none;
    }
  }
}

@layer mobile-polish {
  /* Tap highlight · removed ugly blue flash on iOS/Android */
  * {
    -webkit-tap-highlight-color: transparent;
  }

  /* Focus-visible · keyboard navigation clarity */
  :focus-visible {
    outline: 3px solid var(--pt-primary);
    outline-offset: 2px;
    border-radius: 4px;
  }

  /* Better button defaults · touch-friendly */
  .btn {
    -webkit-appearance: none;
    appearance: none;
    min-height: 48px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
  }

  /* Sticky CTA · mobile-optimized */
  .sticky-cta {
    padding: 12px 16px !important;
    border-radius: 12px !important;
    bottom: 12px !important;
    left: 12px !important;
    right: 12px !important;
    max-width: none !important;
  }
  .sticky-cta-text {
    font-size: 13px !important;
  }
  .sticky-cta-btn {
    min-height: 44px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
  }

  /* WhatsApp float · safe-area-aware for notched phones */
  .wa-float {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
    right: 16px !important;
    width: 52px !important;
    height: 52px !important;
  }

  /* FAQ accordion · mobile-friendly summary hit target */
  details.faq-item summary {
    min-height: 56px;
    padding: 18px 20px;
  }

  /* FAQ content padding */
  details.faq-item .faq-answer {
    padding: 0 20px 20px;
  }

  /* Trust grid · 2 columns on mobile, more on desktop */
  .trust-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  @media (min-width: 768px) {
    .trust-grid {
      grid-template-columns: repeat(6, 1fr) !important;
    }
  }

  /* Hero-illust-stage mobile · prevent extreme scale on tiny phones */
  @media (max-width: 374px) {
    .hero-illust-stage { aspect-ratio: 1 / 1; }
  }

  /* All chips · minimum touch target */
  .lede-products li {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  /* Section heads · mobile padding */
  .section-head {
    margin-bottom: 32px !important;
  }
  .section-head h2 {
    font-size: clamp(24px, 5vw, 40px) !important;
    line-height: 1.15 !important;
  }

  /* Hero tagline + sub-brand lists · wrap cleanly */
  .hero-tagline-list,
  .hero-subbrand {
    flex-wrap: wrap !important;
  }
  .hero-tagline-list li,
  .hero-subbrand li {
    font-size: 13px !important;
    padding: 4px 0 !important;
  }

  /* Reduce big margin on mobile */
  @media (max-width: 767px) {
    .section { padding-top: 56px !important; padding-bottom: 56px !important; }
  }

  /* Smooth scrolling */
  html { scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      transition-duration: 0.01ms !important;
    }
  }
}
