:root {
  /* Farebná paleta */
  --color-bureau-blue: #1a2b48;
  --color-paper-white: #f4f4f4;
  --color-ink-blue: #2c3e50;
  --color-stamp-red: #a93226;
  --color-border: #d1d1d1;
  --color-text-main: #333;

  /* Typografia */
  --font-serif: "Playfair Display", "EB Garamond", serif;
  --font-sans: "Inter", "Roboto", sans-serif;

  /* Rozmery a spacing */
  --container-max-width: 1200px;
  --section-padding: 5rem 2rem;
  --transition: all 0.3s ease;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-paper-white);
  color: var(--color-text-main);
  line-height: 1.6;
  /* Jemný raster papiera */
  background-image: radial-gradient(#d1d1d1 0.5px, transparent 0.5px);
  background-size: 20px 20px;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--color-bureau-blue);
  line-height: 1.2;
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Custom Cursor */
body {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"), auto;
}

/* Header & Navigation */
.site-header {
  background: white;
  border-bottom: 2px solid var(--color-bureau-blue);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;

  .container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-serif);
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--color-bureau-blue);

    .logo-snail {
      width: 40px;
      height: 40px;
      border: 2px solid var(--color-bureau-blue);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.2rem;
    }
  }

  .main-nav ul {
    display: flex;
    gap: 2rem;

    a {
      font-weight: 500;
      font-size: 0.9rem;
      text-transform: uppercase;
      letter-spacing: 1px;
      transition: var(--transition);

      &:hover {
        color: var(--color-stamp-red);
      }
    }
  }

  .cta-button {
    background: var(--color-bureau-blue);
    color: white;
    padding: 0.8rem 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;

    &::after {
      content: "";
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
      );
      transition: 0.5s;
    }

    &:hover {
      background: var(--color-stamp-red);
      transform: translateY(-2px);
      box-shadow: 0 4px 8px rgba(0,0,0,0.2);

      &::after {
        left: 100%;
      }
    }
  }
}

/* Hero Section */
.hero {
  padding: var(--section-padding);
  background: white;
  border-bottom: 1px solid var(--color-border);

  .container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
  }

  .hero-content {
    h1 {
      font-size: 3.5rem;
      margin-bottom: 1.5rem;
    }

    p {
      font-size: 1.25rem;
      color: #666;
      margin-bottom: 2rem;
    }

    .btn-podnet {
      display: inline-flex;
      align-items: center;
      gap: 1.5rem;
      padding: 1.5rem 3rem;
      font-size: 1.4rem;
      font-family: var(--font-serif);
      background-color: var(--color-bureau-blue);
      border: none;
      color: white;
      text-transform: uppercase;
      letter-spacing: 2px;
      cursor: pointer;
      position: relative;
      overflow: hidden;
      transition: background-color 0.3s ease, transform 0.1s ease;
      box-shadow: 0 6px 0 #0d1625, 0 10px 20px rgba(0,0,0,0.2);
      animation: buttonEntrance 1s ease-out 2s both, buttonAttention 4s ease-in-out 5s infinite;

      .stamp-icon {
        width: 40px;
        height: 50px;
        background: #ddd;
        position: relative;
        border-radius: 4px 4px 2px 2px;
        transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28), filter 0.3s ease;
        flex-shrink: 0;

        /* Mushroom handle head */
        &::before {
          content: "";
          position: absolute;
          top: -15px;
          left: 50%;
          transform: translateX(-50%);
          width: 30px;
          height: 30px;
          background: #c0392b; /* Wooden red-brown */
          border-radius: 50% 50% 20% 20%;
          box-shadow: inset -4px -4px 0 rgba(0,0,0,0.2);
        }

        /* Stamp base */
        &::after {
          content: "";
          position: absolute;
          bottom: -5px;
          left: 50%;
          transform: translateX(-50%);
          width: 46px;
          height: 8px;
          background: #333;
          border-radius: 2px;
        }
      }

      .btn-text {
        position: relative;
        z-index: 2;
      }

      .imprint {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(2);
        font-family: var(--font-serif);
        font-weight: 900;
        font-size: 4rem;
        color: var(--color-stamp-red);
        opacity: 0;
        pointer-events: none;
        z-index: 3;
        border: 4px double var(--color-stamp-red);
        padding: 0.5rem 1rem;
        mix-blend-mode: multiply;
        transition: none;
      }

      &:hover {
        background-color: #121e33;
        transform: translateY(-2px);
        box-shadow: 0 8px 0 #0d1625, 0 15px 30px rgba(0,0,0,0.3);

        .stamp-icon {
          transform: translateY(-8px) rotate(-5deg);
          filter: drop-shadow(0 15px 10px rgba(0,0,0,0.4));
        }
      }

      &:active {
        background-color: #0d1625;
        transform: translateY(4px);
        box-shadow: 0 2px 0 #000, 0 5px 10px rgba(0,0,0,0.4);

        .stamp-icon {
          transform: translateY(5px) scaleY(0.8);
        }

        .imprint {
          animation: imprintFlash 0.4s ease-out;
        }
      }
    }
    @media (max-width: 480px) {
      padding: 1rem 2rem;
      font-size: 1.1rem;
      gap: 1rem;

      .stamp-icon {
        transform: scale(0.8);
      }
    }
  }

  .hero-visual {
    position: relative;
    perspective: 1000px; /* Pre 3D efekt */

    .official-letter {
      background: #fff;
      padding: 3rem;
      box-shadow: 0 10px 30px rgba(0,0,0,0.1);
      border: 1px solid var(--color-border);
      transform: rotate(-2deg);
      position: relative;
      animation: letterArrival 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
      animation-delay: 0.5s;
      will-change: transform, opacity;

      &::before {
        content: "";
        position: absolute;
        top: 20px;
        right: 20px;
        width: 100px;
        height: 100px;
        background: url('https://placehold.co/100x100/a93226/white?text=PEČIATKA') no-repeat center;
        opacity: 0;
        mix-blend-mode: multiply;
        transform: rotate(15deg) scale(2);
        animation: stampSlam 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
        animation-delay: 1.5s;
      }

      /* Jemné pohupovanie po načítaní */
      &:hover {
        transform: rotate(0deg) translateY(-10px) scale(1.02);
        box-shadow: 0 20px 40px rgba(0,0,0,0.15);
      }

      transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.6s ease;
    }
  }
}

/* Animations */
@keyframes letterArrival {
  0% {
    opacity: 0;
    transform: translateY(100px) rotate(-10deg) rotateX(-30deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(-2deg) rotateX(0);
  }
}

@keyframes stampSlam {
  0% {
    opacity: 0;
    transform: rotate(45deg) scale(3);
    filter: blur(5px);
  }
  70% {
    opacity: 1;
    transform: rotate(15deg) scale(0.9);
  }
  100% {
    opacity: 0.6;
    transform: rotate(15deg) scale(1);
  }
}

@keyframes buttonEntrance {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes imprintFlash {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(5);
    filter: blur(10px);
  }
  10% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1);
    filter: blur(0);
  }
  90% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

@keyframes buttonAttention {
  0%, 100% {
    box-shadow: 0 0 0 rgba(26, 43, 72, 0);
  }
  50% {
    box-shadow: 0 0 20px rgba(26, 43, 72, 0.3);
  }
}

/* Scroll-based animation for modern browsers */
@supports (animation-timeline: view()) {
  .hero-visual .official-letter {
    animation-timeline: none, view();
    animation-name: letterArrival, letterFloat;
  }

  @keyframes letterFloat {
    from { transform: rotate(-2deg) translateY(0); }
    to { transform: rotate(5deg) translateY(-100px); }
  }
}

/* Bento Grid - Services */
.services {
  padding: var(--section-padding);

  .container {
    max-width: var(--container-max-width);
    margin: 0 auto;
  }

  .section-title {
    text-align: center;
    margin-bottom: 4rem;

    h2 {
      font-size: 2.5rem;
    }
  }

  .bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 350px;
    gap: 1.5rem;
  }

  .bento-item {
    background: white;
    border: 1px solid var(--color-border);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
    transition: var(--transition);

    &:nth-child(1) {
      grid-column: span 2;
    }

    &:nth-child(2) {
      grid-row: span 2;
    }

    &:nth-child(3) {
      grid-column: span 1;
    }

    &:nth-child(4) {
    }

    &:hover {
      border-color: var(--color-bureau-blue);
      box-shadow: 0 10px 30px rgba(0,0,0,0.1);

      img {
        transform: scale(1.05);
      }
    }

    .icon {
      font-size: 3rem;
      margin-bottom: 1rem;
    }

    h3 {
      margin-bottom: 1rem;
      position: relative;
      z-index: 2;
    }

    p {
      color: #666;
      max-width: 60%;
      position: relative;
      z-index: 2;
    }

    img {
      position: absolute;
      bottom: 0;
      right: 0;
      width: 60%;
      height: auto;
      object-fit: cover;
      opacity: 0.8;
      transition: var(--transition);
      z-index: 1;
      mask-image: linear-gradient(to top left, black, transparent);
    }
  }
}

/* Process Section */
.process {
  padding: var(--section-padding);
  background: var(--color-bureau-blue);
  color: white;
  position: relative;
  overflow: hidden;

  /* Background decoration - subtle bureau pattern */
  &::before {
    content: "PRÍSNE TAJNÉ • ŠTÁTNE TAJOMSTVO • ARCHÍV";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 8rem;
    font-weight: 900;
    opacity: 0.03;
    white-space: nowrap;
    pointer-events: none;
    z-index: 0;
  }

  .container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
  }

  h2 {
    color: white;
    text-align: center;
    margin-bottom: 6rem;
    font-size: 2.5rem;
    position: relative;

    &::after {
      content: "";
      position: absolute;
      bottom: -1rem;
      left: 50%;
      transform: translateX(-50%);
      width: 60px;
      height: 3px;
      background: var(--color-stamp-red);
    }
  }

  .process-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem;
    position: relative;

    /* Connecting line */
    &::before {
      content: "";
      position: absolute;
      top: 50px;
      left: 15%;
      right: 15%;
      height: 2px;
      background: repeating-linear-gradient(to right, transparent, transparent 10px, rgba(255,255,255,0.2) 10px, rgba(255,255,255,0.2) 20px);
      z-index: 0;
    }

    @media (max-width: 992px) {
      grid-template-columns: 1fr;
      gap: 3rem;

      &::before {
        left: 50%;
        right: auto;
        top: 20px;
        bottom: 20px;
        width: 2px;
        height: auto;
        background: repeating-linear-gradient(to bottom, transparent, transparent 10px, rgba(255,255,255,0.2) 10px, rgba(255,255,255,0.2) 20px);
      }
    }

    .step {
      text-align: center;
      position: relative;
      transition: var(--transition);
      padding: 2rem;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(5px);

      &:hover {
        transform: translateY(-10px);
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--color-stamp-red);

        .step-number {
          color: var(--color-stamp-red);
          opacity: 1;
          transform: scale(1.1) rotate(-5deg);
        }
      }

      .step-number {
        font-family: var(--font-serif);
        font-size: 5rem;
        font-weight: bold;
        color: white;
        opacity: 0.2;
        display: block;
        margin-bottom: 1.5rem;
        line-height: 1;
        transition: var(--transition);
        text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
      }

      h3 {
        color: white;
        margin-bottom: 1rem;
        font-size: 1.5rem;
      }

      p {
        opacity: 0.8;
        font-size: 1rem;
        line-height: 1.6;
      }

      /* Indicator dot */
      &::after {
        content: "";
        position: absolute;
        top: 50px;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 12px;
        height: 12px;
        background: var(--color-paper-white);
        border: 3px solid var(--color-bureau-blue);
        border-radius: 50%;
        z-index: 1;
        box-shadow: 0 0 0 5px rgba(255,255,255,0.1);
      }

      @media (max-width: 992px) {
        padding: 1.5rem;

        &::after {
          top: 20px;
        }

        .step-number {
          font-size: 3.5rem;
          margin-top: 1rem;
        }
      }
    }
  }
}

/* Trust Builder */
.trust-builder {
  padding: var(--section-padding);
  text-align: center;

  .container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
  }

  .stat-item {
    .stat-value {
      display: block;
      font-family: var(--font-serif);
      font-size: 3rem;
      font-weight: bold;
      color: var(--color-stamp-red);
    }

    .stat-label {
      font-weight: bold;
      text-transform: uppercase;
      letter-spacing: 1px;
      font-size: 0.8rem;
    }
  }
}

/* Footer */
.site-footer {
  background: white;
  padding: 4rem 2rem;
  border-top: 2px solid var(--color-bureau-blue);

  .container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
  }

  .footer-info {
    h4 { margin-bottom: 1.5rem; }
    p { font-size: 0.9rem; color: #666; }
  }

  .footer-links {
    h4 { margin-bottom: 1.5rem; }
    ul li { margin-bottom: 0.5rem; }
    a {
      font-size: 0.9rem;
      &:hover { color: var(--color-stamp-red); }
    }
  }
}

.footer-bottom {
  max-width: var(--container-max-width);
  margin: 2rem auto 0;
  padding: 2rem 2rem 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.8rem;
  color: #999;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero .container {
    gap: 2rem;
  }

  .hero-content h1 {
    font-size: 2.8rem;
  }

  .services {
    .bento-grid {
      grid-template-columns: repeat(2, 1fr);
      grid-auto-rows: 300px;
    }

    .bento-item {
      &:nth-child(1) {
        grid-column: span 2;
      }

      &:nth-child(2) {
        grid-row: span 1;
        grid-column: span 1;
      }

      &:nth-child(3) {
        grid-column: span 1;
      }

      &:nth-child(4) {
        grid-column: span 2;
      }
    }
  }
}

@media (max-width: 768px) {
  .site-header {
    .container {
      flex-direction: column;
      gap: 1.5rem;
    }

    .main-nav ul {
      gap: 1rem;
      flex-wrap: wrap;
      justify-content: center;
    }
  }

  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content p {
    max-width: 100%;
  }

  .services {
    .bento-grid {
      grid-template-columns: 1fr;
      grid-auto-rows: auto;
    }

    .bento-item {
      padding: 2rem;
      min-height: 250px;

      &:nth-child(1),
      &:nth-child(2),
      &:nth-child(3),
      &:nth-child(4) {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
      }

      p {
        max-width: 100%;
      }

      img {
        width: 40%;
        opacity: 0.4;
      }
    }
  }

  .process .process-steps {
    flex-direction: column;
    gap: 3rem;

    &::before {
      width: 2px;
      height: 100%;
      left: 50%;
      top: 0;
    }

    .step {
      width: 100%;
      text-align: center;
    }
  }

  .site-footer .container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --section-padding: 3rem 1.5rem;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-visual .official-letter {
    padding: 1.5rem;
  }
}
