:root {
  --purple: #7752e8;
  --purple-dark: #5f3fd0;
  --cream: #f9f7f2;
  --surface: #ffffff;
  --text: #111111;
  --muted: #5c5c63;
  --border: #e4e4e8;
  --radius: 16px;
  --radius-lg: 24px;
  --max: 1080px;
  --hero-carousel-max-w: 680px;
  --hero-carousel-max-h: 980px;
  --hero-carousel-top-crop: 0%;
  --rankd-gradient-top: #a353ce;
  --rankd-gradient-bottom: #813ab6;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--cream);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

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

.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(249, 247, 242, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .nav {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px clamp(16px, 4vw, 24px);
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  justify-self: start;
  flex-shrink: 0;
  min-width: 0;
}

.brand-logo {
  height: 34px;
  width: auto;
  max-width: min(180px, 42vw);
  object-fit: contain;
  object-position: left center;
}

.nav-toggle {
  display: inline-flex;
  grid-column: 2;
  justify-self: end;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
  position: absolute;
  top: calc(100% + 10px);
  right: clamp(16px, 4vw, 24px);
  z-index: 30;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-width: 220px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.nav-links.is-open {
  display: flex;
}

.nav-links a {
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--text);
}

.nav-links a:hover {
  background: rgba(119, 82, 232, 0.08);
  color: var(--purple);
}

.nav-dropdown {
  display: flex;
  flex-direction: column;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.nav-dropdown-trigger::after {
  content: "›";
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.nav-dropdown.is-open .nav-dropdown-trigger {
  background: rgba(119, 82, 232, 0.08);
  color: var(--purple);
}

.nav-dropdown.is-open .nav-dropdown-trigger::after {
  transform: rotate(90deg);
  color: var(--purple);
}

.nav-dropdown-trigger:hover {
  background: rgba(119, 82, 232, 0.08);
  color: var(--purple);
}

.nav-dropdown-menu {
  display: none;
  flex-direction: column;
  padding: 0 0 4px 10px;
}

.nav-dropdown.is-open .nav-dropdown-menu {
  display: flex;
}

.nav-dropdown-menu a {
  padding: 10px 14px 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.nav-dropdown-menu a[aria-current="page"] {
  color: var(--purple);
  background: rgba(119, 82, 232, 0.08);
}

.nav-lang {
  display: flex;
  align-items: center;
  padding: 4px 14px 8px;
}

.nav-lang .lang-switch {
  width: auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.button.primary {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 8px 24px rgba(119, 82, 232, 0.32);
}

.button.primary:hover {
  background: var(--purple-dark);
  transform: translateY(-1px);
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero .button.primary {
  background: #007aff;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.28);
}

.hero .button.primary:hover {
  background: #0066d6;
}

.hero {
  background: linear-gradient(160deg, #0a0a0a 0%, #1a1033 55%, #7752e8 100%);
  color: #fff;
  padding: 56px 0 0;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 32px;
  align-items: center;
}

.hero-copy {
  align-self: center;
  padding-bottom: 0;
}

.hero-copy h1 {
  margin: 12px 0 16px;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.hero-copy p {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
  max-width: 34ch;
}

.hero-carousel {
  width: 100%;
  max-width: min(var(--hero-carousel-max-w), 55vw);
  margin-left: auto;
  align-self: end;
}

.hero-carousel-viewport {
  position: relative;
  overflow: hidden;
}

.hero-carousel-track {
  position: relative;
  width: 100%;
  min-height: 0;
}

.hero-slide {
  margin: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.hero-slide.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.hero-slide:not(.is-active) {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

.hero-slide img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(92vh, var(--hero-carousel-max-h));
  object-fit: contain;
  object-position: bottom center;
  clip-path: inset(var(--hero-carousel-top-crop) 0 0 0);
}

.site-footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a:hover {
  color: var(--purple);
}

.legal-main {
  padding: 48px 0 72px;
}

.legal-main .content-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}

.content-card h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.content-card h2 {
  margin: 28px 0 10px;
  font-size: 20px;
  font-weight: 700;
}

.content-card p,
.content-card li {
  color: var(--muted);
}

.content-card ul {
  padding-left: 20px;
}

.content-card a {
  color: var(--purple);
  text-decoration: underline;
  text-underline-offset: 2px;
}

html:has(body.page-home) {
  height: 100%;
  overflow: hidden;
}

body.page-home {
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--rankd-gradient-top) 0%, var(--rankd-gradient-bottom) 100%);
  color: #fff;
}

body.page-home .site-header {
  background: rgba(249, 247, 242, 0.9);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

body.page-home .nav-toggle span {
  background: var(--text);
}

body.page-home .brand-logo {
  filter: none;
}

body.page-home .site-footer {
  display: none;
}

body.page-home .hero {
  padding: clamp(20px, 4vh, 48px) 0 0;
  overflow: hidden;
  background: transparent;
}

body.page-home .hero-slide img {
  max-height: calc(100dvh - 88px);
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    align-items: center;
  }

  .hero-copy {
    padding-bottom: 0;
    text-align: center;
  }

  .button-row {
    justify-content: center;
  }

  .hero-carousel {
    margin: 16px auto 0;
    max-width: min(100%, 480px);
    align-self: center;
  }

  body.page-home {
    display: flex;
    flex-direction: column;
  }

  body.page-home main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  body.page-home .hero {
    flex: 1;
    min-height: 0;
    padding-top: 0;
    display: flex;
    flex-direction: column;
  }

  body.page-home .hero > .container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  body.page-home .hero-grid {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }

  body.page-home .hero-copy {
    text-align: center;
    padding-top: clamp(52px, 13vh, 76px);
    flex-shrink: 0;
  }

  body.page-home .hero-copy h1 {
    margin: 0 0 10px;
    font-size: clamp(22px, 6.5vw, 34px);
    line-height: 1.1;
  }

  body.page-home .button-row {
    justify-content: center;
    margin-top: 10px;
  }

  body.page-home .hero-carousel {
    margin: auto auto 0;
    max-width: min(100%, 340px);
    align-self: center;
  }

  body.page-home .hero-slide img {
    max-height: calc(100dvh - 260px);
  }
}
