:root {
  --bg: #f5f5f2;
  --ink: #1b1d22;
  --surface: #fcfcfa;
  --surface-strong: #ffffff;
  --line: rgba(27, 29, 34, 0.14);
  --line-soft: rgba(27, 29, 34, 0.08);
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.16);
  --shadow: 0 20px 40px -30px rgba(23, 33, 45, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at 85% 6%, rgba(15, 118, 110, 0.12), transparent 33%),
    radial-gradient(circle at 10% 35%, rgba(27, 29, 34, 0.06), transparent 28%),
    var(--bg);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.2;
  background-image: radial-gradient(rgba(20, 20, 20, 0.3) 0.35px, transparent 0.35px);
  background-size: 3px 3px;
}

.hero,
.layout,
.to-top {
  position: relative;
  z-index: 1;
}

.hero {
  min-height: min(72rem, 100dvh);
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(1.3rem, 4vw, 3.3rem);
  position: relative;
  overflow: hidden;
  border-radius: 1.8rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 24px 56px -40px rgba(23, 33, 45, 0.45);
  display: grid;
  place-items: unset;
  align-items: start;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  filter: saturate(1.04) contrast(1.03);
}

.hero-gradient {
  position: absolute;
  inset: 0;
}

.hero-gradient-warm {
  background:
    radial-gradient(circle at 10% 22%, rgba(240, 106, 58, 0.45), transparent 38%),
    radial-gradient(circle at 87% 86%, rgba(240, 106, 58, 0.35), transparent 32%);
}

.hero-gradient-cool {
  background:
    linear-gradient(145deg, rgba(250, 246, 240, 0.72), rgba(255, 255, 255, 0.25) 35%, rgba(27, 29, 34, 0.18)),
    radial-gradient(circle at 80% 6%, rgba(15, 118, 110, 0.28), transparent 32%);
  mix-blend-mode: multiply;
}

.hero-copy {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: min(760px, 92vw);
  padding: 0;
  text-align: center;
}

h1,
h2,
h3 {
  font-family: "Outfit", sans-serif;
  letter-spacing: -0.02em;
}

.hero-tagline {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.35rem, 3.2vw, 2.4rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #17120f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.hero-cat {
  position: absolute;
  right: clamp(0.7rem, 1.8vw, 1.6rem);
  bottom: clamp(0.7rem, 1.8vw, 1.6rem);
  z-index: 2;
  width: clamp(88px, 11vw, 140px);
  aspect-ratio: 1;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  filter: drop-shadow(0 12px 16px rgba(23, 33, 45, 0.28));
  animation: floaty 2.8s ease-in-out infinite, buttonPulse 1.8s ease-in-out infinite;
}

.hero-cat svg {
  width: 100%;
  height: 100%;
}

.cat-nose-hit {
  transform-origin: center;
  animation: nosePulse 1.15s ease-in-out infinite;
}

.hero-cat:hover .cat-nose-hit {
  animation-duration: 0.72s;
}

.hero-cat:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.55);
  outline-offset: 4px;
  border-radius: 999px;
}

.layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.4rem clamp(1rem, 3vw, 2.2rem) 4.5rem;
  display: grid;
  grid-template-columns: minmax(11rem, 0.9fr) minmax(0, 2.35fr);
  gap: clamp(1rem, 2vw, 1.5rem);
}

.side-nav {
  position: sticky;
  top: 1.2rem;
  align-self: start;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line-soft);
  border-radius: 1.4rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset;
  padding: 0.95rem;
  display: grid;
  gap: 0.26rem;
}

.side-nav p {
  margin: 0 0 0.34rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(27, 29, 34, 0.62);
}

.side-nav a {
  color: rgba(27, 29, 34, 0.85);
  text-decoration: none;
  border-radius: 0.7rem;
  padding: 0.38rem 0.56rem;
  font-size: 0.9rem;
  transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.side-nav a:hover {
  background: var(--accent-soft);
  transform: translateX(3px);
}

.content-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(0.85rem, 1.5vw, 1.15rem);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 1.35rem;
  padding: clamp(1rem, 2.5vw, 1.7rem);
  box-shadow: var(--shadow);
  animation: rise 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.panel:nth-child(2) { animation-delay: 70ms; }
.panel:nth-child(3) { animation-delay: 120ms; }
.panel:nth-child(4) { animation-delay: 180ms; }
.panel:nth-child(5) { animation-delay: 240ms; }
.panel:nth-child(6) { animation-delay: 300ms; }

.intro,
#zodynas,
#saugumas,
#internetas-vs-ai {
  grid-column: 1 / -1;
}

h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3.7vw, 2.45rem);
  line-height: 1.05;
}

h3 {
  margin: 0;
  font-size: 1.1rem;
}

.panel p,
.panel li {
  font-size: 0.98rem;
  line-height: 1.55;
}

.panel ul,
.panel ol {
  margin: 0.7rem 0 0;
  padding-left: 1.15rem;
}

.catrot-inline {
  margin-top: 0.85rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.85rem;
  border: 1px dashed rgba(240, 106, 58, 0.4);
  background: rgba(255, 251, 241, 0.9);
}

.term-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.72rem;
}

.catrot-note {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 0.7rem;
  align-items: center;
  background: rgba(255, 251, 241, 0.9);
  border: 1px dashed rgba(240, 106, 58, 0.4);
  border-radius: 1rem;
  padding: 0.65rem;
}

.catrot-note.compact {
  grid-template-columns: 70px 1fr;
}

.catrot-note img {
  width: 100%;
  max-height: 92px;
  object-fit: contain;
  animation: floaty 3.2s ease-in-out infinite;
}

.catrot-note.compact img {
  max-height: 64px;
}

.catrot-note p {
  margin: 0;
  font-size: 0.94rem;
}

.term-list.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.term {
  border: 1px solid var(--line-soft);
  background: var(--surface-strong);
  border-radius: 1rem;
  padding: 0.78rem;
}

.term p {
  margin: 0.5rem 0 0;
}

.note {
  color: rgba(27, 29, 34, 0.72);
  font-size: 0.92rem;
}

.chips {
  margin-top: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.56rem;
}

.chips span {
  border-radius: 999px;
  padding: 0.44rem 0.78rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line-soft);
  font-size: 0.9rem;
}

.split {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topic-illustration {
  margin: 0.9rem 0 0;
}

.topic-illustration img {
  width: min(100%, 420px);
  display: block;
  border-radius: 1rem;
  border: 1px solid var(--line-soft);
  background: #fff;
}

.closing {
  margin-top: 1rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.8rem;
  background: var(--accent-soft);
  border: 1px solid rgba(15, 118, 110, 0.24);
  font-weight: 600;
}

.to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.88rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  padding: 0.52rem 0.72rem;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.to-top.visible {
  transform: translateY(0);
  opacity: 1;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floaty {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes wobble {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  25% {
    transform: rotate(-1.5deg) translateY(-2px);
  }
  75% {
    transform: rotate(1.5deg) translateY(2px);
  }
}

@keyframes nosePulse {
  0%, 100% {
    transform: scale(1);
    fill: #f06a3a;
  }
  50% {
    transform: scale(1.16);
    fill: #f58760;
  }
}

@keyframes buttonPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 12px 16px rgba(23, 33, 45, 0.28));
  }
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 16px 20px rgba(240, 106, 58, 0.32));
  }
}

@keyframes shineSweep {
  0% {
    background-position: 180% 50%;
  }
  100% {
    background-position: -40% 50%;
  }
}

@media (max-width: 980px) {
  .hero-video {
    object-position: center 35%;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-nav p {
    grid-column: 1 / -1;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .intro,
  #zodynas,
  #saugumas,
  #internetas-vs-ai {
    grid-column: auto;
  }

  .term-list.two-col,
  .split {
    grid-template-columns: 1fr;
  }

  .catrot-note {
    grid-template-columns: 70px 1fr;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 100dvh;
    padding-top: 1.4rem;
    padding-bottom: 1.4rem;
  }

  .hero-copy {
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: min(92vw, 720px);
  }

  .hero-tagline {
    font-size: clamp(1.5rem, 7.2vw, 2.4rem);
    line-height: 1.15;
  }

  .hero-gradient-cool {
    background:
      linear-gradient(165deg, rgba(250, 246, 240, 0.84), rgba(255, 255, 255, 0.35) 40%, rgba(27, 29, 34, 0.2)),
      radial-gradient(circle at 82% 5%, rgba(15, 118, 110, 0.22), transparent 30%);
  }

  .hero-media {
    background: linear-gradient(180deg, rgba(245, 226, 210, 0.65), rgba(233, 246, 239, 0.45));
  }

  .hero-video {
    object-fit: contain;
    object-position: center center;
    transform: scale(1);
  }

  .hero-cat {
    width: 86px;
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  .catrot-note,
  .catrot-note.compact {
    grid-template-columns: 1fr;
  }

  .catrot-note img,
  .catrot-note.compact img {
    width: 72px;
    max-height: none;
    margin: 0 auto;
  }

  .to-top {
    right: 0.7rem;
    bottom: 0.7rem;
  }
}

/* Force hero tagline to top-left (non-centered) */
.hero {
  align-items: flex-start !important;
  justify-items: flex-start !important;
}

.hero-copy {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  z-index: 3 !important;
  width: min(620px, calc(100% - 140px)) !important;
  margin-top: 36px !important;
  margin-left: 36px !important;
  margin-right: 0 !important;
  text-align: left !important;
}

@media (max-width: 640px) {
  .hero-copy {
    width: min(86vw, 560px) !important;
    margin-top: 24px !important;
    margin-left: 16px !important;
  }
}
