/* ============================================================
   GLOBAL TECH — DESIGN SYSTEM
   Tokens, reset, tipografía base y utilidades.
   Capas: reset → tokens → base → utilities
   ============================================================ */

@layer reset, tokens, base, components, sections, utilities;

/* ------------------------------------------------------------
   TOKENS
   ------------------------------------------------------------ */
@layer tokens {
  :root {
    /* --- Color: superficies --- */
    --c-bg:           #050505;
    --c-bg-elevated:  #0a0a0b;
    --c-surface:      #101012;
    --c-surface-2:    #16161a;
    --c-border:       rgba(212, 175, 55, 0.14);
    --c-border-strong:rgba(212, 175, 55, 0.35);

    /* --- Color: marca --- */
    --c-gold:        #d4af37;
    --c-gold-dark:   #aa8500;
    --c-gold-light:  #f3e5ab;
    --c-gold-soft:   rgba(212, 175, 55, 0.08);
    --c-gold-glow:   rgba(212, 175, 55, 0.22);

    /* --- Color: texto (contraste AA sobre #050505) --- */
    --c-text:        #f5f5f2;
    --c-text-soft:   #b8bcc4;   /* 4.6:1 sobre fondo */
    --c-text-muted:  #9ca3af;   /* solo texto grande / secundario */
    --c-text-invert: #050505;

    /* --- Color: feedback --- */
    --c-success:     #4ade80;
    --c-error:       #f87171;
    --c-warning:     #fbbf24;

    /* --- Gradientes --- */
    --g-gold: linear-gradient(135deg, #f3e5ab 0%, #d4af37 45%, #aa8500 100%);
    --g-gold-h: linear-gradient(90deg, #aa8500, #d4af37, #f3e5ab, #d4af37, #aa8500);
    --g-hero-overlay: linear-gradient(180deg,
        rgba(5,5,5,0.55) 0%,
        rgba(5,5,5,0.35) 40%,
        rgba(5,5,5,0.82) 85%,
        #050505 100%);
    --g-card-overlay: linear-gradient(180deg, transparent 30%, rgba(5,5,5,0.92) 100%);

    /* --- Tipografía --- */
    --f-sans: 'Outfit', system-ui, -apple-system, sans-serif;
    --f-serif: 'Cormorant Garamond', Georgia, serif;

    --fs-xs:   clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
    --fs-sm:   clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
    --fs-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
    --fs-md:   clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
    --fs-lg:   clamp(1.375rem, 1.2rem + 0.8vw, 1.875rem);
    --fs-xl:   clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem);
    --fs-2xl:  clamp(2.25rem, 1.7rem + 2.8vw, 4rem);
    --fs-hero: clamp(2.5rem, 1.8rem + 4vw, 5.25rem);

    /* --- Espaciado (escala 4/8) --- */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-7: 3rem;
    --sp-8: 4rem;
    --sp-9: 6rem;
    --sp-10: 8rem;
    --sp-section: clamp(4rem, 3rem + 5vw, 8rem);

    /* --- Radios --- */
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 22px;
    --r-full: 999px;

    /* --- Sombras --- */
    --sh-sm: 0 2px 8px rgba(0,0,0,0.35);
    --sh-md: 0 8px 30px rgba(0,0,0,0.45);
    --sh-lg: 0 24px 60px rgba(0,0,0,0.6);
    --sh-gold: 0 0 0 1px var(--c-border), 0 8px 40px rgba(212,175,55,0.12);
    --sh-gold-hover: 0 0 0 1px var(--c-border-strong), 0 14px 50px rgba(212,175,55,0.2);

    /* --- Transiciones --- */
    --t-fast: 160ms cubic-bezier(0.33, 1, 0.68, 1);
    --t-base: 260ms cubic-bezier(0.33, 1, 0.68, 1);
    --t-slow: 420ms cubic-bezier(0.22, 1, 0.36, 1);
    --t-spring: 380ms cubic-bezier(0.34, 1.4, 0.64, 1);

    /* --- Z-index --- */
    --z-base: 0;
    --z-raised: 10;
    --z-nav: 100;
    --z-drawer: 200;
    --z-modal: 300;
    --z-toast: 400;
    --z-loader: 500;
    --z-cursor: 600;

    /* --- Layout --- */
    --w-container: 1240px;
    --w-narrow: 820px;
    --nav-h: 76px;

    /* --- Glass --- */
    --glass-bg: rgba(16, 16, 18, 0.55);
    --glass-blur: 18px;
  }

  @media (max-width: 767px) {
    :root {
      --nav-h: 64px;
    }
  }
}

/* ------------------------------------------------------------
   RESET
   ------------------------------------------------------------ */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }

  * { margin: 0; }

  html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 1rem);
  }

  body {
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  img, picture, svg, video, canvas {
    display: block;
    max-width: 100%;
  }

  input, button, textarea, select {
    font: inherit;
    color: inherit;
  }

  button { cursor: pointer; background: none; border: none; }

  a { color: inherit; }

  :focus { outline: none; }
  :focus-visible {
    outline: 2px solid rgba(212, 175, 55, 0.85);
    outline-offset: 3px;
  }

  p, h1, h2, h3, h4 { overflow-wrap: break-word; }

  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

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

/* ------------------------------------------------------------
   BASE
   ------------------------------------------------------------ */
@layer base {
  :root { color-scheme: dark; }

  body {
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--f-sans);
    font-size: var(--fs-base);
    font-weight: 300;
    min-height: 100dvh;
  }

  h1, h2, h3 {
    font-family: var(--f-serif);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: 0.01em;
  }

  h4, h5, h6 {
    font-family: var(--f-sans);
    font-weight: 500;
    line-height: 1.3;
  }

  ::selection {
    background: var(--c-gold);
    color: var(--c-text-invert);
  }

  :focus-visible {
    outline: 2px solid var(--c-gold);
    outline-offset: 3px;
    border-radius: 2px;
  }

  /* Scrollbar sutil */
  @media (pointer: fine) {
    ::-webkit-scrollbar { width: 10px; }
    ::-webkit-scrollbar-track { background: var(--c-bg); }
    ::-webkit-scrollbar-thumb {
      background: #2a2a2e;
      border-radius: 5px;
      border: 2px solid var(--c-bg);
    }
    ::-webkit-scrollbar-thumb:hover { background: var(--c-gold-dark); }
  }
}

/* ------------------------------------------------------------
   UTILITIES
   ------------------------------------------------------------ */
@layer utilities {
  .container {
    width: min(100% - 2.5rem, var(--w-container));
    margin-inline: auto;
  }

  .container--narrow {
    width: min(100% - 2.5rem, var(--w-narrow));
  }

  .text-gold {
    background: var(--g-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--c-gold);
  }

  .eyebrow::before {
    content: "";
    width: 2.5rem;
    height: 1px;
    background: var(--g-gold);
  }

  .section-title {
    font-size: var(--fs-xl);
    margin-block: var(--sp-4) var(--sp-5);
  }

  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  .skip-link {
    position: fixed;
    top: -100%;
    left: 1rem;
    z-index: calc(var(--z-loader) + 1);
    padding: var(--sp-3) var(--sp-5);
    background: var(--c-gold);
    color: var(--c-text-invert);
    font-weight: 600;
    border-radius: var(--r-sm);
    transition: top var(--t-fast);
  }

  .skip-link:focus { top: 1rem; }

  .no-scroll { overflow: hidden; }
}
