/* ============================================
   ATAMAP ASSOCIATES — Base Styles
   Mobile-First · Performance-Optimized
   ============================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  hanging-punctuation: first last;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-silver-100);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(212, 175, 55, 0.02) 0%, transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #f8f9fc 25%, #f3f4f8 50%, #f8f9fc 75%, #ffffff 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
  overflow-x: hidden;
  /* Safe area padding for notch devices */
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

/* Inter font loaded via Google Fonts <link> in <head> — local @font-face removed (was referencing broken URL) */

/* ── Fluid Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-silver-100);
  text-wrap: balance;
}

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

/* Fluid scaling for headings at larger screens */
@media (min-width: 768px) {
  h1 { font-size: var(--font-size-5xl); }
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-steel-300);
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-spring-settle);
}

a:hover {
  color: var(--color-accent-hover);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--border-radius-xs);
}

strong, b {
  font-weight: var(--font-weight-semibold);
}

small {
  font-size: var(--font-size-sm);
}

/* Lists */
ul, ol {
  list-style: none;
}

/* Images — Responsive + Performance */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* SVGs */
svg {
  overflow: visible;
}

/* Forms */
input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

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

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
}

/* Focus Management */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  z-index: var(--z-toast);
  font-weight: var(--font-weight-semibold);
  transition: top var(--duration-fast) var(--ease-spring-settle);
}

.skip-link:focus {
  top: 0;
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Selection */
::selection {
  background: var(--color-accent-dim);
  color: var(--color-silver-100);
}

/* Scrollbar — Minimal premium (light theme) */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c4c8d0;
  border-radius: var(--border-radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ── Performance: Contain Layout ── */
.card,
.service-card,
.project-card,
.value-card,
.presence-item,
.country-card,
.alliance-card,
.mandate-card {
  contain: layout style;
  content-visibility: auto;
  contain-intrinsic-size: auto 300px;
}

/* Audit fix: prevent sticky header from covering anchored section headings.
   Header is 64px tall (--header-height), plus 8px breathing room. */
[id] { scroll-margin-top: calc(var(--header-height, 64px) + 8px); }


/* Visually hidden but available to screen readers (WCAG 2.1 Technique H95) */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
