/* leonidbelikov.com — design B "Dark technical" */

:root {
  --bg: #0b1120;
  --surface: #0f172a;
  --surface-2: #111a2e;
  --line: #1e293b;
  --line-strong: #334155;
  --text: #e2e8f0;
  --text-strong: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;

  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --container: 1120px;
  --pad-x: 32px;
  --section-y: 96px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

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

.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }
.small { font-size: 14px; }
.dim { color: var(--text-faint); }

.skip-link {
  position: absolute; left: 16px; top: -48px;
  padding: 8px 16px; border-radius: 6px;
  background: var(--accent); color: var(--bg); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 16px; }

.container { max-width: var(--container); margin: 0 auto; padding-inline: var(--pad-x); }

.grid-bg {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
  position: relative;
  isolation: isolate;
}

/* Grid spotlight: accent-colored copy of the grid, revealed around the cursor
   by a radial mask that fades from full accent at the cursor to transparent at --spot-r. */
.grid-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(96, 165, 250, 0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.4) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
  --spot-r: 180px;
  -webkit-mask-image: radial-gradient(circle var(--spot-r) at var(--mx, -999px) var(--my, -999px), #000 0%, rgba(0, 0, 0, 0.5) 40%, transparent 100%);
          mask-image: radial-gradient(circle var(--spot-r) at var(--mx, -999px) var(--my, -999px), #000 0%, rgba(0, 0, 0, 0.5) 40%, transparent 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.grid-bg.is-spot::before { opacity: 1; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.header {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  padding-block: 24px;
}
.logo { font-size: 16px; font-weight: 500; color: var(--text); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 24px; font-size: 15px; }
.nav a { color: var(--text-muted); text-decoration: none; }
.nav a:hover { color: var(--accent-hover); }

/* Hero */
.hero {
  display: flex; flex-wrap: wrap; align-items: center; gap: 64px;
  padding-block: 112px 128px;
}
.hero__text { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.eyebrow { font-size: 15px; }
h1 {
  font-size: clamp(40px, 7vw, 60px); line-height: 1.06; font-weight: 700;
  letter-spacing: -0.025em; color: var(--text-strong);
}
.lead { font-size: clamp(18px, 2.4vw, 22px); line-height: 1.55; color: var(--text-muted); max-width: 620px; }
.hero__photo { flex: 1 1 240px; display: flex; justify-content: center; }
.hero__photo img {
  width: 260px; height: 260px; border-radius: 16px; border: 1px solid var(--line-strong);
}
.hero__photo img { object-fit: cover; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 48px; padding: 0 24px; border-radius: 6px;
  font-size: 16px; font-weight: 600; text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn--primary { background: var(--accent); color: var(--bg); }
.btn--primary:hover { background: var(--accent-hover); color: var(--bg); }
.btn--ghost {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: rgba(11, 17, 32, 0.25);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-hover); }

/* Sections */
.section { border-top: 1px solid var(--line); }
.section .container { padding-block: var(--section-y); }
.section-title { font-size: 20px; font-weight: 500; }
.split { display: flex; flex-wrap: wrap; gap: 48px; }
.split .section-title { flex: 1 1 240px; }
.stack { display: flex; flex-direction: column; gap: 40px; }

.about-text { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; font-size: 19px; line-height: 1.7; color: var(--text-muted); }

h3 { font-size: 18px; font-weight: 600; color: var(--text-strong); }

.expertise {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.expertise li { padding: 28px; background: var(--surface); display: flex; flex-direction: column; gap: 12px; }
/* Explicit column counts instead of auto-fit, so the 3-column layout can stretch
   the last card (Stack) across the whole second row instead of leaving empty cells. */
@media (min-width: 560px)  { .expertise { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 800px)  { .expertise { grid-template-columns: repeat(3, minmax(0, 1fr)); }
                             .expertise li:last-child { grid-column: 1 / -1; } }
@media (min-width: 1040px) { .expertise { grid-template-columns: repeat(4, minmax(0, 1fr)); }
                             .expertise li:last-child { grid-column: auto; } }
.expertise p { font-size: 15px; line-height: 1.6; color: var(--text-dim); }
.expertise p.small { font-size: 14px; line-height: 1.7; }

.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 24px; }
.services li { padding: 32px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 12px; }
.services h3 { font-size: 20px; }
.services p { font-size: 16px; line-height: 1.6; color: var(--text-dim); }

.contact { gap: 24px; }
.section .contact { padding-block: 112px; }
.contact__title { font-size: clamp(30px, 5vw, 44px); font-weight: 700; letter-spacing: -0.02em; color: var(--text-strong); }

/* Footer */
.footer { border-top: 1px solid var(--line); }
.footer .container { padding-block: 28px; font-size: 13px; color: var(--text-dim); }

/* Narrow screens: photo moves above the text, centered and smaller */
@media (max-width: 900px) {
  .hero { gap: 56px; padding-top: 56px; }
  .hero__photo { order: -1; flex-basis: 100%; }
  .hero__photo img { width: 240px; height: 240px; border-radius: 16px; }
}

/* Phone */
@media (max-width: 640px) {
  :root { --pad-x: 20px; --section-y: 64px; }
  .hero { padding-block: 40px 72px; gap: 40px; }
  .hero__photo img { width: 140px; height: 140px; border-radius: 12px; }
  .section .contact { padding-block: 72px; }
  .btn--primary[href^="mailto"] { font-size: 15px; padding: 0 16px; }
}
