/**
 * O'zbekiston Yoshlar Diplomatiya Markazi (YDM)
 * Rasmiy veb-sayt asosiy stillari (CSS)
 */

/* ==========================================================================
   1. Rang o'zgaruvchilari (Design Tokens) va Asosiy Sozlamalar
   ========================================================================== */
:root {
  /* Markaz brend ranglari */
  --navy: #0B1F5C;
  --navy2: #071440;
  --blue: #1F6FE5;
  --sky: #3E9BFF;
  --gold: #B8913A;
  --gold2: #D9B663;

  /* Matn va fon ranglari */
  --ink: #0B1F5C;
  --muted: #5A6788;
  --bg: #F6F8FD;

  /* Tipografiya va o'lchamlar */
  --font-main: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition-smooth: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img, svg {
  display: block;
  max-width: 100%;
}

/* ==========================================================================
   2. Harakatlanuvchi Fon Bloblari va Zarrachalar Tarmog'i (Canvas)
   ========================================================================== */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, #FFFFFF 0%, #EEF3FD 100%);
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
  will-change: transform;
}

.b1 {
  width: 520px;
  height: 520px;
  background: var(--sky);
  top: -160px;
  left: -140px;
}

.b2 {
  width: 460px;
  height: 460px;
  background: var(--navy);
  bottom: -180px;
  right: -120px;
  opacity: 0.35;
  animation-delay: -6s;
}

.b3 {
  width: 300px;
  height: 300px;
  background: var(--gold2);
  top: 40%;
  left: 55%;
  opacity: 0.35;
  animation-delay: -12s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(60px, 40px) scale(1.08);
  }
  66% {
    transform: translate(-40px, 60px) scale(0.95);
  }
}

canvas#net {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   3. Yuqori Navigatsiya Paneli (Navbar)
   ========================================================================== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 6vw;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(11, 31, 92, 0.08);
  transform: translateY(-100%);
  animation: drop 0.8s 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes drop {
  to {
    transform: none;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.brand img,
.brand svg.ydm-fallback {
  width: 44px;
  height: 40px;
  object-fit: contain;
  flex: none;
}

.brand span {
  font-size: 15px;
  line-height: 1.2;
}

.brand small {
  display: block;
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 2px;
  font-weight: 600;
}

nav .links {
  display: flex;
  gap: 28px;
  font-weight: 600;
  font-size: 14px;
}

nav .links a {
  position: relative;
  color: var(--muted);
  transition: color 0.3s;
}

nav .links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  transition: width 0.35s ease;
}

nav .links a:hover {
  color: var(--navy);
}

nav .links a:hover::after {
  width: 100%;
}

.nav-cta {
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--navy);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 13px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(11, 31, 92, 0.3);
}

/* ==========================================================================
   4. Hero Bo'limi (Bosh Sahifa)
   ========================================================================== */
.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 130px 6vw 60px;
  position: relative;
}

.logo-wrap {
  position: relative;
  width: min(380px, 70vw);
  margin: 0 auto 34px;
}

.logo-wrap img,
.logo-wrap svg.ydm-fallback {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 40px rgba(11, 31, 92, 0.15));
  animation: pop 1.1s 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.eyebrow {
  color: var(--gold);
  letter-spacing: 6px;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(34px, 6.4vw, 74px);
  font-weight: 800;
  line-height: 1.05;
  margin: 10px 0 6px;
  letter-spacing: 1px;
}

h1 .grad {
  background: linear-gradient(90deg, var(--navy), var(--blue), var(--sky), var(--blue), var(--navy));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

.lead {
  max-width: 640px;
  margin: 18px auto 34px;
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.7;
}

.typed {
  color: var(--blue);
  font-weight: 700;
  border-right: 2px solid var(--gold);
  padding-right: 4px;
  animation: caret 0.8s steps(1) infinite;
}

@keyframes caret {
  50% {
    border-color: transparent;
  }
}

/* ==========================================================================
   5. Tugmalar (Buttons)
   ========================================================================== */
.btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s, color 0.3s;
  cursor: pointer;
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #FFFFFF;
  box-shadow: 0 14px 30px rgba(31, 111, 229, 0.35);
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: sweep 3.2s infinite;
}

@keyframes sweep {
  60%, 100% {
    left: 140%;
  }
}

.btn-ghost {
  border: 2px solid var(--navy);
  color: var(--navy);
  background: rgba(255, 255, 255, 0.65);
}

.btn:hover {
  transform: translateY(-3px);
}

.btn-ghost:hover {
  background: var(--navy);
  color: #FFFFFF;
}

/* Pastga skroll ko'rsatkichi */
.scroll-hint {
  margin-top: 50px;
  display: inline-block;
  width: 26px;
  height: 42px;
  border: 2px solid var(--navy);
  border-radius: 14px;
  position: relative;
  opacity: 0.6;
  transition: opacity 0.3s, transform 0.3s;
}

.scroll-hint:hover {
  opacity: 1;
  transform: translateY(2px);
}

.scroll-hint::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--gold);
  animation: wheel 1.6s infinite;
}

@keyframes wheel {
  to {
    transform: translateY(14px);
    opacity: 0;
  }
}

/* ==========================================================================
   6. Skroll Animatsiyalari (Scroll Reveal)
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.hero .reveal:nth-child(2) { transition-delay: 0.5s; }
.hero .reveal:nth-child(3) { transition-delay: 0.65s; }
.hero .reveal:nth-child(4) { transition-delay: 0.8s; }
.hero .reveal:nth-child(5) { transition-delay: 0.95s; }

/* ==========================================================================
   7. Bo'limlar Sarlavhalari (Section Headings)
   ========================================================================== */
section {
  padding: 100px 6vw;
  position: relative;
}

.sec-head {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 56px;
}

.sec-head .tag {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(184, 145, 58, 0.12);
  color: var(--gold);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.sec-head h2 {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 800;
  margin: 14px 0 10px;
  line-height: 1.15;
}

.sec-head p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 16px;
}

/* ==========================================================================
   8. Qadriyatlar Kartochkalari (Values Section)
   ========================================================================== */
.values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  max-width: 1150px;
  margin: 0 auto;
}

.vcard {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(11, 31, 92, 0.08);
  border-radius: 24px;
  padding: 32px 26px;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.vcard:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 50px rgba(11, 31, 92, 0.12);
}

.vicon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #FFFFFF;
}

.vicon svg {
  width: 28px;
  height: 28px;
}

.vcard:nth-child(2) .vicon {
  background: linear-gradient(135deg, var(--gold2), var(--gold));
}

.vcard:nth-child(4) .vicon {
  background: linear-gradient(135deg, var(--sky), var(--blue));
}

.vcard h3 {
  font-size: 19px;
  margin-bottom: 8px;
  color: var(--navy);
  font-weight: 700;
}

.vcard p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}

/* ==========================================================================
   9. Ijtimoiy Tarmoqlar Bo'limi (Dark Section)
   ========================================================================== */
.dark {
  background: linear-gradient(160deg, var(--navy2), var(--navy) 60%, #123089);
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
}

.dark::before {
  content: "";
  position: absolute;
  width: 700px;
  height: 700px;
  right: -250px;
  top: -250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(62, 155, 255, 0.35), transparent 65%);
  animation: float 16s ease-in-out infinite;
  pointer-events: none;
}

.dark::after {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  left: -200px;
  bottom: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 182, 99, 0.25), transparent 65%);
  animation: float 20s ease-in-out infinite reverse;
  pointer-events: none;
}

.dark .sec-head h2 {
  color: #FFFFFF;
}

.dark .sec-head p {
  color: #B7C3E6;
}

.dark .sec-head .tag {
  background: rgba(217, 182, 99, 0.15);
  color: var(--gold2);
}

.grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  max-width: 1150px;
  margin: 0 auto;
}

.soc {
  --c: var(--sky);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
  transition: transform 0.4s ease, border-color 0.4s ease, background-color 0.4s ease;
}

.soc::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--c), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.soc:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--c);
}

.soc:hover::before {
  opacity: 0.28;
}

.soc .ic {
  position: relative;
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--c);
  color: #FFFFFF;
  transition: transform 0.5s ease;
}

.soc:hover .ic {
  transform: rotate(-10deg) scale(1.1);
}

.soc .ic svg {
  width: 26px;
  height: 26px;
}

.soc .tx {
  position: relative;
  min-width: 0;
}

.soc b {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: #FFFFFF;
}

.soc small {
  color: #B7C3E6;
  font-size: 13px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.soc .arr {
  position: relative;
  margin-left: auto;
  opacity: 0.5;
  font-size: 18px;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.soc:hover .arr {
  transform: translateX(6px);
  opacity: 1;
}

/* ==========================================================================
   10. Telegram Bot Bo'limi va Interaktiv Chat Simulyatsiyasi
   ========================================================================== */
.bot {
  max-width: 1100px;
  margin: 0 auto;
  border-radius: 32px;
  padding: 56px 6%;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: center;
  background: linear-gradient(135deg, #FFFFFF, #EAF2FF);
  border: 1px solid rgba(11, 31, 92, 0.08);
  box-shadow: 0 40px 80px rgba(11, 31, 92, 0.1);
  position: relative;
  overflow: hidden;
}

.bot h2 {
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 800;
  margin: 12px 0;
  color: var(--navy);
  line-height: 1.2;
}

.bot p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 26px;
  font-size: 16px;
}

.chat {
  background: var(--navy);
  border-radius: 24px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 270px;
  box-shadow: 0 30px 60px rgba(11, 31, 92, 0.3);
}

.chat .head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.chat .head i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3BD16F;
  box-shadow: 0 0 0 0 #3BD16F;
  animation: live 1.6s infinite;
}

@keyframes live {
  70% {
    box-shadow: 0 0 0 8px rgba(59, 209, 111, 0);
  }
}

.msg {
  max-width: 85%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.msg.show {
  opacity: 1;
  transform: none;
}

.msg.bot-m {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-bottom-left-radius: 4px;
}

.msg.me {
  background: linear-gradient(135deg, var(--blue), var(--sky));
  color: #FFFFFF;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFFFFF;
  opacity: 0.6;
  animation: bounce 1s infinite;
}

.dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes bounce {
  50% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* ==========================================================================
   11. Footer (Quyi qism)
   ========================================================================== */
footer {
  padding: 50px 6vw 40px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  background: transparent;
}

footer .brand {
  justify-content: center;
  margin-bottom: 16px;
  color: var(--navy);
}

footer .mini {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}

footer .mini a {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #FFFFFF;
  border: 1px solid rgba(11, 31, 92, 0.1);
  color: var(--navy);
  transition: transform 0.3s, background-color 0.3s, color 0.3s, box-shadow 0.3s;
}

footer .mini a:hover {
  background: var(--navy);
  color: #FFFFFF;
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(11, 31, 92, 0.15);
}

footer .mini svg {
  width: 18px;
  height: 18px;
}

.copyright {
  font-size: 13px;
  color: var(--muted);
}

/* ==========================================================================
   12. Moslashuvchanlik (Responsive Design) va Accessibility
   ========================================================================== */
@media (max-width: 820px) {
  nav .links {
    display: none;
  }
  
  .bot {
    grid-template-columns: 1fr;
    padding: 40px 6%;
  }

  section {
    padding: 70px 6vw;
  }
}

@media (max-width: 480px) {
  .btns {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .soc {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
