@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&display=swap');

:root {
  --bg:     #0c0b09;
  --border: #1c1408;
  --dim:    #352405;
  --mute:   #8a6820;
  --text:   #d09030;
  --fg:     #eca838;
  --bright: #f8bc40;
  --accent: #ffce48;
  --live:   #62d47e;
  --warn:   #e09a40;
  --link:   #78a8d8;
  --link-h: #98c4f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ─── BACK BUTTON ─── */
#back-btn {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 99999;
  color: var(--mute);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  padding: 0.35em 0.75em;
  border: 1px solid var(--dim);
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  pointer-events: auto;
  background: rgba(12,11,9,0.85);
  backdrop-filter: blur(2px);
}
#back-btn::before { content: '['; color: var(--amber-d); margin-right: 0.2em; }
#back-btn::after  { content: ']'; color: var(--amber-d); margin-left: 0.2em; }
#back-btn:hover {
  color: var(--amber);
  border-color: var(--amber-d);
  background: rgba(200,169,110,0.06);
  cursor: none;
}

/* ─── MICRO MAGNIFIER ─── */
body {
  cursor: none;
}

#crt-cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(236, 168, 56, 0.15);
  box-shadow: 0 0 20px rgba(236, 168, 56, 0.3);
  transform: translate(-50%, -50%);
  transition: transform 0.05s linear, opacity 0.15s linear;
  opacity: 0;
  z-index: 10001;
  filter: blur(6px);
}



/* Скрываем все кроме boot */
#slides,
#website-grid,
#crt-vignette {
  display: none;
}

/* CRT мир (custom cursors) */
#slides { cursor: var(--cur-default), auto; }
#slides a, #slides button, #slides [role="button"] { cursor: var(--cur-pointer), pointer; }

html, body {
  overflow: hidden;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-shadow: 0 0 8px rgba(200,138,48,0.12);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px;
  pointer-events: none;
  z-index: 9999;
}

/* ─── WEBSITE WIREFRAME GRID OVERLAY ─── */
#website-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  display: flex;
  flex-direction: column;
  opacity: 0.06;
}

#website-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  border-left: 1px solid rgba(255,255,255,0.5);
  border-right: 1px solid rgba(255,255,255,0.5);
}

.wg-header {
  height: 12vh;
  border-bottom: 1px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  padding: 0 5vw;
  gap: 3vw;
}

.wg-header::before {
  content: '';
  width: 120px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.5);
  flex-shrink: 0;
}

.wg-header::after {
  content: '';
  flex: 1;
  height: 1px;
  border-bottom: 1px solid rgba(255,255,255,0.5);
}

.wg-main {
  flex: 1;
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.5);
}

.wg-sidebar {
  width: 18vw;
  border-right: 1px solid rgba(255,255,255,0.5);
  display: flex;
  flex-direction: column;
  gap: 2vh;
  padding: 3vh 2vw;
}

.wg-sidebar::before,
.wg-sidebar::after {
  content: '';
  height: 20px;
  border: 1px solid rgba(255,255,255,0.3);
}

.wg-content {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3vw;
  padding: 4vh 4vw;
}

.wg-card {
  border: 1px solid rgba(255,255,255,0.3);
  height: 200px;
  display: flex;
  flex-direction: column;
  gap: 1.5vh;
  padding: 2vh;
}

.wg-card::before {
  content: '';
  height: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.3);
}

.wg-card::after {
  content: '';
  flex: 1;
  border: 1px solid rgba(255,255,255,0.2);
}

.wg-footer {
  height: 10vh;
  border-top: 1px solid rgba(255,255,255,0.5);
  display: flex;
  gap: 4vw;
  padding: 2vh 5vw;
  align-items: flex-start;
}

.wg-footer::before,
.wg-footer::after {
  content: '';
  flex: 1;
  height: 60%;
  border: 1px solid rgba(255,255,255,0.3);
}

/* ─── CRT VIGNETTE ─── */
#crt-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.65) 100%);
}

/* ─── CRT SCANLINES (multiply blend — модифицируют цвет под ними) ─── */
@keyframes scanlines-drift {
  0%   { background-position: 0 0;    opacity: 1;    }
  25%  { background-position: 0 1px;  opacity: 0.96; }
  50%  { background-position: 0 -1px; opacity: 0.98; }
  75%  { background-position: 0 2px;  opacity: 0.95; }
  100% { background-position: 0 0;    opacity: 1;    }
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: multiply;
  background-image: repeating-linear-gradient(
    to bottom,
    #ffffff 0px,
    #ffffff 1px,
    #c89840 1px,
    #c89840 9px
  );
  background-size: 100% 10px;
  animation: scanlines-drift 0.12s steps(1) infinite;
}

::selection { background: var(--accent); color: var(--bg); }
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--dim); }

/* ─── SLIDES ─── */
#slides {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
}

.slide {
  height: 100vh;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-content {
  max-width: 820px;
  width: 100%;
  padding: 0 36px;
}

/* ─── HERO SLIDE ─── */
#terrain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hud-label {
  position: absolute;
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 1px;
  pointer-events: none;
  user-select: none;
  font-feature-settings: 'tnum';
  z-index: 1;
  white-space: nowrap;
}

#bottomBars {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52px;
  display: flex;
  align-items: flex-end;
  gap: 1px;
  pointer-events: none;
  z-index: 1;
}

.bar { flex: 1; background: var(--dim); min-height: 2px; }

.hint {
  position: absolute;
  bottom: 60px;
  left: 36px;
  font-size: 12px;
  color: var(--mute);
  letter-spacing: 2px;
  animation: fi 1s ease 1.4s both, pulse 2.5s ease 2s infinite;
  user-select: none;
  z-index: 2;
  transition: opacity 0.4s;
}

/* ─── SESSION / LOGO / TAGLINE ─── */
.session {
  font-size: 14px;
  color: var(--mute);
  margin-bottom: 36px;
}
.session em { color: var(--mute); font-style: normal; }

#logo { display: block; user-select: none; }

.tagline {
  margin-top: 24px;
  font-size: 14px;
  color: var(--mute);
  letter-spacing: 3px;
}
.tagline span { color: var(--mute); margin: 0 8px; }

/* ─── CRT POWER ON / OFF ─── */
@keyframes crt-on {
  0%   { clip-path: inset(49.5% 0 49.5% 0); }
  100% { clip-path: inset(0% 0 0% 0); }
}
@keyframes crt-off {
  0%   { clip-path: inset(0% 0 0% 0); }
  100% { clip-path: inset(49.5% 0 49.5% 0); }
}

#slides.crt-on  { animation: crt-on  0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
#slides.crt-off { animation: crt-off 0.4s  cubic-bezier(0.55, 0,    1,    0.45) forwards; }

/* ─── ANIMATIONS ─── */
@keyframes pulse { 0%,100% { opacity: .4; } 50% { opacity: .9; } }
@keyframes fi    { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes monitor-on {
  0% {
    opacity: 0;
    transform: scale(0) translateZ(0);
    clip-path: circle(0% at 50% 50%);
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
    transform: scale(1) translateZ(0);
    clip-path: circle(100% at 50% 50%);
  }
}

/* ─── PROMPT / OUTPUT ─── */
.prompt {
  font-size: 15px;
  color: var(--text);
  display: flex;
  gap: 6px;
  align-items: baseline;
  user-select: none;
  margin-bottom: 12px;
}
.prompt .path  { color: var(--mute); }
.prompt .cmd   { color: var(--text); }
.prompt .ibeam { color: var(--fg); visibility: hidden; }
.prompt .ibeam.on {
  visibility: visible;
  animation: blink 0.7s step-end infinite;
}

.output       { display: none; }
.output.show  { display: block; }

.line         { opacity: 0; }
.line.in      { opacity: 1; }

/* ─── SPARKLINE ─── */
.spark {
  display: inline-block;
  vertical-align: middle;
  margin-left: 5px;
  opacity: 0.5;
}

/* ─── ABOUT ─── */
.bio { max-width: 640px; font-size: 16px; color: var(--text); }
.bio strong { color: var(--bright); font-weight: 500; }

/* ─── SKILLS ─── */
.skill-list { display: flex; flex-direction: column; gap: 5px; }
.skill-row  { display: flex; font-size: 15px; }
.sk { color: var(--mute); width: 72px; flex-shrink: 0; font-size: 13px; padding-top: 2px; }
.sv { display: flex; flex-wrap: wrap; gap: 0 18px; color: var(--mute); }
.sv span { transition: color 0.1s; }
.sv span:hover { color: var(--fg); }
.sv .hi       { color: var(--fg); }
.sv .hi:hover { color: var(--accent); }

/* ─── PROJECTS ─── */
.ls-header {
  display: grid;
  grid-template-columns: 90px 36px 180px 1fr 72px 72px;
  gap: 0 14px;
  font-size: 12px;
  color: var(--mute);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.ls-row {
  display: grid;
  grid-template-columns: 90px 36px 180px 1fr 72px 72px;
  gap: 0 14px;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
  transition: background 0.1s;
}
.ls-row:last-child  { border-bottom: none; }
.ls-row:hover       { background: rgba(200,138,48,0.03); }
.ls-perms { color: var(--mute); font-size: 12px; letter-spacing: -0.5px; }
.ls-size  { color: var(--mute); font-size: 12px; text-align: right; }
.ls-name  { color: var(--fg); font-weight: 500; }
.ls-name.dir::after { content: '/'; color: var(--mute); font-weight: 400; }
.ls-desc  { color: var(--mute); font-size: 13px; }
.ls-tech  { color: var(--mute); font-size: 12px; }
.ls-stat  { font-size: 12px; white-space: nowrap; }
.ls-stat.live { color: var(--live); }
.ls-stat.wip  { color: var(--warn); }
.ls-stat.done { color: var(--mute); }

/* ─── CONTACT ─── */
.ct-list { display: flex; flex-direction: column; gap: 4px; }
.ct-row  { display: flex; gap: 16px; font-size: 15px; }
.ct-k    { color: var(--mute); width: 90px; flex-shrink: 0; font-size: 13px; }
.ct-v    { color: var(--text); }
.ct-v a  {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.1s, border-color 0.1s;
}
.ct-v a:hover { color: var(--link-h); border-bottom-color: var(--link-h); }

/* ─── FOOTER ─── */
.term-end {
  margin-top: 32px;
  font-size: 15px;
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 4px;
}
.caret {
  display: inline-block;
  width: 9px;
  height: 16px;
  background: var(--fg);
  vertical-align: -3px;
  animation: blink 1.1s step-end infinite;
}

/* ─── SLIDE POSITION INDICATOR ─── */
#slide-pos {
  position: fixed;
  bottom: 20px;
  right: 24px;
  font-size: 11px;
  color: var(--text);
  letter-spacing: 2px;
  font-family: 'JetBrains Mono', monospace;
  z-index: 100;
  pointer-events: none;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  #slides { transition: none; }
  .caret, .ibeam.on { animation: none; }
}

/* ─── MOBILE ─── */
@media (max-width: 600px) {
  .slide-content { padding: 0 16px; }
  .hint { left: 16px; }
  .ls-header { display: none; }
  .ls-row {
    grid-template-columns: 10px 1fr auto;
    grid-template-rows: auto auto;
    gap: 2px 8px;
  }
  .ls-perms, .ls-size, .ls-tech { display: none; }
  .ls-name { grid-column: 2; grid-row: 1; }
  .ls-desc { grid-column: 2/4; grid-row: 2; font-size: 10px; }
  .ls-stat { grid-column: 3; grid-row: 1; }
  .ct-k    { width: 64px; color: var(--mute); }
}
