/* ELVARIS SOFTWARE LTD — base.css
   Design tokens, reset, typography. "Systems in Motion" premium editorial system. */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  /* --- Surfaces --- */
  --ivory: #F6F3EC;
  --paper: #F6F3EC;
  --white: #FCFBF8;
  --bone: #EDE8DE;
  --grey: #E6E3DC;
  --sand: #DDD2C0;

  /* --- Ink / midnight --- */
  --ink: #0E1016;
  --midnight: #12151F;
  --midnight-2: #191D2B;
  --graphite: #333849;
  --slate: #5C6478;

  /* --- Accents --- */
  --cobalt: #2F55F0;
  --cobalt-bright: #4B72FF;
  --cobalt-dark: #1B37B8;
  --violet: #7A63EA;
  --vermilion: #F0563A;
  --coral: #FF7A5C;
  --amber: #C9762E;
  --pale-blue: #DCE5FF;
  --luminous: #8FB0FF;

  /* --- Category accents --- */
  --category-1: #2F55F0;
  --category-2: #F0563A;
  --category-3: #7A63EA;
  --category-4: #C9762E;
  --accent: var(--cobalt);

  /* --- Type --- */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;

  --measure: 66ch;
  --measure-narrow: 58ch;

  /* --- Radii --- */
  --radius-s: 4px;
  --radius-m: 12px;
  --radius-l: 20px;
  --radius-xl: 30px;

  /* --- Motion --- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 200ms;
  --dur-mid: 460ms;
  --dur-slow: 820ms;

  --header-h: 76px;

  /* --- Elevation --- */
  --shadow-s: 0 2px 8px -4px rgba(14, 16, 22, 0.18);
  --shadow-m: 0 18px 40px -28px rgba(14, 16, 22, 0.42);
  --shadow-l: 0 40px 80px -44px rgba(14, 16, 22, 0.55);

  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@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;
  min-width: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1;
}

body.no-scroll { overflow: hidden; }

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

/* ---------- Headings ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 0.5em;
  color: var(--ink);
  text-wrap: balance;
  letter-spacing: -0.018em;
  font-optical-sizing: auto;
}

h1 { font-size: clamp(2.5rem, 5.4vw, 4.6rem); font-weight: 600; }
h2 { font-size: clamp(1.85rem, 3.4vw, 3rem); }
h3 { font-size: clamp(1.15rem, 1.7vw, 1.45rem); }
h4 { font-size: 1.05rem; }

p {
  margin: 0 0 1.15em;
  max-width: var(--measure);
}

.lead {
  font-size: clamp(1.05rem, 1.45vw, 1.24rem);
  line-height: 1.6;
  color: var(--graphite);
  max-width: var(--measure-narrow);
}

a {
  color: var(--cobalt-dark);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color var(--dur-fast);
}
a:hover { text-decoration-color: currentColor; }

ul, ol { padding-left: 1.25em; max-width: var(--measure); }
li { margin-bottom: 0.45em; }
li::marker { color: var(--accent); }

strong { font-weight: 650; }
small { font-size: 0.85em; }

hr { border: none; border-top: 1px solid var(--grey); margin: 2.5rem 0; }

button { font-family: inherit; }

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

/* ---------- Focus ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
  border-radius: 3px;
}

.on-dark a:focus-visible,
.on-dark button:focus-visible {
  outline-color: var(--luminous);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -90px;
  background: var(--ink);
  color: var(--white);
  padding: 0.85em 1.4em;
  border-radius: var(--radius-s);
  z-index: 1200;
  font-weight: 600;
  transition: top var(--dur-fast) var(--ease-out);
}
.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;
}

::selection { background: var(--ink); color: var(--ivory); }

/* ---------- Dark section base ---------- */
.on-dark {
  background: var(--ink);
  color: rgba(246, 243, 236, 0.82);
}
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4 { color: var(--white); }
.on-dark .lead { color: rgba(246, 243, 236, 0.74); }
.on-dark a { color: var(--luminous); }
.on-dark p { color: rgba(246, 243, 236, 0.78); }

/* ---------- Grain texture utility ---------- */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}
