/* Ranglar @property bilan e'lon qilingan, shunda ular silliq o'zgaradi */
@property --paper { syntax: "<color>"; inherits: true; initial-value: #fbf5ea; }
@property --ink { syntax: "<color>"; inherits: true; initial-value: #33261d; }
@property --muted { syntax: "<color>"; inherits: true; initial-value: #6b5a4c; }
@property --line { syntax: "<color>"; inherits: true; initial-value: #e6d9c6; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #a8492a; }
@property --accent-dark { syntax: "<color>"; inherits: true; initial-value: #8a3a20; }
@property --accent-soft { syntax: "<color>"; inherits: true; initial-value: #f6e6d8; }
@property --on-accent { syntax: "<color>"; inherits: true; initial-value: #fff; }
@property --card { syntax: "<color>"; inherits: true; initial-value: #fffaf2; }
@property --band { syntax: "<color>"; inherits: true; initial-value: #f6ecdc; }
@property --shadow { syntax: "<color>"; inherits: true; initial-value: rgba(51, 38, 29, 0.12); }

:root {
  --paper: #fbf5ea;
  --ink: #33261d;
  --muted: #6b5a4c;
  --line: #e6d9c6;
  --accent: #a8492a;
  --accent-dark: #8a3a20;
  --accent-soft: #f6e6d8;
  --on-accent: #fff;
  --card: #fffaf2;
  --band: #f6ecdc;
  --shadow: rgba(51, 38, 29, 0.12);
  --theme-speed: 0.4s;
  color-scheme: light;
  transition:
    --paper var(--theme-speed) ease,
    --ink var(--theme-speed) ease,
    --muted var(--theme-speed) ease,
    --line var(--theme-speed) ease,
    --accent var(--theme-speed) ease,
    --accent-dark var(--theme-speed) ease,
    --accent-soft var(--theme-speed) ease,
    --on-accent var(--theme-speed) ease,
    --card var(--theme-speed) ease,
    --band var(--theme-speed) ease,
    --shadow var(--theme-speed) ease;
}

:root[data-theme="dark"] {
  --paper: #161210;
  --ink: #f4ebdf;
  --muted: #b8a999;
  --line: #3a312a;
  --accent: #e08a63;
  --accent-dark: #eca17e;
  --accent-soft: #33251d;
  --on-accent: #1c1410;
  --card: #211b17;
  --band: #1d1815;
  --shadow: rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

html { scroll-behavior: smooth; }

* { box-sizing: border-box; margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

.wrap {
  max-width: 66rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

section { padding: clamp(3.5rem, 8vw, 5.5rem) 0; }

.band { background: var(--band); }

h1, h2, h3 {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
}

.hero { padding: 1rem; }

.hero-panel {
  max-width: 88rem;
  margin: 0 auto;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 3rem;
}

.logo {
  color: var(--ink);
  font: 600 1.5rem/1 "Source Serif 4", Georgia, serif;
  text-decoration: none;
}

.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav .nav-cta {
  flex: none;
  padding: 0.5rem 1.25rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24rem minmax(0, 1fr);
  gap: 2rem;
  padding: 0 3rem;
}

.intro {
  position: relative;
  z-index: 1;
  align-self: center;
  padding-bottom: 3rem;
}

.greeting {
  color: var(--accent);
  font: 500 1.5rem/1.3 "Source Serif 4", Georgia, serif;
}

h1 {
  font-size: clamp(3rem, 4.6vw, 3.75rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-top: 0.25rem;
}

h1 span { display: block; }

.about {
  color: var(--muted);
  line-height: 1.6;
  margin-top: 1.25rem;
}

.hero-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.chip {
  padding: 0.45rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 1rem;
  text-decoration: none;
}

.chip:hover { background: var(--accent-soft); }

.icon-link {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
}

.icon-link:hover { background: var(--accent-soft); }

.icon-link.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.icon-link.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.icon-link svg {
  width: 1.1rem;
  height: 1.1rem;
}

.visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 36rem;
}

.circle {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  width: 28rem;
  aspect-ratio: 1;
  background: var(--accent-soft);
  border-radius: 50%;
  transform: translateX(-50%);
}

.photo {
  position: relative;
  flex: none;
  display: block;
  width: 27rem;
  max-width: none;
  height: auto;
  /* Yenglar rasm chetida tik kesilmasligi uchun yon tomonlar yumshatiladi */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
}

/* Suzib yuruvchi xizmat belgilari */
.float-list {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  padding-bottom: 2rem;
}

.float-card {
  width: 11rem;
  color: var(--ink);
  text-decoration: none;
}

.float-card:nth-child(2) {
  align-self: flex-end;
  transition-delay: 0.1s;
}

.float-card:nth-child(3) {
  margin-left: 1.5rem;
  transition-delay: 0.2s;
}

.float-inner {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  perspective: 30rem;
  animation: bob 6s ease-in-out infinite;
}

.float-card:nth-child(2) .float-inner { animation-delay: -2s; }
.float-card:nth-child(3) .float-inner { animation-delay: -4s; }

.float-icon {
  display: grid;
  place-items: center;
  width: 5.5rem;
  height: 5.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0.5rem 0.75rem 1.5rem var(--shadow);
  color: var(--accent);
  transform: rotateX(10deg) rotateY(-18deg);
  transition: transform 0.3s ease;
}

.float-card:hover .float-icon { transform: none; }

.float-icon svg {
  width: 2.25rem;
  height: 2.25rem;
}

.float-label {
  padding: 0.3rem 0.9rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

@keyframes bob {
  50% { transform: translateY(-0.6rem); }
}

/* Rasm atrofidagi 3D bezaklar */
.ring {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  border: 0.5rem solid var(--accent);
  border-radius: 50%;
  opacity: 0.7;
  animation: ring-spin 9s linear infinite;
}

@keyframes ring-spin {
  from { transform: perspective(20rem) rotateX(60deg) rotateZ(0deg); }
  to   { transform: perspective(20rem) rotateX(60deg) rotateZ(360deg) rotateY(360deg); }
}

.orb {
  position: absolute;
  bottom: 7rem;
  left: -0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  background: radial-gradient(circle at 32% 30%, var(--accent-soft), var(--accent) 75%);
  border-radius: 50%;
  animation: bob 7s ease-in-out infinite;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
  scroll-margin-top: 4rem;
}

ol,
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
}

li { display: grid; }

.card {
  --rx: 0deg;
  --ry: 0deg;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  transform: perspective(50rem) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.num {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
  font: 500 1.5rem/1.4 "Source Serif 4", Georgia, serif;
  transform: translateZ(2rem);
}

.card-body { transform: translateZ(1.25rem); }

.project-card {
  display: grid;
  padding: 1.75rem 2rem;
  border-radius: 20px;
}

.project-card .card-body {
  display: flex;
  flex-direction: column;
}

.project-card h3 { font-size: 1.5rem; }

.project-card p { margin-top: 0.75rem; }

.card .year {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}

.project-card .card-body > p:nth-of-type(1) { margin-bottom: 1.25rem; }

h3 {
  font-size: 1.25rem;
  line-height: 1.4;
}

li p {
  color: var(--muted);
  margin-top: 0.25rem;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  flex: 1 1 15rem;
  padding: 0.8rem 1.25rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.btn:hover { background: var(--accent-soft); }

.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.contact-note {
  color: var(--muted);
  margin-top: 1rem;
}

/* Oq/qora rejim tugmasi: faqat JS ishlaganda ko'rinadi */
.theme-toggle {
  display: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  cursor: pointer;
}

.js .theme-toggle { display: grid; }

.theme-toggle:hover { background: var(--accent-soft); }

.theme-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.theme-toggle svg {
  grid-area: 1 / 1;
  width: 1.25rem;
  height: 1.25rem;
  transition: opacity 0.3s ease, transform 0.4s ease;
}

/* Yorug' rejimda oy, qorong'ida quyosh ko'rinadi */
.icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

[data-theme="dark"] .icon-sun {
  opacity: 1;
  transform: none;
}

[data-theme="dark"] .icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

/* 3D kub */
.scene {
  --size: 4.5rem;
  position: absolute;
  top: 3rem;
  left: 0;
  width: var(--size);
  height: var(--size);
  perspective: 30rem;
}

.tilt {
  --rx: 0deg;
  --ry: 0deg;
  width: 100%;
  height: 100%;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.2s ease-out;
}

.cube {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: spin 24s linear infinite;
}

.face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--accent);
  color: var(--accent);
  font: 600 calc(var(--size) * 0.26) / 1 Consolas, ui-monospace, monospace;
}

.face.front  { transform: translateZ(calc(var(--size) / 2)); }
.face.back   { transform: rotateY(180deg) translateZ(calc(var(--size) / 2)); }
.face.right  { transform: rotateY(90deg) translateZ(calc(var(--size) / 2)); }
.face.left   { transform: rotateY(-90deg) translateZ(calc(var(--size) / 2)); }
.face.top    { transform: rotateX(90deg) translateZ(calc(var(--size) / 2)); }
.face.bottom { transform: rotateX(-90deg) translateZ(calc(var(--size) / 2)); }

.face.right,
.face.left {
  background: var(--accent);
  color: var(--on-accent);
}

.face.top,
.face.bottom { background: var(--accent-soft); }

@keyframes spin {
  from { transform: rotateX(-20deg) rotateY(0deg); }
  to   { transform: rotateX(340deg) rotateY(720deg); }
}

/* Paydo bo'lish: faqat JS ishlaganda yashiriladi */
.js .reveal {
  opacity: 0;
  transform: perspective(60rem) rotateX(-18deg) translateY(1.5rem);
  transform-origin: top;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

li:nth-child(2).reveal { transition-delay: 0.1s; }
li:nth-child(3).reveal { transition-delay: 0.2s; }

@media (hover: hover) {
  .card:hover { box-shadow: 0 1rem 2rem var(--shadow); }
}

@media (max-width: 72rem) {
  .nav { padding: 1rem 1.25rem; }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding: 0 1.25rem;
  }

  h1 { font-size: clamp(3rem, 11vw, 4.5rem); }

  .intro { padding: 1rem 0 0; }

  .about { max-width: 36rem; }

  .float-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.75rem;
    padding: 0;
  }

  .float-card,
  .float-card:nth-child(2),
  .float-card:nth-child(3) {
    align-self: auto;
    width: auto;
    margin: 0;
  }

  .float-inner {
    grid-auto-flow: column;
    justify-content: start;
    align-items: center;
    gap: 0.75rem;
  }

  .float-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
  }

  .float-icon svg {
    width: 1.4rem;
    height: 1.4rem;
  }

  .float-label {
    padding: 0;
    background: none;
    border: 0;
  }

  .visual {
    order: 1;
    height: 27rem;
  }

  .circle {
    bottom: 0;
    width: 22rem;
  }

  .photo { width: 21rem; }

  .scene {
    --size: 3.5rem;
    top: 3rem;
    left: 1.5rem;
  }

  .ring { right: 1rem; }

  .orb { left: 1rem; }
}

@media (max-width: 40rem) {
  .nav-links { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  :root { --theme-speed: 0s; }

  .theme-toggle svg,
  .float-icon { transition: none; }

  .float-inner,
  .ring,
  .orb { animation: none; }

  .cube {
    animation: none;
    transform: rotateX(-20deg) rotateY(-35deg);
  }

  .tilt,
  .card { transition: none; }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
