/* Geomehanika — shared design system for the 3 pitch directions.
   Tokens first, then shared components, then per-direction overrides via [data-dir]. */

/* ---------- Fonts (self-hosted, OFL; latin + latin-ext for č ć š ž đ) ---------- */
@font-face { font-family: "Archivo"; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url("fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Archivo"; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url("fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url("fonts/source-sans-3-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url("fonts/source-sans-3-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 400;
  src: url("fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 400;
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 500;
  src: url("fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 500;
  src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* ---------- Tokens ---------- */
:root {
  /* brand colour (from the live site) */
  --navy: #25364c;
  --slate: #86909f;
  --sand: #d1be8a;
  --ink: #16191e;
  --text: #333;
  --white: #fff;
  --paper: #f6f3ec;
  --water: #4f7896; /* groundwater line only, A's cross-section */

  /* semantic (overridden per direction) */
  --bg: var(--white);
  --fg: var(--text);
  --heading: var(--navy);
  --muted: #5c6573;
  --line: rgba(37, 54, 76, .16);
  --accent: var(--navy);
  --accent-fg: var(--white);

  /* type */
  --font-display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --font-text: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --display-stretch: 100%;
  --display-weight: 700;
  --display-case: none;
  --display-track: -0.02em;

  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.875rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.45rem);
  --step-2: clamp(1.45rem, 1.3rem + 0.75vw, 1.95rem);
  --step-3: clamp(1.8rem, 1.5rem + 1.4vw, 2.75rem);
  --step-4: clamp(2.2rem, 1.7rem + 2.5vw, 3.9rem);
  --step-5: clamp(2.6rem, 1.8rem + 4vw, 5.5rem);
  --step-6: clamp(3rem, 1.6rem + 7vw, 8.5rem);
  --leading: 1.6;

  /* space (4-based) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 144px;
  --gutter: clamp(20px, 4vw, 48px);
  --maxw: 1320px;

  /* one radius */
  --radius: 2px;

  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur-1: 160ms;
  --dur-2: 320ms;
  --dur-3: 700ms;
}

/* ---------- Per-direction overrides ---------- */
[data-dir="a"] {
  --bg: var(--paper);
  --fg: #2b3440;
  --heading: var(--navy);
  --muted: #5d6675;
  --line: rgba(37, 54, 76, .18);
  --rule: var(--sand);
  --accent: var(--navy);
  --display-stretch: 118%;
  --display-weight: 600;
  --display-track: -0.025em;
}
[data-dir="b"] {
  --bg: var(--ink);
  --fg: #cfd3da;
  --heading: #f1ece0;
  --muted: #8d95a2;
  --line: rgba(209, 190, 138, .22);
  --accent: var(--sand);
  --accent-fg: var(--ink);
  --display-stretch: 66%;
  --display-weight: 650;
  --display-case: uppercase;
  --display-track: 0;
  color-scheme: dark;
}
[data-dir="c"] {
  --bg: var(--white);
  --fg: var(--text);
  --heading: var(--navy);
  --muted: #5c6573;
  --line: #e2e5ea;
  --accent: var(--navy);
  --display-stretch: 100%;
  --display-weight: 750;
  --display-track: -0.03em;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 var(--step-0)/var(--leading) var(--font-text);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, h4 {
  margin: 0; color: var(--heading);
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-stretch: var(--display-stretch); text-transform: var(--display-case);
  letter-spacing: var(--display-track); line-height: 1.02;
  text-wrap: balance;
}
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--sand); outline-offset: 3px; }
::selection { background: var(--sand); color: var(--ink); }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: .04em; text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s-4); top: -60px; z-index: 100; padding: var(--s-3) var(--s-4); background: var(--sand); color: var(--ink); }
.skip:focus { top: var(--s-4); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6em; min-height: 48px; padding: 0 1.25em;
  border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: var(--accent-fg);
  font: 600 var(--step-0)/1 var(--font-text); text-decoration: none; white-space: nowrap;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.btn:hover { background: var(--heading); border-color: var(--heading); color: var(--bg); }
.btn--ghost { background: transparent; color: var(--heading); border-color: currentColor; }
.btn--ghost:hover { background: var(--heading); color: var(--bg); }
.btn .arr { font-family: var(--font-mono); font-weight: 400; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: var(--s-6); min-height: 76px; }
.logo { display: block; flex: none; }
.logo img { height: 46px; width: auto; }
.nav { display: flex; gap: clamp(14px, 1.8vw, 30px); margin-left: auto; }
.nav a { text-decoration: none; font-weight: 500; font-size: var(--step-0); color: var(--fg); padding-block: 6px; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--heading); border-bottom-color: var(--sand); }
.site-header .btn { min-height: 44px; }
.nav-m { display: none; margin-left: auto; position: relative; }
.nav-m summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 600; color: var(--heading); }
.nav-m summary::-webkit-details-marker { display: none; }
.nav-m[open] summary { border-color: var(--heading); }
.nav-m .panel { position: absolute; right: 0; top: calc(100% + 10px); width: min(86vw, 320px); background: var(--bg); border: 1px solid var(--line); padding: var(--s-4); display: grid; gap: 2px; box-shadow: 0 18px 40px rgba(0,0,0,.18); }
.nav-m .panel a { padding: 12px 8px; text-decoration: none; color: var(--heading); font-weight: 500; border-bottom: 1px solid var(--line); }
.nav-m .panel .btn { margin-top: var(--s-3); justify-content: center; color: var(--accent-fg); border-bottom: 0; }
@media (max-width: 1080px) {
  .nav, .site-header .wrap > .btn { display: none; }
  .nav-m { display: block; }
  .logo img { height: 40px; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: var(--s-8) var(--s-6); font-size: var(--step-0); }
.site-footer .cols { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: var(--s-7); }
.site-footer h2 { font-size: var(--step-1); margin-bottom: var(--s-4); }
.site-footer address { font-style: normal; }
.site-footer address a { text-decoration: none; border-bottom: 1px solid var(--line); }
.site-footer address a:hover { border-color: var(--sand); }
.site-footer .lead { max-width: 34ch; color: var(--muted); margin-top: var(--s-4); }
.site-footer .iso { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); justify-content: space-between; color: var(--muted); }
@media (max-width: 860px) { .site-footer .cols { grid-template-columns: 1fr; gap: var(--s-6); } }

/* ---------- Motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; }
}
