/* ╔══════════════════════════════════════════════════════════════╗
   ║  KRESAN — styles.css (v6)                                     ║
   ║  Brand: Paper #F7F6F2 · Ink #0E0E0C · Electric Blue #3B82F6  ║
   ╚══════════════════════════════════════════════════════════════╝ */

:root {
  --paper: #F7F6F2;
  --ink: #0E0E0C;
  --blue: #3B82F6;
  --blue-hover: #2563EB;
  --blue-subtle: #DBEAFE;
  --gray-50: #F1F0EC;
  --gray-100: #EBEAE5;
  --gray-200: #D6D4CC;
  --gray-300: #B8B6AE;
  --gray-500: #6E6C66;
  --gray-700: #383631;
  --line: rgba(14, 14, 12, 0.08);
  --muted: rgba(14, 14, 12, 0.58);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'tnum' 1, 'kern' 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body[data-lang="ua"] .lang-en { display: none; }
body[data-lang="en"] .lang-ua { display: none; }

main { flex: 1 0 auto; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* Global SVG защита — никогда не растягивается */
svg { max-width: 100%; height: auto; flex-shrink: 0; }

/* ─── SPLASH ───────────────────────────────── */
.splash {
  position: fixed; inset: 0;
  background: var(--paper);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  opacity: 1;
  transition: opacity 520ms cubic-bezier(0.4, 0, 0.2, 1);
}
.splash.is-dismissing { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; padding: 32px; }
.splash-logo {
  font-size: clamp(56px, 10vw, 108px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--blue);
  margin-bottom: clamp(16px, 2.2vw, 24px);
  animation: splash-focus 1100ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.splash-slogan {
  font-size: clamp(14px, 1.4vw, 17px);
  color: var(--muted);
  letter-spacing: -0.005em;
  font-weight: 400;
  opacity: 0;
  animation: splash-fade-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) 800ms forwards;
}
@keyframes splash-focus {
  0%   { opacity: 0; filter: blur(22px); transform: scale(1.04); }
  60%  { opacity: 1; filter: blur(2px); }
  100% { opacity: 1; filter: blur(0); transform: scale(1); }
}
@keyframes splash-fade-in { to { opacity: 1; } }
body.has-splash { overflow: hidden; }

/* ─── NAV ─────────────────────────────────── */
nav.site-nav {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(247, 246, 242, 0.9);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  z-index: 50;
}
.nav-inner {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1120px; margin: 0 auto; padding: 0 32px;
}
.logo {
  font-weight: 500; font-size: 17px;
  letter-spacing: -0.02em; color: var(--blue);
  text-decoration: none;
}
.nav-right { display: flex; align-items: center; gap: 26px; font-size: 13px; }
.nav-link {
  color: var(--muted); text-decoration: none;
  transition: color 150ms ease;
  letter-spacing: -0.005em;
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-active { color: var(--ink); }

.lang-toggle { display: flex; gap: 2px; align-items: center; }
.lang-btn {
  background: none; border: none; font: inherit; cursor: pointer;
  color: var(--muted);
  padding: 4px 6px;
  transition: color 150ms ease;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px; font-weight: 500;
}
.lang-btn.active { color: var(--ink); }
.lang-btn:hover:not(.active) { color: var(--ink); }
.lang-sep { color: var(--line); font-size: 11px; }

/* ─── HERO ────────────────────────────────── */
.hero {
  padding: clamp(64px, 9vw, 104px) 0 clamp(56px, 8vw, 88px);
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-size: clamp(34px, 5.2vw, 56px);
  font-weight: 500;
  letter-spacing: -0.036em;
  line-height: 1;
  max-width: 18ch;
  margin-bottom: 28px;
}
.hero .sub {
  font-size: clamp(15px, 1.4vw, 17px);
  color: var(--muted);
  max-width: 56ch;
  line-height: 1.55;
  font-weight: 400;
}

/* Page-hero */
.page-hero {
  padding: clamp(48px, 7vw, 80px) 0 clamp(36px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
}
.page-hero .eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 16px;
  font-weight: 500;
}
.page-hero .eyebrow .dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--blue);
  margin-right: 10px; vertical-align: 1px;
}
.page-hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.08;
  max-width: 20ch;
  margin-bottom: 22px;
}
.page-hero .sub {
  font-size: clamp(14px, 1.4vw, 17px);
  color: var(--muted);
  max-width: 56ch;
  line-height: 1.55;
}

/* ─── SECTIONS ────────────────────────────── */
section {
  padding: clamp(56px, 7vw, 80px) 0;
  border-bottom: 1px solid var(--line);
}
.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 500;
}
.section-label .dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--blue);
  margin-right: 10px; vertical-align: 1px;
}
.section-heading {
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.12;
  max-width: 22ch;
  margin-bottom: 22px;
}
.section-lead {
  font-size: clamp(14px, 1.4vw, 17px);
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.55;
  margin-bottom: 48px;
}

/* ─── ABOUT PROSE ─────────────────────────── */
.about-prose {
  max-width: 62ch;
  font-size: clamp(14px, 1.3vw, 16px);
  line-height: 1.65;
  color: var(--ink);
}
.about-prose p + p { margin-top: 18px; }
.about-prose .muted { color: var(--muted); }

/* ─── SERVICES ────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px 56px;
  max-width: 1000px;
}
.service { border-top: 1px solid var(--ink); padding-top: 18px; }
.service .num {
  font-size: 11px; font-feature-settings: 'tnum' 1;
  color: var(--muted); letter-spacing: 0.04em;
  margin-bottom: 10px; display: block;
}
.service h3 {
  font-size: 17px; font-weight: 500;
  letter-spacing: -0.015em; line-height: 1.3;
  margin-bottom: 8px;
}
.service p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.services-footer {
  margin-top: 56px; padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
  max-width: 760px;
}
.services-footer strong { color: var(--ink); font-weight: 500; }
.services-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.services-footer a:hover { color: var(--blue); }

/* ─── PRODUCT / WORK CARDS ────────────────── */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}
.work-card {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 14px;
  padding: 28px 26px 26px;
  display: flex; flex-direction: column;
  transition: border-color 200ms ease;
}
.work-card:hover { border-color: rgba(14, 14, 12, 0.18); }

.work-logo {
  font-size: 42px; font-weight: 500;
  letter-spacing: -0.04em; line-height: 1;
  color: var(--ink);
  margin-bottom: 14px;
  font-feature-settings: 'tnum' 1, 'kern' 1;
}

/* Product icon: filled blue square (app-icon style) */
.work-icon {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  max-width: 56px;
  max-height: 56px;
  border-radius: 12px;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  flex-shrink: 0;
}
.work-icon svg {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  display: block;
  color: #ffffff;
  flex-shrink: 0;
}

.work-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 500;
}
.work-tag::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%; background: var(--gray-300);
  flex-shrink: 0;
}
.work-card.is-product .work-tag::before { background: var(--blue); }

.work-tagline {
  font-size: 15px; color: var(--ink);
  font-weight: 500; letter-spacing: -0.01em;
  line-height: 1.4;
  margin-bottom: 14px;
}
.work-body {
  font-size: 13.5px; color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
}
.work-meta {
  display: flex; flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted);
  font-feature-settings: 'tnum' 1;
}
.work-meta span { position: relative; padding: 0 12px; }
.work-meta span:first-child { padding-left: 0; }
.work-meta span:not(:last-child)::after {
  content: "·"; position: absolute;
  right: -3px; color: var(--gray-200);
}

/* ─── DEMO REQUEST: collapsible CTA + messenger row ──────── */
.demo-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.demo-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--blue);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 150ms ease;
}
.demo-btn:hover { color: var(--blue-hover); }
.demo-chevron {
  font-size: 10px;
  transition: transform 250ms ease;
  display: inline-block;
  line-height: 1;
}
.demo-btn[aria-expanded="true"] .demo-chevron {
  transform: rotate(180deg);
}
.demo-options {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.demo-options[hidden] { display: none; }

.demo-link {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  opacity: 0.7;
  text-decoration: none;
  transition: opacity 150ms ease, border-color 150ms ease, color 150ms ease;
  flex-shrink: 0;
  flex-grow: 0;
}
.demo-link:hover {
  opacity: 1;
  border-color: rgba(14, 14, 12, 0.2);
  color: var(--blue);
}
.demo-link svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  display: block;
  flex-shrink: 0;
}

/* ─── PRINCIPLES ──────────────────────────── */
.principles-list { display: grid; gap: 0; max-width: 920px; }
.principle {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.principle:last-child { border-bottom: 1px solid var(--line); }
.principle .num {
  font-size: 12px; font-feature-settings: 'tnum' 1;
  color: var(--blue); font-weight: 500;
  letter-spacing: 0.04em;
}
.principle p {
  font-size: clamp(16px, 1.6vw, 19px);
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.3;
}

/* ─── CONTACT ─────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  max-width: 880px;
  margin-bottom: 48px;
}
.contact-item .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.contact-item a,
.contact-item .value {
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-bottom: 1px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
  display: inline-block;
  padding-bottom: 2px;
}
.contact-item a:hover {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* Messenger channels block on contact page */
.contact-channels {
  padding-top: 40px;
  border-top: 1px solid var(--line);
  max-width: 880px;
}
.contact-channels-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 18px;
  font-weight: 500;
}
.contact-channels-row {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px;
}
.contact-channel {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: border-color 150ms ease, color 150ms ease;
}
.contact-channel:hover {
  border-color: rgba(14, 14, 12, 0.2);
  color: var(--blue);
}
.contact-channel svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  display: block;
  flex-shrink: 0;
}

/* ─── NEXT-PAGE NAVIGATION ────────────────── */
.page-next {
  padding: clamp(36px, 5vw, 56px) 0;
  border-bottom: 1px solid var(--line);
}
.page-next-link {
  display: inline-flex; flex-direction: column; gap: 6px;
  text-decoration: none;
  color: var(--ink);
  transition: color 150ms ease;
  padding: 4px 0;
}
.page-next-link:hover { color: var(--blue); }
.page-next-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 500;
}
.page-next-title {
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
}
.page-next-title .arrow { transition: transform 200ms ease; display: inline-block; }
.page-next-link:hover .arrow { transform: translateX(6px); }

/* ─── FOOTER ──────────────────────────────── */
footer.site-footer {
  padding: 28px 0 40px;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.footer-meta { font-feature-settings: 'tnum' 1; }

/* ─── REVEAL ──────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: reveal 700ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.reveal-1 { animation-delay: 80ms; }
.reveal-2 { animation-delay: 220ms; }
@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ──────────────────────────── */
@media (max-width: 720px) {
  .container, .nav-inner { padding-left: 20px; padding-right: 20px; }
  .nav-right { gap: 14px; }
  .nav-link.hide-mobile { display: none; }
  .work-card { padding: 22px; }
  .work-logo { font-size: 34px; }
  .work-icon { width: 48px; height: 48px; min-width: 48px; min-height: 48px; max-width: 48px; max-height: 48px; border-radius: 10px; margin-bottom: 18px; }
  .work-icon svg { width: 28px !important; height: 28px !important; min-width: 28px; min-height: 28px; max-width: 28px; max-height: 28px; }
  .principle { grid-template-columns: 36px 1fr; gap: 12px; padding: 16px 0; }
  .services-grid { gap: 32px; }
  .services-footer { margin-top: 40px; }
  .work-grid { gap: 12px; }
  .contact-channels-row { gap: 8px; }
  .contact-channel { padding: 8px 14px 8px 10px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .splash-logo, .splash-slogan { animation: none; opacity: 1; filter: none; transform: none; }
  html { scroll-behavior: auto; }
  .page-next-title .arrow, .demo-chevron { transition: none; }
}
