/* ============================================================
   ELLI TRADE — elli-trade.com
   House style: flat SVG illustration language shared by the
   local project family — blue blob base, black-outlined white
   objects, one inverted black card, dot matrices, dashed flow
   lines, sparkles. Slow float / dash-flow / twinkle animations.
   Fonts: Space Grotesk / Instrument Sans / IBM Plex Mono.
   ============================================================ */

:root {
  --bg: #EDF1FB;
  --card: #FFFFFF;
  --ink: #1A1F36;
  --ink-2: #3E4560;
  --muted: #6B7280;
  --faint: #9CA3AF;
  --line: #E3E7F2;
  --line-strong: #C9D2E8;
  --brand: #2563EB;
  --brand-strong: #1D4ED8;
  --brand-soft: #DDE6FA;
  --brand-tint: #F0F4FE;
  --black: #111318;
  --black-2: #23262E;
  --on-black: #F2F4FA;
  --muted-on-black: #9BA1B4;
  --brand-on-black: #7EA2F5;
  --line-on-black: #3A3F4D;
  --line-on-black-strong: #4A5064;
  --line-on-black-faint: #2A2E3A;
  --amber: #F59E0B;
  --dot: rgba(37, 99, 235, 0.2);

  --font-display: 'Space Grotesk', 'Avenir Next', 'Segoe UI', sans-serif;
  --font-body: 'Instrument Sans', 'Segoe UI', 'Helvetica Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', monospace;

  --w-max: 1120px;
  --radius: 20px;
  --radius-sm: 10px;
  --shadow-card: 0 20px 60px rgba(31, 47, 116, 0.12), 0 4px 14px rgba(31, 47, 116, 0.06);
  --shadow-soft: 0 10px 30px rgba(31, 47, 116, 0.08), 0 2px 8px rgba(31, 47, 116, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

::selection { background: var(--brand); color: #fff; }

/* ---------- type ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.3rem, 5vw, 3.7rem); }
h2 { font-size: clamp(1.65rem, 3vw, 2.3rem); }
h3 { font-size: 1.18rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  display: block;
  margin-bottom: 16px;
}

.lede {
  font-size: clamp(1.02rem, 1.7vw, 1.2rem);
  color: var(--ink-2);
  max-width: 42em;
}

.tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  color: var(--brand-strong);
  letter-spacing: 0.02em;
}

.mono { font-family: var(--font-mono); }

/* ---------- layout ---------- */

.container {
  max-width: var(--w-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 40px 0; }
.section:first-of-type { padding-top: 48px; }
.section:last-of-type { padding-bottom: 88px; }

.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: clamp(40px, 6vw, 72px);
  position: relative;
  overflow: hidden;
}

.panel-dark {
  background: var(--black);
  color: var(--on-black);
}
.panel-dark .eyebrow { color: var(--brand-on-black); }
.panel-dark .lede { color: var(--muted-on-black); }

.section-head { max-width: 46em; margin-bottom: 44px; }
.section-head .lede { margin-top: 16px; }

/* dot matrices — CSS radial-gradient tiles, house pattern */
.dots {
  position: absolute;
  background-image: radial-gradient(circle, var(--dot) 2.4px, transparent 2.4px);
  background-size: 14px 14px;
  pointer-events: none;
}
.dots-tr { top: 36px; right: 40px; width: 140px; height: 84px; }
.dots-bl { bottom: 36px; left: 40px; width: 112px; height: 70px; opacity: 0.7; }
.panel-dark .dots { background-image: radial-gradient(circle, rgba(126, 162, 245, 0.28) 2.4px, transparent 2.4px); }

/* skip link (keyboard bypass) */
.skip-link {
  position: absolute;
  left: 16px;
  top: -52px;
  z-index: 100;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top 150ms;
}
.skip-link:focus-visible { top: 0; }
#main { scroll-margin-top: 80px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand .brand-mark { width: 30px; height: 30px; flex: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: var(--radius-sm);
  transition: color 150ms, background-color 150ms;
}
.nav-links a:hover { color: var(--ink); background: var(--brand-tint); }
.nav-links a[aria-current="page"] {
  color: var(--brand-strong);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

.nav-cta { margin-left: 12px; }
.nav-links a.btn-primary { color: #fff; }
.nav-links a.btn-primary:hover { color: #fff; background: var(--brand-strong); }

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  color: var(--ink);
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  border: 1.5px solid transparent;
  transition: background-color 150ms, border-color 150ms, color 150ms, transform 80ms;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }

.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-strong); }

.panel-dark .btn-ghost { border-color: var(--line-on-black); color: var(--on-black); }
.panel-dark .btn-ghost:hover { border-color: var(--on-black); }

.btn:focus-visible, a:focus-visible, .nav-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.nav-toggle:hover { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-tint); }

/* inline content links */
.footnote a, .flow-steps a, .prose a, .registry a, .partner-note a {
  color: var(--brand-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-thickness 100ms;
}
.footnote a:hover, .flow-steps a:hover, .prose a:hover, .registry a:hover, .partner-note a:hover {
  text-decoration-thickness: 2px;
}

/* ---------- hero ---------- */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 48px;
  align-items: center;
}

.hero-grid h1 { margin: 16px 0 16px; max-width: 13em; font-size: clamp(2.2rem, 4.2vw, 3.15rem); }
.hero-grid .tagline { display: block; margin-bottom: 24px; }
.hero-grid .lede { margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-note {
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--muted);
}

.illu { width: 100%; max-width: 420px; margin: 0 auto; height: auto; }
.illu-sm { max-width: 320px; }

/* ---------- page hero (inner pages) ---------- */

.page-hero .panel { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 40px; align-items: center; }
.page-hero h1 { margin: 16px 0 16px; max-width: 14em; font-size: clamp(2rem, 4.2vw, 3rem); }

/* ---------- feature tiles ---------- */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.tile {
  display: block;
  text-decoration: none;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  background: var(--card);
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.tile:hover { border-color: var(--brand); box-shadow: var(--shadow-soft); transform: translateY(-2px); }
.tile .pict { width: 44px; height: 44px; margin-bottom: 16px; }
.tile h3 { margin-bottom: 8px; }
.tile p { color: var(--ink-2); font-size: 0.95rem; }
.tile .go {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-strong);
}

/* ---------- pillars (3 short statements) ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.pillar { background: var(--card); padding: 24px 28px; }
.pillar .k {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  display: block;
  margin-bottom: 12px;
}
.pillar p { font-size: 0.95rem; color: var(--ink-2); }
.pillar strong { display: block; font-weight: 600; color: var(--ink); margin-bottom: 4px; }

/* ---------- registry rows (Company) ---------- */

.registry {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
}
.registry .row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  font-size: 0.98rem;
}
.registry .row:first-child { border-top: none; }
.registry .key {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 4px;
}
.registry .val { color: var(--ink); }
.registry .val .sub { display: block; color: var(--muted); font-size: 0.86rem; margin-top: 4px; }

.footnote { margin-top: 16px; font-size: 0.86rem; color: var(--muted); max-width: 46em; }

/* ---------- function grid (Company roles) ---------- */

.func-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.func {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}
.func .pict { width: 40px; height: 40px; margin-bottom: 16px; }
.func h3 { font-size: 1.05rem; margin-bottom: 8px; }
.func p { font-size: 0.92rem; color: var(--ink-2); }

/* ---------- product cards ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.product {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  display: flex;
  flex-direction: column;
}
.product .art {
  background: var(--brand-tint);
  border-bottom: 1.5px solid var(--line);
  padding: 28px 24px;
  display: flex;
  justify-content: center;
}
.product .art svg { width: 100%; max-width: 220px; height: auto; }
.product .body { padding: 24px 24px 28px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product h3 { font-size: 1.2rem; }
.product p { font-size: 0.94rem; color: var(--ink-2); }
.product .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

/* ---------- grade A definition list ---------- */

.def-list { list-style: none; max-width: 780px; }
.def-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 16px;
}
.def-list li:first-child { border-top: 1.5px solid var(--line-strong); }
.def-list .tick { color: var(--brand); font-family: var(--font-mono); font-size: 0.88rem; padding-top: 4px; }
.def-list strong { display: block; margin-bottom: 4px; font-weight: 600; }
.def-list p { color: var(--ink-2); font-size: 0.94rem; }

/* ---------- operations flow ---------- */

.flow-track { margin: 8px 0 36px; }
.flow-track svg { width: 100%; height: auto; }

.flow-steps {
  counter-reset: step;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.flow-steps li {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  position: relative;
}
.flow-steps li::before {
  counter-increment: step;
  content: "0" counter(step);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--brand);
  display: block;
  margin-bottom: 12px;
}
.flow-steps h3 { font-size: 1rem; margin-bottom: 8px; }
.flow-steps p { font-size: 0.88rem; color: var(--ink-2); }

.partner-note {
  margin-top: 28px;
  border: 1.5px solid var(--brand-soft);
  background: var(--brand-tint);
  border-radius: 14px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 16px;
  align-items: start;
  font-size: 0.96rem;
  color: var(--ink-2);
}
.partner-note .pict { width: 34px; height: 34px; }
.partner-note strong { color: var(--ink); }

/* ---------- quality checklist ---------- */

.check-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.check-card {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}
.check-card .pict { width: 40px; height: 40px; margin-bottom: 16px; }
.check-card h3 { font-size: 1.02rem; margin-bottom: 12px; }
.check-card ul { list-style: none; }
.check-card li {
  font-size: 0.9rem;
  color: var(--ink-2);
  padding: 8px 0;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
}
.check-card li::before {
  content: "—";
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ---------- CTA band ---------- */

.cta-band h2 { max-width: 18em; margin-bottom: 12px; }
.cta-band .lede { margin-bottom: 28px; }
.cta-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.cta-mail {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--on-black);
  text-decoration: none;
  border-bottom: 1.5px solid var(--line-on-black-strong);
  padding-bottom: 4px;
}
.cta-mail:hover { border-color: var(--on-black); }

/* ---------- prose ---------- */

.prose { max-width: 46em; }
.prose p { margin-bottom: 16px; color: var(--ink-2); }
.prose strong { color: var(--ink); }

/* ---------- footer ---------- */

.site-footer {
  background: var(--black);
  color: var(--muted-on-black);
  padding: 56px 0 36px;
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 3fr);
  gap: 48px;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--line-on-black-faint);
}
.site-footer .brand { color: var(--on-black); margin-bottom: 16px; }
.site-footer p { max-width: 30em; }
.site-footer h3 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: var(--on-black);
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--muted-on-black); text-decoration: none; }
.site-footer a:hover { color: var(--on-black); }
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  font-size: 0.82rem;
}
.footer-legal--solo { border: none; padding-top: 0; }

/* ---------- 404 ---------- */

.error-page { min-height: 55vh; display: flex; align-items: center; }
.error-code { font-family: var(--font-mono); color: var(--brand); margin-bottom: 16px; }
.error-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- utilities ---------- */

.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.error-lede { margin: 16px 0 0; }

/* ---------- illustration animation (house patterns) ---------- */

.float-a, .float-b, .float-c, .float-d {
  transform-box: fill-box;
  transform-origin: center;
}
.float-a { animation: drift 7s ease-in-out infinite; }
.float-b { animation: drift 9s ease-in-out infinite 1.2s; }
.float-c { animation: drift 8s ease-in-out infinite 2.4s; }
.float-d { animation: drift 10s ease-in-out infinite 0.6s; }

@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25%      { transform: translate(0, -6px) rotate(-0.8deg); }
  60%      { transform: translate(0, 3px) rotate(0.6deg); }
}

.twinkle-a, .twinkle-b {
  transform-box: fill-box;
  transform-origin: center;
}
.twinkle-a { animation: twinkle 3.2s ease-in-out infinite; }
.twinkle-b { animation: twinkle 4.1s ease-in-out infinite 1.4s; }

@keyframes twinkle {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(0.55); opacity: 0.45; }
}

.flow-dash { animation: dashflow 1.6s linear infinite; }

@keyframes dashflow {
  to { stroke-dashoffset: -14; }
}

.breathe {
  transform-box: fill-box;
  transform-origin: center;
  animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .float-a, .float-b, .float-c, .float-d,
  .twinkle-a, .twinkle-b, .flow-dash, .breathe { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .page-hero .panel { grid-template-columns: 1fr; }
  .page-hero .illu-wrap { display: none; }
  .tile-grid { grid-template-columns: 1fr 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .func-grid, .product-grid, .check-cards { grid-template-columns: 1fr 1fr; }
  .flow-steps { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .registry .row { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 720px) {
  .section { padding: 24px 0; }
  .panel { border-radius: 16px; }
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px 24px;
    gap: 4px;
    box-shadow: var(--shadow-soft);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 8px; font-size: 1.05rem; }
  .nav-cta { margin: 8px 0 0; text-align: center; }
  .tile-grid, .func-grid, .product-grid, .check-cards, .flow-steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .dots { display: none; }
}
