/* ==========================================================================
   INGEOMAS - base.css
   Tokens, reset, tipografia editorial y utilidades.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* --------------------------------------------------------------------
     Identidad INGEOMAS. Colores tomados del archivo de marca
     assets/logo/original/ingeomas-logo-original.svg:
       azul base  #0E1F30   dorado  #FCBB03   filete  #173566
     -------------------------------------------------------------------- */
  --navy: #0e1f30; /* color de marca, fondo de la pagina */
  --navy-line: #173566; /* el filete azul del propio logotipo */

  /* Escala construida sobre el azul de marca */
  --ink-950: #081420; /* pozos de contraste: escenario del hero */
  --ink-900: #0e1f30; /* fondo general */
  --ink-850: #112538;
  --ink-800: #142a40;
  --ink-700: #1a3350;
  --ink-600: #213d5e;
  --ink-500: #2a4a6e;

  --steel-400: #3e5570;
  --steel-300: #5e7794;
  --concrete-200: #93a5b8;

  --ivory: #f4f1e9;
  --ivory-80: rgba(244, 241, 233, 0.8);
  --ivory-62: rgba(244, 241, 233, 0.62);
  --ivory-42: rgba(244, 241, 233, 0.42);
  --ivory-16: rgba(244, 241, 233, 0.16);
  --ivory-08: rgba(244, 241, 233, 0.08);

  /* Acento: Dorado INGEOMAS */
  --amber: #fcbb03;
  --amber-deep: #c89302;
  --amber-pale: #ffd97a;
  --amber-16: rgba(252, 187, 3, 0.16);
  --amber-08: rgba(252, 187, 3, 0.08);

  /* Velos sobre el azul de marca, para scrims y superficies translucidas */
  --navy-92: rgba(14, 31, 48, 0.92);
  --navy-78: rgba(14, 31, 48, 0.78);
  --navy-62: rgba(14, 31, 48, 0.62);

  /* Tipografia */
  --font-display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype",
    "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", "Segoe UI", -apple-system, BlinkMacSystemFont,
    Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "Cascadia Mono",
    Consolas, "Liberation Mono", monospace;

  /* Escala fluida */
  --step--2: clamp(0.69rem, 0.67rem + 0.11vw, 0.76rem);
  --step--1: clamp(0.83rem, 0.79rem + 0.19vw, 0.95rem);
  --step-0: clamp(1rem, 0.94rem + 0.3vw, 1.19rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.48vw, 1.48rem);
  --step-2: clamp(1.44rem, 1.29rem + 0.75vw, 1.85rem);
  --step-3: clamp(1.73rem, 1.5rem + 1.14vw, 2.31rem);
  --step-4: clamp(2.07rem, 1.74rem + 1.67vw, 2.89rem);
  --step-5: clamp(2.49rem, 2.01rem + 2.4vw, 3.61rem);
  --step-6: clamp(2.99rem, 2.31rem + 3.39vw, 4.51rem);

  /* Ritmo espacial */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.25rem;
  --space-xl: 3.5rem;
  --space-2xl: 5.5rem;
  --space-3xl: 8rem;
  --space-4xl: 11rem;

  /* Estructura */
  --shell: 88rem;
  --shell-narrow: 64rem;
  --gutter: clamp(1.25rem, 4vw, 4.5rem);
  --rule: 1px solid var(--ivory-08);
  --radius: 2px;

  /* Movimiento */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 220ms;
  --dur: 480ms;
  --dur-slow: 900ms;

  --nav-h: 4.75rem;

  /* Grano procedural generado por tools/make-grain.js */
  --grain-src: url("../assets/textures/grain.png");
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto; /* el scroll suave lo gestiona Lenis / JS */
}

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd,
fieldset,
legend {
  margin: 0;
}

ul[class],
ol[class] {
  margin: 0;
  padding: 0;
  list-style: none;
}

body {
  min-height: 100vh;
  /* Evita desbordamiento horizontal en todos los breakpoints */
  overflow-x: hidden;
  background-color: var(--ink-900);
  color: var(--ivory);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  font-weight: 350;
  line-height: 1.65;
  letter-spacing: 0.005em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img,
video {
  height: auto;
}

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

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

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

fieldset {
  border: 0;
  padding: 0;
}

/* --------------------------------------------------------------------------
   3. Tipografia
   -------------------------------------------------------------------------- */
.display,
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-6);
}
h2 {
  font-size: var(--step-5);
}
h3 {
  font-size: var(--step-2);
}

/* Etiqueta tecnica: rotulo de plano arquitectonico */
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 400;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--amber);
  line-height: 1;
}

.eyebrow::before {
  content: "";
  width: clamp(1.5rem, 4vw, 3.25rem);
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  flex: none;
}

.lede {
  font-size: var(--step-1);
  font-weight: 300;
  line-height: 1.55;
  color: var(--ivory-80);
  max-width: 46ch;
  text-wrap: pretty;
}

.prose {
  color: var(--ivory-62);
  max-width: 62ch;
  text-wrap: pretty;
}

.prose + .prose {
  margin-top: var(--space-s);
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.amber {
  color: var(--amber);
}

/* --------------------------------------------------------------------------
   4. Utilidades
   -------------------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shell--narrow {
  max-width: var(--shell-narrow);
}

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

.skip-link {
  position: absolute;
  top: var(--space-s);
  left: var(--space-s);
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--amber);
  color: var(--ink-900);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* Foco visible y consistente en todo el sitio */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

/* Filete tecnico horizontal */
.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(
    90deg,
    var(--ivory-16),
    var(--ivory-08) 55%,
    transparent
  );
}

/* --------------------------------------------------------------------------
   5. Grano cinematografico + vineteado global
   -------------------------------------------------------------------------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: var(--grain-src);
  background-size: 180px 180px;
  will-change: transform;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 89;
  pointer-events: none;
  background: radial-gradient(
    120% 90% at 50% 45%,
    transparent 40%,
    rgba(4, 12, 22, 0.5) 100%
  );
}

/* --------------------------------------------------------------------------
   6. prefers-reduced-motion
   -------------------------------------------------------------------------- */
@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;
  }

  .grain {
    display: none;
  }
}
