/* it.gd3d.ru — Игорь Фенько */

:root {
  --bg: #eceef0;
  --bg-2: #e3e6e9;
  --paper: #f8f9fa;
  --ink: #12161c;
  --ink-2: #2b323b;
  --muted: #5d6671;
  --line: #d2d7dd;
  --line-2: #c2c8cf;
  --accent: #ff4f1a;
  --accent-ink: #c63a0d;
  --accent-soft: #ffe3d8;
  --ok: #17924f;
  --term-bg: #12161c;
  --term-ink: #e6e9ed;
  --grid: rgba(18, 22, 28, .055);
  --shadow: 0 1px 2px rgba(18, 22, 28, .06), 0 12px 32px -12px rgba(18, 22, 28, .18);

  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --radius: 14px;
  --header-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0e1114;
    --bg-2: #13171b;
    --paper: #171c21;
    --ink: #e8ebee;
    --ink-2: #c9ced4;
    --muted: #8a939d;
    --line: #262d34;
    --line-2: #333b43;
    --accent: #ff6a3d;
    --accent-ink: #ff8a63;
    --accent-soft: #3a1c12;
    --ok: #3ccf7f;
    --term-bg: #0a0c0f;
    --grid: rgba(232, 235, 238, .04);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul { list-style: none; padding: 0; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: clamp(30px, 4.4vw, 48px); }
h3 { font-size: 21px; letter-spacing: -.01em; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px;
}
.skip:focus { top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Header ---------- */

.header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: var(--header-h);
  transition: background .25s, border-color .25s, backdrop-filter .25s;
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-color: var(--line);
}
.header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 16px var(--mono); }
.brand__mark {
  display: grid; place-items: center; width: 32px; height: 32px;
  background: var(--accent); border-radius: 8px;
}
.brand__name span { color: var(--muted); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; font-size: 15px; font-weight: 500; color: var(--ink-2);
  padding: 8px 12px; border-radius: 8px; transition: color .2s, background .2s;
}
.nav a:hover { color: var(--ink); background: var(--bg-2); }
.nav a.is-active { color: var(--ink); }
.nav a.is-active::before { content: "› "; color: var(--accent); font-family: var(--mono); }
.nav .nav__cta { background: var(--ink); color: var(--bg); margin-left: 8px; padding-inline: 16px; }
.nav .nav__cta.is-active { color: var(--bg); }
.nav .nav__cta.is-active::before { content: none; }
.nav .nav__cta:hover { background: var(--accent); color: #fff; }

.burger {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--paper); cursor: pointer; position: relative;
}
.burger span {
  position: absolute; left: 11px; right: 11px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .25s, top .25s;
}
.burger span:first-child { top: 15px; }
.burger span:last-child { top: 23px; }
.burger[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .burger { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 16px 20px; background: var(--bg); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav.is-open { opacity: 1; transform: none; visibility: visible; }
  .nav a { padding: 14px 12px; font-size: 17px; }
  .nav .nav__cta { margin: 8px 0 0; text-align: center; }
  .header:has(.nav.is-open) { background: var(--bg); border-color: var(--line); }
}

/* ---------- Common ---------- */

.eyebrow, .kicker {
  font: 500 13px/1.4 var(--mono); letter-spacing: .02em; color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.kicker { color: var(--accent-ink); margin-bottom: 14px; }
.kicker::before { content: ""; width: 22px; height: 1px; background: currentColor; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.dot--ok { background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 24px; border-radius: 12px;
  font: 600 16px var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .2s, background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -10px var(--accent); }
.btn--primary:hover { background: var(--accent-ink); }
.btn--ghost { border: 1px solid var(--line-2); color: var(--ink); background: var(--paper); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--lg { min-height: 58px; padding: 0 30px; font-size: 17px; }

.section { padding: clamp(72px, 10vw, 128px) 0; }
.section--alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section__head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.section__sub { margin-top: 16px; color: var(--muted); font-size: 18px; }

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Hero ---------- */

.hero {
  position: relative; overflow: hidden;
  padding: calc(var(--header-h) + clamp(40px, 7vw, 88px)) 0 clamp(40px, 6vw, 64px);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
}
.hero__matrix {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 80% 40%, #000 10%, transparent 75%);
          mask-image: radial-gradient(ellipse 60% 70% at 80% 40%, #000 10%, transparent 75%);
  opacity: .55;
}
.hero__inner {
  position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 72px); align-items: center;
}
.hero__title {
  font-size: clamp(56px, 9vw, 116px); font-weight: 800; letter-spacing: -.045em; line-height: .92;
  margin: 18px 0 28px;
}

.term {
  background: var(--term-bg); color: var(--term-ink); border-radius: 12px;
  font: 500 15px/1.7 var(--mono); padding: 0 18px 14px; max-width: 460px;
  box-shadow: var(--shadow);
}
.term__bar {
  display: flex; align-items: center; gap: 6px; height: 34px; margin: 0 -18px 8px; padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08); font-size: 12px; color: #7d8691;
}
.term__bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a4149; }
.term__bar i:first-child { background: var(--accent); }
.term__bar span { margin-left: auto; }
.term__prompt { color: var(--accent); margin-right: 6px; }
.term__out { color: #9fe5bd; min-height: 1.7em; }
.term__caret {
  display: inline-block; width: 9px; height: 1.1em; margin-left: 2px; vertical-align: -3px;
  background: var(--accent); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__lead { margin-top: 28px; font-size: clamp(17px, 1.6vw, 19px); max-width: 600px; color: var(--ink-2); }
.hero__lead--muted { margin-top: 12px; color: var(--muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero__photo { position: relative; justify-self: center; width: min(440px, 100%); }
.photo {
  position: relative; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, var(--paper), var(--bg-2) 70%);
}
.photo::before {
  content: ""; position: absolute; inset: -14px; border-radius: 50%;
  border: 1px dashed var(--line-2);
  animation: spin 60s linear infinite;
}
.photo::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
  top: 50%; left: -21px; margin-top: -7px;
  box-shadow: 0 0 0 6px var(--bg);
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .photo::before, .dot--ok { animation: none; } }
.photo img { position: relative; width: 100%; filter: contrast(1.04); }

.chip {
  position: absolute; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line);
  font: 500 13px var(--mono); box-shadow: var(--shadow); white-space: nowrap;
}
.chip b { font-weight: 600; color: var(--ok); }
.chip--status { left: 0; bottom: 10%; }
.chip--a { right: -4%; top: 12%; }
.chip--b { right: 4%; bottom: 0; background: var(--ink); color: var(--bg); border-color: var(--ink); }

.stack {
  position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(48px, 7vw, 80px);
  padding-top: 24px; border-top: 1px solid var(--line);
}
.stack li {
  font: 500 13px var(--mono); padding: 6px 12px; border-radius: 8px;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink-2);
}

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__photo { order: -1; width: min(300px, 78%); }
  .hero__title { margin-top: 14px; }
  .chip--a { right: -10%; }
}

/* ---------- Areas ---------- */

.areas {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.area { background: var(--paper); padding: 32px 28px 36px; transition: background .25s; }
.area:hover { background: var(--bg); }
.area__code {
  display: inline-block; font: 500 12px var(--mono); color: var(--accent-ink);
  background: var(--accent-soft); padding: 4px 10px; border-radius: 6px; margin-bottom: 22px;
}
.area__code::before { content: "#"; opacity: .6; }
.area h3 { margin-bottom: 10px; }
.area p { color: var(--muted); font-size: 16px; }

@media (max-width: 900px) { .areas { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .areas { grid-template-columns: 1fr; } .area { padding: 26px 22px 28px; } }

/* ---------- Skills ---------- */

.meter {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(22px, 4vw, 40px); box-shadow: var(--shadow);
  --name-w: 220px; --val-w: 52px; --gap: 20px;
}
.meter__scale, .meter__row {
  display: grid; grid-template-columns: var(--name-w) 1fr var(--val-w); gap: var(--gap); align-items: center;
}
.meter__scale {
  font: 500 12px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  padding-bottom: 14px; border-bottom: 1px dashed var(--line-2); margin-bottom: 8px;
  grid-template-columns: var(--name-w) repeat(3, 1fr) var(--val-w);
}
.meter__scale span:first-child { grid-column: 2; }
.meter__scale span { border-left: 1px solid var(--line-2); padding-left: 10px; }
.meter__row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.meter__row:last-child { border-bottom: 0; padding-bottom: 0; }
.meter__name { font-weight: 600; }
.meter__track {
  position: relative; height: 10px; border-radius: 6px; background: var(--bg-2); overflow: hidden;
  background-image: linear-gradient(90deg, transparent calc(33.33% - 1px), var(--line-2) calc(33.33% - 1px), var(--line-2) 33.33%, transparent 33.33%, transparent calc(66.66% - 1px), var(--line-2) calc(66.66% - 1px), var(--line-2) 66.66%, transparent 66.66%);
}
.meter__fill {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--ink-2), var(--accent));
  transition: width 1.2s cubic-bezier(.2, .7, .2, 1);
}
.meter__val { font: 600 14px var(--mono); text-align: right; color: var(--ink-2); }

@media (max-width: 680px) {
  .meter__scale { grid-template-columns: repeat(3, 1fr); }
  .meter__scale span:first-child { grid-column: auto; }
  .meter__row { grid-template-columns: 1fr auto; gap: 10px 12px; }
  .meter__track { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Certificates ---------- */

.certs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.cert {
  display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  transition: border-color .25s, box-shadow .25s;
}
.cert:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.cert__img {
  padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: zoom-in;
  background: #fff; position: relative;
}
.cert__img img { transition: transform .5s; }
.cert__img:hover img { transform: scale(1.04); }
.cert__img::after {
  content: "⤢"; position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--ink); color: #fff; border-radius: 8px; font-size: 16px; opacity: 0; transition: opacity .25s;
}
.cert__img:hover::after, .cert__img:focus-visible::after { opacity: 1; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--mono);
  color: var(--accent-ink); background: var(--accent-soft); padding: 4px 10px; border-radius: 6px;
}
.badge::before { content: "▮▮▮"; letter-spacing: -2px; font-size: 9px; }
.cert h3 { font-size: 32px; margin: 14px 0 16px; }
.cert__meta { display: grid; gap: 6px; margin-bottom: 22px; font-size: 15px; }
.cert__meta div { display: flex; gap: 10px; }
.cert__meta dt { color: var(--muted); min-width: 56px; }
.cert__meta dd { font-family: var(--mono); font-size: 14px; }
.link-dl {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px;
  text-decoration: none; border-bottom: 1.5px solid var(--accent); padding-bottom: 2px;
}
.link-dl:hover { color: var(--accent-ink); }

@media (max-width: 1000px) { .certs { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .cert { grid-template-columns: 110px 1fr; gap: 18px; padding: 16px; }
  .cert h3 { font-size: 26px; margin: 10px 0 10px; }
  .cert__meta { margin-bottom: 14px; }
  .link-dl { font-size: 14px; }
}

.lightbox {
  margin: auto; border: 0; padding: 0; background: transparent; max-width: min(92vw, 820px); max-height: 92vh; overflow: visible;
}
.lightbox::backdrop { background: rgba(8, 10, 12, .82); backdrop-filter: blur(4px); }
.lightbox img { max-height: 92vh; width: auto; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.lightbox__close {
  position: absolute; top: -14px; right: -14px; width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: var(--accent); color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}
@media (max-width: 600px) { .lightbox__close { top: 8px; right: 8px; } }

/* ---------- Projects ---------- */

.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.projects li { display: flex; }
.project {
  display: flex; flex-direction: column; width: 100%; text-decoration: none;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 26px;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.project__logo {
  display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 10px; margin-bottom: 22px; overflow: hidden;
}
.project__logo img { width: auto; max-height: 62%; max-width: 62%; transition: transform .5s; }
.project:hover .project__logo img { transform: scale(1.06); }
.project__logo--dark { background: radial-gradient(circle at 50% 40%, #232a31, #0c0f12); }
.project__logo--warm { background: radial-gradient(circle at 50% 40%, #fff6e3, #f4dfb8); }
.project__url, .project h3, .project p, .project__go { padding-inline: 12px; }
.project__url { font: 500 13px var(--mono); color: var(--muted); }
.project h3 { font-size: 26px; margin: 6px 0 10px; }
.project p { color: var(--muted); font-size: 16px; flex: 1; }
.project__go { margin-top: 20px; font-weight: 600; font-size: 15px; color: var(--accent-ink); }
.project__go span { display: inline-block; transition: transform .25s; }
.project:hover .project__go span { transform: translateX(4px); }

@media (max-width: 900px) { .projects { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .projects { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */

.contact__box {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 5vw, 64px); align-items: center;
  background: var(--term-bg); color: var(--term-ink); border-radius: 22px;
  padding: clamp(28px, 5vw, 64px);
  background-image:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 30%, transparent), transparent 45%),
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
}
.kicker--light { color: #ff8a63; }
.contact h2 { font-size: clamp(28px, 3.8vw, 44px); }
.contact__sub { margin: 16px 0 28px; color: #9aa3ad; font-size: 18px; }

.socials { display: grid; gap: 10px; }
.socials a {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 12px; text-decoration: none;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08);
  transition: background .2s, border-color .2s, transform .2s;
}
.socials a:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); transform: translateX(4px); }
.socials svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.socials span { display: flex; flex-direction: column; line-height: 1.3; font: 400 13px var(--mono); color: #8d969f; }
.socials b { font: 600 16px var(--sans); color: #fff; }

@media (max-width: 860px) { .contact__box { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */

.footer { padding: 28px 0 36px; color: var(--muted); font-size: 14px; font-family: var(--mono); }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--accent-ink); }
