/* x.ok7.cz - Portfolio Blog (ATARI-ish), extracted & adapted from ok7.cz */

@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

:root{
  --floppy-color: #004d9d;
  --external-background: #401040;
  --screen-background: #00597E;
  --text-main: #53b6db;
  --text-soft: #aae8ff;
  --hover: rgba(83,182,219,0.18);
  --shadow: #170317;
  --black: #000000;
}

*{ box-sizing: border-box; }
html, body{ height:100%; }
body{
  margin:0;
  background: var(--external-background);
  color:#fff;
  font-family: "Press Start 2P", system-ui, sans-serif;
}

a{ color: inherit; }

.layout{
  min-height: 100vh;
  display:flex;
}

/* Sidebar */
.sidebar{
  width: 5vw;
  min-width: 72px;
  max-width: 110px;
  background: rgba(0,0,0,0.25);
  border-right: 6px solid #000;
  display:flex;
  flex-direction: column;
  align-items:center;
  padding: 14px 8px;
  gap: 14px;
  position: sticky;
  top:0;
  height:100vh;
  overflow:hidden;
}

.brand{
  display:flex;
  align-items:center;
  gap: 8px;
  justify-content:center;
  flex-direction: column;
  margin-bottom: 6px;
}
.brand .brand-text{
  font-size: 10px;
  color: var(--text-soft);
  text-shadow: 0 .12em 0 #000;
  letter-spacing: .5px;
}

.brand-icon{
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  display:block;
}
.brand-icon--sm{
  width: 22px;
  height: 22px;
}
.brand-link{
  text-decoration:none;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
}
.brand-link--stack{
  flex-direction: column;
  gap: 6px;
}
.brand-link--inline{
  flex-direction: row;
  gap: 8px;
}

/* Floppy icon (CSS build, from ok7.cz, scaled) */

/* Brain icon (8-bit-ish, SVG pixels) */
.brain{
  width: 58px;
  height: 58px;
  display:flex;
  align-items:center;
  justify-content:center;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.35));
  user-select:none;
}
.brain-svg{
  width: 58px;
  height: 58px;
}
.brain-fill{ fill: var(--text-soft); }
.brain-outline{ fill: rgba(0,0,0,0.45); }
.brain-fold{ fill: rgba(0,0,0,0.22); }

.brand a.brand-link{
  text-decoration:none;
  display:flex;
  flex-direction: column;
  align-items:center;
  gap: 8px;
}

.floppy{
  width: 44px;
  height: 48px;
  position: relative;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.35));
  cursor: pointer;
  user-select:none;
}
.floppy .arrow{
  position:absolute;
  top:-18px;
  left: 14px;
  font-size: 16px;
  color:#fff;
  text-shadow: 0 .15em 0 #000;
  opacity:.85;
}
.floppy .top{
  width: 100%;
  height: 32px;
  background: var(--floppy-color);
  border: 4px solid #000;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  position: relative;
}
.floppy .top .slider{
  width: 22px;
  height: 12px;
  background: rgba(255,255,255,.15);
  border: 3px solid #000;
  border-radius: 4px;
  position:absolute;
  top: 8px;
  left: 8px;
}
.floppy .top .carrier{
  width: 12px;
  height: 16px;
  background: rgba(0,0,0,.35);
  border: 3px solid #000;
  position:absolute;
  top: 6px;
  right: 8px;
}
.floppy .down{
  width: 100%;
  height: 16px;
  background: var(--floppy-color);
  border: 4px solid #000;
  border-radius: 0 0 10px 10px;
  position: relative;
}
.floppy .down .notes{
  position:absolute;
  left: 6px;
  right: 6px;
  top: 3px;
  height: 10px;
  background: rgba(255,255,255,.82);
  border: 2px solid #000;
  border-radius: 3px;
}

/* Menu items */
.nav{
  display:flex;
  flex-direction: column;
  gap: 10px;
  width:100%;
}

.nav{
  display:flex;
  flex-direction: column;
  gap: 10px;
  width:100%;
  flex: 1;
  overflow-y: auto;
}

.nav-bottom{
  margin-top: auto;
  width: 100%;
}

.admin-entry{
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  width: 100%;
  border-radius: 12px;
  padding: 10px 8px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,0.25);
  border: 2px solid rgba(0,0,0,0.40);
  color: var(--text-soft);
  text-shadow: 0 .12em 0 #000;
  font-size: 10px;
  letter-spacing: .5px;
}
.admin-entry:hover{
  background: rgba(0, 89, 126, 0.20);
}
.nav a, .nav button{
  all: unset;
  box-sizing: border-box;
  cursor:pointer;
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  padding: 10px 8px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 6px;
  border: 3px solid transparent;
  background: rgba(0,0,0,0.12);
}
.nav a:hover, .nav button:hover{
  background: rgba(0,0,0,0.22);
}
.nav .active{
  border-color: rgba(255,255,255,0.65);
  background: rgba(0,0,0,0.22);
}
.nav img{
  display:block;
  width: 26px;
  height: 26px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Content */
.content{
  flex:1;
  display:flex;
  justify-content: center;
  padding: 22px 14px 60px;
}

.crt-wrap{
  width: 82%;
  max-width: 1400px;
  min-width: 320px;
}

.crt{
  background: var(--screen-background);
  border-top: 15px solid #000;
  border-bottom: 15px solid #000;
  border-left: 8px solid #000;
  border-right: 8px solid #000;
  border-radius: 29px;
  padding: 22px 16px;
  min-height: 780px;
  height: min(92vh, 1080px);
  overflow: hidden;
  position: relative;
  box-shadow: 0 18px 0 rgba(0,0,0,.28);
  display:flex;
}

/* Scanlines */
.crt::before{
  content:"";
  pointer-events:none;
  position:absolute;
  inset:0;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0.16),
      rgba(0,0,0,0.16) 1px,
      rgba(0,0,0,0.0) 3px,
      rgba(0,0,0,0.0) 5px
    );
  mix-blend-mode: multiply;
  opacity: .35;
}

.screen{
  position: relative;
  z-index: 1;
  color: var(--text-main);
  text-shadow: 0 .12em 0 #000;
  font-size: 14px;
  line-height: 1.42;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  white-space: pre-wrap;
}

/* Intro */
.intro-title{
  color: var(--text-soft);
  text-align: center;
}
.ascii{
  white-space: pre;
  font-size: clamp(12px, 1.65vw, 24px);
  line-height: 1.02;
  color: var(--text-soft);
  text-shadow: 0 .12em 0 #000;
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}
.name{
  margin-top: 16px;
  text-align: center;
  color: #fff;
  font-size: clamp(16px, 2.3vw, 24px);
  line-height: 1.05;
  letter-spacing: .08em;
  text-shadow:
    0 .12em 0 #000,
    0 0 10px rgba(140,210,255,.35),
    0 0 18px rgba(140,210,255,.18);
}
.hint{
  margin-top: clamp(16px, 2.6vh, 28px);
  text-align: center;
}

.blink{
  display:inline-block;
  animation: blink 1.05s infinite;
}
.inverse{
  background: var(--text-soft);
  color: #123;
  padding: 6px 10px;
  border-radius: 6px;
}
.center{
  display:flex;
  flex-direction: column;
  align-items:center;
  gap: 10px;
  padding-top: 22px;
}

@keyframes blink { 50%{ opacity: 0; } }

.list-item{
  display:block;
  padding: 10px 10px;
  border-radius: 10px;
  cursor:pointer;
}
.list-item:hover{
  background: var(--hover);
}
.small{
  font-size: 11px;
  color: rgba(255,255,255,.85);
}
.hr{
  height: 1px;
  background: rgba(0,0,0,0.35);
  margin: 10px 0;
}

/* Markdown render (v detailu článku) */
.md{
  white-space: normal;
}
.md p{
  margin: 0 0 12px;
}
.md h1,.md h2,.md h3,.md h4,.md h5,.md h6{
  margin: 14px 0 10px;
  color: var(--text-soft);
}
.md ul,.md ol{
  margin: 10px 0 12px 22px;
  padding: 0;
}
.md li{ margin: 6px 0; }
.md code{
  background: rgba(0,0,0,0.25);
  border: 2px solid rgba(0,0,0,0.35);
  padding: 2px 6px;
  border-radius: 8px;
}
.md pre{
  background: rgba(0,0,0,0.25);
  border: 3px solid rgba(0,0,0,0.35);
  padding: 12px;
  border-radius: 12px;
  overflow:auto;
  white-space: pre;
}
.md blockquote{
  margin: 12px 0;
  padding: 8px 12px;
  border-left: 6px solid rgba(0,0,0,0.45);
  background: rgba(0,0,0,0.18);
  border-radius: 10px;
}
.md a{ text-decoration: underline; }

.pager{
  display:flex;
  gap: 10px;
  justify-content: center;
  padding: 12px 0 0;
}
.pager button{
  all: unset;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.25);
  border: 3px solid rgba(0,0,0,0.45);
  color: #fff;
  text-shadow: 0 .12em 0 #000;
}
.pager button:disabled{
  opacity: .5;
  cursor: default;
}

.topbar-mobile{
  display:none;
}

.copyright{
  position: fixed;
  bottom: 0px;
  right: 0px;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.5);
  font-family: "Press Start 2P";
  font-size: 8px;
  color: white;
  text-shadow: 0 .1em 0 #000;
  border-radius: 10px 0 0 0;
  z-index: 50;
}


/* Admin: trochu těsnější sazba */
.admin .screen{
  line-height: 1.22;
  font-size: 13px;
}
.admin .hr{
  margin: 6px 0;
}

@media (max-width: 780px){
  .ascii{ font-size: clamp(11px, 2.9vw, 16px); }
  .name{ font-size: clamp(12px, 3.2vw, 15px); }
  .hint{ margin-top: clamp(14px, 2.4vh, 22px); }

  .sidebar{
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-110%);
    transition: transform .25s ease;
    z-index: 40;
  }
  .sidebar.open{ transform: translateX(0); }
  .content{ padding-top: 64px; padding-bottom: 78px; }
  .topbar-mobile{
    display:flex;
    position: fixed;
    top:0;
    left:0;
    right:0;
    height: 56px;
    z-index: 45;
    align-items:center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.35);
    border-bottom: 6px solid #000;
    backdrop-filter: blur(6px);
  }
  .burger{
    all: unset;
    cursor:pointer;
    padding: 10px;
    border-radius: 10px;
    background: rgba(0,0,0,0.25);
    border: 3px solid rgba(0,0,0,0.45);
  }
  .crt-wrap{ width: 100%; }
  .crt{ height: calc(100svh - 112px); min-height: 0; padding: 16px 10px; }
  .screen{ font-size: 12px; line-height: 1.34; }
  .center{ padding-top: 10px; gap: 8px; }
  .ascii{ font-size: clamp(8px, 2.7vw, 12px); }
}
