/* ==========================================================================
   TekyMag — Base (reset, typographie, primitives, utilitaires)
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  font-family: var(--teky-font-ui);
  font-size: var(--teky-body);
  line-height: var(--teky-lh-body);
  color: var(--teky-charcoal);
  background: var(--teky-white);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--teky-cyan-700); text-decoration: none; }
a:hover { color: var(--teky-navy); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--teky-cyan);
  outline-offset: 2px;
  border-radius: var(--teky-radius-sm);
}

h1, h2, h3, h4, h5 {
  font-family: var(--teky-font-display);
  color: var(--teky-navy);
  font-weight: 800;
  line-height: var(--teky-lh-title);
  margin: 0 0 .5em;
}
h1 { font-size: var(--teky-h1); line-height: var(--teky-lh-tight); letter-spacing: -0.01em; }
h2 { font-size: var(--teky-h2); letter-spacing: -0.01em; }
h3 { font-size: var(--teky-h3); }
h4 { font-size: 1.125rem; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.25em; }
hr { border: none; border-top: 1px solid var(--teky-line); margin: 2rem 0; }

small, .meta { font-size: var(--teky-meta); color: var(--teky-muted); }
strong, b { font-weight: 700; }

::selection { background: var(--teky-cyan); color: var(--teky-white); }

html.no-scroll, html.no-scroll body { overflow: hidden; height: 100%; }

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: calc(var(--teky-container) + var(--teky-gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--teky-gutter);
}
.container--wide { max-width: calc(var(--teky-container-wide) + var(--teky-gutter) * 2); }
.container--mid { max-width: calc(var(--teky-container-mid) + var(--teky-gutter) * 2); }
.container--narrow { max-width: calc(var(--teky-container-narrow) + var(--teky-gutter) * 2); }

.section { padding-block: clamp(28px, 5vw, 56px); }
.section-tight { padding-block: clamp(16px, 3vw, 28px); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.section-head h2 { margin-bottom: .15em; }
.section-head .section-kicker { display: block; font-size: var(--teky-meta); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--teky-cyan-700); margin-bottom: .35em; }
.section-head__link { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.section-head__link::after { content: '→'; margin-left: .3em; display: inline-block; transition: transform var(--teky-duration) var(--teky-ease); }
.section-head__link:hover::after { transform: translateX(3px); }

.skip-link {
  position: absolute; left: 1rem; top: -60px;
  background: var(--teky-navy); color: var(--teky-white);
  padding: .75rem 1.25rem; border-radius: var(--teky-radius); z-index: 1200;
  transition: top var(--teky-duration) var(--teky-ease);
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

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

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--teky-font-ui); font-weight: 700; font-size: .95rem;
  padding: .7em 1.35em; border-radius: var(--teky-radius-pill);
  border: 1.5px solid transparent; cursor: pointer;
  transition: background var(--teky-duration) var(--teky-ease), color var(--teky-duration) var(--teky-ease), border-color var(--teky-duration) var(--teky-ease), transform var(--teky-duration-fast) var(--teky-ease);
  text-decoration: none; line-height: 1.2; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teky-cyan); color: var(--teky-navy); }
.btn-primary:hover { background: var(--teky-cyan-700); color: var(--teky-white); }
.btn-navy { background: var(--teky-navy); color: var(--teky-white); }
.btn-navy:hover { background: var(--teky-navy-700); color: var(--teky-white); }
.btn-outline { background: transparent; color: var(--teky-navy); border-color: var(--teky-line); }
.btn-outline:hover { border-color: var(--teky-navy); background: var(--teky-grey); }
.btn-ghost { background: transparent; color: var(--teky-navy); border-color: transparent; padding-inline: .6em; }
.btn-ghost:hover { background: var(--teky-grey); }
.btn-sm { padding: .45em 1em; font-size: .85rem; }
.btn-lg { padding: .9em 1.75em; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon { width: 2.5rem; height: 2.5rem; padding: 0; border-radius: 50%; }

/* ---- Forms ---- */
.field { margin-bottom: 1.1rem; }
.field label, .field legend {
  display: block; font-weight: 700; font-size: .9rem; margin-bottom: .4rem; color: var(--teky-navy);
}
.field .hint { font-size: .8rem; color: var(--teky-muted); margin-top: .35rem; }
.input, .textarea, .select {
  width: 100%; font: inherit; color: var(--teky-charcoal);
  background: var(--teky-white); border: 1.5px solid var(--teky-line);
  border-radius: var(--teky-radius); padding: .7em .9em;
  transition: border-color var(--teky-duration) var(--teky-ease), box-shadow var(--teky-duration) var(--teky-ease);
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--teky-cyan); box-shadow: var(--teky-shadow-focus); outline: none; }
.textarea { resize: vertical; min-height: 7rem; }
.field-error .input, .field-error .textarea { border-color: var(--teky-error); }
.field-error .error-msg { color: var(--teky-error); font-size: .8rem; margin-top: .35rem; display: block; font-weight: 600; }
.checkbox-row { display: flex; align-items: flex-start; gap: .6rem; font-size: .85rem; color: var(--teky-muted); }
.checkbox-row input { margin-top: .25rem; }

/* ---- Badges / tags / pills ---- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .4em;
  font-family: var(--teky-font-ui); font-weight: 700; font-size: .82rem;
  color: var(--teky-cyan-700);
}
.eyebrow .dot { width: .45em; height: .45em; border-radius: 50%; background: currentColor; flex: none; }
.tag-pill {
  display: inline-flex; align-items: center; font-size: .82rem; font-weight: 600;
  padding: .4em .9em; border-radius: var(--teky-radius-pill);
  background: var(--teky-grey); color: var(--teky-navy);
  border: 1px solid var(--teky-line);
  transition: background var(--teky-duration) var(--teky-ease), color var(--teky-duration) var(--teky-ease), border-color var(--teky-duration) var(--teky-ease);
}
a.tag-pill:hover { background: var(--teky-navy); color: var(--teky-white); border-color: var(--teky-navy); text-decoration: none; }
.tag-pill.is-active { background: var(--teky-navy); color: var(--teky-white); border-color: var(--teky-navy); }
.badge {
  display: inline-flex; align-items: center; gap: .35em; font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; padding: .3em .6em; border-radius: var(--teky-radius-sm);
}
.badge-sponsor { background: var(--teky-warning-bg); color: #8A5A0A; }
.badge-new { background: var(--teky-cyan-100); color: var(--teky-cyan-700); }
.badge-partner { background: var(--teky-cyan-100); color: var(--teky-cyan-700); }
.badge-live { background: var(--teky-error-bg); color: var(--teky-error); }
.badge-live .dot { width: .5em; height: .5em; border-radius: 50%; background: currentColor; animation: pulse 1.6s var(--teky-ease) infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---- Misc utilities ---- */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.text-muted { color: var(--teky-muted); }
.text-center { text-align: center; }
.hide-mobile { display: none; }
@media (min-width: 768px) { .hide-mobile { display: initial; } .hide-desktop { display: none; } }
.sr-focusable:not(:focus):not(:focus-within) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.divider { height: 1px; background: var(--teky-line); border: none; margin: 2.5rem 0; }

/* Skeleton loading state */
.skeleton { position: relative; overflow: hidden; background: var(--teky-grey); }
.skeleton::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
