/* Wersja 3: motyw terminala. Ciemny jest domyślny, jasny to "papierowy" terminal. */
:root {
  --bg: #f4f1e8;
  --bg-2: #ece7da;
  --term: #fbf9f3;
  --bar: #e4dfd0;
  --text: #2b2f36;
  --muted: #6b6f78;
  --green: #1e7a3c;
  --blue: #2b2f36;
  --cyan: #6b6f78;
  --amber: #a15c00;
  --red: #c0392b;
  --border: #d6cfbd;
  --grid: rgba(43, 47, 54, .06);
  --glyph: rgba(30, 122, 60, .10);
  --glow: rgba(30, 122, 60, .0);
  --shadow: 0 1px 2px rgba(40, 35, 20, .08), 0 12px 32px rgba(40, 35, 20, .10);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07090c;
    --bg-2: #0b0f14;
    --term: #0d1217;
    --bar: #151b22;
    --text: #d3dbe4;
    --muted: #7d8a99;
    --green: #4ee07f;
    --blue: #f2f5f8;
    --cyan: #9aa8b8;
    --amber: #f0b44c;
    --red: #ff6b5e;
    --border: #1f2831;
    --grid: rgba(78, 224, 127, .045);
    --glyph: rgba(78, 224, 127, .09);
    --glow: rgba(78, 224, 127, .10);
    --shadow: 0 0 0 1px rgba(78, 224, 127, .06), 0 18px 48px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  --bg: #07090c;
  --bg-2: #0b0f14;
  --term: #0d1217;
  --bar: #151b22;
  --text: #d3dbe4;
  --muted: #7d8a99;
  --green: #4ee07f;
  --blue: #f2f5f8;
  --cyan: #9aa8b8;
  --amber: #f0b44c;
  --red: #ff6b5e;
  --border: #1f2831;
  --grid: rgba(78, 224, 127, .045);
  --glyph: rgba(78, 224, 127, .09);
  --glow: rgba(78, 224, 127, .10);
  --shadow: 0 0 0 1px rgba(78, 224, 127, .06), 0 18px 48px rgba(0, 0, 0, .55);
}

/* JetBrains Mono, licencja OFL (fonts/OFL.txt), hostowany lokalnie */
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/jbmono-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/jbmono-latin-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/jbmono-latin-ext-400.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/jbmono-latin-ext-700.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 "JetBrains Mono", ui-monospace, "SFMono-Regular", "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  position: relative;
}
/* Tło: kratka, poświata i rozsypane znaki heksadecymalne */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    radial-gradient(ellipse 60% 40% at 80% 0%, var(--glow), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
}
.glyphs {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  color: var(--glyph); font-size: 13px; line-height: 1.9; white-space: pre; user-select: none;
}
.glyphs span { position: absolute; }

a { color: var(--blue); }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
.g { color: var(--green); }
.b { color: var(--blue); }
.c { color: var(--cyan); }
.a { color: var(--amber); }
.m { color: var(--muted); }

/* Pasek górny jak linia statusu */
header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); }
header .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.logo { text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: .02em; }
.logo .g { font-weight: 700; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; font-size: 15px; }
nav a { color: var(--muted); text-decoration: none; }
nav a::before { content: "./"; color: var(--green); opacity: .7; }
.lang { color: var(--muted); }
.lang a::before { content: none; }
.lang [aria-current] { color: var(--green); font-weight: 700; }
nav a:hover, nav a[aria-current] { color: var(--text); }
.theme-toggle { background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); line-height: 0; padding: 6px; cursor: pointer; }
.theme-toggle:hover { color: var(--green); border-color: var(--green); }

/* Okno terminala */
.term { background: var(--term); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bar); border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.gr { background: #28c840; }
.term-bar .title { flex: 1; text-align: center; margin-right: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-body { padding: 22px 24px 26px; }
.line { margin: 0; }
.line + .line { margin-top: 2px; }
.out { margin: 4px 0 18px; }
.prompt { color: var(--green); font-weight: 700; }
.prompt .path { color: var(--blue); }
.cursor { display: inline-block; width: .6em; height: 1.1em; vertical-align: -.2em; background: var(--green); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Hero */
.hero { padding: 64px 0 40px; }
.hero h1 { font-size: 34px; line-height: 1.25; margin: 6px 0 10px; letter-spacing: -.01em; }
.hero .lead { color: var(--muted); max-width: 720px; margin: 0; }
.hero .reveal { opacity: 0; animation: reveal .01s forwards; }
.hero .reveal:nth-child(1) { animation-delay: .1s; }
.hero .reveal:nth-child(2) { animation-delay: .5s; }
.hero .reveal:nth-child(3) { animation-delay: .9s; }
.hero .reveal:nth-child(4) { animation-delay: 1.3s; }
.hero .reveal:nth-child(5) { animation-delay: 1.7s; }
.hero .reveal:nth-child(6) { animation-delay: 2.1s; }
.hero .reveal:nth-child(7) { animation-delay: 2.5s; }
.hero .reveal:nth-child(8) { animation-delay: 2.9s; }
@keyframes reveal { to { opacity: 1; } }
.stats { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.stats b { color: var(--green); font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-block; font: inherit; font-size: 15px; padding: 10px 18px; border-radius: 6px; text-decoration: none; border: 1px solid var(--green); }
.btn-primary { background: var(--green); color: var(--term); font-weight: 700; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { color: var(--green); }
.btn-ghost:hover { background: color-mix(in srgb, var(--green) 12%, transparent); }

/* Sekcje */
section { padding: 48px 0; }
.cmd { font-size: 15px; margin: 0 0 16px; }
h2 { font-size: 26px; margin: 0 0 22px; letter-spacing: -.01em; }
h2::before { content: "# "; color: var(--green); }

/* Usługi jako listing katalogu */
.ls { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.entry { background: var(--term); border: 1px solid var(--border); border-radius: 8px; padding: 18px 18px 20px; position: relative; transition: border-color .2s ease, transform .2s ease; }
.entry:hover { border-color: var(--green); transform: translateY(-2px); }
.perm { font-size: 12px; color: var(--muted); display: block; margin-bottom: 8px; }
.entry h3 { white-space: nowrap; font-size: 17px; margin: 0 0 8px; color: var(--blue); }
.entry h3::after { content: "/"; color: var(--muted); }
.entry p { margin: 0; color: var(--muted); font-size: 15px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--amber); border: 1px solid currentColor; border-radius: 4px; padding: 0 6px; margin-left: 6px; vertical-align: 2px; }

/* Kontakt i bezpieczeństwo */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.kv { margin: 0; }
.kv dt { color: var(--cyan); display: inline; }
.kv dd { display: inline; margin: 0; }
.kv dd::after { content: ""; display: block; margin-bottom: 4px; }
.kv dt::after { content: " =\00a0"; color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.comment { color: var(--muted); }
.sec-file { font: inherit; font-size: 14px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.sec-file .k { color: var(--cyan); }

/* Podstrona Bezpieczeństwo */
.doc h2 { font-size: 22px; margin-top: 8px; }
.doc ul { padding-left: 0; list-style: none; }
.doc li { padding-left: 22px; position: relative; margin: 4px 0; }
.doc li::before { content: ">"; position: absolute; left: 0; color: var(--green); }
.doc p { margin: 0 0 12px; }
.doc .term + .term { margin-top: 20px; }
.term-body .comment { margin: 0 0 10px; }

footer { border-top: 1px solid var(--border); padding: 22px 0 28px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

@media (max-width: 760px) {
  body { font-size: 15px; }
  .hero { padding: 36px 0 24px; }
  .hero h1 { font-size: 25px; }
  h2 { font-size: 22px; }
  .term-body { padding: 16px 16px 20px; }
  .two { grid-template-columns: 1fr; }
  .term-bar .title { margin-right: 0; }
  .glyphs { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero .reveal { opacity: 1; animation: none; }
  .cursor { animation: none; }
  .entry { transition: none; }
}


/* Kafel "praca w toku" */
.wip { border-style: dashed; }
.wip h3 { color: var(--muted); }
.wip h3::after { content: "/"; }
.tag-wip { color: var(--green); animation: blink 1.6s steps(1) infinite; }
.wip-log { font: inherit; font-size: 13px; line-height: 1.6; margin: 0; color: var(--muted); white-space: pre; text-overflow: ellipsis; overflow: hidden; height: 8em; }
.wip-log .ok { color: var(--green); }
.wip-log .warn { color: var(--amber); }
.wip-log .err { color: var(--red); }
@media (prefers-reduced-motion: reduce) { .tag-wip { animation: none; } }

.wip { cursor: pointer; }
.wip:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.denied { padding: 0; border: 0; background: none; max-width: 520px; width: calc(100% - 32px); color: var(--text); }
.denied::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); }
.denied .term { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 0 40px color-mix(in srgb, var(--red) 35%, transparent); }
.denied .err-line { color: var(--red); }
.denied-big { font-size: 28px; font-weight: 700; color: var(--red); letter-spacing: .08em; margin: 18px 0 10px; animation: glitch 2.4s steps(1) infinite; }
.denied form { margin-top: 20px; }
@keyframes glitch { 0%, 92%, 100% { transform: none; opacity: 1; } 93% { transform: translateX(-3px); opacity: .6; } 95% { transform: translateX(3px); } 97% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .denied-big { animation: none; } }
.denied .btn { background: transparent; color: var(--red); border: 1px solid var(--red); font: inherit; font-size: 15px; cursor: pointer; }
.denied .btn:hover { background: color-mix(in srgb, var(--red) 14%, transparent); }
.denied .btn:focus { outline: none; }
.denied .btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* Pasy "tail -f" między sekcjami */
.stream { height: 96px; overflow: hidden; position: relative; margin: -24px 0; pointer-events: none; user-select: none;
  mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent); -webkit-mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent); }
.stream-inner { font: inherit; font-size: 13px; line-height: 1.7; margin: 0; color: var(--muted); opacity: .35; white-space: pre; animation: stream 40s linear infinite; }
.stream-inner .d { color: var(--green); }
@keyframes stream { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) { .stream-inner { animation: none; } }
@media (max-width: 760px) { .stream { height: 72px; } .stream-inner { font-size: 12px; } }
.mt, .line.mt { margin-top: 14px; }

/* Ekran startowy: raz na sesję, tylko z JS; awaryjnie znika sam po 3 s */
html.intro body > *:not(.boot) { visibility: hidden; animation: intro-safety 0s 3s forwards; }
html.intro body { overflow: hidden; }
@keyframes intro-safety { to { visibility: visible; } }
.boot { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; cursor: pointer; transition: opacity .4s ease; }
.boot.done { opacity: 0; pointer-events: none; }
.boot-box { width: min(320px, calc(100% - 64px)); text-align: center; }
.boot-logo { font-size: 26px; font-weight: 700; margin-bottom: 28px; }
.boot-msg { font-size: 13px; color: var(--muted); height: 1.7em; margin-bottom: 10px; text-align: left; }
.boot-msg b { color: var(--green); font-weight: 700; }
.boot-bar { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 25%, transparent); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--text); transition: width .25s ease; }
.boot-skip { margin-top: 18px; font-size: 12px; color: var(--muted); opacity: .6; }
html.intro .hero .reveal { animation-play-state: paused; }
