/* Портфоліо Дмитра Виперайла. Один файл стилів на обидві мови.
   Форми: кнопки - pill, картки й зображення - 12px. Один акцент на всю сторінку. */

@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/onest-cyrillic-ext.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/onest-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/onest-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/onest-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #fafaf9;
  --surface: #f1f1ef;
  --line: #e2e2df;
  --text: #1c1c1b;
  --muted: #5c5c59;
  --accent: #1d7a52;
  --accent-ink: #ffffff;
  --accent-soft: #e6f2ec;
  --grid: #e6e6e3;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413;
    --surface: #1c1c1a;
    --line: #2c2c2a;
    --text: #ededeb;
    --muted: #a6a6a2;
    --accent: #3aa774;
    --accent-ink: #0d1a13;
    --accent-soft: #19281f;
    --grid: #2a2a28;
  }
}
:root[data-theme="dark"] {
  --bg: #141413; --surface: #1c1c1a; --line: #2c2c2a; --text: #ededeb; --muted: #a6a6a2;
  --accent: #3aa774; --accent-ink: #0d1a13; --accent-soft: #19281f; --grid: #2a2a28;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px; line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

/* Навігація */
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.nav .name { font-weight: 600; text-decoration: none; }
.nav .right { display: flex; align-items: center; gap: 16px; }
.nav .lang { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav .lang:hover { color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  padding: 11px 22px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 16px;
  text-decoration: none; border: 1px solid transparent;
  transition: transform .2s cubic-bezier(.16,1,.3,1), background-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--surface); }
.nav .btn { padding: 8px 16px; font-size: 15px; }
@media (max-width: 520px) { .nav .btn { display: none; } }

/* Перший екран */
.hero { display: grid; gap: 40px; padding: 40px 0 56px; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.15fr 1fr; padding: 56px 0 72px; } }
.hero h1 { font-size: clamp(32px, 4.2vw, 48px); line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 20px; font-weight: 700; }
.hero p { font-size: 19px; color: var(--muted); margin: 0 0 28px; max-width: 38ch; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.shot { border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--surface); }
.shot img { width: 100%; height: auto; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; }

/* Цифри */
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 24px; padding: 36px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .metrics { grid-template-columns: repeat(4, 1fr); } }
.metric .num { font-size: clamp(30px, 4vw, 42px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric .lbl { color: var(--muted); font-size: 15px; margin-top: 6px; max-width: 22ch; }
.source { font-size: 13px; color: var(--muted); margin: 14px 0 0; }

section { padding: 72px 0 0; }
h2 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 16px; }
h3 { font-size: 19px; margin: 0 0 8px; line-height: 1.3; }
.lead { color: var(--muted); max-width: 62ch; margin: 0 0 32px; }
.live-link { color: var(--accent); font-weight: 600; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Графік */
.chart { position: relative; margin: 0 0 8px; }
.chart h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.chart .sub { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 12px; font-family: inherit; }
.chart .bar { fill: var(--accent); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:focus { outline: none; }
.chart g.col:hover .bar, .chart g.col:focus-within .bar { filter: brightness(1.12); }
.chart .val { fill: var(--text); font-size: 13px; font-weight: 600; font-family: inherit; }
/* SVG масштабується вниз, тож на телефоні підписи в одиницях viewBox треба збільшити */
@media (max-width: 600px) {
  .chart .axis { font-size: 19px; }
  .chart .val { font-size: 21px; }
}
.tip {
  position: absolute; pointer-events: none; background: var(--text); color: var(--bg);
  font-size: 13px; line-height: 1.4; padding: 8px 10px; border-radius: 8px; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .12s;
}
.tip.on { opacity: 1; }
details.table { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
details.table summary { cursor: pointer; }
details.table table { border-collapse: collapse; margin-top: 10px; font-variant-numeric: tabular-nums; }
details.table th, details.table td { text-align: left; padding: 4px 18px 4px 0; }

/* Кейс: що зроблено + висновок */
.case-grid { display: grid; gap: 40px; margin-top: 44px; }
@media (min-width: 900px) { .case-grid { grid-template-columns: 1.6fr 1fr; gap: 56px; } }
.did { display: grid; gap: 28px; }
.did ul { margin: 0; padding-left: 18px; color: var(--muted); }
.did li { margin: 4px 0; }
.insight { background: var(--accent-soft); border-radius: var(--radius); padding: 28px; align-self: start; }
.insight p { margin: 0 0 12px; }
.insight p:last-child { margin: 0; }

/* Як працюю */
.statement p { font-size: clamp(20px, 2.4vw, 26px); line-height: 1.45; letter-spacing: -0.01em; max-width: 40ch; margin: 0 0 20px; }
.statement p.small { font-size: 17px; color: var(--muted); max-width: 62ch; letter-spacing: 0; }

/* Автоматизації: бенто */
.bento { display: grid; gap: 16px; }
@media (min-width: 768px) { .bento { grid-template-columns: 1.2fr 1fr; grid-template-rows: auto auto auto; } }
.tile { border-radius: var(--radius); padding: 26px; background: var(--surface); }
.tile p { margin: 0; color: var(--muted); font-size: 16px; }
.tile .stack { margin-top: 12px; font-size: 14px; color: var(--muted); }
.tile.big { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
@media (min-width: 768px) { .tile.big { grid-row: span 3; } }
.tile.big img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.tile.big .body { padding: 26px; }
.tile.accent { background: var(--accent-soft); }
.tile.outline { background: transparent; border: 1px solid var(--line); }

/* GMod */
.split { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1.15fr 1fr; gap: 56px; } }
.split ul { color: var(--muted); padding-left: 18px; margin: 0; }

/* Формат роботи */
.facts { display: grid; gap: 32px; }
@media (min-width: 768px) { .facts { grid-template-columns: 1fr 1fr; gap: 56px; } }
.facts dl { margin: 0; display: grid; gap: 14px; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.pills li { border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; font-size: 14px; }

/* Контакти */
.contact { margin: 88px 0 0; padding: 56px 0 64px; border-top: 1px solid var(--line); }
.contact p { color: var(--muted); margin: 0 0 24px; max-width: 52ch; }
.contact .row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.contact .mail { font-weight: 600; text-underline-offset: 3px; }
