:root {
  --bg: #07070b;
  --bg-2: #0c0d14;
  --ink: #f4ead5;
  --muted: #8d8796;
  --gold: #e8c872;
  --gold-2: #a8883a;
  --cyan: #8be9fd;
  --green: #61f2a0;
  --warn: #ffd36b;
  --red: #ff6b7a;
  --line: rgba(232, 200, 114, 0.22);
  --paper: #14151d;
  --paper-2: #1b1c27;
  --shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.65, 0.05, 0.12, 1);
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --display: "Syne", "Segoe UI", sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Great Vibes", "Segoe Script", cursive;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  overflow: hidden;
  font-family: var(--mono);
  cursor: crosshair;
}

body.act-card {
  overflow: auto;
  cursor: auto;
}

::selection {
  background: rgba(232, 200, 114, 0.35);
  color: #fff;
}

#field {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.grain,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.grain {
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.35s steps(2) infinite;
}

.vignette {
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

.scene {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
}

.land {
  display: grid;
  place-items: center;
  padding: 24px;
}

.land-meta {
  position: absolute;
  top: 28px;
  left: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
  animation: pulse 1.6s ease-in-out infinite;
}

.dim {
  opacity: 0.55;
}

.land-frame {
  width: min(760px, 94vw);
  padding: 48px 44px 40px;
  overflow: visible;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 21, 29, 0.72), rgba(7, 7, 11, 0.55));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  animation: rise 1.1s var(--ease) both;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 22px;
}

.land-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 0.9;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.land-title span {
  display: block;
}

.foil {
  background: linear-gradient(110deg, #8a6a2a 0%, #f8e7a8 36%, #fff6d2 48%, #c9a227 58%, #8a6a2a 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: foil 5.5s linear infinite;
}

.land-sub {
  margin: 22px 0 32px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.btn-gold {
  appearance: none;
  border: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  background: linear-gradient(180deg, #f3e0a4, #c9a227);
  color: #1a1408;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
  box-shadow: 0 10px 30px rgba(201, 162, 39, 0.25);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(201, 162, 39, 0.35);
}

.btn-gold i {
  width: 28px;
  height: 1px;
  background: #1a1408;
  position: relative;
}

.btn-gold i::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  width: 7px;
  height: 7px;
  border-right: 1px solid #1a1408;
  border-top: 1px solid #1a1408;
  transform: rotate(45deg);
}

.hint {
  margin-top: 16px;
  font-size: 11px;
  color: var(--muted);
}

.boot {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 72px;
}

.boot-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #101119;
  font-size: 12px;
}

.boot-dots {
  display: flex;
  gap: 6px;
}

.boot-dots b {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3a3d4a;
}

.boot-dots b:nth-child(1) {
  background: #ff6b7a;
}
.boot-dots b:nth-child(2) {
  background: #ffd36b;
}
.boot-dots b:nth-child(3) {
  background: #61f2a0;
}

.boot-title {
  flex: 1;
  color: #c9c4d4;
}

.boot-env {
  color: var(--green);
  letter-spacing: 0.08em;
}

.boot-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 14px;
  margin-top: 14px;
  min-height: 0;
}

.log {
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 9, 14, 0.82);
  color: #c8e6c0;
  font-size: 13px;
  line-height: 1.65;
  min-height: 52vh;
  overflow: auto;
  text-shadow: 0 0 12px rgba(97, 242, 160, 0.15);
}

.log .ok {
  color: var(--green);
}
.log .info {
  color: var(--cyan);
}
.log .warn {
  color: var(--warn);
}
.log .gold {
  color: var(--gold);
}
.log .dim {
  color: #667068;
}

.pipeline {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 13, 20, 0.8);
  padding: 18px 16px;
}

.pipeline h2 {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 500;
}

.pipeline li {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: #9aa094;
}

.pipeline .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3a3d4a;
  flex-shrink: 0;
}

.pipeline li.run .dot {
  background: var(--warn);
  animation: pulse 0.8s infinite;
}

.pipeline li.pass .dot {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.pipeline li.pass {
  color: #d7ffe8;
}

.skip {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 5;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--gold);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.skip:hover {
  background: rgba(232, 200, 114, 0.08);
}

.stage {
  display: block;
  min-height: 100dvh;
  padding: 0;
}

.stage-hero {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 16px 72px;
}

.stage-kicker,
.stage-hint {
  position: absolute;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.stage-kicker {
  top: 24px;
}

.stage-hint {
  bottom: 18px;
}

.to-board {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.85;
  white-space: nowrap;
}

.to-board:hover,
.to-board.glow {
  opacity: 1;
}

.to-board.glow {
  animation: pulse 1.6s ease-in-out infinite;
}

.board {
  position: relative;
  z-index: 2;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 48px 18px 96px;
}

.board-head {
  max-width: 680px;
  margin: 0 auto 36px;
  text-align: center;
}

.board-kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.board-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, 7vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 18px;
}

.board-lead {
  font-family: var(--serif);
  font-size: clamp(17px, 3.4vw, 22px);
  line-height: 1.45;
  color: #d9d0c0;
}

.board-wall {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  align-items: start;
}

.pin {
  grid-column: span 2;
  background: linear-gradient(180deg, #1a1b24, #12131a);
  border: 1px solid rgba(232, 200, 114, 0.22);
  padding: 12px 12px 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  transform: rotate(var(--tilt, 0deg));
  animation: rise 0.9s var(--ease) both;
  animation-delay: var(--d, 0s);
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
}

.pin:nth-child(4),
.pin:nth-child(5) {
  grid-column: span 3;
}

.pin:hover {
  transform: rotate(0deg) translateY(-6px);
  box-shadow: 0 28px 50px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.pin-photo {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: #0a0b10;
  cursor: zoom-in;
  overflow: hidden;
}

.pin-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.04);
  transition: transform 0.6s var(--ease), filter 0.4s;
}

.pin:hover .pin-photo img {
  transform: scale(1.04);
  filter: saturate(1.05) contrast(1.06);
}

.pin figcaption {
  padding: 14px 4px 0;
}

.pin-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-2);
  margin-bottom: 6px;
}

.pin strong {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  font-weight: 600;
  color: #f4ead5;
  margin-bottom: 8px;
}

.pin p {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.45;
  color: #bdb3a4;
}

.board-note {
  margin: 42px auto 0;
  max-width: 640px;
  padding: 28px 26px;
  border-left: 2px solid var(--gold);
  background: rgba(20, 21, 29, 0.55);
}

.board-note p {
  font-family: var(--serif);
  font-size: clamp(18px, 3vw, 22px);
  line-height: 1.45;
  color: #e8dfd0;
}

.board-note footer {
  margin-top: 16px;
  font-family: var(--script);
  font-size: 34px;
  color: var(--gold);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(5, 5, 8, 0.92);
  display: grid;
  place-items: center;
  padding: 24px;
  gap: 14px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(920px, 92vw);
  max-height: 78vh;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.lightbox p {
  max-width: 640px;
  text-align: center;
  font-family: var(--serif);
  font-size: 16px;
  color: #d9d0c0;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 28px;
  cursor: pointer;
}

.scene-3d {
  perspective: 1600px;
  transform-style: preserve-3d;
}

.card {
  position: relative;
  width: min(430px, 92vw);
  height: min(640px, calc(100dvh - 96px));
  transform-style: preserve-3d;
  transform: rotateX(8deg) rotateY(-12deg);
  transition: transform 0.6s var(--ease);
  outline: none;
}

.card:hover,
.card:focus-visible {
  transform: rotateX(4deg) rotateY(-6deg) translateY(-6px);
}

.card.open {
  transform: rotateX(0deg) rotateY(0deg);
}

.page,
.cover {
  position: absolute;
  inset: 0;
  border-radius: 2px;
}

.page {
  background:
    radial-gradient(1200px 400px at 20% 0%, rgba(232, 200, 114, 0.08), transparent 50%),
    linear-gradient(180deg, #1a1b26 0%, #12131b 100%);
  border: 1px solid rgba(232, 200, 114, 0.28);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.page::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(232, 200, 114, 0.15);
  pointer-events: none;
}

.page-inner {
  position: relative;
  height: 100%;
  padding: 36px 34px 28px;
  display: flex;
  flex-direction: column;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.page-meta {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-2);
  flex-shrink: 0;
}

.page-hello {
  font-family: var(--serif);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(34px, 7vw, 58px);
  line-height: 0.92;
  margin: 14px 0 14px;
  color: #f7efe0;
  flex-shrink: 0;
}

.page-letter {
  font-family: var(--serif);
  font-size: clamp(14px, 3.6vw, 17px);
  line-height: 1.45;
  color: #d9d0c0;
  white-space: pre-wrap;
  flex: 1 1 auto;
  min-height: 9rem;
}

.sign {
  font-family: var(--script);
  font-size: clamp(32px, 8vw, 42px);
  color: var(--gold);
  margin-top: 10px;
  flex-shrink: 0;
}

.hash {
  font-size: 10px;
  color: #6e6878;
  letter-spacing: 0.08em;
  margin-top: 6px;
  flex-shrink: 0;
}

.cover {
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1.55s var(--ease);
}

.card.open .cover {
  transform: rotateY(-168deg);
  pointer-events: none;
}

.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border: 1px solid rgba(232, 200, 114, 0.4);
  box-shadow: var(--shadow);
}

.face.front {
  background:
    radial-gradient(800px 280px at 50% 0%, rgba(232, 200, 114, 0.16), transparent 55%),
    linear-gradient(165deg, #161821 0%, #0b0c12 70%);
}

.front-frame::before,
.front-frame::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(232, 200, 114, 0.55);
}

.front-frame::before {
  top: 8px;
  left: 8px;
  border-right: 0;
  border-bottom: 0;
}

.front-frame::after {
  right: 8px;
  bottom: 8px;
  border-left: 0;
  border-top: 0;
}

.face.back {
  transform: rotateY(180deg);
  background: repeating-linear-gradient(
      -18deg,
      #14151e 0 12px,
      #12131a 12px 24px
    );
  display: grid;
  place-content: center;
  text-align: center;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 11px;
  color: #8a8170;
  gap: 10px;
}

.face.back strong {
  font-family: var(--display);
  letter-spacing: 0.18em;
  color: var(--gold);
}

.front-frame {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(232, 200, 114, 0.28);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.front-tag {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.front-grade {
  margin-top: 36px;
  font-size: 12px;
  letter-spacing: 0.46em;
  color: var(--gold);
}

.front-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(40px, 8vw, 54px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin: 16px 0 12px;
}

.front-host {
  color: var(--muted);
  font-size: 11px;
}

.seal {
  margin-top: auto;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #3a120f;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.06em;
  background:
    radial-gradient(circle at 35% 30%, #e36a6a, #8a1f24 62%, #4c0d12);
  box-shadow:
    inset 0 0 0 6px rgba(90, 16, 18, 0.35),
    0 10px 20px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(180, 40, 40, 0.25);
  transform: rotate(-8deg);
  cursor: pointer;
}

.seal span {
  font-size: 22px;
}

.seal:active {
  transform: rotate(-8deg) scale(0.96);
}

.front-cta {
  margin-top: 18px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-2);
  animation: pulse 2s ease-in-out infinite;
}

.card.open .front-cta {
  display: none;
}

.shell {
  position: fixed;
  z-index: 20;
  left: 50%;
  top: 8vh;
  transform: translateX(-50%);
  width: min(720px, 92vw);
  background: #0b0c10;
  border: 1px solid rgba(139, 233, 253, 0.25);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.shell-bar {
  padding: 8px 12px;
  font-size: 11px;
  color: #7f9ea8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #101218;
}

.shell-body {
  min-height: 220px;
  max-height: 42vh;
  overflow: auto;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.55;
  color: #d4f1c7;
  white-space: pre-wrap;
}

.shell-input {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ps1::before {
  content: var(--ps1, "ваня@birthday");
  color: var(--cyan);
}

.ps1::after {
  content: ":~$";
  color: var(--gold);
}

.shell-input input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: #f4ead5;
  font-family: var(--mono);
  font-size: 13px;
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: rgba(12, 13, 20, 0.92);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold);
}

body.act-land #boot,
body.act-land #stage,
body.act-boot #land,
body.act-boot #stage,
body.act-card #land,
body.act-card #boot {
  display: none;
}

body.act-boot #boot,
body.act-card #stage {
  display: block;
}

body.act-card #stage {
  display: block;
}

@keyframes foil {
  to {
    background-position: 220% center;
  }
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes grain {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-1%, 1%);
  }
}

@media (max-width: 820px) {
  .boot-grid {
    grid-template-columns: 1fr;
  }
  .pipeline {
    display: none;
  }
  .land-frame {
    padding: 32px 22px;
  }
  .stage-hero {
    padding: 56px 12px 88px;
    align-items: start;
  }
  .card {
    width: min(430px, 94vw);
    height: calc(100dvh - 140px);
    max-height: 720px;
    transform: none;
  }
  .card:hover,
  .card:focus-visible,
  .card.open {
    transform: none;
  }
  .page-inner {
    padding: 24px 20px 20px;
  }
  .page-hello {
    font-size: 34px;
    margin: 10px 0 12px;
  }
  .page-letter {
    font-size: 15px;
    min-height: 11rem;
  }
  .sign {
    font-size: 34px;
  }
  .stage-hint {
    font-size: 10px;
    letter-spacing: 0.1em;
  }
  .to-board {
    bottom: 52px;
  }
  .board-wall {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .pin,
  .pin:nth-child(4),
  .pin:nth-child(5) {
    grid-column: auto;
    transform: none;
  }
  .pin:hover {
    transform: translateY(-4px);
  }
  .pin strong {
    font-size: 24px;
  }
  .board {
    padding: 28px 14px 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
