:root {
  --bg: #0d1412;
  --bg-soft: #15201d;
  --card: rgba(21, 32, 29, 0.74);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f6f5;
  --muted: #b7c4be;
  --accent: #f59e0b;
  --accent-2: #22c55e;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, rgba(245, 158, 11, 0.28), transparent 38%),
    radial-gradient(circle at 80% 2%, rgba(34, 197, 94, 0.24), transparent 36%),
    linear-gradient(180deg, #0d1412 0%, #0a1110 100%);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: radial-gradient(#ffffff 0.5px, transparent 0.5px);
  background-size: 3px 3px;
  z-index: -1;
}

h1,
h2,
.logo {
  font-family: "Bebas Neue", cursive;
  letter-spacing: 0.05em;
  margin: 0;
}

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

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

.hero {
  padding: 86px clamp(20px, 4vw, 56px) 70px;
}

.topbar {
  position: fixed;
  top: 7px;
  left: clamp(20px, 4vw, 56px);
  right: clamp(20px, 4vw, 56px);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 20, 18, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.logo {
  font-size: clamp(1.28rem, 2.55vw, 1.87rem);
  flex: 0 0 auto;
}

.menu {
  display: flex;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
  gap: 16px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.menu::-webkit-scrollbar {
  display: none;
}

.menu a {
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.menu a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.menu a.active {
  border-color: var(--accent-2);
  color: var(--text);
}

.hero-content {
  max-width: 760px;
}

.hero-grid {
  display: grid;
  gap: 22px;
}

.hero-text {
  max-width: 760px;
}

.hero-name {
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 0.95;
}

.profile-card {
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.profile-photo {
  width: 100%;
  aspect-ratio: 4 / 4;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.profile-card p {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: 0.95rem;
}

.profile-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 0.94rem;
}

.profile-list.compact {
  margin-top: 0;
}

.eyebrow {
  color: var(--accent-2);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  margin: 0 0 10px;
}

h1 {
  font-size: clamp(2.3rem, 7vw, 5rem);
  line-height: 0.95;
  margin-bottom: 16px;
}

.lead {
  max-width: 65ch;
  color: var(--muted);
  margin-bottom: 24px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-random-quote {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.45;
  max-width: 62ch;
}

.btn {
  display: inline-block;
  background: linear-gradient(125deg, var(--accent), #f97316);
  color: #1b1b1b;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  background: linear-gradient(125deg, var(--accent-2), #84cc16);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.xima-actions .btn {
  border: 1px solid transparent;
}

.xima-actions .xima-btn-official {
  background: linear-gradient(125deg, #22d3ee, #0ea5e9);
  color: #06253a;
}

.xima-actions .xima-btn-play {
  background: linear-gradient(125deg, #84cc16, #22c55e);
  color: #132b09;
}

.xima-actions .xima-btn-videos {
  background: linear-gradient(125deg, #fb7185, #f97316);
  color: #3a0f0f;
}

.xima-actions .xima-btn-bookweb {
  background: linear-gradient(125deg, #c084fc, #8b5cf6);
  color: #210a3c;
}

.xima-actions .xima-btn-book {
  background: linear-gradient(125deg, #facc15, #f59e0b);
  color: #352307;
}

main {
  padding: 0 clamp(20px, 4vw, 56px) 70px;
  display: grid;
  gap: 42px;
}

.section {
  background: var(--card);
  backdrop-filter: blur(4px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 28px);
}

.section-heading {
  margin-bottom: 14px;
}

.section-note {
  color: var(--muted);
  margin: 6px 0 18px;
}

.hub-grid {
  display: grid;
  gap: 12px;
}

.hub-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.hub-card h3 {
  margin-top: 4px;
}

.hub-card p {
  margin: 8px 0;
  color: var(--muted);
}

.media-grid {
  display: grid;
  gap: 12px;
}

.media-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.media-card h3 {
  margin-top: 10px;
}

.media-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.media-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #000;
}

.media-cover {
  display: block;
  object-fit: cover;
  object-position: center;
}

.section-media-contain .media-video {
  object-fit: contain;
  background: rgba(5, 6, 7, 0.92);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.text-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.kpi-grid {
  display: grid;
  gap: 12px;
}

.kpi {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.kpi p {
  margin: 8px 0 0;
  color: var(--muted);
}

.papers-grid {
  display: grid;
  gap: 12px;
}

.paper-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.paper-card h3 {
  margin-top: 4px;
}

.paper-card p {
  margin: 8px 0;
  color: var(--muted);
}

.paper-meta {
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--accent-2) !important;
  text-transform: uppercase;
}

.paper-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.split-note {
  display: grid;
  gap: 8px;
}

.xima-book {
  display: grid;
  gap: 12px;
  margin: 14px 0 12px;
}

.xima-book-cover {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3 / 4;
  display: block;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 6, 7, 0.92);
  padding: 10px;
  justify-self: center;
}

.xima-media-carousel {
  margin: 8px 0 14px;
}

.xima-media-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

h2 {
  font-size: clamp(1.8rem, 5vw, 3rem);
}

.gallery-list {
  display: grid;
  gap: 28px;
}

.gallery-block + .gallery-block {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.gallery-block .section-heading h2 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.gallery-digital .card img,
.gallery-anime .card img,
.gallery-chiaroscuro .card img,
.gallery-light .card img {
  object-fit: contain;
  background: rgba(5, 6, 7, 0.92);
}

.carousel {
  --visible-cards: 2;
  --gap: 12px;
  position: relative;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  padding: 14px 0 16px;
}

.carousel-window {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.carousel-window::-webkit-scrollbar {
  display: none;
}

.js-ready .carousel-window {
  overflow: hidden;
}

.track {
  display: flex;
  gap: var(--gap);
  transition: transform 0.28s ease;
  will-change: transform;
  width: max-content;
}

.js-ready .track {
  width: auto;
}

.card {
  flex: 0 0 50%;
  flex: 0 0 calc((100% - (var(--visible-cards) - 1) * var(--gap)) / var(--visible-cards));
  min-width: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  scroll-snap-align: start;
}

.card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.carousel-contain .card img {
  object-fit: contain;
  background: rgba(5, 6, 7, 0.92);
}

.card img[data-loaded="false"] {
  filter: blur(8px);
  transform: scale(1.015);
}

.card img[data-loaded="true"] {
  filter: blur(0);
  transform: none;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.lightbox-trigger {
  cursor: zoom-in;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 26px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 9, 0.8);
  backdrop-filter: blur(4px);
}

.lightbox-dialog {
  position: relative;
  z-index: 2;
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  align-items: center;
  gap: clamp(8px, 2vw, 16px);
}

.lightbox-figure {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.45);
}

.lightbox-image {
  width: 100%;
  max-height: min(82vh, 900px);
  display: block;
  object-fit: contain;
  background: #000;
}

.lightbox-caption {
  margin: 0;
  padding: 10px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

.lightbox-nav,
.lightbox-close {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
}

.lightbox-nav {
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
}

.lightbox-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 40px;
  height: 40px;
  font-size: 1.4rem;
  line-height: 1;
  z-index: 3;
}

.caption {
  margin: 0;
  padding: 10px 11px;
  color: var(--muted);
  font-size: 0.9rem;
}

.control {
  position: absolute;
  top: 44%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 2;
}

.control.prev {
  left: 8px;
}

.control.next {
  right: 8px;
}

.dots {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
}

.dot.active {
  background: var(--accent);
}

.contact p {
  color: var(--muted);
  max-width: 65ch;
}

footer {
  padding: 14px 20px 30px;
  text-align: center;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: reveal 0.7s ease forwards;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }

  .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-note {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .xima-book {
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    align-items: start;
  }

  .xima-book-cover {
    max-width: none;
    justify-self: stretch;
  }

  .xima-book .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid,
  .papers-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .hub-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .xima-book .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .card {
    flex-basis: 33.3333%;
  }

  .carousel {
    --visible-cards: 3;
    --gap: 14px;
    max-width: 1120px;
    margin-inline: auto;
  }
}

@media (max-width: 760px) {
  .hero {
    padding-top: 128px;
  }

  .topbar {
    top: 7px;
    left: 12px;
    right: 12px;
    border-radius: 16px;
    padding: 8px;
    gap: 7px;
    flex-wrap: wrap;
  }

  .topbar .logo {
    width: 100%;
    font-size: clamp(1.15rem, 6vw, 1.49rem);
  }

  .menu {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    padding-bottom: 2px;
  }

  .menu a {
    font-size: 0.88rem;
  }

  .carousel {
    --gap: 10px;
  }

  .carousel-window {
    padding: 0 12px;
  }

  .card img {
    max-height: 220px;
  }

  .control {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
  }

  .lightbox-dialog {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 8px;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .lightbox-close {
    top: -8px;
    right: -2px;
  }

  .lightbox-image {
    max-height: 72vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .track {
    transition: none;
  }

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