/* ==========================================================================
   GEM FX — base: tokens, reset, tipografía
   ========================================================================== */

:root {
  /* --- Color: obsidiana fría + esmeralda tallada -------------------------- */
  --obsidian: #06090c;
  --onyx: #0b1216;
  --onyx-2: #101a1f;
  --line: #1c2a30;
  --line-soft: #16232a;

  --bone: #e9f0ed;
  --mist: #8ba0a4;
  --mist-dim: #5f7176;

  --emerald: #1fb37e;
  --emerald-deep: #0a5f46;
  --facet: #74efc0;

  --ruby: #e24a63;
  --citrine: #dcc08a;

  --focus: #74efc0;

  /* --- Tipografía --------------------------------------------------------- */
  --display: 'Martian Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;
  --body: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* --- Ritmo -------------------------------------------------------------- */
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --measure: 66ch;
  --shell: 1180px;
  --radius: 4px;
  --cut: 20px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  min-height: 100svh;
  background: var(--obsidian);
  color: var(--bone);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* Necesario: varias clases usan display:grid o flex y pisarían a [hidden]. */
[hidden] {
  display: none !important;
}

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

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

:where(h1, h2, h3, h4) {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

:where(p) {
  text-wrap: pretty;
}

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

::selection {
  background: var(--emerald-deep);
  color: var(--bone);
}

/* --- Utilidades ---------------------------------------------------------- */

.shell {
  width: min(100% - (var(--gutter) * 2), var(--shell));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  background: var(--emerald);
  color: var(--obsidian);
  font-weight: 600;
  border-radius: var(--radius);
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

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

.eyebrow {
  font-family: var(--display);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mist);
}

/* Bisel de gema: una esquina cortada, como la tabla de una piedra tallada. */
.bevel {
  --b: var(--cut);
  clip-path: polygon(0 0, calc(100% - var(--b)) 0, 100% var(--b), 100% 100%, 0 100%);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
