*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --ink: #090907;
  --paper: #f5f0e8;
  --gold: #f0a030;
  --gold2: #ffc444;
  --muted: #6a6458;
  --dim: #32302a;
  --card: #111008;
  --card2: #1a1810;
  --border: rgba(255, 255, 255, 0.07);
  --border-gold: rgba(240, 160, 48, 0.28);
}

html {
  scroll-behavior: smooth;
}

/* ── BACKGROUND CANVAS ── */
#bgc {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* sits behind everything including the layer cards */
}

/* Ensure all layers sit above the canvas */
.layer {
  position: relative;
  z-index: 1;
}
nav {
  z-index: 500;
}

body {
  background: var(--ink);
  color: var(--paper);
  font-family: "Bricolage Grotesque", sans-serif;
  overflow-x: hidden;
  overflow-y: auto; /* <--- OPRAVENO: Původní 'clip' blokoval veškerý scroll */
}

/* grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");
  opacity: 0.55;
}

/* ──────────────────────────────
   LAYER SYSTEM
   Each layer stacks like a card
   sliding up over the previous.
────────────────────────────── */
.layer {
  position: sticky;
  top: 0;
  min-height: 100svh;
  overflow: hidden;
  /* Each layer clips its content and casts a top shadow onto the one below */
  box-shadow:
    0 -2px 0 0 rgba(255, 255, 255, 0.04),
    0 -40px 80px -20px rgba(0, 0, 0, 0.6);
}

/* Hero sits at z-index 1 — it's the base */
.layer-hero {
  z-index: 1;
  background: var(--ink);
  /* hero has no top radius — it's the very first */
}

/* Projects slides over hero */
.layer-projects {
  z-index: 2;
  background: #0f0e0b;
  border-radius: 20px 20px 0 0;
}

/* Contact slides over projects */
.layer-contact {
  z-index: 3;
  background: #141210;
  border-radius: 20px 20px 0 0;
}

/* Inner padding for non-hero layers */
.layer-inner {
  padding: clamp(56px, 8vw, 100px) clamp(20px, 5vw, 60px)
    clamp(60px, 8vw, 100px);
}

/* ──────────────────────────────
   NAV
────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  padding: 0 clamp(20px, 5vw, 60px);
  height: clamp(56px, 6vw, 68px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s;
}
nav.scrolled {
  background: rgba(9, 9, 7, 0.92);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-size: clamp(16px, 1.7vw, 19px);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--paper);
  text-decoration: none;
}
.nav-logo b {
  color: var(--gold);
  text-shadow: 0 0 22px rgba(240, 160, 48, 0.55);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(28px, 4vw, 52px);
}
.nav-links a {
  text-decoration: none;
  font-size: clamp(12px, 1.2vw, 14px);
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.03em;
  position: relative;
  padding-bottom: 3px;
  transition: color 0.2s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.nav-links a:hover,
.nav-links a.on {
  color: var(--paper);
}
.nav-links a.on::after {
  transform: scaleX(1);
}

/* ──────────────────────────────
   HERO LAYER
────────────────────────────── */
.layer-hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: clamp(60px, 8vw, 96px);
  padding-left: clamp(20px, 5vw, 60px);
  padding-right: clamp(20px, 5vw, 60px);
  padding-top: clamp(56px, 6vw, 68px);
}

/* Soft ambient blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
}
.blob-a {
  width: clamp(300px, 45vw, 620px);
  height: clamp(300px, 45vw, 620px);
  background: radial-gradient(
    circle,
    rgba(240, 160, 48, 0.11) 0%,
    transparent 70%
  );
  top: -15%;
  right: -8%;
  animation: blobFloat 11s ease-in-out infinite;
}
.blob-b {
  width: clamp(180px, 28vw, 380px);
  height: clamp(180px, 28vw, 380px);
  background: radial-gradient(
    circle,
    rgba(200, 110, 20, 0.08) 0%,
    transparent 70%
  );
  bottom: 8%;
  left: -6%;
  animation: blobFloat 14s ease-in-out infinite reverse;
}
.blob-c {
  width: clamp(120px, 18vw, 240px);
  height: clamp(120px, 18vw, 240px);
  background: radial-gradient(
    circle,
    rgba(255, 190, 60, 0.06) 0%,
    transparent 70%
  );
  top: 40%;
  left: 35%;
  animation: blobFloat 9s ease-in-out infinite 2s;
}
@keyframes blobFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(-2%, 4%) scale(1.08);
  }
  66% {
    transform: translate(3%, -2%) scale(0.95);
  }
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(16px, 2.5vw, 28px);
  opacity: 0;
  animation: fu 0.5s 0.1s forwards;
}
.hero-role {
  font-family: "DM Mono", monospace;
  font-size: clamp(10px, 1vw, 12px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}
.hero-sep {
  color: var(--dim);
}
.hero-loc {
  font-family: "DM Mono", monospace;
  font-size: clamp(10px, 1vw, 12px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.h-name {
  font-size: clamp(72px, 12.5vw, 176px);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.038em;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.h-name .ln {
  overflow: hidden;
  display: block;
}
.h-name .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(108%);
}
.h-name .ln:nth-child(1) .w {
  animation: su 0.95s 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.h-name .ln:nth-child(2) .w {
  animation: su 0.95s 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes su {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.h-desc {
  font-size: clamp(15px, 1.6vw, 20px);
  font-weight: 300;
  line-height: 1.65;
  color: #9a9080;
  max-width: min(500px, 100%);
  margin-bottom: clamp(32px, 4.5vw, 52px);
  opacity: 0;
  animation: fu 0.7s 0.5s forwards;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: clamp(13px, 1.3vw, 15px);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--gold);
  padding: clamp(13px, 1.6vw, 17px) clamp(24px, 3vw, 38px);
  border-radius: 100px;
  width: fit-content;
  box-shadow: 0 4px 28px rgba(240, 160, 48, 0.3);
  transition:
    background 0.2s,
    transform 0.18s,
    box-shadow 0.2s;
  opacity: 0;
  animation: fu 0.6s 0.75s forwards;
}
.hero-cta:hover {
  background: var(--gold2);
  transform: scale(1.04);
  box-shadow: 0 8px 40px rgba(240, 160, 48, 0.42);
}
.hero-cta svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  transition: transform 0.2s;
}
.hero-cta:hover svg {
  transform: translateX(4px);
}

@keyframes fu {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* scroll hint */
.scroll-hint {
  position: absolute;
  right: clamp(20px, 5vw, 60px);
  bottom: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fu 0.6s 0.9s forwards;
}
.scroll-hint span {
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  writing-mode: vertical-rl;
}
.sh-line {
  width: 1px;
  height: clamp(36px, 5vw, 56px);
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: shPulse 2.2s ease-in-out infinite;
}
@keyframes shPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scaleY(1);
  }
  50% {
    opacity: 1;
    transform: scaleY(0.7);
  }
}
@media (max-width: 480px) {
  .scroll-hint {
    display: none;
  }
}

/* ──────────────────────────────
   PROJECTS LAYER
────────────────────────────── */
.sec-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: clamp(32px, 5vw, 60px);
  flex-wrap: wrap;
  gap: 12px;
}
.sec-idx {
  font-family: "DM Mono", monospace;
  font-size: clamp(9px, 0.9vw, 11px);
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sec-ttl {
  font-size: clamp(36px, 5.5vw, 72px);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.proj-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.pl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 3vw, 40px);
  padding: clamp(20px, 3vw, 34px) clamp(16px, 2.5vw, 28px);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--paper);
  position: relative;
  transition: background 0.25s;
  cursor: pointer;
}
a.pl-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--gold2), var(--gold));
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
a.pl-item:hover::before {
  transform: scaleY(1);
}
a.pl-item:hover {
  background: rgba(240, 160, 48, 0.03);
}
.pl-wip {
  opacity: 0.32;
  cursor: default;
}

.pl-left {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 36px);
  min-width: 0;
}
.pl-num {
  font-family: "DM Mono", monospace;
  font-size: clamp(10px, 1vw, 13px);
  color: var(--gold);
  letter-spacing: 0.08em;
  flex-shrink: 0;
  opacity: 0.6;
}
.pl-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pl-live {
  font-family: "DM Mono", monospace;
  font-size: clamp(9px, 0.9vw, 11px);
  color: #5de88a;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pl-title {
  font-size: clamp(20px, 2.8vw, 38px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  white-space: nowrap;
}
.pl-tech {
  font-family: "DM Mono", monospace;
  font-size: clamp(9px, 0.9vw, 11px);
  color: var(--muted);
  letter-spacing: 0.06em;
}
.pl-right {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  flex-shrink: 0;
}
.pl-thumb {
  width: clamp(64px, 9vw, 130px);
  aspect-ratio: 3/2;
  border-radius: 8px;
  overflow: hidden;
  background: var(--card2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.pl-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
a.pl-item:hover .pl-thumb img {
  transform: scale(1.08);
}
.pl-arrow {
  font-size: clamp(18px, 2.2vw, 30px);
  color: var(--gold);
  line-height: 1;
  transition: transform 0.22s;
  opacity: 0.6;
}
a.pl-item:hover .pl-arrow {
  transform: translate(4px, -4px);
  opacity: 1;
}
.pl-wip-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "DM Mono", monospace;
  font-size: clamp(9px, 1vw, 11px);
  color: var(--muted);
  letter-spacing: 0.07em;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
}
.pl-wip-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: bk 1.8s ease-in-out infinite;
  flex-shrink: 0;
  font-style: normal;
  display: block;
}
@keyframes bk {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.15;
  }
}
@media (max-width: 540px) {
  .pl-thumb {
    display: none;
  }
  .pl-title {
    font-size: clamp(18px, 6vw, 26px);
    white-space: normal;
  }
}

/* ──────────────────────────────
   CONTACT LAYER
────────────────────────────── */
.ct-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 7vw, 110px);
  align-items: start;
}
@media (max-width: 680px) {
  .ct-grid {
    grid-template-columns: 1fr;
  }
}

.ct-ttl {
  font-size: clamp(38px, 6vw, 80px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-bottom: clamp(18px, 2.5vw, 26px);
}

.avail-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: "DM Mono", monospace;
  font-size: clamp(10px, 1vw, 12px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5de88a;
  background: rgba(93, 232, 138, 0.07);
  border: 1px solid rgba(93, 232, 138, 0.18);
  border-radius: 100px;
  padding: 7px 16px;
  margin-bottom: clamp(24px, 3.5vw, 40px);
  width: fit-content;
}
.avail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5de88a;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(93, 232, 138, 0.7);
  animation: bk 2.2s ease-in-out infinite;
}

.ct-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ct-lnk {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  padding: clamp(12px, 1.5vw, 15px) clamp(14px, 2vw, 20px);
  border: 1px solid var(--border);
  border-radius: clamp(8px, 1vw, 12px);
  background: var(--card);
  color: #9a9080;
  font-size: clamp(12px, 1.2vw, 14px);
  transition:
    border-color 0.2s,
    color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}
.ct-lnk:hover {
  border-color: var(--border-gold);
  color: var(--paper);
  transform: translateX(5px);
  box-shadow: 0 4px 20px rgba(240, 160, 48, 0.07);
}
.ct-ico {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(240, 160, 48, 0.1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ct-ico svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.8;
}

.ct-form {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.5vw, 16px);
}
.fg label {
  display: block;
  font-family: "DM Mono", monospace;
  font-size: clamp(9px, 1vw, 10px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 7px;
}
.fg input,
.fg textarea {
  width: 100%;
  background: var(--card2);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: clamp(8px, 1vw, 10px);
  padding: clamp(10px, 1.3vw, 13px) clamp(12px, 1.5vw, 16px);
  color: var(--paper);
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(13px, 1.2vw, 14px);
  outline: none;
  resize: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  -webkit-appearance: none;
}
.fg input:focus,
.fg textarea:focus {
  border-color: rgba(240, 160, 48, 0.55);
  box-shadow: 0 0 0 3px rgba(240, 160, 48, 0.07);
}
.fg textarea {
  min-height: clamp(100px, 12vw, 130px);
}

.btn-send {
  padding: clamp(13px, 1.5vw, 16px);
  background: var(--gold);
  color: var(--ink);
  border: none;
  border-radius: clamp(8px, 1vw, 10px);
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(13px, 1.2vw, 15px);
  font-weight: 700;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    background 0.2s,
    transform 0.15s,
    box-shadow 0.2s;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 4px 28px rgba(240, 160, 48, 0.28);
}
.btn-send:hover {
  background: var(--gold2);
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(240, 160, 48, 0.42);
}
.btn-send svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
}

.form-zprava {
  font-family: "DM Mono", monospace;
  font-size: clamp(11px, 1vw, 13px);
  letter-spacing: 0.03em;
  padding: 10px 14px;
  border-radius: 8px;
  display: none;
}
.form-zprava:not(:empty) {
  display: block;
}
.form-ok {
  background: rgba(93, 232, 138, 0.1);
  color: #5de88a;
  border: 1px solid rgba(93, 232, 138, 0.2);
}
.form-err {
  background: rgba(220, 70, 70, 0.1);
  color: #e07878;
  border: 1px solid rgba(220, 70, 70, 0.2);
}

/* ──────────────────────────────
   FOOTER (inside contact layer)
────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: clamp(18px, 3vw, 26px) clamp(20px, 5vw, 60px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: clamp(48px, 7vw, 80px);
}
footer p {
  font-family: "DM Mono", monospace;
  font-size: clamp(9px, 1vw, 11px);
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ──────────────────────────────
   REVEAL
────────────────────────────── */
.r {
  opacity: 0;
  transform: translateY(18px);
}
.r.v {
  transition:
    opacity 0.65s ease,
    transform 0.65s ease;
  opacity: 1;
  transform: none;
}


/* ──────────────────────────────
   ABOUT LAYER
────────────────────────────── */
.layer-about {
  z-index: 2;
  background: #100f0c;
  border-radius: 20px 20px 0 0;
}

/* push projects and contact z-index up by 1 */
.layer-projects { z-index: 3; }
.layer-contact  { z-index: 4; }

/* about grid */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 90px);
  align-items: start;
}
@media (max-width: 700px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* Na počítačích a tabletech posuneme celý obsah hero sekce doprava */
@media (min-width: 769px) {
  .hero-inner {
    padding-left: 10%; /* Hodnotu si můžeš upravit (např. na 5vw nebo konkrétní px) podle toho, jak moc doprava to chceš */
  }
}
.about-bio {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vw, 20px);
}
.about-bio p {
  font-size: clamp(14px, 1.45vw, 17px);
  font-weight: 300;
  line-height: 1.75;
  color: #9a9080;
}
.about-bio strong {
  color: var(--paper);
  font-weight: 600;
}

/* cards */
.about-cards {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.4vw, 14px);
}
.about-card {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: clamp(10px, 1.2vw, 14px);
  padding: clamp(18px, 2.2vw, 28px);
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px 16px;
  align-items: start;
  transition: border-color .22s, background .22s;
}
.about-card:hover {
  border-color: rgba(240,160,48,.28);
  background: rgba(240,160,48,.03);
}
.about-card-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(240,160,48,.1);
  display: flex; align-items: center; justify-content: center;
  grid-row: 1 / 3;
}
.about-card-icon svg {
  width: 16px; height: 16px;
  fill: none; stroke: var(--gold); stroke-width: 1.8;
}
.about-card h3 {
  font-size: clamp(14px, 1.4vw, 16px);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--paper);
  margin: 0;
  align-self: end;
}
.about-card p {
  font-size: clamp(12px, 1.1vw, 13px);
  font-weight: 300;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}