/* ============================================================
   GoTechCom Ecosystem — Tier 0 core
   The ONE place where the shared, "invisible" layer is defined:
   slate neutrals, spacing, layout, breakpoints, radius scale,
   shadow scale, status colours, motion, the ecosystem blue and
   the dark-mode surface structure.

   Load order on every page / deck of every brand:
     1. this file            (tier 0 — core)
     2. <brand>/references/tokens.css   (tier 1 theme + tier 2 motifs)
   Brand files map aliases onto these (e.g. --gt-border: var(--eco-border))
   and MUST NOT redefine any --eco-* token.
   ============================================================ */

:root {
  /* --- slate neutrals (Tailwind slate) --- */
  --eco-slate-50:  #f8fafc;
  --eco-slate-100: #f1f5f9;
  --eco-slate-200: #e2e8f0;
  --eco-slate-300: #cbd5e1;
  --eco-slate-400: #94a3b8;
  --eco-slate-500: #64748b;
  --eco-slate-600: #475569;
  --eco-slate-700: #334155;
  --eco-slate-800: #1e293b;
  --eco-slate-900: #0f172a;
  --eco-ink:       #0b1120;   /* darkest surface, never #000 */

  /* --- the ecosystem blue: GoTechCom primary, the thread that ties
         every product back to the parent. Light: #2563eb. Flips in dark. --- */
  --eco-blue-600:  #2563eb;   /* fixed: 5.17 on #fff, 4.24 on #DBEAFE (icons only) */
  --eco-blue-400:  #60a5fa;   /* fixed: 7.41 on #0b1120, 5.75 on #1e293b */
  --eco-blue:      var(--eco-blue-600);   /* theme-aware: flips to -400 in dark.
     Use --eco-blue-600 on surfaces that stay light in dark mode (pastel tiles). */

  /* --- semantic surfaces (light). Flip in the dark blocks below. --- */
  --eco-bg:          #ffffff;
  --eco-fg:          var(--eco-slate-900);
  --eco-card:        #ffffff;
  --eco-surface-muted: var(--eco-slate-100);
  --eco-band:        rgba(241, 245, 249, .30);   /* slate-100 @ 30% */
  --eco-band-solid:  #fbfcfd;   /* the band pre-composited on --eco-bg: use it where nothing
                                 opaque sits behind (slides, cards over other fills) */
  --eco-muted-fg:    var(--eco-slate-500);        /* 4.76 on #fff */
  --eco-border:      var(--eco-slate-200);
  --eco-border-soft: var(--eco-slate-100);

  /* --- status --- */
  --eco-success:      #00c950;   /* dots, ticks on dark (6.60 on #1e293b) */
  --eco-success-ink:  #15803d;   /* green text/icon on light, 4.57 on #DCFCE7 */
  --eco-warning:      #f59e0b;
  --eco-danger:       #ef4444;   /* icons on light: 3.76 on #fff */
  --eco-danger-ink:   #b91c1c;   /* red text on light */

  /* --- spacing: 4px base --- */
  --eco-space-1:   4px;
  --eco-space-2:   8px;
  --eco-space-3:  12px;
  --eco-space-4:  16px;
  --eco-space-6:  24px;
  --eco-space-8:  32px;
  --eco-space-10: 40px;
  --eco-space-12: 48px;
  --eco-space-16: 64px;
  --eco-space-20: 80px;
  --eco-space-24: 96px;

  /* --- layout --- */
  --eco-container:     1280px;
  --eco-prose:          768px;
  --eco-container-pad:   16px;   /* 24px ≥640, 32px ≥1024 (set below) */
  --eco-gutter:          32px;

  /* --- breakpoints (reference values: CSS can't read vars inside @media,
         so media queries repeat the number; JS can read these) --- */
  --eco-bp-sm:  640px;
  --eco-bp-md:  768px;
  --eco-bp-lg: 1024px;
  --eco-bp-xl: 1280px;

  /* --- radius scale --- */
  --eco-radius-sm:     8px;   /* inputs (GoTechCom)          */
  --eco-radius-md:    12px;   /* inner boxes                 */
  --eco-radius-lg:    16px;   /* GoTechCom cards, Betiny tiles */
  --eco-radius-xl:    24px;   /* Betiny cards, hero frames   */
  --eco-radius-full: 999px;   /* pills                       */

  /* --- shadow scale: slate-tinted, never neutral black --- */
  --eco-shadow-sm:  0 1px 2px 0 rgba(15, 23, 42, .05);
  --eco-shadow-md:  0 4px 6px -1px rgba(15, 23, 42, .08), 0 2px 4px -2px rgba(15, 23, 42, .05);
  --eco-shadow-lg:  0 10px 15px -3px rgba(15, 23, 42, .08), 0 4px 6px -4px rgba(15, 23, 42, .05);
  --eco-shadow-xl:  0 20px 25px -5px rgba(15, 23, 42, .10), 0 8px 10px -6px rgba(15, 23, 42, .06);
  --eco-shadow-2xl: 0 25px 50px -12px rgba(15, 23, 42, .25);

  /* --- motion --- */
  --eco-duration-fast: 150ms;
  --eco-duration:      200ms;
  --eco-duration-slow: 300ms;
  --eco-ease:     cubic-bezier(.4, 0, .2, 1);
  --eco-ease-out: cubic-bezier(0, 0, .2, 1);
}

@media (min-width: 640px)  { :root { --eco-container-pad: 24px; } }
@media (min-width: 1024px) { :root { --eco-container-pad: 32px; } }

/* ============================================================
   DARK STRUCTURE — taken from GoTechCom. Same values for every brand.
   Trigger: .dark or [data-theme="dark"] on <html>, or the system
   preference unless the page opts out with .light / [data-theme="light"].
   ============================================================ */
.dark, [data-theme="dark"] {
  --eco-blue:          var(--eco-blue-400);
  --eco-bg:            var(--eco-ink);
  --eco-fg:            var(--eco-slate-200);
  --eco-card:          var(--eco-slate-800);
  --eco-surface-muted: var(--eco-slate-800);
  --eco-band:          rgba(30, 41, 59, .30);
  --eco-band-solid:    #111828;
  --eco-muted-fg:      var(--eco-slate-400);   /* 7.34 on bg, 5.71 on card */
  --eco-border:        var(--eco-slate-700);
  --eco-border-soft:   #273449;
  --eco-shadow-sm:  0 1px 2px 0 rgba(2, 6, 23, .30);
  --eco-shadow-md:  0 4px 6px -1px rgba(2, 6, 23, .40);
  --eco-shadow-lg:  0 10px 15px -3px rgba(2, 6, 23, .45);
  --eco-shadow-xl:  0 20px 25px -5px rgba(2, 6, 23, .50);
  --eco-shadow-2xl: 0 25px 50px -12px rgba(2, 6, 23, .60);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not(.light) {
    --eco-blue:          var(--eco-blue-400);
    --eco-bg:            var(--eco-ink);
    --eco-fg:            var(--eco-slate-200);
    --eco-card:          var(--eco-slate-800);
    --eco-surface-muted: var(--eco-slate-800);
    --eco-band:          rgba(30, 41, 59, .30);
    --eco-band-solid:    #111828;
    --eco-muted-fg:      var(--eco-slate-400);
    --eco-border:        var(--eco-slate-700);
    --eco-border-soft:   #273449;
    --eco-shadow-sm:  0 1px 2px 0 rgba(2, 6, 23, .30);
    --eco-shadow-md:  0 4px 6px -1px rgba(2, 6, 23, .40);
    --eco-shadow-lg:  0 10px 15px -3px rgba(2, 6, 23, .45);
    --eco-shadow-xl:  0 20px 25px -5px rgba(2, 6, 23, .50);
    --eco-shadow-2xl: 0 25px 50px -12px rgba(2, 6, 23, .60);
  }
}

/* ============================================================
   REDUCED MOTION — ecosystem-wide. Brands may add stricter rules.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   ENDORSEMENT — "Một sản phẩm của GoTechCom"
   The only ecosystem primitive. Sits in the PRODUCT's own type
   (inherits font); the GoTechCom hexagon is MONOCHROME
   (fill: currentColor), never the blue→cyan gradient.
   Markup:
     <a class="eco-endorse" href="https://gotechcom.com">
       <svg class="eco-endorse__mark" viewBox="0 0 64 64" aria-hidden="true">
         <path fill-rule="evenodd" d="M32 2L58 16V48L32 62L6 48V16L32 2Z M16 24H28V28H20V36H28V32H24V30H30V40H16V24Z M34 24H48V28H43V40H39V28H34V24Z"/></svg>
       (lục giác + chữ GT khoét rỗng = logo thật ở dạng đơn sắc; lục giác trơn là SAI)
       Một sản phẩm của <strong>GoTechCom</strong>
     </a>
   ============================================================ */
.eco-endorse {
  display: inline-flex; align-items: center; gap: var(--eco-space-2);
  font-size: 14px; line-height: 1.4; color: inherit; text-decoration: none;
}
.eco-endorse strong { font-weight: 700; }
.eco-endorse__mark  { width: 18px; height: 18px; flex: none; fill: currentColor; }
a.eco-endorse:hover { text-decoration: underline; }
