/* ============================================================
   Illia Khalipov — Quantitative Research & Financial Analytics
   White / ink / royal blue — institutional factsheet aesthetic
   ============================================================ */

:root {
  --bg: #FFFFFF;
  --bg-alt: #F5F6F8;          /* cool light grey, alternate sections */
  --text: #10141A;            /* ink */
  --muted: #5B6470;
  --line: #E2E5EA;            /* hairline */
  --line-ink: #10141A;        /* heavy editorial rules */
  --line-strong: #878E99;     /* form field borders */
  --accent: #1F3FD8;          /* royal blue */
  --accent-dark: #16309F;
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;
  --container: 1160px;
  --text-measure: 720px;
}

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

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  background: var(--text);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 0.7rem 1.2rem;
}

.skip-link:focus {
  top: 0.5rem;
  color: #FFFFFF;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

::selection { background: rgba(31, 63, 216, 0.15); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ------------------------------------------------------------
   Typography
   ------------------------------------------------------------ */

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.05;
}

h2 {
  font-size: clamp(2.125rem, 5vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.75rem;
}

/* section head: heavy editorial rule on top */
.section-head {
  border-top: 2px solid var(--line-ink);
  padding-top: 1.25rem;
  margin-bottom: 3.5rem;
}

.section-head h2 { max-width: 18ch; }

.section-lede {
  color: var(--muted);
  max-width: var(--text-measure);
  font-size: 1.0625rem;
  margin-top: 1rem;
}

/* ------------------------------------------------------------
   Navigation
   ------------------------------------------------------------ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease;
}

.nav.scrolled { border-bottom-color: var(--line); }

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 560px) {
  .brand-rest { display: none; }
}

/* --- KIR / IKR anagram mark ---------------------------------- */

.logo {
  display: inline-flex;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.5em 0.55em;
}

.logo-lg { font-size: 1.0625rem; }

.logo-l { display: inline-block; }

/* K and I trade places: KIR ⇄ IKR */
.logo-k { animation: swap-k 14s ease-in-out infinite; }
.logo-i { animation: swap-i 14s ease-in-out infinite; }

@keyframes swap-k {
  0%, 42%  { transform: none; }
  48%, 92% { transform: translateX(1ch); }
  98%, 100% { transform: none; }
}

@keyframes swap-i {
  0%, 42%  { transform: none; }
  48%, 92% { transform: translateX(-1ch); }
  98%, 100% { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-k, .logo-i { animation: none; }
}

html.static .logo-k,
html.static .logo-i { animation: none; }

.nav-links {
  display: flex;
  gap: 1.9rem;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s ease;
}

.nav-links a:hover { color: var(--text); }
.nav-links a.nav-contact { color: var(--accent); }
.nav-links a.nav-contact:hover { color: var(--accent-dark); }

/* hide section links on small screens, keep Contact */
@media (max-width: 767px) {
  .nav-links a:not(.nav-contact) { display: none; }
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7.5rem 0 0;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2.25rem;
}

.hero-headline {
  font-size: clamp(2.625rem, 7.4vw, 5.625rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  max-width: 17ch;
  margin-bottom: 2rem;
}

.hero-sub {
  color: var(--muted);
  font-size: 1.125rem;
  max-width: 56ch;
  margin-bottom: 2.75rem;
}

.hero-sub strong { color: var(--text); font-weight: 600; }

.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

/* stats strip — Two Sigma-style data row */
.hero-stats {
  margin-top: auto;
  padding-top: 4.5rem;
}

.hero-stats-row {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 2px solid var(--line-ink);
}

.stat {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.stat:last-child { border-bottom: none; }

.stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat-zero .stat-num { color: var(--accent); }
.stat-zero .stat-label { color: var(--text); }

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (min-width: 768px) {
  .hero-stats-row { grid-template-columns: repeat(4, 1fr); }
  .stat {
    flex-direction: column;
    gap: 0.5rem;
    border-bottom: none;
    border-right: 1px solid var(--line);
    padding: 1.75rem 1.5rem 2.25rem 0;
  }
  .stat + .stat { padding-left: 1.5rem; }
  .stat:last-child { border-right: none; }
  .stat-num { font-size: 2.625rem; }
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.95rem 1.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--accent-dark);
  color: #FFFFFF;
}

.btn-ghost {
  border-color: var(--text);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ------------------------------------------------------------
   Sections
   ------------------------------------------------------------ */

.section {
  padding: clamp(5rem, 10vw, 8rem) 0;
}

.section-alt { background: var(--bg-alt); }

/* ------------------------------------------------------------
   Philosophy — editorial ruled items, no boxes
   ------------------------------------------------------------ */

.principles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 2.5rem;
}

@media (min-width: 768px) {
  .principles { grid-template-columns: repeat(3, 1fr); }
}

.principle {
  border-top: 1px solid var(--line-ink);
  padding: 1.4rem 0 2.5rem;
}

/* two-column variant for the Why section */
@media (min-width: 768px) {
  .principles-2 { grid-template-columns: repeat(2, 1fr); }
}

.principles-2 .principle p { font-size: 1rem; max-width: 52ch; }

.principle-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.principle h3 { margin-bottom: 0.7rem; }

.principle p {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ------------------------------------------------------------
   Services — factsheet rate table
   ------------------------------------------------------------ */

.rate-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border: 1px solid var(--line);
}

.rate-table th {
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  color: #FFFFFF;
  background: var(--text);
  padding: 0.9rem 1.5rem;
}

.rate-table td {
  padding: 1.75rem 1.5rem;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.th-rate { width: 15%; }
.th-level { width: 20%; }

.level-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.level-name {
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  display: block;
  max-width: 12ch;
}

.td-includes ul { list-style: none; }

.td-includes li {
  position: relative;
  padding-left: 1.3rem;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.td-includes li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.td-note {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--muted);
  max-width: 44ch;
}

.rate {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.rate small {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.3rem;
  letter-spacing: 0.04em;
}

/* responsive collapse below 900px */
@media (max-width: 899px) {
  .rate-table thead {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .rate-table, .rate-table tbody, .rate-table tr, .rate-table td { display: block; }
  .rate-table { border: none; background: none; }
  .rate-table tr {
    background: var(--bg);
    border: 1px solid var(--line);
    margin-bottom: 1.25rem;
  }
  .rate-table td { border-top: none; padding: 1.25rem 1.25rem 0; }
  .rate-table td:last-child { padding-bottom: 1.5rem; }
  .td-rate::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.3rem;
  }
  .td-includes { padding-top: 0.4rem; }
  .rate { font-size: 1.375rem; }
}

.terms {
  margin-top: 2.5rem;
  max-width: var(--text-measure);
  font-size: 0.875rem;
  color: var(--muted);
}

/* ------------------------------------------------------------
   Expertise
   ------------------------------------------------------------ */

.scope {
  list-style: none;
  max-width: var(--text-measure);
  margin-bottom: 4rem;
}

.scope li {
  position: relative;
  padding: 1rem 0 1rem 1.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 0.9375rem;
}

.scope li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.stack {
  display: grid;
  gap: 2.25rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .stack { grid-template-columns: repeat(2, 1fr); }
}

.stack-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tags span {
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 0.35rem 0.75rem;
  white-space: nowrap;
}

.section-alt .tags span { background: var(--bg); }

.frameworks {
  max-width: var(--text-measure);
  color: var(--muted);
  margin-bottom: 3.5rem;
}

.outside-scope {
  max-width: var(--text-measure);
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
}

.outside-scope p:last-child {
  color: var(--muted);
  font-size: 0.875rem;
}

/* ------------------------------------------------------------
   Background
   ------------------------------------------------------------ */

.edu { max-width: 860px; }

.edu-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}

.edu-item:first-child { border-top: 1px solid var(--line-ink); }

@media (min-width: 768px) {
  .edu-item { grid-template-columns: 180px 1fr; gap: 2rem; }
}

.edu-years {
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 0.2rem;
}

.edu-item h3 { margin-bottom: 0.35rem; }

.edu-item p { color: var(--muted); font-size: 0.9375rem; }

/* ------------------------------------------------------------
   Contact
   ------------------------------------------------------------ */

/* process steps — how an engagement starts */
.process {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 2.5rem;
  margin-bottom: 4.5rem;
}

@media (min-width: 768px) {
  .process { grid-template-columns: repeat(4, 1fr); }
}

.step {
  border-top: 1px solid var(--line-ink);
  padding: 1.4rem 0 2rem;
}

.step-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.step h3 { margin-bottom: 0.6rem; }

.step p {
  color: var(--muted);
  font-size: 0.9rem;
}

.contact-grid {
  display: grid;
  gap: 3.5rem;
}

@media (min-width: 768px) {
  .contact-grid { grid-template-columns: 1fr 1fr; gap: 5rem; }
}

.contact-lede {
  color: var(--muted);
  font-size: 1.0625rem;
  margin-bottom: 2.5rem;
}

.contact-rows { display: grid; gap: 1.75rem; }

.contact-row { display: grid; gap: 0.35rem; }

.contact-row a {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  width: fit-content;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.contact-row a:hover {
  color: var(--accent);
}

.contact-static {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.field { margin-bottom: 1.4rem; }

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.field input,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  padding: 0.8rem 1rem;
  transition: border-color 0.25s ease;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.form-note {
  margin-top: 1rem;
  font-size: 0.78125rem;
  color: var(--muted);
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */

.footer {
  padding: 3.5rem 0 2.5rem;
  border-top: 2px solid var(--line-ink);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.footer-brand-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.disclaimer {
  max-width: var(--text-measure);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-row a { color: var(--muted); text-transform: none; }
.footer-row a:hover { color: var(--text); }

/* ------------------------------------------------------------
   Reveal on scroll
   ------------------------------------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* static mode (?static) — no motion, for screenshots and print */
html.static { scroll-behavior: auto; }
html.static .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

/* ------------------------------------------------------------
   Print
   ------------------------------------------------------------ */

@media print {
  .nav, .skip-link, .hero-cta, .contact-form { display: none; }

  .hero { min-height: 0; padding: 2rem 0 0; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .section { padding: 2.5rem 0; }

  .rate-table th { color: var(--text); background: none; border-bottom: 2px solid var(--line-ink); }
}

