/* =====================================================================
   ASORIN — common.css  (loaded on every public page)
   Colours, fonts, header, menu, buttons, footer.
   Each page adds its own file: home.css, activities.css, about.css, settings.css.
   "Gold Light"
   Layout: clean surfaces, no ornament. Motion carries the personality:
   a slow gold glow behind the logo, staggered headline, a moving ticker
   of the five fields, cards that lift and catch light under the cursor.
   ===================================================================== */
:root {
  color-scheme: dark;
  --bg: #07090F;
  --bg-2: #0F131D;
  --bg-3: #171C2A;
  --fg: #EEF0F5;
  --fg-2: #A3A9BA;
  --fg-3: #6B7286;
  --gold: #E2B857;
  --gold-2: #F6D88E;
  --glow-a: rgba(226, 184, 87, .22);
  --glow-b: rgba(70, 100, 220, .22);
  --line: rgba(238, 240, 245, .08);
  --line-2: rgba(226, 184, 87, .38);
  --on-gold: #07090F;
  --shadow: rgba(0, 0, 0, .55);
  --header-bg: rgba(7, 9, 15, .72);

  --f-display: 'Sora', 'Vazirmatn', 'Noto Sans SC', system-ui, sans-serif;
  --f-body: 'Manrope', 'Vazirmatn', 'Noto Sans SC', system-ui, sans-serif;
  --maxw: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #F5F6FA; --bg-2: #FFFFFF; --bg-3: #ECEEF4;
    --fg: #0D1120; --fg-2: #4D5468; --fg-3: #8A90A2;
    --gold: #A67A12; --gold-2: #7E5C0B;
    --glow-a: rgba(226, 184, 87, .38); --glow-b: rgba(90, 120, 240, .16);
    --line: rgba(13, 17, 32, .08); --line-2: rgba(166, 122, 18, .45);
    --on-gold: #FFFFFF; --shadow: rgba(13, 17, 32, .14); --header-bg: rgba(245, 246, 250, .75);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F6FA; --bg-2: #FFFFFF; --bg-3: #ECEEF4;
  --fg: #0D1120; --fg-2: #4D5468; --fg-3: #8A90A2;
  --gold: #A67A12; --gold-2: #7E5C0B;
  --glow-a: rgba(226, 184, 87, .38); --glow-b: rgba(90, 120, 240, .16);
  --line: rgba(13, 17, 32, .08); --line-2: rgba(166, 122, 18, .45);
  --on-gold: #FFFFFF; --shadow: rgba(13, 17, 32, .14); --header-bg: rgba(245, 246, 250, .75);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  background: var(--bg); color: var(--fg);
  font-family: var(--f-body); font-size: 16px; line-height: 1.75;
  transition: background-color .4s ease, color .4s ease;
}
html[dir="rtl"] body { font-family: 'Vazirmatn', var(--f-body); }
a { color: inherit; }
img { max-width: 100%; }
button, select { font-family: inherit; font-size: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3, h4 { text-wrap: balance; }
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.num-ltr { direction: ltr; unicode-bidi: isolate; }
.display { font-family: var(--f-display); font-weight: 700; letter-spacing: -.02em; }
html[dir="rtl"] .display { font-family: 'Vazirmatn', sans-serif; font-weight: 900; letter-spacing: 0; }
html[lang="zh"] .display { font-family: 'Noto Sans SC', sans-serif; font-weight: 900; letter-spacing: 0; }
.label { margin: 0; color: var(--gold); font-weight: 700; font-size: .85rem; }
html[dir="ltr"] .label { text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; }

/* ambient glow: two soft lights drifting behind everything */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient i { position: absolute; border-radius: 50%; filter: blur(90px); }
.ambient i:nth-child(1) { width: 46vmax; height: 46vmax; background: var(--glow-a); top: -18vmax; inset-inline-end: -10vmax; animation: drift1 22s ease-in-out infinite alternate; }
.ambient i:nth-child(2) { width: 40vmax; height: 40vmax; background: var(--glow-b); bottom: -20vmax; inset-inline-start: -12vmax; animation: drift2 26s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-12vmax, 14vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(14vmax, -10vmax) scale(1.15); } }

/* ---------- header ---------- */
header.site {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--header-bg); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent; transition: border-color .3s, padding .3s;
}
header.site.scrolled { border-bottom-color: var(--line); }
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; transition: padding .3s var(--ease); }
header.site.scrolled .nav-row { padding-block: 8px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.logo img { width: 42px; height: 42px; object-fit: contain; flex-shrink: 0; transition: transform .5s var(--ease); }
.logo:hover img { transform: rotate(-8deg) scale(1.06); }
.logo b { font-family: var(--f-display); font-weight: 800; font-size: 1.2rem; letter-spacing: .04em; white-space: nowrap; }
html[dir="rtl"] .logo b { font-family: 'Vazirmatn', sans-serif; font-weight: 900; letter-spacing: 0; }
nav.links { position: relative; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
nav.links a {
  position: relative; z-index: 1; padding: 7px 16px; border-radius: 999px;
  font-size: .9rem; font-weight: 600; color: var(--fg-2); text-decoration: none; transition: color .3s;
}
nav.links a:hover { color: var(--fg); }
nav.links a.current { color: var(--on-gold); }
.nav-pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: var(--gold); transition: left .45s var(--ease), width .45s var(--ease); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--fg); transition: transform .3s var(--ease), border-color .3s;
}
.icon-btn:hover { border-color: var(--gold); transform: rotate(20deg); }
.menu-toggle { display: none; }
.menu-toggle:hover { transform: none; }
select.lang-select {
  height: 40px; padding-inline: 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--fg); font-size: .86rem;
}

/* ---------- mobile drawer ---------- */
.mobile-nav-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 69; opacity: 0; pointer-events: none; transition: opacity .3s; }
.mobile-nav-backdrop.open { opacity: 1; pointer-events: auto; }
.mobile-nav {
  position: fixed; top: 0; inset-inline-end: 0; height: 100%; width: min(84vw, 330px); z-index: 70;
  background: var(--bg-2); padding: calc(84px + env(safe-area-inset-top, 0px)) 24px 24px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
  transform: translateX(100%); visibility: hidden; transition: transform .4s var(--ease), visibility 0s .4s;
}
html[dir="rtl"] .mobile-nav { transform: translateX(-100%); }
.mobile-nav.open { transform: translateX(0) !important; visibility: visible; transition: transform .4s var(--ease), visibility 0s; }
html.switching *, html.switching *::before, html.switching *::after { transition: none !important; }
.mobile-nav-close { position: absolute; top: calc(20px + env(safe-area-inset-top, 0px)); inset-inline-end: 20px; }
.mobile-nav a { padding: 14px 16px; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 1.1rem; color: var(--fg-2); }
.mobile-nav a.current { color: var(--on-gold); background: var(--gold); }

/* ---------- pages ---------- */
main > * { animation: rise .7s var(--ease) both; }
main > *:nth-child(2) { animation-delay: .08s; }
main > *:nth-child(3) { animation-delay: .16s; }
@keyframes rise { from { opacity: .001; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.page-head { padding-block: clamp(48px, 8vw, 96px) 32px; }
.page-head h1 { margin: 12px 0 14px; font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.2; }
html[dir="rtl"] .page-head h1 { line-height: 1.45; }
.page-head p { margin: 0; max-width: 60ch; color: var(--fg-2); font-size: 1.08rem; }

.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--fg); font-weight: 700; font-size: .96rem; text-decoration: none;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s;
}
.btn:hover { transform: translateY(-3px); border-color: var(--gold); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--on-gold); box-shadow: 0 10px 30px -10px var(--glow-a); }
.btn-gold:hover { box-shadow: 0 18px 40px -12px var(--gold); }
.btn-gold::after { /* light sweep */
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-20deg); animation: sweep 3.8s ease-in-out 1.2s infinite;
}
@keyframes sweep { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn .arr { transition: transform .35s var(--ease); }
html[dir="rtl"] .btn .arr { transform: scaleX(-1); }
.btn:hover .arr { transform: translateX(4px); }
html[dir="rtl"] .btn:hover .arr { transform: scaleX(-1) translateX(4px); }

/* ---------- footer / fab ---------- */
footer.site { border-top: 1px solid var(--line); padding-block: 40px 100px; color: var(--fg-2); font-size: .9rem; }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot nav a { text-decoration: none; transition: color .2s; }
.foot-contacts { display: contents; }
.foot nav a:hover { color: var(--gold); }
.foot small { font-size: .8rem; color: var(--fg-3); }
.fab {
  position: fixed; inset-inline-end: 22px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 55;
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; text-decoration: none;
  background: #22B35E; color: #fff; box-shadow: 0 12px 30px var(--shadow); transition: transform .35s var(--ease);
}
.fab::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #22B35E; z-index: -1; animation: ping 2.4s ease-out infinite; }
@keyframes ping { from { transform: scale(1); opacity: .55; } to { transform: scale(1.7); opacity: 0; } }
.fab:hover { transform: scale(1.08); }

/* scroll-linked reveal where the browser supports it; static elsewhere */
@supports (animation-timeline: view()) {
  .sr { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
}

/* ---------- responsive (shared parts) ---------- */
@media (max-width: 960px) {
  nav.links { display: none; }
  .menu-toggle { display: grid; }
}
@media (max-width: 600px) {
  select.lang-select { padding-inline: 8px; font-size: .8rem; }
}
@media (max-width: 400px) { .logo b { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
