/* ============================================================
   lokoz.com — style.css
   Paleta: Natura i Głębia Mazur
   ============================================================ */

:root {
  /* Główne kolory marki */
  --forest-deep:  #1D352B;   /* Deep Forest Green — tło, akcenty */

  /* Tła i przestrzeń */
  --bg-ash:       #E7E1D8;   /* Sun-Bleached Ash — główne tło strony */

  /* Akcenty */
  --accent:       #CDB596;   /* Golden Sunrise Sand — kluczowe wyróżnienia, CTA */

  /* Tekst */
  --ink:          #0F1512;   /* Obsidian Black — tekst główny */

  --white:        #ffffff;

  /* Zieleń terminala (spójność hero z programem) */
  --t-green: #8ef79a;
  --t-mint:  #d8ffdd;
  --t-blue:  #79c0ff;

  --maxw: 1140px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --font: 'Inter', Verdana, Arial, 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-ash);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--t-green);
  outline-offset: 4px;
}

/* ============================================================
   NAGŁÓWEK
   ============================================================ */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: linear-gradient(to bottom, rgba(29,53,43,.6), rgba(29,53,43,0));
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: Verdana, Arial, sans-serif;
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.5px;
  color: var(--white);
  line-height: 1;
}
.logo-dot { color: var(--t-green); }

/* ============================================================
   HERO
   ============================================================ */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;          /* iOS Safari: dynamiczne jednostki */
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  background-color: var(--forest-deep);
  background-image:
    linear-gradient(180deg, rgba(29,53,43,.10) 0%, rgba(29,53,43,.28) 100%),
    url('img/background.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(5,15,10,.8) 0%,
    rgba(6,16,11,.5) 45%,
    rgba(8,18,13,.18) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: 96px;
  padding-bottom: 96px;
  max-width: 760px;
}

.hero-kicker {
  display: inline-block;
  margin: 0 0 18px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--t-green);
  text-shadow: 0 0 10px rgba(142,247,154,.45);
}

.hero-title {
  margin: 0 0 22px;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--t-mint);
  text-shadow: 0 2px 24px rgba(4,11,8,.75), 0 0 20px rgba(142,247,154,.25);
}

.hero-lead {
  margin: 0 0 36px;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: rgba(190,228,196,.92);
  max-width: 60%;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ============================================================
   PRZYCISK
   ============================================================ */

.btn {
  display: inline-block;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  transition: transform .15s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--t-green);
  color: #03210a;
  box-shadow: 0 8px 24px rgba(142,247,154,.3);
}
.btn-primary:hover {
  background: #a9ffb4;
  box-shadow: 0 10px 30px rgba(142,247,154,.45);
}

/* ============================================================
   RESPONSYWNOŚĆ
   ============================================================ */

@media (max-width: 768px) {
  .hero-lead { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ============================================================
   TERMINAL PEŁNOEKRANOWY (po kliknięciu „Poznajmy się”)
   ============================================================ */

.terminal-screen {
  --t-green: #8ef79a;
  --t-dim:   #5f8c69;
  --t-blue:  #79c0ff;
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 120% at 50% 0%, #060d0a 0%, #030504 70%, #010202 100%);
  color: var(--t-green);
  font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, 'Menlo', 'Consolas', monospace;
  font-size: clamp(1rem, 1.1vw + .6rem, 1.18rem);
  line-height: 1.55;
  text-shadow: 0 0 6px rgba(142,247,154,.35);
  /* stan ukryty */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform-origin: center center;
}
.terminal-screen.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: crtPowerOn .42s var(--ease) both;
}
.terminal-screen.is-off {
  animation: crtPowerOff .28s var(--ease) both;
}

@keyframes crtPowerOn {
  0%   { clip-path: inset(50% 0 50% 0); filter: brightness(3.2); }
  50%  { clip-path: inset(49.4% 0 49.4% 0); filter: brightness(3.2); }
  78%  { clip-path: inset(0 0 0 0);         filter: brightness(2); }
  100% { clip-path: inset(0 0 0 0);         filter: brightness(1); }
}
@keyframes crtPowerOff {
  0%   { clip-path: inset(0 0 0 0);         filter: brightness(1); }
  35%  { clip-path: inset(0 0 0 0);         filter: brightness(2.4); }
  100% { clip-path: inset(50% 0 50% 0); filter: brightness(3.2); }
}

/* Linie skanowania CRT */
.terminal-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,.18) 3px,
    rgba(0,0,0,.18) 4px
  );
  opacity: .6;
  z-index: 2;
}

.terminal-screen-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  padding: clamp(16px, 4vw, 40px);
  width: 100%;
}


@media (prefers-reduced-motion: reduce) {
  .terminal-screen.is-on,
  .terminal-screen.is-off { animation: none; }
  .terminal-screen.is-off { opacity: 0; visibility: hidden; }
}

/* ============================================================
   PROGRAM TUI w terminalu (menu sekcji)
   ============================================================ */

.term-app { margin-top: 6px; }

.tui {
  border: 1px solid rgba(142,247,154,.45);
  border-radius: 4px;
  padding: 0;
  max-width: 760px;
  box-shadow: 0 0 24px rgba(142,247,154,.08), inset 0 0 40px rgba(142,247,154,.03);
}

.tui-title {
  padding: 6px 14px;
  border-bottom: 1px solid rgba(142,247,154,.28);
  color: #d8ffdd;
  font-weight: 700;
  letter-spacing: .5px;
  background: rgba(142,247,154,.06);
}
.tui-subtitle {
  padding: 8px 14px 4px;
  color: var(--t-dim);
}

.tui-list { padding: 6px 0 8px; }

.tui-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4px 14px;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-shadow: inherit;
  text-align: left;
  cursor: pointer;
  white-space: normal;
}
.tui-item .marker { flex: 0 0 1.2em; color: var(--t-green); opacity: 0; }
.tui-item .label  { color: var(--t-green); }
.tui-item .hint   { flex: 0 0 auto; margin-left: auto; color: var(--t-dim); padding-left: 18px; }

.tui-item.active {
  background: var(--t-green);
  text-shadow: none;
}
.tui-item.active .marker { opacity: 1; color: #03210a; }
.tui-item.active .label  { color: #03210a; font-weight: 700; }
.tui-item.active .hint   { color: #1c5026; }

.tui-foot {
  padding: 6px 14px;
  border-top: 1px solid rgba(142,247,154,.28);
  color: var(--t-dim);
}
.tui-foot b { color: var(--t-green); font-weight: 700; }

/* Widok szczegółów sekcji */
.tui-detail {
  --t-dim: #91b69a;
  max-width: 820px;
}
.tui-detail .tui-body {
  padding: 24px 28px 28px;
  line-height: 1.75;
  text-shadow: 0 0 4px rgba(142,247,154,.22);
}
.tui-detail .tui-body:focus-visible { outline: none; }
.tui-detail h3 {
  margin: 0 0 8px;
  color: #d8ffdd;
  font-size: 1.05em;
  line-height: 1.5;
}
.tui-detail p { margin: 0 0 1.15em; color: var(--t-green); }
.tui-detail .muted { color: var(--t-dim); }
.tui-detail ul { margin: 0 0 1.4em; padding-left: 0; list-style: none; }
.tui-detail li { position: relative; margin: 0 0 1em; padding-left: 1.4em; }
.tui-detail li::before { content: "›"; position: absolute; left: 0; color: var(--t-green); }
.tui-detail .cat { display: block; margin-bottom: .2em; color: #d8ffdd; font-weight: 700; }
.tui-detail strong, .tui-detail b { color: #d8ffdd; font-weight: 700; }
.tui-detail a { color: var(--t-blue); text-decoration: underline; text-underline-offset: .2em; }
.tui-detail .experience-entry {
  margin-top: 1.6em;
  padding-top: 1.4em;
  border-top: 1px dashed rgba(142,247,154,.28);
}
.tui-detail .entry-meta { margin-bottom: 1em; color: var(--t-dim); font-size: .88em; }
.tui-detail .tui-body > :last-child,
.tui-detail .experience-entry > :last-child,
.tui-detail li:last-child { margin-bottom: 0; }

/* Animacja ładowania (między ekranami programu) */
.tui-loading {
  padding: 14px 4px;
  color: var(--t-green);
  white-space: pre;
}
.tui-loading .ld { color: #d8ffdd; }
.tui-loading .pct { color: var(--t-dim); }

/* Terminal na telefonie — większa czytelność */
@media (max-width: 600px) {
  .terminal-screen { font-size: 1.04rem; line-height: 1.62; }
  .terminal-screen-inner { padding: 18px 14px 32px; }
  .terminal-screen-inner:has(.tui-menu) {
    --menu-bottom-gap: max(12px, env(safe-area-inset-bottom));
    padding-bottom: var(--menu-bottom-gap);
  }
  .tui-menu {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 24px - var(--menu-bottom-gap));
    min-height: calc(100dvh - 24px - var(--menu-bottom-gap)); /* odstęp nad i pod ramką */
  }
  .tui-menu .tui-foot {
    margin-top: auto;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
  .tui, .tui-detail { max-width: 100%; }
  .tui-title { font-size: 1rem; }
  .tui-item { padding: 9px 13px; }      /* wygodniejszy cel dotykowy */
  .tui-item .hint { padding-left: 4px; }
  .tui-detail .tui-body { padding: 20px 16px 24px; }
  .tui-loading { font-size: .95rem; white-space: normal; word-break: break-word; }
}

/* Wyśrodkowanie programu na komputerze */
@media (min-width: 601px) {
  .terminal-screen-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .term-app { margin: auto 0; width: 100%; }
  .tui, .tui-loading { margin-left: auto; margin-right: auto; }
}

/* Linie bootowania (pierwsze uruchomienie) + wyrównanie paska ładowania */
.boot-line { display: block; min-height: 1.5em; color: var(--t-green); }
.boot-line.dim { color: var(--t-dim); }
.boot-line .tag-ok { color: #d8ffdd; }

.tui-loading { text-align: center; }                 /* przejściowy pasek — wyśrodkowany */

/* Delikatnie prześwitujące zdjęcie w tle terminala */
.terminal-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('img/background.webp') center / cover no-repeat;
  opacity: .10;
  filter: brightness(1.3) saturate(1.05);
  pointer-events: none;
  z-index: 0;
}

/* Pionowy kadr zachowuje laptop, wędkę i jezioro na telefonach. */
@media (max-width: 600px) and (orientation: portrait) {
  .hero-media {
    background-image:
      linear-gradient(180deg, rgba(29,53,43,.10) 0%, rgba(29,53,43,.28) 100%),
      url('img/background-mobile.webp');
  }
  .terminal-screen::before { background-image: url('img/background-mobile.webp'); }
}

/* Ekran ładowania systemu — wyśrodkowany blok (log + pasek) */
.boot-wrap {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  text-align: left;
}

/* Obsługa klawiatury i powrotu bez zmiany klasycznego wyglądu CRT. */
.tui-detail .tui-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
.tui-detail .tui-title h2 { flex: 1 1 240px; min-width: 0; margin: 0; font-size: 1.05em; line-height: 1.5; overflow-wrap: anywhere; }
.term-back {
  border: 1px solid #65896d;
  border-radius: 3px;
  background: transparent;
  color: var(--t-green);
  font: inherit;
  padding: 6px 12px;
  cursor: pointer;
}
.term-back:hover { color: #03210a; background: var(--t-green); }
.tui-item:focus-visible { outline-offset: -3px; outline-color: var(--t-mint); }
.tui-item.active:focus-visible { outline-color: #03210a; }
.tui-body { overflow-wrap: anywhere; }

/* Formularz kontaktowy w stylu terminala */
.tform { margin-top: 24px; padding-top: 24px; border-top: 1px solid #344b3b; width: 100%; }
.tform-row { display: flex; gap: 10px; margin-bottom: 12px; align-items: baseline; }
.tform-row--area { align-items: flex-start; }
.tform label {
  color: var(--t-blue);
  white-space: pre;
  flex: 0 0 auto;
}
.tinput {
  flex: 1;
  min-width: 0;
  background: rgba(126,231,135,.05);
  border: 1px solid rgba(126,231,135,.22);
  border-radius: 3px;
  padding: 10px 12px;
  color: var(--t-green);
  font: inherit;
  caret-color: var(--t-green);
  outline: none;
}
.tinput::placeholder { color: var(--t-dim); opacity: 1; }
.tinput:focus { border-color: var(--t-green); box-shadow: 0 0 0 1px rgba(126,231,135,.35); }
.tinput:disabled { opacity: .6; }
.tarea { resize: vertical; min-height: 80px; line-height: 1.5; }

.tform-actions { display: flex; align-items: center; gap: 14px; margin-top: 4px; flex-wrap: wrap; }
.tsend {
  background: var(--t-green);
  color: #03210a;
  border: 0;
  border-radius: 3px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 8px 18px;
  cursor: pointer;
  text-shadow: none;
  transition: background .15s ease, box-shadow .15s ease;
}
.tsend:hover:not(:disabled) { background: #a9ffb4; box-shadow: 0 0 16px rgba(126,231,135,.4); }
.tsend:disabled { opacity: .55; cursor: default; }

.tform-status { min-height: 1.4em; }
.tform-note { font-size: .85em; }
.contact-links { margin-top: 20px; text-align: right; }
.tform-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.cf-warn { color: #ffd479; }
.cf-dim  { color: var(--t-dim); }
.cf-ok   { color: #d8ffdd; }

@media (max-width: 600px) {
  .tform-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .tinput { width: 100%; }
}

/* Treść dla wyszukiwarek / czytników ekranu — ukryta wizualnie, obecna w DOM */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   MENU SEKCJI NA STRONIE GŁÓWNEJ + widok treści w hero
   ============================================================ */


/* Widok treści sekcji (podmienia powitanie) */
.hero-view {
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  width: calc(100% - 48px);
  max-width: 800px;
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  margin: 96px auto 24px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(142,247,154,.22);
  border-radius: 16px;
  background: rgba(7,21,15,.96);
  box-shadow: 0 24px 80px rgba(0,0,0,.4);
  backdrop-filter: blur(16px);
}
.hero-view.is-active { display: grid; animation: heroFade .3s var(--ease) both; }
@keyframes heroFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.hero-view-header {
  padding: 24px 32px 22px;
  border-bottom: 1px solid rgba(142,247,154,.18);
}

.hero-back {
  background: none;
  border: 1px solid rgba(126,231,135,.5);
  border-radius: 999px;
  color: var(--t-green);
  font: inherit;
  font-weight: 600;
  padding: 8px 16px;
  min-height: 44px;
  font-size: .9rem;
  margin-bottom: 16px;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.hero-back:hover { background: var(--t-green); color: #03210a; }

.hero-view-title {
  margin: 0;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  color: var(--t-mint);
  line-height: 1.2;
}
.hero-view-body {
  min-height: 0;
  overflow-y: auto;
  padding: 28px 32px 32px;
  color: #e3eee5;
  font-size: 1.0625rem;
  line-height: 1.8;
}

/* Hierarchia treści poza terminalem. */
.hero-view-body {
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #65896d #102319;
  scrollbar-gutter: stable;
}
.hero-view-body:focus-visible { outline-offset: -3px; }
.hero-view-body p { margin: 0 0 1.2em; }
.hero-view-body .muted { color: #b1c4b7; }
.hero-view-body strong { color: var(--t-mint); }
.hero-view-body a {
  color: var(--t-blue);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.hero-view-body ul { list-style: none; margin: 0 0 24px; padding: 0; }
.hero-view-body li {
  margin: 0;
  padding: 16px 0 16px 20px;
  position: relative;
  border-bottom: 1px solid rgba(142,247,154,.12);
}
.hero-view-body li:first-child { padding-top: 0; }
.hero-view-body li:last-child { border-bottom: 0; padding-bottom: 0; }
.hero-view-body li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--t-green);
}
.hero-view-body .cat {
  display: block;
  margin-bottom: 4px;
  color: var(--t-mint);
  font-weight: 700;
}
.hero-view-body h3 {
  margin: 0 0 8px;
  color: var(--t-mint);
  font-size: 1.2em;
  line-height: 1.4;
}
.hero-view-body .experience-entry {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid rgba(142,247,154,.22);
}
.hero-view-body .entry-meta {
  margin-bottom: 18px;
  color: #b1c4b7;
  font-size: .9em;
  line-height: 1.6;
}
.hero-view-body > :last-child,
.hero-view-body .experience-entry > :last-child { margin-bottom: 0; }

@media (max-width: 600px) {
  .hero-view {
    width: calc(100% - 24px);
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
    margin: 84px auto 12px;
    border-radius: 12px;
  }
  .hero-view-header { padding: 16px 20px 18px; }
  .hero-back { margin-bottom: 12px; }
  .hero-view-body { padding: 22px 20px; font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-view.is-active { animation: none; }
}
