/* vadimdagman.com: one stylesheet, no third-party assets. */

:root {
  color-scheme: dark;

  --accent: #3f6fff;
  --accent-strong: #5a84ff;
  --accent-soft: rgba(90, 132, 255, 0.14);
  --link: #8faaff;
  --link-hover: #b7c8ff;
  --text: #e9ecf2;
  --muted: #a3acbd;
  --surface: #1b2029;
  --border: #313848;
  --dot: #5a6378;
  --card: #232937;
  --card-hover: #283041;
  --bg: #161a22;
  --header-bg: rgba(22, 26, 34, 0.84);
  --error: #ff8a80;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 12px 32px -12px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 1px 0 rgba(255, 255, 255, 0.07) inset, 0 20px 44px -14px rgba(0, 0, 0, 0.8), 0 4px 10px rgba(0, 0, 0, 0.4);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --step-4: clamp(2rem, 1.35rem + 3vw, 3.5rem);

  --gutter: clamp(16px, 4vw, 32px);
  --radius: 8px;
  --header-h: 64px;
  --max: 1120px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ul, ol { margin: 0; }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--link-hover); }

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

section[id] { scroll-margin-top: calc(var(--header-h) + 8px); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 0.5rem 0.875rem;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 8px; color: #fff; }

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(56px, 8vw, 104px); }
.section--surface { background: var(--surface); }

.section__title {
  font-size: var(--step-3);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: clamp(24px, 4vw, 40px);
}

.eyebrow {
  color: var(--link);
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: 0.04em;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375em;
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

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

.btn--small {
  min-height: 36px;
  padding: 0.4375rem 0.875rem;
  font-size: var(--step--1);
}

/* ---------- Tags ---------- */

.tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--link);
  font-size: 0.8125rem;
  font-weight: 550;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* ---------- Top bar ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1rem;
  min-height: var(--header-h);
}

.brand,
.site-header__actions { min-height: var(--header-h); }

.brand {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
  color: var(--text);
  font-weight: 750;
  font-size: var(--step-1);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-nav ul {
  display: flex;
  list-style: none;
  padding: 0;
}

.site-nav a {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { color: var(--text); }

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.menu-toggle__bars,
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  margin-inline: auto;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-toggle__bars { position: relative; }
.menu-toggle__bars::before,
.menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle__bars::before { top: -6px; }
.menu-toggle__bars::after { top: 6px; }

.menu-toggle[aria-expanded="true"] .menu-toggle__bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Phones: name, menu button and Book a call on one row.
   Without JS the nav stays visible as a second row. With JS (html.js, added
   by site.js) it collapses until the menu button adds .is-open to #site-nav. */
@media (max-width: 759.98px) {
  .site-nav {
    order: 3;
    flex-basis: 100%;
  }
  .site-nav ul {
    flex-wrap: wrap;
    column-gap: 1.25rem;
    padding-bottom: 0.75rem;
  }
  .site-nav a { padding-block: 0.25rem; }

  .js .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .js .site-nav:not(.is-open) { display: none; }
  .js .site-nav ul {
    flex-direction: column;
    padding-block: 0.25rem 0.75rem;
  }
  .js .site-nav a {
    padding-block: 0.625rem;
    font-size: var(--step-0);
    color: var(--text);
  }
  .js .site-nav li + li { border-top: 1px solid var(--border); }
}

@media (max-width: 359.98px) {
  .brand { font-size: var(--step-0); }
  .site-header__inner { column-gap: 0.5rem; }
  .btn--small { padding-inline: 0.625rem; }
}

@media (min-width: 760px) {
  .site-nav ul { gap: 1.75rem; }
  .site-nav { margin-right: 0.75rem; }
}

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

.hero { padding-top: clamp(48px, 9vw, 112px); }

.hero h1 {
  max-width: 21ch;
  margin-top: 0.875rem;
  font-size: var(--step-4);
  font-weight: 780;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

/* On wider screens the headline is set as exactly three lines. */
@media (min-width: 900px) {
  .hero h1 { max-width: none; font-size: clamp(2.5rem, 1rem + 2.9vw, 3.25rem); }
  .hero h1 .h1-line { display: block; white-space: nowrap; }
}

.hero__lede {
  max-width: 40rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.55;
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

@media (max-width: 479.98px) {
  .hero__actions .btn--primary { flex-basis: 100%; }
  .hero__actions .btn--ghost { flex: 1 1 0; }
}

/* ---------- Clients row ---------- */

.clients {
  margin-top: clamp(48px, 7vw, 88px);
  background: var(--surface);
}

.clients__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem clamp(1.5rem, 4vw, 3rem);
  padding-block: 1.5rem;
}

.clients__label {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.clients__list {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem clamp(1.25rem, 4vw, 3rem);
  list-style: none;
  padding: 0;
}

.clients__list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.clients__list img {
  display: block;
  max-width: 100%;
  height: auto;
}

@media (max-width: 759.98px) {
  .clients__list { justify-content: flex-start; flex-basis: 100%; }
}

/* ---------- Facts strip ---------- */

.facts {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0.25rem;
  padding: 1.25rem 0 0;
  list-style: none;
  color: var(--muted);
  font-size: var(--step--1);
}

.facts li {
  display: inline-flex;
  align-items: center;
}

.facts .app-icon { margin-right: 0.4rem; }

.facts li:not(:last-child)::after {
  content: "·";
  content: "·" / "";
  margin-inline: 0.625rem;
  color: var(--dot);
}

/* Technology line: every tag used on the cards, quieter than the facts. */
.stack {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0.2rem;
  max-width: 62rem;
  padding: 0.625rem 0 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.8125rem;
  opacity: 0.85;
}

.stack li:not(:last-child)::after {
  content: "·";
  content: "·" / "";
  margin-inline: 0.5rem;
  color: var(--dot);
}

/* ---------- Featured work ---------- */

.projects {
  display: grid;
  gap: 1rem;
}

.project {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.project:hover {
  transform: translateY(-2px);
  background: var(--card-hover);
  box-shadow: var(--shadow-card-hover);
}

@media (prefers-reduced-motion: reduce) {
  .project { transition: none; }
  .project:hover { transform: none; }
}

.project__title {
  font-size: var(--step-2);
  font-weight: 720;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

/* App icon pinned to the card's top-right; title and meta stay clear of it. */
.project__icon {
  position: absolute;
  top: clamp(1.25rem, 3vw, 1.75rem);
  right: clamp(1.25rem, 3vw, 1.75rem);
  width: 48px;
  height: 48px;
}

/* macOS icons carry their own shape and padding, so no rounding. */
.project__icon--mac {
  width: 60px;
  height: 60px;
  margin: -6px;
  border-radius: 0;
}

.project__title,
.project__meta { padding-right: 60px; }

.project__meta {
  margin-top: -0.375rem;
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 550;
}

.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: auto;
  padding: 0.25rem 0 0;
  list-style: none;
}

.project__link {
  align-self: flex-start;
  font-size: var(--step--1);
  font-weight: 600;
}

.project__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

@media (min-width: 760px) {
  /* Fill column by column: client work on the left, own products on the right. */
  .projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, auto);
    grid-auto-flow: column;
    gap: 1.25rem;
  }
}

/* ---------- Other projects ---------- */

.minis {
  display: grid;
  gap: 1rem;
}

.mini {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.mini__title {
  font-size: var(--step-1);
  font-weight: 700;
  line-height: 1.25;
}

.mini__body {
  flex: 1;
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1.55;
}

@media (min-width: 640px) {
  .minis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
  .minis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
}

/* ---------- Services ---------- */

.services {
  display: grid;
  gap: 1rem;
}

.service {
  min-width: 0;
  padding: 1.25rem 1.375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.service h3 {
  font-size: var(--step-1);
  font-weight: 700;
  line-height: 1.3;
}

.service p {
  margin-top: 0.375rem;
  color: var(--muted);
}

@media (min-width: 640px) {
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .services { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.good-fit {
  max-width: 44rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}

.good-fit__title {
  font-size: var(--step-1);
  font-weight: 700;
}

.good-fit ul {
  margin-top: 0.5rem;
  padding-left: 1.25rem;
  color: var(--muted);
}
.good-fit li + li { margin-top: 0.25rem; }

/* ---------- About ---------- */

.about {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.portrait {
  width: min(240px, 60vw);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
  background: var(--surface);
}

.about__text { min-width: 0; max-width: 44rem; }

.bio p + p { margin-top: 1rem; }

.about__subtitle {
  margin-top: clamp(2rem, 4vw, 2.75rem);
  font-size: var(--step-1);
  font-weight: 700;
}

.timeline {
  margin-top: 0.75rem;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--border);
}

.timeline li {
  padding: 0 0 1rem 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
}
.timeline li:last-child { padding-bottom: 0; }

.timeline__head { color: var(--text); }
.timeline__head strong { font-weight: 650; }

.patents {
  margin-top: 1.75rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.patents summary {
  padding-block: 0.875rem;
  font-weight: 650;
  cursor: pointer;
}

.patents ul {
  padding: 0 0 1rem 1.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
}
.patents li + li { margin-top: 0.375rem; }

@media (min-width: 760px) {
  .about { grid-template-columns: 240px minmax(0, 1fr); }
  .portrait { width: 240px; margin-top: 0.5rem; }
}

/* ---------- Writing ---------- */

.articles {
  display: grid;
  gap: 0.75rem;
  max-width: 44rem;
  padding: 0;
  list-style: none;
}

.articles li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}

.articles a {
  font-size: var(--step-1);
  font-weight: 600;
}

.articles__source {
  color: var(--muted);
  font-size: var(--step--1);
}

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

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--step--1);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 2rem;
}

.site-footer__name { color: var(--text); font-weight: 600; }
.site-footer__copy { margin-left: 0.375rem; color: var(--muted); font-weight: 400; }

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding: 0;
  list-style: none;
}

.site-footer__links a { color: var(--muted); }
.site-footer__links a:hover { color: var(--text); }

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

.contact { display: grid; gap: clamp(28px, 5vw, 56px); }
@media (min-width: 860px) {
  .contact { grid-template-columns: 1fr 1.1fr; align-items: start; }
}
.contact__intro p { max-width: 36rem; margin-bottom: 1rem; }
.contact__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }

.contact-form { display: grid; gap: 1rem; min-width: 0; }
.field { display: grid; gap: 0.375rem; min-width: 0; }
.field label { font-size: var(--step--1); font-weight: 600; }
.field input,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.625rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.field textarea { resize: vertical; }
.field input:hover,
.field textarea:hover { border-color: var(--dot); }
.contact-form .btn { justify-self: start; }
.form-status { min-height: 1.5em; margin: 0; color: var(--muted); }
.form-status.is-error { color: var(--error); }
.form-status.is-ok { color: var(--text); font-weight: 600; }

/* Tezza's wordmark is black-on-transparent; flip it for the dark theme. */
.clients__list img[src$="logos/tezza.png"] { filter: invert(1); }

/* App icons get the iOS rounded-square shape. */
.app-icon { border-radius: 22%; }
