/* ==========================================================================
   Resume website – Oleksandr Diachenko
   Structure: 1 tokens · 2 base · 3 header · 4 hero · 5 sections · 6 cards
              7 contact · 8 footer · 9 motion · 10 responsive
   ========================================================================== */

/* ---------- Fonts (self-hosted, no external requests) ---------- */
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- 1. Design tokens ---------- */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece5;
  --text: #161a20;
  --muted: #565d68;
  --line: #dcd8cf;
  --accent: #1d4a5c;
  --accent-ink: #ffffff;
  --accent-soft: #e2edf0;
  --shadow: 0 1px 2px rgb(22 26 32 / 0.05), 0 8px 24px rgb(22 26 32 / 0.06);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;

  --radius: 18px;
  --wrap: 1120px;
  --gutter: clamp(16px, 5vw, 40px);
  --header-h: 68px;
}
:root[data-theme="dark"] {
  --bg: #0e1217;
  --surface: #151b22;
  --surface-2: #1a222b;
  --text: #eceef1;
  --muted: #9aa5b1;
  --line: #27323d;
  --accent: #7cc0d1;
  --accent-ink: #0b1318;
  --accent-soft: #16303a;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
}

/* ---------- 2. Base ---------- */
*, *::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-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.nobr { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

.i {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- 3. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.bar { height: var(--header-h); display: flex; align-items: center; gap: 16px; }
.site-header .wrap { max-width: 1280px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; flex: none; }
.mono {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-head); font-weight: 600; font-size: 1rem; letter-spacing: 0.02em;
}
.nav { margin-left: auto; }
.nav ul { display: flex; gap: 4px; }
.nav a {
  display: block; padding: 8px 12px; border-radius: 999px; text-decoration: none; white-space: nowrap;
  font-size: 0.9rem; font-weight: 500; color: var(--muted);
  transition: color 0.2s, background-color 0.2s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.tools { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.lang {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface);
}
.lang .sep { display: none; }
.lang button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em;
  min-width: 40px; min-height: 34px; padding: 0 10px; border-radius: 999px;
  transition: background-color 0.2s, color 0.2s;
}
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.lang button:not([aria-pressed="true"]):hover { color: var(--text); }
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.icon-btn:hover { background: var(--surface-2); }
/* theme icon: show the one that switches *to* the other theme */
#themeBtn .i-sun { display: none; }
:root[data-theme="dark"] #themeBtn .i-moon { display: none; }
:root[data-theme="dark"] #themeBtn .i-sun { display: block; }
.menu-btn { display: none; }
.menu-btn .i-close { display: none; }
.menu-btn[aria-expanded="true"] .i-menu { display: none; }
.menu-btn[aria-expanded="true"] .i-close { display: block; }

/* ---------- 4. Hero ---------- */
.hero { padding-block: clamp(48px, 9vw, 120px) clamp(40px, 7vw, 90px); }
.hero-grid { display: grid; gap: clamp(32px, 5vw, 64px); grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr); align-items: center; }
.eyebrow {
  display: inline-block; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 20px;
}
h1 {
  font-family: var(--font-head); font-weight: 500; letter-spacing: -0.025em;
  font-size: clamp(2.7rem, 8.5vw, 5.6rem); line-height: 1.02; text-wrap: balance;
}
.lead { margin-top: 26px; max-width: 38em; font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted); line-height: 1.6; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-size: 0.97rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 0.2s, background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.ghost { border-color: var(--line); background: transparent; color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 0.88rem; border-color: var(--line); background: var(--surface); color: var(--text); }
.btn.small:hover { background: var(--surface-2); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.facts { padding: clamp(22px, 3vw, 32px); }
.facts-title { font-family: var(--font-head); font-weight: 500; font-size: 1.25rem; margin-bottom: 14px; }
.facts dl > div { padding-block: 14px; border-top: 1px solid var(--line); }
.facts dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin-top: 2px; font-weight: 500; line-height: 1.45; }

/* ---------- 5. Sections ---------- */
.section { padding-block: clamp(48px, 8vw, 104px); scroll-margin-top: var(--header-h); }
.section:nth-of-type(even) { background: color-mix(in srgb, var(--surface-2) 45%, var(--bg)); }
.sec-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: clamp(28px, 5vw, 52px); }
.sec-head .num { font-family: var(--font-head); font-size: 1rem; font-weight: 500; color: var(--accent); letter-spacing: 0.05em; }
.sec-head h2 { font-family: var(--font-head); font-weight: 500; letter-spacing: -0.02em; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; }
.about { max-width: 46rem; display: grid; gap: 1.2em; font-size: clamp(1.05rem, 2vw, 1.2rem); }
.about p:first-child { color: var(--text); }
.about p:not(:first-child) { color: var(--muted); }

/* ---------- 6. Cards: timeline, skills, languages ---------- */
.timeline { display: grid; gap: 20px; position: relative; }
.job { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); gap: 8px 28px; padding: clamp(20px, 3vw, 32px); transition: transform 0.25s, border-color 0.25s; }
.job:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.job-when { font-size: 0.92rem; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; padding-top: 0.35em; }
.job-main { min-width: 0; }
.job h3 { font-family: var(--font-head); font-weight: 500; font-size: clamp(1.3rem, 2.6vw, 1.6rem); letter-spacing: -0.01em; line-height: 1.25; }
.org { margin-top: 4px; font-weight: 500; }
.job-meta { margin-top: 2px; color: var(--muted); font-size: 0.93rem; }
.badge {
  display: inline-block; margin-bottom: 10px; padding: 3px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
}
.job.featured { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.bullets { margin-top: 16px; display: grid; gap: 9px; }
.bullets li { position: relative; padding-left: 20px; color: var(--muted); font-size: 0.99rem; line-height: 1.6; overflow-wrap: anywhere; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 2px; border-radius: 2px; background: var(--accent); }
.bullets strong { color: var(--text); font-weight: 600; }
.more { margin-top: 16px; }
.more summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.88rem; font-weight: 600; color: var(--accent); background: var(--bg);
}
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: "+"; font-size: 1.15rem; line-height: 1; transition: transform 0.2s; }
.more[open] summary::after { content: "–"; }
.more summary:hover { background: var(--surface-2); }
.more .bullets { margin-top: 18px; }

.skill-grid { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.skill { padding: clamp(20px, 3vw, 30px); }
.skill h3 { font-family: var(--font-head); font-weight: 500; font-size: 1.35rem; margin-bottom: 16px; }
.skill:nth-child(2) { grid-row: span 3; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 6px 14px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line);
  font-size: 0.9rem; line-height: 1.4; overflow-wrap: anywhere;
}

.lang-grid { display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lang-card { padding: clamp(16px, 3vw, 28px); }
.lang-card h3 { font-family: var(--font-head); font-weight: 500; font-size: 1.35rem; }
.lang-card .level { margin-top: 10px; font-weight: 600; color: var(--accent); font-size: 1.05rem; overflow-wrap: anywhere; }
.lang-card .note { margin-top: 4px; color: var(--muted); font-size: 0.92rem; }
.lang-card .note:empty { display: none; }

/* ---------- 7. Contact ---------- */
.contact-card { padding: clamp(24px, 4vw, 48px); display: grid; gap: 28px; justify-items: start; max-width: 48rem; }
.contact-lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 34em; }
.contact-list { display: grid; gap: 18px; width: 100%; }
.contact-list li { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.contact-list .i { width: 24px; height: 24px; color: var(--accent); }
.contact-list li > div { display: grid; min-width: 0; flex: 1 1 200px; }
.label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.mail, .value { font-size: clamp(1.1rem, 4.4vw, 1.5rem); font-weight: 500; overflow-wrap: anywhere; }
.mail { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); text-underline-offset: 4px; }
.mail:hover { text-decoration-color: var(--accent); }

/* ---------- 8. Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 28px; color: var(--muted); font-size: 0.9rem; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.to-top { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-height: 44px; }
.to-top:hover { color: var(--text); }

/* ---------- 9. Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- 10. Responsive ---------- */
@media (max-width: 1360px) {
  .nav a { padding-inline: 9px; font-size: 0.86rem; }
}
@media (max-width: 1100px) {
  .lang-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1240px) {
  .menu-btn { display: grid; }
  .nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: 8px var(--gutter) 20px; display: none; margin: 0;
  }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; gap: 2px; }
  .nav a { padding: 14px 14px; font-size: 1.02rem; border-radius: 12px; }
  .tools { margin-left: auto; }
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .skill-grid { grid-template-columns: minmax(0, 1fr); }
  .skill:nth-child(2) { grid-row: auto; }
}
@media (max-width: 720px) {
  .job { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .job-when { padding-top: 0; }
}
@media (max-width: 480px) {
  :root { --header-h: 62px; }
  body { font-size: 1rem; }
  .brand-name { display: none; }
  .tools { gap: 6px; }
  .cta .btn { width: 100%; }
  .lang-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .sec-head { gap: 12px; }
  .contact-card .btn.primary { width: 100%; }
}
@media (max-width: 400px) {
  .lang-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1700px) {
  :root { --wrap: 1240px; }
  body { font-size: 1.125rem; }
}
