:root {
  --bg: #f5f6f8;
  --bg-2: #eceef1;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --surface-3: #e9ebef;
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.16);
  --ink: #0f1216;
  --muted: #4b5560;
  --faint: #707a86;
  --brand: #d99a06;
  --brand-text: #936700;
  --brand-soft: rgba(217, 154, 6, 0.12);
  --on-brand: #1a1206;
  --ring: rgba(217, 154, 6, 0.30);
  --ok: #15803d;
  --err: #dc2626;
  --grid-line: rgba(15, 23, 42, 0.05);
  --shadow: 0 18px 50px -24px rgba(15, 23, 42, 0.30);
  --header-bg: rgba(255, 255, 255, 0.82);
}

html.dark {
  --bg: #07080a;
  --bg-2: #0b0d11;
  --surface: #101319;
  --surface-2: #161a21;
  --surface-3: #1d222b;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --ink: #f3f5f7;
  --muted: #9aa3ad;
  --faint: #69727d;
  --brand: #f5b50a;
  --brand-text: #f7c948;
  --brand-soft: rgba(245, 181, 10, 0.10);
  --on-brand: #0a0a0a;
  --ring: rgba(245, 181, 10, 0.35);
  --ok: #34d399;
  --err: #f87171;
  --grid-line: rgba(255, 255, 255, 0.04);
  --shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);
  --header-bg: rgba(7, 8, 10, 0.72);
}

* {
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--ink);
  transition: background-color 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--brand);
  color: var(--on-brand);
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--brand);
  border-radius: 999px;
  border: 2px solid var(--bg);
}

.ink {
  color: var(--ink);
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.brand-text {
  color: var(--brand-text);
}

.bg-base {
  background-color: var(--bg);
}

.bg-alt {
  background-color: var(--bg-2);
}

.surface {
  background-color: var(--surface);
  border: 1px solid var(--border);
}

.surface-2 {
  background-color: var(--surface-2);
}

.hairline {
  border-color: var(--border);
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

.card-hover:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  border-radius: 999px;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 10px 30px -12px var(--ring);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -12px var(--ring);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  color: var(--brand-text);
}

.field {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  color: var(--ink);
  font-weight: 500;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.field::placeholder {
  color: var(--faint);
}

.field:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--ring);
  background: var(--surface);
}

.field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--brand-soft);
  color: var(--brand-text);
  border: 1px solid var(--border);
}

.rule {
  height: 3px;
  width: 56px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), transparent);
}

.grid-bg {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 46px 46px;
}

.glow-amber {
  position: absolute;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.16;
  filter: blur(120px);
  pointer-events: none;
}

.link-underline {
  position: relative;
}

.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.link-underline:hover {
  color: var(--brand-text);
}

.link-underline:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.lang-pill {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--faint);
  padding: 0.25rem 0.45rem;
  border-radius: 7px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.lang-pill.active {
  color: var(--on-brand);
  background: var(--brand);
}

.icon-tile {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--brand-soft);
  color: var(--brand-text);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease, color 0.3s ease;
}

.card-hover:hover .icon-tile {
  transform: scale(1.08) rotate(-4deg);
  background: var(--brand);
  color: var(--on-brand);
}

.z-dropdown { z-index: 30; }
.z-sticky { z-index: 40; }
.z-header { z-index: 50; }
.z-backdrop { z-index: 90; }
.z-modal { z-index: 100; }
.z-toast { z-index: 120; }
.z-lightbox { z-index: 200; }

.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, padding 0.3s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 12px 34px -22px rgba(0, 0, 0, 0.55);
}

.hero-card {
  background: rgba(8, 10, 14, 0.5);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 0.85);
}

.toast-item {
  transform: translateX(120%);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.toast-item.show {
  transform: translateX(0);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--brand), var(--brand-text));
  z-index: 130;
  will-change: transform;
}

@keyframes kenburns {
  from { transform: scale(1.12); }
  to { transform: scale(1); }
}

.heroSwiper .swiper-slide img {
  transform: scale(1.12);
}

.heroSwiper .swiper-slide-active img {
  animation: kenburns 7s ease-out forwards;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

.pop-in {
  animation: pop-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes bar-grow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

.bar-grow {
  transform-origin: bottom;
  animation: bar-grow 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), filter 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

html.js .reveal.reveal-l { transform: translateX(-34px); }
html.js .reveal.reveal-r { transform: translateX(34px); }
html.js .reveal.reveal-scale { transform: scale(0.94); filter: blur(8px); }

html.js .reveal.in {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

html.js .reveal[data-delay="1"] { transition-delay: 0.07s; }
html.js .reveal[data-delay="2"] { transition-delay: 0.14s; }
html.js .reveal[data-delay="3"] { transition-delay: 0.21s; }
html.js .reveal[data-delay="4"] { transition-delay: 0.28s; }
html.js .reveal[data-delay="5"] { transition-delay: 0.35s; }
html.js .reveal[data-delay="6"] { transition-delay: 0.42s; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

.modal-panel {
  animation: modal-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.backdrop-in {
  animation: backdrop-in 0.25s ease-out both;
}

@keyframes admin-in {
  from { opacity: 0; transform: translateY(12px); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

.admin-enter > * {
  animation: admin-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.admin-enter > *:nth-child(1) { animation-delay: 0.02s; }
.admin-enter > *:nth-child(2) { animation-delay: 0.08s; }
.admin-enter > *:nth-child(3) { animation-delay: 0.14s; }
.admin-enter > *:nth-child(4) { animation-delay: 0.2s; }
.admin-enter > *:nth-child(5) { animation-delay: 0.26s; }

.float-btn {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}

.float-btn:hover {
  transform: translateY(-4px) scale(1.05);
}

.copy-btn .fa-check { display: none; }
.copy-btn.copied .fa-copy { display: none; }
.copy-btn.copied .fa-check { display: inline-block; }

.swiper-pagination-bullet {
  background: var(--faint) !important;
  opacity: 0.5 !important;
}

.swiper-pagination-bullet-active {
  background: var(--brand) !important;
  opacity: 1 !important;
  width: 22px !important;
  border-radius: 6px !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html.js .reveal {
    opacity: 1;
    transform: none;
  }
}
