/* Eleman — landing page styles
   Palette: warm off-white ground, near-black ink, one ochre accent. */

/* ---- Fonts (self-hosted) ---- */
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("assets/fonts/schibsted-grotesk-latin.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: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("assets/fonts/schibsted-grotesk-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Cyrillic (Ukrainian) — falls back per glyph after Schibsted Grotesk */
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("assets/fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Arabic — falls back per glyph after Schibsted Grotesk */
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-arabic-400.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-arabic-600.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-arabic-700.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* ---- Tokens ---- */
:root {
  --paper: #f6f4ef;
  --paper-2: #efece3;
  --ink: #17150f;
  --ink-soft: #5a5749;
  --line: #ded9c9;
  --accent: #a34e10;
  --accent-strong: #893f0b;
  --accent-ink: #fdf6ef;
  --dark: #17140f;
  --dark-ink: #f2eee5;
  --dark-soft: #b6af9e;
  --dark-accent: #eaa869;
  --dark-line: #322d24;

  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 1140px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --radius: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1rem, 0.95rem + 0.18vw, 1.125rem);
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

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

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

h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.05; letter-spacing: -0.025em; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  top: -3rem;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 1rem; }

/* ---- Header ---- */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 0.9rem; }

.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 9px;
  background: var(--ink);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 1.05rem;
  padding-bottom: 1px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-weight: 650; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-text small { color: var(--ink-soft); font-size: 0.72rem; letter-spacing: 0.02em; }

.site-nav { display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 1.6rem); }
.site-nav > a:not(.btn) {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink-soft);
  padding-block: 0.25rem;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.site-nav > a:not(.btn):hover { color: var(--ink); border-color: var(--ink); }

/* Header right cluster + language switcher */
.header-right { display: flex; align-items: center; gap: clamp(0.5rem, 2vw, 1.4rem); }
.lang-nav { display: flex; align-items: center; gap: 0.15rem; }
.lang-nav a {
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.32rem 0.46rem;
  border-radius: 7px;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.lang-nav a:hover { color: var(--ink); background: var(--paper-2); }
.lang-nav a[aria-current="true"] { color: var(--ink); font-weight: 600; background: var(--paper-2); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.85em 1.35em;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { padding: 0.6em 1.05em; font-size: 0.92rem; }

/* ---- Hero ---- */
.hero { padding-block: clamp(3rem, 8vw, 6.5rem) 0; }
.hero h1 {
  font-size: clamp(2.75rem, 7.6vw, 5.5rem);
  line-height: 1.0;
  max-width: 15ch;
}
.lede {
  margin-top: clamp(1.2rem, 2.5vw, 1.8rem);
  max-width: 58ch;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: clamp(1.6rem, 3vw, 2.4rem); }

.hero-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 2rem;
  margin: clamp(2.75rem, 6vw, 4.5rem) 0 0;
  border-top: 1px solid var(--line);
}
.hero-meta > div { padding: 1.35rem 0; border-bottom: 1px solid var(--line); }
.hero-meta dt {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
  font-weight: 600;
}
.hero-meta dd { margin: 0.5rem 0 0; font-size: 0.98rem; }
.hero-meta dd a { color: var(--accent); text-decoration: none; }
.hero-meta dd a:hover { text-decoration: underline; text-underline-offset: 3px; }

.route-wrap { margin-top: 2rem; }
.route { display: block; width: 100%; height: 56px; overflow: visible; }
.route-line, .route-ticks line { stroke: var(--line); stroke-width: 1.5; fill: none; }
.route-dot { fill: var(--accent); }

/* ---- Sections ---- */
.section { padding-block: clamp(4rem, 9vw, 8rem); }
.section-alt { background: var(--paper-2); }

h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
.section-lede {
  margin-top: 0.9rem;
  max-width: 52ch;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

/* Imports list */
.imports { list-style: none; margin: clamp(2.5rem, 5vw, 3.5rem) 0 0; padding: 0; border-top: 1px solid var(--line); }
.imports li {
  display: grid;
  grid-template-columns: minmax(11rem, 1fr) 2fr;
  gap: 0.5rem 2.5rem;
  padding-block: clamp(1.4rem, 3vw, 2.2rem);
  border-bottom: 1px solid var(--line);
  transition: border-color 0.25s var(--ease);
}
.imports h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 600; letter-spacing: -0.015em; }
.imports li > div p { color: var(--ink-soft); max-width: 60ch; }
.imports .origins { margin-top: 0.55rem; font-size: 0.86rem; color: var(--ink); opacity: 0.7; }
.imports li:hover { border-color: var(--ink); }
.imports li:hover h3 { color: var(--accent); }

.supply { margin-top: clamp(1.8rem, 3.5vw, 2.5rem); max-width: 52ch; color: var(--ink-soft); }

/* Steps */
.steps { list-style: none; counter-reset: step; margin: clamp(2.5rem, 5vw, 3.5rem) 0 0; padding: 0; border-top: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 3.5rem 1fr; gap: 0.4rem 1.5rem; padding-block: clamp(1.4rem, 3vw, 2rem); border-bottom: 1px solid var(--line); }
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  padding-top: 0.25rem;
}
.step h3 { font-size: clamp(1.15rem, 1.8vw, 1.45rem); font-weight: 600; grid-column: 2; }
.step p { grid-column: 2; color: var(--ink-soft); max-width: 62ch; margin-top: 0.35rem; }

/* Approach */
.pull { margin-top: clamp(1.8rem, 4vw, 2.75rem); font-size: clamp(1.5rem, 3.2vw, 2.4rem); line-height: 1.18; letter-spacing: -0.02em; font-weight: 600; max-width: 22ch; }
.principles { display: grid; grid-template-columns: 1fr; gap: 2.5rem; margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.principle { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.principle h3 { font-size: 1.15rem; font-weight: 600; }
.principle p { margin-top: 0.55rem; color: var(--ink-soft); font-size: 0.98rem; }

/* Contact */
.contact { background: var(--dark); color: var(--dark-ink); padding-block: clamp(4.5rem, 10vw, 8rem); }
.contact h2 { font-size: clamp(2rem, 4vw, 3.2rem); max-width: 18ch; }
.contact-lede { margin-top: 1.2rem; max-width: 50ch; color: var(--dark-soft); font-size: 1.08rem; }
.contact-mails { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; margin-top: clamp(2rem, 4vw, 2.75rem); }
.contact-mails a {
  color: var(--dark-ink);
  text-decoration: none;
  font-size: clamp(1.3rem, 3vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  border-bottom: 2px solid var(--dark-line);
  padding-bottom: 0.15em;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.contact-mails a:hover { color: var(--dark-accent); border-color: var(--dark-accent); }
.contact :focus-visible { outline-color: var(--dark-accent); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 1.8rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; align-items: center; color: var(--ink-soft); font-size: 0.9rem; }
.footer-inner a { text-decoration: none; color: var(--ink); }
.footer-inner a:hover { color: var(--accent); }

/* ---- Entrance (progressive enhancement) ---- */
.js .hero h1,
.js .hero .lede,
.js .hero-actions,
.js .hero-meta { animation: rise 0.9s var(--ease) both; }
.js .hero .lede { animation-delay: 0.08s; }
.js .hero-actions { animation-delay: 0.16s; }
.js .hero-meta { animation-delay: 0.24s; }

.route-line { stroke-dasharray: 1400; stroke-dashoffset: 0; }
.js .route.is-in .route-line { animation: draw 1.1s var(--ease) both; }
.js .route.is-in .route-ticks line { animation: fade-in 0.5s var(--ease) 0.7s both; }
.js .route.is-in .route-dot { animation: fade-in 0.5s var(--ease) 1s both; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dashoffset: 1400; } to { stroke-dashoffset: 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---- Responsive ---- */
@media (min-width: 600px) {
  .hero-meta { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .hero-meta { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 760px) {
  .principles { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .site-nav > a:not(.btn) { display: none; }
}
@media (max-width: 720px) {
  .site-nav .btn { display: none; }
  .imports li { grid-template-columns: 1fr; gap: 0.5rem; }
}
@media (max-width: 520px) {
  .step { grid-template-columns: 2.5rem 1fr; gap: 0.4rem 0.9rem; }
  .header-inner .brand-text small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .hero h1, .js .hero .lede, .js .hero-actions, .js .hero-meta {
    opacity: 1; transform: none; animation: none;
  }
  .js .route-line, .js .route-ticks line, .js .route-dot { opacity: 1; animation: none; }
  .route-line { stroke-dashoffset: 0; }
  * { transition-duration: 0.01ms !important; }
}

/* ---- Language-specific type ---- */
html[lang="uk"] { --font: "Schibsted Grotesk", "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
html[lang="ar"] { --font: "Schibsted Grotesk", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

html[lang="ar"] body { line-height: 1.9; }
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] .pull,
html[lang="ar"] .hero-meta dt,
html[lang="ar"] .brand-text small { letter-spacing: 0; }
html[lang="ar"] h1 { line-height: 1.28; }
html[lang="ar"] h2,
html[lang="ar"] h3 { line-height: 1.4; }

/* ---- Right-to-left ---- */
html[dir="rtl"] .route { transform: scaleX(-1); }
