/* ═══════════════════════════════════════════
   VARIABLES & RESET
═══════════════════════════════════════════ */
:root {
  --red:       #b50000;
  --red-dark:  #7a0000;
  --red-deep:  #3d0000;
  --white:     #ffffff;
  --grid-line: rgba(255, 255, 255, 0.18);
  --cell:      120px;
  --font-display: 'Explora', cursive;
  --font-body:    'Poiret One', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--red);
  color: var(--white);
  font-family: var(--font-body);
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════
   SHARED GRID BACKGROUND
═══════════════════════════════════════════ */
.hero-grid-bg,
.section-grid-bg,
.footer-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════════
   INTRO — LEILA (sneaky)
═══════════════════════════════════════════ */
#intro {
  position: fixed;
  inset: 0;
  background: var(--red);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.1s ease 0.1s;
}

#intro.done { opacity: 0; }
#intro.gone { display: none; }

#grid-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#leila-svg {
  position: relative;
  z-index: 2;
  width: min(80vw, 800px);
  height: auto;
  overflow: visible;
  /* subtle — low opacity so it doesn't scream */
  opacity: 0.1;
}

.leila-letter {
  fill: none;
  stroke: var(--white);
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

/* ═══════════════════════════════════════════
   HERO
═══════════════════════════════════════════ */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--red);
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 6rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem;
}

.hero-name { display: flex; flex-direction: column; gap: 0.2em; }

.name-norak,
.name-ericsok {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1;
  color: var(--white);
  letter-spacing: 0.02em;
}

.name-norak   { font-size: clamp(5rem, 14vw, 14rem); }
.name-ericsok { font-size: clamp(4rem, 11vw, 11rem); }

.hero-sub {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.8rem);
  color: rgba(255,255,255,0.85);
  margin-top: 0.5em;
  font-style: italic;
  line-height: 1.5;
}

/* Logo replacing old dragon */
.hero-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-logo svg {
  width: clamp(140px, 22vw, 280px);
  height: auto;
  opacity: 0.82;
}

/* ═══════════════════════════════════════════
   PROJEKTY
═══════════════════════════════════════════ */
#projekty {
  position: relative;
  min-height: 100vh;
  background: var(--red);
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.projekty-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 6rem);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 400;
  color: var(--white);
  margin-bottom: 0.3em;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding-bottom: 0.1em;
  display: inline-block;
}

.projekty-nav {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, var(--cell));
  width: 100%;
  margin-top: 2rem;
}

.proj-link {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--white);
  text-decoration: none;
  display: flex;
  align-items: flex-end;
  padding: 0.15em 0.2em;
  line-height: 1;
  position: relative;
  transition: color 0.25s, text-shadow 0.25s;
}

.proj-link::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 1px solid transparent;
  transition: border-color 0.25s;
  pointer-events: none;
}


.proj-link:hover         { color: rgba(160, 0, 0, 0.475); text-shadow: 0 0 20px }

.proj-link.size-xl { font-size: clamp(2.5rem, 5vw, 5rem); }
.proj-link.size-lg { font-size: clamp(2rem,  4vw, 4rem);  }
.proj-link.size-md { font-size: clamp(1.5rem, 3vw, 3rem); }
.proj-link.size-sm { font-size: clamp(1.1rem, 2vw, 2rem); }

.cell-tl { grid-column: 4 / 7; grid-row: 1 / 2; align-items: flex-start; justify-content: flex-end; }
.cell-ml { grid-column: 1 / 4; grid-row: 2 / 3; align-items: center; }
.cell-mr { grid-column: 4 / 7; grid-row: 2 / 3; align-items: center; justify-content: center; }
.cell-bl { grid-column: 3 / 7; grid-row: 3 / 5; align-items: flex-end; }
.cell-br { grid-column: 1 / 3; grid-row: 4 / 5; align-items: flex-end; }
/* new links */
.cell-ml2 { grid-column: 1 / 4; grid-row: 5 / 6; align-items: center; }
.cell-tr2 { grid-column: 4 / 7; grid-row: 5 / 7; align-items: flex-end; justify-content: flex-end; }

/* ═══════════════════════════════════════════
   ODŮVODNĚNÍ PRÁCE
═══════════════════════════════════════════ */
#oduvodneni {
  position: relative;
  background: var(--red);
  overflow: hidden;
  min-height: 80vh;
}

.oduvodneni-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 6rem);
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.od-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  font-weight: 400;
  color: var(--white);
  line-height: 1.1;
}

/* ── Scattered grid for items ── */
.od-grid {
  display: grid;
  /* 12 narrow columns so we can offset items freely */
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto auto;
  gap: 0;
  align-items: start;
}

/* "grid" item — sits left-of-center, top row */
.od-item--grid {
  grid-column: 1 / 6;
  grid-row: 1;
  border-top: 1px solid var(--grid-line);
  border-bottom: 1px solid var(--grid-line);
}

/* "Zvláštní rozcestník" — sits right side, pushed down by ~1 row height */
.od-item--rozcestnik {
  grid-column: 7 / 13;
  grid-row: 1;
  margin-top: clamp(3rem, 8vw, 8rem); /* the "offset" that makes them feel scattered */
  border-top: 1px solid var(--grid-line);
  border-bottom: 1px solid var(--grid-line);
}

/* shared trigger */
.od-trigger {
  width: 100%;
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 3rem);
  text-align: left;
  gap: 1rem;
  transition: color 0.2s;
}

.od-trigger:hover { color: rgba(255,255,255,0.75); }

.od-icon {
  font-family: var(--font-body);
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform 0.3s;
  line-height: 1;
}

.od-trigger[aria-expanded="true"] .od-icon { transform: rotate(45deg); }

.od-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1), padding-bottom 0.4s;
  padding-bottom: 0;
}

.od-panel:not([hidden]) {
  max-height: 500px;
  padding-bottom: 1.4rem;
}

.od-panel[hidden] { display: block !important; }

.od-panel p {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  line-height: 1.8;
  color: rgba(255,255,255,0.85);
}

/* ═══════════════════════════════════════════
   FOOTER — full width, anchored to page bottom
═══════════════════════════════════════════ */
#site-footer {
  position: relative;
  width: 100%;
  background: linear-gradient(to bottom, var(--red-dark) 0%, var(--red-deep) 100%);
  overflow: hidden;
  /* makes footer fill remaining vertical space if page is short,
     and always occupies at least a solid chunk */
  min-height: 30vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  padding: 4rem 2rem;
}

.footer-name,
.footer-year,
.footer-rights {
  font-family: var(--font-display);
  color: rgba(255,255,255,0.9);
}

.footer-name   { font-size: clamp(1.6rem, 3.5vw, 3rem); }
.footer-year   { font-size: clamp(1.4rem, 3vw,   2.5rem); }
.footer-rights { font-size: clamp(1rem,   2vw,   1.6rem); color: rgba(255,255,255,0.65); }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --cell: 80px; }

  .hero-content {
    grid-template-columns: 1fr;
    padding: 3rem 1.5rem;
    padding-top: 5rem;
  }

  .hero-logo { order: -1; }
  .hero-logo svg { width: 120px; }

  /* projekty stacked */
  .projekty-nav {
    display: flex;
    flex-direction: column;
  }

  .proj-link {
    font-size: clamp(1.8rem, 8vw, 2.5rem) !important;
    padding: 0.6em 0;
    border-bottom: 1px solid var(--grid-line);
  }
  .projekty-nav .proj-link:first-child { border-top: 1px solid var(--grid-line); }
  .cell-tl,.cell-ml,.cell-mr,.cell-bl,.cell-br {
    grid-column: unset; grid-row: unset;
    justify-content: flex-start; align-items: center;
  }

  /* od-items stacked on mobile */
  .od-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .od-item--grid,
  .od-item--rozcestnik {
    margin-top: 0;
    border-top: 1px solid var(--grid-line);
    border-bottom: none;
  }

  .od-item--rozcestnik { border-bottom: 1px solid var(--grid-line); }
}

@media (max-width: 480px) {
  .name-norak   { font-size: clamp(3.5rem, 18vw, 6rem); }
  .name-ericsok { font-size: clamp(2.5rem, 13vw, 4.5rem); }
}
