/* ============================================================
   main.css — Custom properties, reset, typography
   Mobile-first: base → 768px → 1200px
   ============================================================ */

/* Brand typography (Brand Identity guide, 2026):
   Montserrat SemiBold — headings, Montserrat Regular — body (Cyrillic subset),
   Lato Bold/Regular — the "Club Bulgaria" logo wordmark only. */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Lato:wght@400;700&display=swap');

/* ---- Custom properties ---- */
:root {
  /* Brand palette — from Brand_CIO_club.pdf */
  --brand-pulse-red:      #F45656;   /* Pulse Red   */
  --brand-gradient-start: #FF6666;   /* Tech Gradient start */
  --brand-deep-violet:    #1B0068;   /* Deep Violet / Tech Gradient end */
  --brand-deep-blue:      #160D38;   /* Deep Blue   */
  --brand-slate:          #CBD5E1;   /* Slate Gray  */
  --brand-white:          #FFFFFF;   /* Pure White  */

  /* Tech Gradient — red → ember → violet, as on the logo badge */
  --gradient-tech: linear-gradient(135deg,
                     var(--brand-gradient-start) 0%,
                     #B5363F 38%,
                     #5A1458 72%,
                     var(--brand-deep-violet) 100%);
  /* Short accent rule used under / beside headings in the brand guide */
  --gradient-rule: linear-gradient(90deg, var(--brand-pulse-red) 0%, #5A1458 100%);
  --gradient-rule-v: linear-gradient(180deg, var(--brand-pulse-red) 0%, rgba(90, 20, 88, 0.4) 100%);

  /* Functional roles */
  --color-primary:        #D23F3F;   /* Pulse Red, deepened for AA text/buttons on light */
  --color-primary-dark:   #B83434;
  --color-primary-light:  var(--brand-pulse-red);
  --color-accent:         var(--brand-pulse-red);
  --color-accent-bright:  var(--brand-gradient-start);
  --color-accent-subtle:  rgba(244, 86, 86, 0.10);
  --color-violet:         var(--brand-deep-violet);
  --color-violet-subtle:  rgba(27, 0, 104, 0.07);

  /* Surfaces */
  --color-surface-dark:   var(--brand-deep-blue);
  --color-surface-mid:    #221A44;   /* raised panel on Deep Blue (guide card colour) */
  --color-surface:        var(--brand-white);
  --color-surface-alt:    #F3F5F9;   /* Slate Gray at low strength */

  /* Text */
  --color-text-primary:   var(--brand-deep-blue);
  --color-text-secondary: #4D4A68;
  --color-text-muted:     #7D7B95;
  --color-text-on-dark:   var(--brand-white);
  --color-text-on-dark-2: var(--brand-slate);

  /* Utility */
  --color-border:         #E1E5EE;
  --color-border-dark:    rgba(203, 213, 225, 0.12);
  --color-success:        #23824A;
  --color-error:          #C93636;
  --color-warning:        #C2570C;

  /* Atmosphere — tiny SVG noise tile for dark sections */
  --texture-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  /* Pixel field — the scattered-squares motif from the business-card reverse */
  --texture-pixels: url("/assets/img/pixel-field.svg");

  /* Typography */
  --font-display: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --font-logo:    'Lato', 'Segoe UI', system-ui, sans-serif;

  /* Fluid type scale — clamp(min, preferred, max) */
  --text-xs:   clamp(0.75rem,  1.5vw,  0.8125rem);
  --text-sm:   clamp(0.875rem, 1.8vw,  0.9375rem);
  --text-base: clamp(1rem,     2vw,    1.0625rem);
  --text-md:   clamp(1.125rem, 2.2vw,  1.25rem);
  --text-lg:   clamp(1.25rem,  2.5vw,  1.5rem);
  --text-xl:   clamp(1.5rem,   3vw,    2rem);
  --text-2xl:  clamp(1.875rem, 4vw,    2.5rem);
  --text-3xl:  clamp(2.25rem,  5vw,    3.25rem);
  --text-4xl:  clamp(2.75rem,  6.5vw,  4.5rem);
  --text-hero: clamp(3rem,     9vw,    7rem);

  /* Spacing */
  --space-1:   0.25rem;
  --space-2:   0.5rem;
  --space-3:   0.75rem;
  --space-4:   1rem;
  --space-5:   1.25rem;
  --space-6:   1.5rem;
  --space-8:   2rem;
  --space-10:  2.5rem;
  --space-12:  3rem;
  --space-16:  4rem;
  --space-20:  5rem;
  --space-24:  6rem;

  /* Radii */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs:        0 1px 3px rgba(22, 13, 56, 0.06);
  --shadow-card:      0 2px 16px rgba(22, 13, 56, 0.07);
  --shadow-card-hover:0 14px 36px rgba(27, 0, 104, 0.14);
  --shadow-nav:       0 2px 24px rgba(10, 6, 28, 0.35);

  /* Transitions */
  --transition:       0.2s ease;
  --transition-slow:  0.35s ease;
}

/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text-primary);
  background: var(--color-surface);
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font: inherit;
  border: none;
  background: none;
  outline: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ---- Typography ---- */
/* Brand rule: headings in Montserrat SemiBold (Bold only by exception) */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.015em;
  overflow-wrap: break-word;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
  overflow-wrap: break-word;
}

strong { font-weight: 700; }
em     { font-style: italic; }

/* ---- Section heading pattern ---- */
.section-title {
  font-size: var(--text-3xl);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  position: relative;
  display: inline-block;
  margin-bottom: var(--space-6);
}

/* Short red → violet pill, as used under titles in the brand guide */
.section-title::after {
  content: '';
  display: block;
  width: 3.5rem;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--gradient-rule);
  margin-top: var(--space-4);
}

.section-title--light {
  color: var(--color-text-on-dark);
}

.section-title--center {
  display: block;
  text-align: center;
}

.section-title--center::after {
  margin-left: auto;
  margin-right: auto;
}

/* ---- Utility classes ---- */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

@media (min-width: 768px) {
  .container { padding-left: var(--space-8); padding-right: var(--space-8); }
}

@media (min-width: 1200px) {
  .container { padding-left: var(--space-12); padding-right: var(--space-12); }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.text-center { text-align: center; }
.text-left   { text-align: left; }

/* ---- Fade-up animation for IntersectionObserver ---- */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---- Dark atmosphere (shared by page hero, CTA, footer) ----
   Deep Blue base, a red ember top-left and violet depth bottom-right —
   the same light fall-off as the logo badge — plus fine noise. */
.atmosphere-dark,
.page-hero,
.cta-banner,
.section--dark,
.site-footer {
  background-color: var(--color-surface-dark);
  background-image:
    var(--texture-noise),
    radial-gradient(ellipse 60% 80% at 0% 0%,   rgba(244, 86, 86, 0.16) 0%, transparent 70%),
    radial-gradient(ellipse 70% 90% at 100% 100%, rgba(27, 0, 104, 0.85) 0%, transparent 70%),
    linear-gradient(135deg, var(--brand-deep-blue) 0%, #120A30 100%);
  background-size: 160px 160px, auto, auto, auto;
  background-blend-mode: soft-light, normal, normal, normal;
}

/* ---- Page hero (inner pages) ---- */
.page-hero {
  padding: var(--space-16) 0 var(--space-12);
  position: relative;
  overflow: hidden;
}

/* Pixel-field motif, bottom-right corner */
.page-hero::after {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -20px;
  width: 340px;
  height: 220px;
  background: var(--texture-pixels) no-repeat right bottom / contain;
  opacity: 0.55;
  pointer-events: none;
}

.page-hero__content {
  position: relative;
  z-index: 1;
}

/* Title with the guide's vertical gradient bar on the left */
.page-hero__title {
  font-size: var(--text-4xl);
  color: var(--color-text-on-dark);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 0;
  padding-left: var(--space-5);
  position: relative;
  max-width: 22ch;
}

.page-hero__title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.12em;
  bottom: 0.12em;
  width: 4px;
  border-radius: var(--radius-full);
  background: var(--gradient-rule-v);
}

.page-hero__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-on-dark-2);
  opacity: 0.75;
  margin-bottom: var(--space-5);
  padding-left: var(--space-5);
}

.page-hero__breadcrumb a {
  transition: opacity var(--transition);
}

.page-hero__breadcrumb a:hover {
  opacity: 1;
}

.page-hero__breadcrumb span { opacity: 0.5; }

.page-hero__subtitle {
  color: var(--color-text-on-dark-2);
  font-size: var(--text-md);
  margin-top: var(--space-4);
  padding-left: var(--space-5);
  max-width: 60ch;
}

@media (min-width: 768px) {
  .page-hero__subtitle { padding-left: var(--space-6); }
}

@media (min-width: 768px) {
  .page-hero {
    padding: var(--space-24) 0 var(--space-16);
  }

  .page-hero::after {
    width: 520px;
    height: 300px;
  }

  .page-hero__title,
  .page-hero__breadcrumb {
    padding-left: var(--space-6);
  }
}
