:root {
  color-scheme: light;
  --page: #f7f6fb;
  --surface: #fff;
  --ink: #1a1625;
  --muted: #575264;
  --accent: #6335db;
  --accent-dark: #5024c2;
  --rule: #e1ddeb;
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
p, h1, h2, h3, dd { margin: 0; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
.wrap { width: min(100% - 5rem, 78rem); margin-inline: auto; }
.skip { position: fixed; inset: .75rem auto auto 1rem; z-index: 2; transform: translateY(-200%); background: #fff; padding: .8rem; }
.skip:focus { transform: none; }

.header { border-bottom: 1px solid var(--rule); }
.header-inner { min-height: 4.75rem; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }
.brand { display: inline-flex; gap: .7rem; align-items: center; width: fit-content; font-size: 1rem; font-weight: 750; letter-spacing: -.025em; white-space: nowrap; }
.brand-mark { width: 2.55rem; height: 2.55rem; flex: none; }
.header nav { display: flex; gap: clamp(1rem, 4vw, 2.75rem); }
.header nav a, .header-github { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; font-size: .95rem; font-weight: 650; }
.header nav a { color: var(--muted); }
.header nav a:hover, .footer a:hover { color: var(--accent); }
.header-github { justify-self: end; border: 1px solid var(--rule); border-radius: 999px; padding-inline: 1.05rem; }
.header-github:hover { border-color: var(--accent); color: var(--accent); }

.hero { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(2rem, 5.7vw, 5.75rem); padding-block: clamp(3rem, 5.2vw, 5.25rem); }
.hero-copy { padding-block: .25rem; }
.eyebrow { display: flex; align-items: center; gap: .62rem; margin-bottom: 1.25rem; color: var(--accent-dark); font-size: .84rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; line-height: 1.5; }
.eyebrow::before { content: ""; width: 1.15rem; height: 2px; border-radius: 1px; background: currentColor; flex: none; }
h1 { font-size: clamp(2.7rem, 5.7vw, 5.4rem); font-weight: 780; line-height: .99; letter-spacing: -.071em; overflow-wrap: anywhere; }
.hero h1 span { display: block; color: var(--accent); }
.intro { max-width: 34rem; margin-top: 1.65rem; color: var(--muted); font-size: clamp(1rem, 1.45vw, 1.16rem); line-height: 1.62; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 3rem; padding: .65rem 1.25rem; border-radius: .7rem; font-size: .98rem; font-weight: 700; line-height: 1.3; }
.primary { background: var(--accent); color: #fff; transition: background .18s; }
.primary:hover { background: var(--accent-dark); }
.hero .button, .detail-hero .button { margin-top: 1.8rem; }
.hero-art { width: 100%; max-width: 30rem; justify-self: end; overflow: hidden; border-radius: 1.4rem; background: #171719; }
.hero-art img { width: 100%; height: auto; }

.profile-story { display: grid; grid-template-columns: .65fr 1.35fr; gap: 1.7rem clamp(2rem, 6vw, 6rem); padding-block: clamp(2.1rem, 4.5vw, 4rem); border-top: 1px solid var(--rule); }
.profile-story h2 { font-size: clamp(2rem, 3.45vw, 3.1rem); }
.profile-story p { max-width: 42rem; color: var(--muted); font-size: clamp(1rem, 1.43vw, 1.13rem); line-height: 1.65; }
.profile-story p + p { margin-top: 1.05rem; }

.projects { scroll-margin-top: 1.25rem; border-top: 1px solid var(--rule); padding-block: 2.35rem 4rem; }
.section-heading { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.65rem; }
h2 { font-size: clamp(2rem, 3.8vw, 3.4rem); font-weight: 760; line-height: 1.08; letter-spacing: -.055em; }
.project-count { color: var(--muted); font-size: .9rem; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.35rem; margin: 0; padding: 0; list-style: none; }
.project-grid li { display: flex; min-width: 0; }
.card { width: 100%; display: block; overflow: hidden; background: var(--surface); border: 1px solid var(--rule); border-radius: 1.15rem; transition: box-shadow .2s, transform .2s, border-color .2s; }
.card:hover { transform: translateY(-4px); border-color: #ad96ec; box-shadow: 0 12px 28px #25134513; }
.card-body { position: relative; min-height: 9.4rem; padding: 1.15rem 3.35rem 1.2rem 1.2rem; }
.category { margin-bottom: .3rem; color: var(--accent-dark); font-size: .79rem; font-weight: 700; line-height: 1.4; }
.card h3 { font-size: clamp(1.25rem, 2vw, 1.58rem); font-weight: 770; line-height: 1.14; letter-spacing: -.042em; }
.card-summary { margin-top: .55rem; color: var(--muted); font-size: .98rem; line-height: 1.45; }
.card-open { position: absolute; right: 1.05rem; top: 1.3rem; display: grid; place-items: center; width: 2.15rem; height: 2.15rem; border: 1px solid var(--rule); border-radius: 50%; color: var(--accent); font: 1.35rem/1 Arial, sans-serif; transition: color .2s, background .2s, border-color .2s; }
.card:hover .card-open { background: var(--accent); color: #fff; border-color: var(--accent); }

.art { --glow: #fff9; --lines: #fff8; position: relative; isolation: isolate; display: grid; min-height: 10rem; aspect-ratio: 2.25 / 1; place-items: center; overflow: hidden; background: radial-gradient(ellipse at 51% 58%, var(--glow), transparent 73%), var(--art-base); color: var(--art-ink); }
.art::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--lines) 1px, transparent 1px), linear-gradient(90deg, var(--lines) 1px, transparent 1px); background-size: 1.25rem 1.25rem; mask-image: radial-gradient(ellipse at center, transparent 8%, #000 79%); }
.art--kartinka { --art-base: #18213b; --art-ink: #f7f8fb; --lines: #d4e0fb27; --glow: #5264548c; }
.art--markethub { --art-base: #d9e6ff; --art-ink: #193978; }
.art--feelody { --art-base: #1e2341; --art-ink: #fff; --lines: #b0a5fc20; --glow: #5b4b9c9c; }
.art--fbs-moscow { --art-base: #dcecae; --art-ink: #111625; }
.art--bitseer { --art-base: #151e37; --art-ink: #e0eaff; --lines: #a9ccff23; --glow: #485b9460; }
.art--kucoin-bot { --art-base: #dce8eb; --art-ink: #24324b; }
.art--kransoft { --art-base: #211c17; --art-ink: #fff; --lines: #f6d2ab27; --glow: #82500860; }
.art--pena { --art-base: #fae397; --art-ink: #3c2709; }
.art--golovnoy-shtab { --art-base: #e5ead8; --art-ink: #283529; }
.project-mark { display: flex; align-items: center; justify-content: center; gap: .48em; max-width: 86%; font-size: clamp(1.36rem, 2.35vw, 2rem); font-weight: 800; letter-spacing: -.045em; }
.project-mark img { width: 5.25rem; height: 5.25rem; object-fit: contain; border-radius: .9rem; filter: drop-shadow(0 .35rem .65rem #0e0a271d); }
.project-mark--lockup img { width: 1.65em; height: 1.65em; border-radius: .4em; flex: none; }
.art--kransoft .project-mark img { width: 14rem; height: auto; border-radius: 0; filter: none; }
.art--golovnoy-shtab .project-mark img { width: 17rem; height: auto; aspect-ratio: auto; transform: translateX(16%); border-radius: 0; filter: none; }

.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .9rem 1.5rem; padding-block: 1.55rem 2rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .94rem; }
.footer a:first-child { color: var(--ink); font-weight: 720; }

.detail { padding-block: 2.5rem 3.5rem; }
.back-link { display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: .9rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--accent-dark); font-size: .92rem; font-weight: 710; }
.back-link:hover { border-color: var(--accent); }
.detail-hero { display: grid; grid-template-columns: 1fr .85fr; align-items: center; gap: clamp(2rem, 5vw, 5rem); margin-block: 1.75rem 3.6rem; }
.detail-hero h1 { font-size: clamp(2.65rem, 6vw, 5.55rem); }
.detail-hero .art { aspect-ratio: 4 / 3; border-radius: 1.4rem; }
.detail-hero .project-mark { font-size: clamp(2rem, 4vw, 3.3rem); }
.detail-hero .project-mark img { width: clamp(7rem, 14vw, 12rem); height: auto; aspect-ratio: 1; border-radius: 1.2rem; }
.detail-hero .project-mark--lockup img { width: 1.65em; border-radius: .4em; }
.detail-hero .art--kransoft .project-mark img { width: 21rem; aspect-ratio: auto; border-radius: 0; }
.detail-hero .art--golovnoy-shtab .project-mark img { width: clamp(15rem, 30vw, 23rem); }
.detail-about { max-width: 52rem; }
.detail-about p { margin-top: 1rem; color: var(--muted); font-size: 1.16rem; line-height: 1.65; }
.features { margin-top: 2.8rem; }
.features dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.35rem 0 0; }
.features dl > div { padding: 1.25rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 1rem; }
.features dt { margin-bottom: .55rem; font-size: 1.07rem; font-weight: 750; }
.features dd { color: var(--muted); line-height: 1.5; }
.detail-nav { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; margin-top: 2.7rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); }
.detail-nav a { color: var(--accent-dark); font-weight: 700; }
.detail-nav a:last-child { text-align: right; }
.detail-nav span { display: block; margin-bottom: .2rem; color: var(--muted); font-size: .8rem; font-weight: 500; }
.detail-nav a:hover { text-decoration: underline; }

@media (max-width: 62rem) {
  .wrap { width: min(100% - 3rem, 78rem); }
  .hero { gap: 2rem; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 45rem) {
  .hero, .profile-story, .detail-hero { grid-template-columns: 1fr; }
  .hero { padding-block: 2.9rem 2.55rem; gap: 1.9rem; }
  .hero h1 { max-width: 37rem; font-size: clamp(2.65rem, 9vw, 4.7rem); }
  .hero-art { justify-self: start; }
  .detail-hero { margin-bottom: 2.5rem; }
  .detail-hero .art { aspect-ratio: 2 / 1; }
  .features dl { grid-template-columns: 1fr; }
}

@media (max-width: 32rem) {
  .wrap { width: calc(100% - 2rem); }
  .header-inner { min-height: 4.25rem; grid-template-columns: 1fr auto; gap: .2rem .65rem; }
  .header nav { gap: .9rem; }
  .header nav a { font-size: .88rem; }
  .header-github { display: none; }
  .brand { gap: .5rem; font-size: .9rem; }
  .brand-mark { width: 2.05rem; height: 2.05rem; }
  .project-grid { grid-template-columns: 1fr; gap: 1rem; }
  .card-body { min-height: auto; padding-bottom: 1.35rem; }
  .project-mark { font-size: 1.7rem; }
  .projects { padding-top: 1.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .primary, .card, .card-open { transition: none; }
  .card:hover { transform: none; }
}
