/*
 * =========================================================
 * NOTTWORKS — BRAND DESIGN TOKENS  (Revision 02)
 * assets/css/tokens.css
 *
 * Single source of truth for all design variables.
 * =========================================================
 */

:root {

  /* -----------------------------------------------------------
   * COLOR PALETTE
   * Source: Nottworks_Marka_Kimligi_Web_Rehberi.pdf v0.9
   * ----------------------------------------------------------- */

  --color-ink-navy:      #111827;
  --color-warm-white:    #F5F3EE;
  --color-steel:         #64748B;
  --color-accent-blue:   #4D9BE8;  /* Use sparingly */
  --color-deep-charcoal: #0B0D10;
  --color-soft-sand:     #D9CBB9;

  /* Semantic aliases */
  --color-bg-primary:    var(--color-warm-white);
  --color-bg-dark:       var(--color-ink-navy);
  --color-text-primary:  var(--color-ink-navy);
  --color-text-muted:    var(--color-steel);
  --color-text-on-dark:  #ffffff;
  --color-border:        rgba(17, 24, 39, 0.08);
  --color-border-subtle: rgba(17, 24, 39, 0.05);

  /* Hero overlay */
  --color-hero-overlay:  rgba(11, 13, 16, 0.78);

  /* -----------------------------------------------------------
   * TYPOGRAPHY — MANROPE
   * ----------------------------------------------------------- */

  --font-heading: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-body:    'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    'JetBrains Mono', 'Cascadia Code', monospace;

  /* Type scale */
  --text-xs:   0.75rem;   /*  12px */
  --text-sm:   0.875rem;  /*  14px */
  --text-base: 1rem;      /*  16px */
  --text-md:   1.125rem;  /*  18px */
  --text-lg:   1.25rem;   /*  20px */
  --text-xl:   1.5rem;    /*  24px */
  --text-2xl:  2rem;      /*  32px */
  --text-3xl:  2.5rem;    /*  40px */
  --text-4xl:  3.5rem;    /*  56px */
  --text-hero: clamp(2.75rem, 5.5vw, 4.5rem);

  /* Unified Section Heading Tokens (Standardized across desktop & mobile) */
  --nw-section-title-desktop: clamp(2rem, 3vw, 2.75rem);
  --nw-section-title-mobile:  clamp(1.75rem, 7.2vw, 2.15rem);
  --nw-section-title-mobile-lh: 1.18;
  --nw-section-title-mobile-ls: -0.025em;
  --nw-section-title-mobile-weight: 800;

  /* Line heights */
  --leading-tight:   1.15;
  --leading-snug:    1.35;
  --leading-normal:  1.6;
  --leading-relaxed: 1.75;

  /* Font weights */
  --weight-regular:   400;
  --weight-medium:    500;
  --weight-semibold:  600;
  --weight-bold:      700;
  --weight-extrabold: 800;

  /* Letter spacing */
  --tracking-tight:  -0.025em;
  --tracking-normal:  0;
  --tracking-wide:    0.05em;
  --tracking-widest:  0.12em;

  /* -----------------------------------------------------------
   * SPACING (Rev 02: centralized vertical rhythm tokens)
   * ----------------------------------------------------------- */

  --space-1:  0.25rem;   /*  4px */
  --space-2:  0.5rem;    /*  8px */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */

  /* -----------------------------------------------------------
   * GLOBAL HEADER OVERLAY & SECTION ALIGNMENT SYSTEM
   * Single source of truth for all sections & inner pages.
   * Every section top boundary aligns with the viewport top (y = 0).
   * Background extends behind the header; content begins below it.
   * ----------------------------------------------------------- */

  /* Shared Mobile Header Clearance Variable: 14px gap above + 58px header + 14px matching gap below = 86px */
  --nw-mobile-header-gap:       14px;
  --nw-mobile-header-height:    58px;
  --nw-mobile-header-top:       max(var(--nw-mobile-header-gap, 14px), env(safe-area-inset-top, 14px));
  --nw-mobile-header-clearance: calc(var(--nw-mobile-header-top, 14px) + var(--nw-mobile-header-height, 58px) + var(--nw-mobile-header-gap, 14px)); /* 86px */

  /* Header physical dimensions */
  --header-height:              64px;
  --header-inset-top:           16px;
  --header-overlay-height:      calc(var(--header-height) + var(--header-inset-top)); /* 80px */

  /* Visual gap between the floating header bottom edge and the first content element */
  --section-content-gap:        clamp(1.75rem, 3.2vw, 2.75rem); /* ~28px to 44px */

  /* Standard internal section top padding: reserves header overlay + uniform visual gap */
  --section-padding-top:        calc(var(--header-overlay-height) + var(--section-content-gap));

  /* Standard internal section bottom padding: balanced vertical rhythm without stretching */
  --section-padding-bottom:     clamp(3.5rem, 6vw, 5.5rem);

  /* Unified vertical padding shorthand */
  --section-padding-y:          var(--section-padding-top) 0 var(--section-padding-bottom) 0;
  --section-padding-x:          clamp(1.25rem, 4vw, 2.5rem);

  /* Vertical rhythm between label/heading/text groups */
  --rhythm-eyebrow-gap:         var(--space-2);   /* eyebrow → heading */
  --rhythm-heading-gap:         var(--space-4);   /* heading → description */
  --rhythm-desc-content:        clamp(2rem, 4vw, 3rem); /* description → content area */
  --rhythm-card-gap:            clamp(1.25rem, 2.5vw, 1.75rem);
  --rhythm-card-padding:        clamp(1.25rem, 2vw, 1.75rem);

  /* -----------------------------------------------------------
   * LAYOUT
   * ----------------------------------------------------------- */

  /* Shared container — content in every section aligns to these */
  --container-max:              1248px;  /* Content columns, aligned to header frame */
  --container-wide:             1248px;  /* Same: unified container */
  --container-narrow:           780px;

  /* Header */
  --header-max-width:           var(--container-max);
  --header-bg:                  #ffffff;
  --header-radius:              18px;    /* Softly rounded, proportional to height */
  --header-cta-radius:          10px;
  --header-z:                   1000;

  /* Reference Logos Desktop First-Viewport Height */
  --nw-logos-height-desktop:    clamp(84px, 9.5vh, 96px);

  /* -----------------------------------------------------------
   * BORDERS & RADII
   * ----------------------------------------------------------- */

  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   18px;
  --radius-2xl:  22px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(17, 24, 39, 0.06);
  --shadow-md:  0 4px 16px rgba(17, 24, 39, 0.08);
  --shadow-lg:  0 12px 36px rgba(17, 24, 39, 0.12);

  /* -----------------------------------------------------------
   * BUTTON SYSTEM (Standardized Global CTA System)
   * ----------------------------------------------------------- */

  --btn-height:      42px;
  --btn-padding-y:   10px;
  --btn-padding-x:   20px;
  --btn-radius:      10px;
  --btn-font-size:   var(--text-sm);
  --btn-font-weight: var(--weight-semibold);
  --btn-icon-size:   14px;
  --btn-gap:         8px;
  --btn-transition:  all 180ms ease;

  /* -----------------------------------------------------------
   * GLOBAL INTERACTION PALETTE (Tokens for hover, active, focus)
   * ----------------------------------------------------------- */

  /* Primary Button Tokens (Ink Navy #111827 fill, white text) */
  --btn-primary-bg:             var(--color-ink-navy);
  --btn-primary-text:           #ffffff;
  --btn-primary-border:         var(--color-ink-navy);
  --btn-primary-hover-bg:       #1f2937;
  --btn-primary-hover-border:   #1f2937;
  --btn-primary-hover-shadow:   0 4px 14px rgba(17, 24, 39, 0.16);

  /* Secondary / Outlined Button Tokens */
  --btn-secondary-bg:           #ffffff;
  --btn-secondary-text:         var(--color-ink-navy);
  --btn-secondary-border:       rgba(17, 24, 39, 0.18);
  --btn-secondary-hover-bg:     var(--color-warm-white);
  --btn-secondary-hover-border: rgba(17, 24, 39, 0.35);
  --btn-secondary-hover-shadow: 0 4px 12px rgba(17, 24, 39, 0.06);

  /* Light / Inverted Button Tokens (Over dark sections like Hero & dark banners) */
  --btn-light-bg:               #ffffff;
  --btn-light-text:             var(--color-ink-navy);
  --btn-light-border:           #ffffff;
  --btn-light-hover-bg:         var(--color-warm-white);
  --btn-light-hover-border:     var(--color-warm-white);
  --btn-light-hover-shadow:     0 6px 18px rgba(0, 0, 0, 0.2);

  /* Dark Overlay Outlined Button Tokens (Hero secondary CTA) */
  --btn-dark-outline-bg:           rgba(255, 255, 255, 0.08);
  --btn-dark-outline-text:         #ffffff;
  --btn-dark-outline-border:       rgba(255, 255, 255, 0.28);
  --btn-dark-outline-hover-bg:     rgba(255, 255, 255, 0.16);
  --btn-dark-outline-hover-border: rgba(255, 255, 255, 0.55);

  /* -----------------------------------------------------------
   * UNIFIED HOVER & INTERACTION SYSTEM (Nottworks Palette)
   * Ink Navy #111827 | Warm White #F5F3EE | Steel #64748B
   * ----------------------------------------------------------- */
  --nw-hover-bg-subtle:        var(--color-warm-white);      /* #F5F3EE */
  --nw-hover-bg-tint:          rgba(17, 24, 39, 0.04);
  --nw-hover-border-neutral:   rgba(17, 24, 39, 0.22);
  --nw-hover-text-primary:     var(--color-ink-navy);        /* #111827 */
  --nw-focus-border-neutral:   rgba(17, 24, 39, 0.35);
  --nw-focus-ring-subtle:      0 0 0 3px rgba(17, 24, 39, 0.08);
  --nw-active-bg-subtle:       rgba(17, 24, 39, 0.08);

  /* Form & Dropdown Control Tokens (Standardized Neutral Palette) */
  --control-bg:                 #ffffff;
  --control-border:             rgba(17, 24, 39, 0.14);
  --control-border-hover:       rgba(17, 24, 39, 0.25);
  --control-border-focus:       var(--nw-focus-border-neutral);
  --control-focus-ring:         var(--nw-focus-ring-subtle);

  /* Dropdown Item Interaction Tokens (Service & Phone Country) */
  --dropdown-item-hover-bg:     var(--color-warm-white);       /* #F5F3EE — never bright blue! */
  --dropdown-item-selected-bg:  var(--color-warm-white);       /* Warm White surface */
  --dropdown-item-selected-bar: rgba(17, 24, 39, 0.4);        /* Neutral indicator bar */
  --dropdown-item-text:         var(--color-ink-navy);

  /* Accessible Focus Indicator (Restrained neutral outline) */
  --focus-ring-color:           rgba(17, 24, 39, 0.4);
  --focus-ring-offset:          2px;

  /* Re-route parent theme button hover blue to Ink Navy */
  --ast-global-color-1:         #1f2937;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 220ms ease;
  --transition-slow: 380ms ease;
}

/* Tablet responsive layout (≤ 1024px) */
@media (max-width: 1024px) {
  :root {
    --header-height:            60px;
    --header-inset-top:         14px;
    --header-overlay-height:    calc(var(--header-height) + var(--header-inset-top)); /* 74px */
    --section-content-gap:      clamp(1.5rem, 2.8vw, 2.25rem);
    --section-padding-top:      calc(var(--header-overlay-height) + var(--section-content-gap));
    --section-padding-bottom:   clamp(3rem, 5vw, 4.5rem);
  }
}

/* Mobile responsive layout & touch targets (WCAG compliant) (≤ 768px) */
@media (max-width: 768px) {
  :root {
    --btn-height:               44px;
    --btn-padding-y:            11px;
    --header-height:            58px;
    --header-inset-top:         14px;
    --header-overlay-height:    calc(var(--header-height) + var(--header-inset-top)); /* 72px */
    --nw-mobile-header-clearance: calc(var(--header-overlay-height) + 14px); /* 86px: header bottom 72px + 14px matching gap */
    --section-content-gap:      14px;
    --section-padding-top:      var(--nw-mobile-header-clearance);
    --section-padding-bottom:   clamp(2.75rem, 5vw, 4rem);
    --section-padding-x:        18px;
  }
}

@media (max-width: 360px) {
  :root {
    --section-padding-x:        14px;
    --nw-mobile-header-clearance: 82px;
    --section-padding-top:      var(--nw-mobile-header-clearance);
  }
}

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