/* ============================================================
   gutek.dev — style.css · GutekOS
   Paleta: "serwerownia się pali, a my spokojnie" —
   chłodny grafitowo-morski UI + koralowy ogień
   ============================================================ */

:root {
  --bg:      #10171A;  /* tło / pulpit pod tapetą */
  --panel:   #17222A;  /* okna */
  --panel-2: #0F1920;  /* wnętrza, inputy, terminale */
  --line:    #2B3B45;
  --accent:  #FF7A59;  /* koral — ogień */
  --accent-dim: #C05A42;
  --mint:    #6BD5C9;  /* linki, drugi akcent */
  --green:   #7FD962;
  --red:     #F0716F;
  --amberish:#FFB454;  /* dodatkowy ciepły (ledy, ogień doom) */
  --text:    #A7B8BE;
  --bright:  #EDF6F5;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow: hidden; /* pulpit: bez scrolla strony, scroll żyje w oknach */
}

code {
  font-family: var(--mono); font-size: .88em;
  color: var(--accent); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 5px; padding: .1em .4em;
}
a { color: var(--mint); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(255,122,89,.3); color: var(--bright); }

/* ============================================================
   PULPIT
   ============================================================ */
#desktop { position: fixed; inset: 0; }

#wallpaper {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block;
}
.wp-caption {
  font-family: var(--mono); font-weight: 600; font-size: 34px;
  fill: var(--accent); letter-spacing: .12em;
}
.wp-caption-sub {
  font-family: var(--mono); font-size: 13px; fill: #6E5560; letter-spacing: .05em;
}

/* ledy w rackach */
.led { fill: var(--green); }
.led.l1 { animation: led-blink 2.1s steps(1) infinite; }
.led.l2 { animation: led-blink 1.4s steps(1) .4s infinite; }
.led.l3 { fill: var(--amberish); animation: led-blink 1.1s steps(1) .2s infinite; }
.led.l4 { fill: var(--red); animation: led-panic .5s steps(1) infinite; }
@keyframes led-blink { 50% { opacity: .25; } }
@keyframes led-panic { 50% { opacity: .1; } }

/* płomienie i dym */
.flame { transform-origin: 50% 100%; transform-box: fill-box; }
.flame.f1 { animation: flame-flick 1.1s ease-in-out infinite alternate; }
.flame.f2 { animation: flame-flick 0.9s ease-in-out .3s infinite alternate; }
.flame.f3 { animation: flame-flick 1.3s ease-in-out .6s infinite alternate; }
@keyframes flame-flick {
  from { transform: scaleY(1) skewX(0deg); }
  to   { transform: scaleY(1.14) skewX(-3deg); }
}
.smoke { transform-box: fill-box; transform-origin: center; }
.smoke.s1 { animation: smoke-rise 5s ease-in-out infinite; }
.smoke.s2 { animation: smoke-rise 6.5s ease-in-out 1s infinite; }
.smoke.s3 { animation: smoke-rise 5.8s ease-in-out 2s infinite; }
@keyframes smoke-rise {
  0% { transform: translateY(0) scale(1); opacity: .5; }
  100% { transform: translateY(-46px) scale(1.5); opacity: 0; }
}

/* ---------------- ikony pulpitu ---------------- */
.icons {
  position: absolute; top: 1.2rem; left: 1.2rem; z-index: 5;
  display: grid; gap: .5rem; width: 108px;
}
.icon {
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: .6rem .3rem .5rem; cursor: pointer;
  display: grid; justify-items: center; gap: .3rem;
  color: var(--bright); font: inherit;
}
.icon:hover { background: rgba(23,34,42,.75); border-color: var(--line); }
.icon:active { transform: scale(.97); }
.icon-glyph {
  font-size: 1.7rem; line-height: 1; font-family: var(--mono);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.6));
}
.icon-label {
  font-family: var(--mono); font-size: .72rem; text-align: center;
  color: var(--bright); text-shadow: 0 1px 4px rgba(0,0,0,.9);
  word-break: break-all;
}

/* ---------------- okna ---------------- */
.window {
  position: absolute; z-index: 10;
  min-width: 300px; max-width: min(720px, calc(100vw - 2rem));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  display: flex; flex-direction: column;
  animation: win-in .16s ease both;
}
@keyframes win-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.window.focused { border-color: var(--accent-dim); }

.win-bar {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .75rem;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: grab; user-select: none;
}
.window.dragging .win-bar { cursor: grabbing; }
.win-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.win-title {
  font-family: var(--mono); font-size: .82rem; color: var(--bright);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.win-close {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); font-family: var(--mono); font-size: .72rem;
  padding: .15rem .5rem; cursor: pointer; flex-shrink: 0;
}
.win-close:hover { color: var(--bright); border-color: var(--accent); }

.win-body {
  padding: 1.1rem 1.2rem; overflow-y: auto;
  max-height: min(62vh, 560px);
}

/* ---------------- pasek zadań ---------------- */
.taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: .7rem;
  padding: .4rem .8rem;
  background: rgba(10,16,20,.92); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: .78rem;
}
.tb-start { color: var(--accent); font-weight: 600; flex-shrink: 0; }
.tb-tasks { display: flex; gap: .4rem; flex: 1; overflow-x: auto; }
.tb-task {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); font: inherit; font-size: .74rem;
  padding: .22rem .6rem; cursor: pointer; white-space: nowrap;
}
.tb-task.active { color: var(--bright); border-color: var(--accent-dim); }
.tb-clock { color: var(--text); flex-shrink: 0; }

/* ============================================================
   TREŚCI OKIEN
   ============================================================ */
.doc p { margin: 0 0 .9rem; font-size: .93rem; }

.fact-strip {
  list-style: none; margin: .4rem 0 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: .6rem;
}
.fact-strip li {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: .7rem .85rem; display: grid; gap: .1rem;
}
.fact-strip strong { color: var(--accent); font-family: var(--mono); font-size: .82rem; font-weight: 600; }
.fact-strip span { font-size: .8rem; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.timeline > li {
  background: var(--panel-2); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 1rem 1.1rem;
}
.tl-meta { display: flex; gap: .8rem; align-items: center; margin-bottom: .25rem; }
.tl-date { font-family: var(--mono); font-size: .76rem; color: var(--accent-dim); }
.timeline h3 { margin: 0 0 .4rem; color: var(--bright); font-size: .98rem; }
.tl-org { color: var(--text); font-weight: 400; font-size: .88em; }
.timeline p { margin: 0 0 .6rem; font-size: .88rem; }
.tl-tags { list-style: none; margin: 0; padding: 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.tl-tags li {
  font-family: var(--mono); font-size: .68rem; color: var(--mint);
  border: 1px solid rgba(107,213,201,.35); border-radius: 5px; padding: .04rem .45rem;
}
.pill {
  display: inline-block; font-family: var(--mono); font-size: .68rem;
  padding: .06rem .5rem; border-radius: 99px; border: 1px solid var(--line);
}
.pill-ok { color: var(--green); border-color: rgba(127,217,98,.4); }

.stack-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.stack-card {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: .85rem 1rem;
}
.stack-card h3 {
  margin: 0 0 .5rem; font-family: var(--mono); font-size: .82rem;
  color: var(--accent); font-weight: 600;
}
.stack-card ul { margin: 0; padding-left: 1rem; font-size: .82rem; display: grid; gap: .2rem; }

.contact-card { font-family: var(--mono); font-size: .9rem; display: grid; gap: .45rem; }
.contact-card p { margin: 0; }
.c-label { color: var(--accent-dim); display: inline-block; min-width: 6.5em; }
.contact-note { margin-top: .5rem !important; font-size: .76rem; color: var(--text); }

/* kafelki playground */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.tile {
  text-align: left; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: .9rem 1rem .8rem;
  display: grid; gap: .3rem; align-content: start;
  color: var(--text); font: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.tile:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.tile-icon { font-size: 1.3rem; color: var(--accent); font-family: var(--mono); line-height: 1; }
.tile-name { font-family: var(--mono); font-weight: 600; color: var(--bright); font-size: .88rem; }
.tile-desc { font-size: .78rem; }
.tile-tag {
  justify-self: start; margin-top: .2rem;
  font-family: var(--mono); font-size: .66rem; color: var(--mint);
  border: 1px solid rgba(107,213,201,.35); border-radius: 5px; padding: .04rem .45rem;
}

/* ---------------- terminal (w oknie) ---------------- */
.terminal-body {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: .8rem .9rem; height: 300px; overflow-y: auto;
  font-family: var(--mono); font-size: .82rem; line-height: 1.55; cursor: text;
}
.terminal-body .line { white-space: pre-wrap; word-break: break-word; }
.out-cmd { color: var(--bright); }
.out-accent { color: var(--accent); }
.out-ok { color: var(--green); }
.out-err { color: var(--red); }
.out-link { color: var(--mint); }
.term-input-line { display: flex; gap: .5rem; align-items: baseline; }
.term-prompt { color: var(--green); flex-shrink: 0; }
.term-input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: var(--bright); font: inherit; caret-color: var(--accent);
}

/* ---------------- elementy wspólne dem ---------------- */
.demo-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: .8rem; }
.demo-input, .demo-select {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px;
  color: var(--bright); font-family: var(--mono); font-size: .86rem;
  padding: .45rem .65rem; min-width: 0;
}
.demo-input { flex: 1; }
.demo-btn {
  background: var(--accent); color: #23100a; border: none; border-radius: 7px;
  font-family: var(--mono); font-weight: 600; font-size: .82rem;
  padding: .5rem .9rem; cursor: pointer;
}
.demo-btn:hover { background: #ff8f73; }
.demo-btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.demo-btn.ghost:hover { color: var(--bright); border-color: var(--accent-dim); }
.demo-out {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px;
  padding: .8rem .95rem; font-family: var(--mono); font-size: .82rem;
  white-space: pre-wrap; word-break: break-word; line-height: 1.6;
}
.demo-out .ok { color: var(--green); }
.demo-out .err { color: var(--red); }
.demo-out .acc { color: var(--accent); }
.demo-note { font-size: .74rem; color: var(--accent-dim); font-family: var(--mono); margin-top: .6rem; }

.demo-canvas {
  width: 100%; border: 1px solid var(--line); border-radius: 7px;
  background: var(--panel-2); display: block; touch-action: none;
}

.log-view {
  height: 280px; overflow-y: auto;
  background: #0B1218; border: 1px solid var(--line); border-radius: 7px;
  padding: .6rem .8rem; font-family: var(--mono); font-size: .74rem; line-height: 1.55;
}
.log-line { white-space: pre-wrap; word-break: break-word; }
.lv-INFO { color: var(--text); } .lv-WARN { color: var(--amberish); }
.lv-ERROR { color: var(--red); } .lv-DEBUG { color: #52697A; }

.entropy-bar {
  height: 9px; border-radius: 99px; background: var(--panel-2);
  border: 1px solid var(--line); overflow: hidden; flex: 1; min-width: 140px;
}
.entropy-fill { height: 100%; width: 0%; background: var(--red); transition: width .25s, background .25s; }

/* ============================================================
   INTRO (DOOM fire + scenka + wejście przez monitor)
   ============================================================ */
body.intro-lock #desktop { filter: brightness(.6); }

#intro {
  position: fixed; inset: 0; z-index: 999;
  background: var(--bg);
  transition: opacity .5s ease .4s, transform .95s cubic-bezier(.55, 0, .85, .35);
  will-change: transform, opacity;
}
#intro.intro-zoom { transform: scale(18); opacity: 0; pointer-events: none; }

#intro-fire {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 40vh;
  image-rendering: pixelated; image-rendering: crisp-edges;
}

.intro-inner {
  position: relative; z-index: 2;
  max-width: 680px; margin: 0 auto;
  padding: 7vh 1.25rem 0;
  font-family: var(--mono);
}
.intro-logo {
  margin: 0 0 1.6rem;
  color: var(--accent);
  font-size: clamp(.4rem, 1.7vw, .78rem); line-height: 1.15;
  text-shadow: 0 0 18px rgba(255,122,89,.45);
  animation: intro-logo-in .7s ease both;
}
.intro-dev { color: var(--mint); }
@keyframes intro-logo-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.intro-scene-wrap { margin: 0 0 1.2rem; max-width: 440px; }
#intro-scene {
  width: 100%; display: block; cursor: pointer;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.intro-caption { font-size: .84rem; color: var(--bright); min-height: 1.6em; margin-top: .4rem; }
.intro-caption.enter-hint { color: var(--accent); animation: hint-pulse 1.2s ease-in-out infinite; }
@keyframes hint-pulse { 50% { opacity: .55; } }

.intro-boot { font-size: .78rem; line-height: 1.55; min-height: 8.5em; }
.intro-line { color: var(--text); animation: intro-line-in .12s steps(2) both; white-space: pre-wrap; }
.intro-line:last-child { color: var(--bright); }
.intro-ok { color: var(--green); }
@keyframes intro-line-in { from { opacity: 0; } to { opacity: 1; } }

.intro-skip {
  position: absolute; top: 1rem; right: 1.25rem; z-index: 3;
  font-size: .68rem; color: var(--accent-dim);
  animation: hint-pulse 1.6s steps(1) infinite;
}

/* ============================================================
   RESPONSYWNOŚĆ
   ============================================================ */
@media (max-width: 700px) {
  .icons { width: 92px; }
  .icon-glyph { font-size: 1.4rem; }
  .window {
    inset: 10px 10px 54px 10px !important;
    width: auto !important; max-width: none;
  }
  .win-body { max-height: none; flex: 1; }
  .tiles, .stack-grid, .fact-strip { grid-template-columns: 1fr; }
  .wp-caption { font-size: 44px; }
  .tb-start { display: none; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .led, .flame, .smoke, .intro-caption.enter-hint, .intro-skip { animation: none !important; }
  .window { animation: none; }
  .tile { transition: none; }
  .tile:hover { transform: none; }
  #intro { transition: opacity .2s ease; }
  #intro.intro-zoom { transform: none; }
}
