:root {
  --ink: #182b20;
  --paper: #e9f0da;
  --green: #4d9a5f;
  --green-d: #2e6e3f;
  --green-l: #c7e6bd;
  --sage: #a9cfa6;
  --sage-d: #55845c;
  --tea: #cfe3ae;
  --tea-d: #7fa14f;
  --tea-dd: #4d642f;
  --mint: #b8f0d4;
  --mint-d: #4cc38a;
  --butter: #d9ecc2;
  --butter-d: #90b968;
  --body: 'DotGothic16', 'MS Gothic', 'Osaka-Mono', ui-monospace, monospace;
  --title: 'Press Start 2P', 'DotGothic16', ui-monospace, monospace;
  --cursor: url("assets/pixel/cursor-bunny.png") 12 30, auto;
}

* {
  box-sizing: border-box;
  cursor: var(--cursor);
}

/* весь текст на сайте нельзя выделить и скопировать */
body,
body * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: #31413a;
  color: var(--ink);
  font: 16px/1.7 var(--body);
  -webkit-font-smoothing: none;
}

::selection {
  background: var(--green);
  color: var(--paper);
}

img {
  max-width: 100%;
  image-rendering: pixelated;
}

:focus-visible {
  outline: 3px dashed var(--ink);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.bg {
  position: fixed;
  inset: -64px;
  z-index: -2;
  background: url(assets/pixel/bg-tile.png) 0 0 / 64px 64px;
  image-rendering: pixelated;
  animation: bg-drift 24s linear infinite;
}

@keyframes bg-drift {
  to {
    transform: translate3d(64px, 64px, 0);
  }
}

.scan {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(220, 255, 230, .04) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 0 140px rgba(24, 43, 32, .45);
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--ink);
}

.js.booting .boot {
  display: flex;
  animation: boot-failsafe 0s linear 4s forwards;
}

.boot.is-leaving {
  animation: boot-out .4s steps(4) forwards;
}

@keyframes boot-failsafe {
  to {
    visibility: hidden;
    pointer-events: none;
  }
}

@keyframes boot-out {
  to {
    opacity: 0;
  }
}

.boot-box {
  text-align: center;
  color: var(--paper);
}

.boot-star {
  width: 44px;
  animation: bob .6s ease-in-out infinite alternate;
}

.boot-title {
  margin: 14px 0 0;
  color: var(--butter);
  font: 16px/1.4 var(--title);
}

.boot-jp {
  margin: 6px 0 18px;
  color: var(--green-l);
}

.boot-bar {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.boot-bar i {
  width: 16px;
  height: 22px;
  background: rgba(255, 255, 255, .12);
  transition: background .25s ease;
}

.boot-bar i.on {
  background: var(--green);
}

.boot-skip {
  margin: 18px 0 0;
  font-size: 12px;
  opacity: .6;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 130px;
}

.masthead {
  position: relative;
  padding: 26px 0 6px;
  text-align: center;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin: 0;
}

.logo-main {
  color: var(--paper);
  font: clamp(56px, 13vw, 112px) / 1 var(--title);
  letter-spacing: .06em;
  text-shadow:
    -4px 0 var(--ink), 4px 0 var(--ink), 0 -4px var(--ink), 0 4px var(--ink),
    -4px -4px var(--ink), 4px -4px var(--ink), -4px 4px var(--ink), 4px 4px var(--ink),
    8px 8px 0 var(--green-d), 12px 12px 0 var(--ink);
  animation: bob 1.6s ease-in-out infinite alternate;
}

@keyframes bob {
  to {
    transform: translateY(-6px);
  }
}

.logo-jp {
  padding: 6px 10px 6px 20px;
  background: var(--butter);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font: 18px/1 var(--body);
  letter-spacing: .5em;
  transform: rotate(-2deg);
}

.tagline {
  display: inline-block;
  margin: 22px 0 0;
  padding: 4px 14px;
  background: var(--paper);
  border: 3px dashed var(--green-d);
  font-size: 15px;
  line-height: 1.5;
}

.deco {
  position: absolute;
  pointer-events: none;
  animation: twinkle 1.6s ease-in-out infinite alternate;
}

.deco-star {
  width: 44px;
}

.deco-heart {
  width: 44px;
}

.deco-sparkle {
  width: 36px;
}

.d1 { left: 7%; top: 24px; }
.d2 { right: 9%; top: 34px; animation-delay: -.4s; }
.d3 { left: 20%; top: 150px; animation-delay: -.8s; }
.d4 { right: 22%; top: 168px; animation-delay: -1.1s; }
.d5 { right: 3%; top: 120px; animation-delay: -.2s; }

@keyframes twinkle {
  to {
    transform: translateY(-9px) scale(1.12);
  }
}

.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 26px 0 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px;
  background-color: var(--green);
  background-clip: padding-box;
  border: 6px solid transparent;
  border-image: url(assets/pixel/button-pink.png) 3 / 6px;
  color: var(--ink);
  font: 15px/1.2 var(--body);
  text-decoration: none;
  filter: drop-shadow(0 4px 0 var(--ink));
  transition: transform .18s ease, filter .18s ease;
}

.btn img {
  width: 22px;
  height: auto;
}

.btn:hover {
  transform: translateY(-3px);
  filter: drop-shadow(0 7px 0 var(--ink)) brightness(1.06);
}

.btn:active {
  transform: translateY(3px);
  filter: drop-shadow(0 1px 0 var(--ink));
}

.btn-white {
  background-color: var(--paper);
  border-image-source: url(assets/pixel/button-white.png);
}

.btn-yellow {
  background-color: var(--butter);
  border-image-source: url(assets/pixel/button-yellow.png);
}

.layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 30px 36px;
  align-items: start;
}

.layout--full {
  grid-template-columns: minmax(0, 1fr);
}

.side {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 30px;
  min-width: 0;
}

.win {
  position: relative;
  background-color: var(--paper);
  background-clip: padding-box;
  border: 8px solid transparent;
  border-image: url(assets/pixel/frame-lavender.png) 4 / 8px;
  filter: drop-shadow(6px 6px 0 var(--ink));
  --bar-a: var(--sage-d);
  --bar-b: var(--sage);
}

.win-green {
  border-image-source: url(assets/pixel/frame-pink.png);
  --bar-a: var(--green-d);
  --bar-b: var(--green);
}

.win-tea {
  border-image-source: url(assets/pixel/frame-sky.png);
  --bar-a: var(--tea-d);
  --bar-b: var(--tea);
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 4px 10px;
  background: repeating-linear-gradient(0deg, var(--bar-a) 0 2px, var(--bar-b) 2px 4px);
  border-bottom: 3px solid var(--ink);
}

.tb-title {
  margin: 0;
  padding: 6px 8px;
  background: var(--paper);
  border: 2px solid var(--ink);
  font: 10px/1.2 var(--title);
  overflow-wrap: anywhere;
}

.tb-dots {
  display: flex;
  gap: 4px;
  flex: none;
}

.tb-dots i {
  width: 14px;
  height: 14px;
  background: var(--paper);
  border: 2px solid var(--ink);
}

.tb-collapse {
  position: relative;
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  background: var(--butter);
  border: 3px solid var(--ink);
}

.tb-collapse span {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 3px;
  background: var(--ink);
}

.tb-collapse[aria-expanded="false"] span {
  width: 10px;
  height: 10px;
  background: transparent;
  border: 3px solid var(--ink);
}

.tb-collapse:hover {
  background: var(--green-l);
}

.tb-star {
  flex: none;
  width: 22px;
  height: auto;
  margin-left: auto;
}

.win-body {
  padding: 16px;
}

.hello {
  display: grid;
  gap: 12px;
  align-content: start;
}

.hello p {
  margin: 0;
}

.hello-lead {
  font: 20px/1.35 var(--body);
  color: var(--green-d);
}

.status-label {
  margin: 0;
  color: var(--tea-dd);
  font: 8px/1.4 var(--title);
}

.clocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 16px;
}

.clock-cell {
  display: grid;
  gap: 8px;
  align-content: start;
}

.clock {
  margin: 0;
  padding: 12px 8px;
  background: var(--ink);
  box-shadow: inset 0 0 0 3px var(--tea-d);
  color: var(--mint);
  font: 16px/1 var(--title);
  letter-spacing: .08em;
  text-align: center;
}

.clock-diff {
  color: var(--butter);
}

.status-date {
  margin: 0;
  font-size: 14px;
  text-align: center;
}

.status-hint {
  margin: 0;
  color: var(--sage-d);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.news {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.news time {
  color: var(--sage-d);
  font: 8px/1.4 var(--title);
}

.news p {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

.new {
  display: inline-block;
  margin-right: 6px;
  padding: 3px 5px;
  background: var(--green-d);
  color: var(--paper);
  font: 8px/1 var(--title);
  animation: flicker 1.6s ease-in-out infinite;
}

@keyframes flicker {
  50% {
    opacity: .35;
  }
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}

.filter {
  min-height: 40px;
  font-size: 14px;
}

.filter b {
  margin-left: 6px;
  padding: 4px 5px;
  background: var(--ink);
  color: var(--butter);
  font: 9px/1 var(--title);
}

.filter[aria-pressed="true"] {
  background-color: var(--butter);
  border-image-source: url(assets/pixel/button-yellow.png);
}

.filter[aria-pressed="false"] {
  background-color: var(--paper);
  border-image-source: url(assets/pixel/button-white.png);
}

.projects {
  display: grid;
  gap: 34px;
}

.project-body {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 16px;
}

.cover {
  margin: 0;
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: 5px 5px 0 var(--green-d);
}

.cover img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid var(--ink);
}

.cover figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 8px;
  padding: 7px 8px;
  background: var(--ink);
  color: var(--paper);
  font: 8px/1.4 var(--title);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 5px 6px;
  background: var(--butter);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font: 8px/1.2 var(--title);
}

.tags li:nth-child(2) {
  background: var(--mint);
}

.tags li:nth-child(3) {
  background: var(--green-l);
}

.project-name {
  margin: 0 0 10px;
  font: 24px/1.25 var(--body);
  text-shadow: 2px 2px 0 var(--green-l);
}

.project-info p {
  margin: 0 0 10px;
}

.muted {
  color: #4a5b4f;
  font-size: 14px;
}

.stats {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.stats > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.stats dt {
  min-width: 108px;
  color: var(--sage-d);
  font: 8px/1.4 var(--title);
}

.stats dd {
  margin: 0;
}

.led {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  background: var(--paper);
  border: 2px solid var(--ink);
  font: 8px/1.4 var(--title);
}

.led-green::before,
.led-yellow::before,
.led-blue::before {
  content: '';
  width: 8px;
  height: 8px;
  flex: none;
  animation: flicker 1.6s ease-in-out infinite;
}

.led-green::before {
  background: var(--mint-d);
}

.led-yellow::before {
  background: var(--butter-d);
}

.led-blue::before {
  background: var(--tea-d);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 30px 12px;
  text-align: center;
}

.empty img {
  width: 44px;
}

.empty p {
  margin: 0;
}

.socials {
  display: grid;
  gap: 26px;
}

.social-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.social-logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 58px;
  height: 58px;
  background: var(--ink);
  box-shadow: inset 0 0 0 3px var(--tea-d);
  color: var(--paper);
}

.social-logo svg {
  width: 30px;
  height: 30px;
}

.social-info {
  flex: 1 1 220px;
  min-width: 0;
}

.social-info b {
  display: block;
  font: 20px/1.3 var(--body);
}

.social-info small {
  color: var(--sage-d);
  font-size: 14px;
}

.social-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: auto;
}

.socials-intro {
  margin: 0 0 18px;
  font-size: 14px;
}

.socials-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 30px;
  color: var(--paper);
  font: 8px/1.6 var(--title);
}

.footer {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-top: 56px;
  padding-top: 26px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 4px, transparent 4px 8px) top / 100% 4px no-repeat;
  color: var(--paper);
  font-size: 14px;
  text-align: center;
}

.footer p {
  margin: 0;
}

.badge88 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 88px;
  height: 31px;
  background: linear-gradient(180deg, var(--green-l) 0 50%, var(--green) 50%);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font: 9px/1 var(--title);
}

.badge88 img {
  width: 11px;
  height: auto;
}

.spark {
  position: fixed;
  z-index: 60;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  background: center / contain no-repeat;
  image-rendering: pixelated;
  pointer-events: none;
  animation: spark .8s steps(8) forwards;
}

.spark-sparkle {
  background-image: url(assets/pixel/sparkle.png);
}

.spark-heart {
  background-image: url(assets/pixel/heart.png);
}

.spark-star {
  background-image: url(assets/pixel/star.png);
}

@keyframes spark {
  to {
    opacity: 0;
    transform: translate(var(--dx, 0), var(--dy, 20px)) scale(.5);
  }
}

.js .win.pop:not(.in) {
  opacity: 0;
}

.js .win.pop.in {
  animation: pop .55s cubic-bezier(.2, .9, .3, 1.2) backwards;
  animation-delay: calc(var(--d, 0) * 110ms);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.96);
  }
}

@media (max-width: 920px) {
  .layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: stretch;
  }

  .main {
    width: 100%;
  }

  .side {
    display: contents;
  }

  .side-hello {
    order: 1;
  }

  .main {
    order: 2;
  }

  .project-body {
    grid-template-columns: 1fr;
  }

  .cover {
    max-width: 460px;
    margin-inline: auto;
  }

  .d3,
  .d4 {
    display: none;
  }
}

@media (max-width: 520px) {
  .page {
    padding: 18px 12px 120px;
  }

  .menu {
    gap: 10px;
  }

  .clocks {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .clock {
    font-size: 14px;
  }

  .logo-main {
    text-shadow:
      -3px 0 var(--ink), 3px 0 var(--ink), 0 -3px var(--ink), 0 3px var(--ink),
      -3px -3px var(--ink), 3px -3px var(--ink), -3px 3px var(--ink), 3px 3px var(--ink),
      6px 6px 0 var(--green-d), 9px 9px 0 var(--ink);
  }

  .logo-jp {
    font-size: 15px;
    letter-spacing: .4em;
  }

  .win-body,
  .project-body {
    padding: 12px;
  }

  .tb-title {
    font-size: 9px;
  }

  .project-name {
    font-size: 21px;
  }

  .stats dt {
    min-width: 0;
    width: 100%;
  }

  .d1 { left: 2%; }
  .d2 { right: 3%; }
  .d5 { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .bg,
  .logo-main,
  .deco,
  .boot-star,
  .new,
  .led::before {
    animation: none !important;
  }

  .js .win.pop:not(.in) {
    opacity: 1;
  }

  .js .win.pop.in {
    animation: none;
  }
}
