/* Veilcast Games — minimal studio site, light + dark */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-tint: #f6f7f9;
  --surface: #ffffff;
  --text: #2d3748;
  --text-soft: #4a5568;
  --muted: #6c757d;
  --faint: #68727c;
  --line: #e9ecef;
  --accent: #323e3e;
  --on-accent: #ffffff;
  --gold: #a07a2e;
  --gold-soft: #f6efe0;
  --chip: #e9ecef;
  --chip-text: #495057;
  --nav-bg: rgba(255, 255, 255, 0.95);
  --pill-bg: rgba(255, 255, 255, 0.9);
  --footer-bg: #1f2626;
  --footer-text: #c9ced3;
  --footer-dim: #8a9197;
  --footer-faint: #a0a8ae;
  --footer-line: #323e3e;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.14);
  --radius: 8px;
  --nav-h: 56px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121616;
  --bg-tint: #171c1d;
  --surface: #1c2223;
  --text: #e6e9ec;
  --text-soft: #b9c0c6;
  --muted: #8f979e;
  --faint: #a0a9b1;
  --line: #2a3133;
  --accent: #dfe4e6;
  --on-accent: #121616;
  --gold: #d4b26a;
  --gold-soft: rgba(212, 178, 106, 0.14);
  --chip: #262d2f;
  --chip-text: #c3c9ce;
  --nav-bg: rgba(18, 22, 22, 0.92);
  --pill-bg: rgba(18, 22, 22, 0.8);
  --footer-bg: #0c0f0f;
  --footer-line: #232a2b;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.5);
}

/* ---------- Language switching ---------- */
:root[lang="en"] .zh,
:root:not([lang="en"]) .en { display: none !important; }

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); background: var(--bg); }

body {
  margin: 0;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}
.navbar.is-scrolled { box-shadow: 0 1px 0 var(--line), 0 4px 16px rgba(0, 0, 0, 0.05); }
.navbar__inner { display: flex; align-items: center; gap: 24px; height: var(--nav-h); }

.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand__mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent) 48%, transparent 52%), var(--faint);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.brand__word { font-weight: 600; letter-spacing: 4px; font-size: 17px; color: var(--accent); }

.nav { display: flex; gap: 36px; margin-left: auto; }
.nav-link {
  position: relative;
  font-size: 13px; letter-spacing: 1.5px; color: var(--muted);
  transition: color 0.2s ease;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--accent); transform: scaleX(0); transition: transform 0.25s ease;
}
.nav-link:hover, .nav-link.is-active { color: var(--text); }
.nav-link.is-active::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.toggle {
  padding: 5px 10px; min-width: 36px;
  font-size: 12px; letter-spacing: 0.08em; line-height: 1.4; white-space: nowrap;
  color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 4px; cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.toggle:hover { color: var(--text); border-color: var(--faint); }

.menu-btn {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 0 9px; background: none; border: 0; cursor: pointer;
}
.menu-btn__bar { height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
.menu-btn[aria-expanded="true"] .menu-btn__bar:nth-child(2) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__bar:nth-child(3) { opacity: 0; }
.menu-btn[aria-expanded="true"] .menu-btn__bar:nth-child(4) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav { background: var(--surface); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12); padding: 8px 16px 16px; }
.mobile-nav a { display: block; padding: 12px 8px; font-size: 14px; letter-spacing: 1.5px; color: var(--text-soft); border-bottom: 1px solid var(--line); }
.mobile-nav a:last-child { border-bottom: 0; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section--tint { background: var(--bg-tint); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.section-title {
  margin: 0; font-size: 2rem; font-weight: 350; color: var(--text);
  text-transform: uppercase; letter-spacing: 1.5px; line-height: 1.2;
}
.title-highlight { font-weight: 300; color: var(--text-soft); }
.title-line { width: 40px; height: 2px; margin-top: 8px; background: linear-gradient(90deg, var(--muted) 0%, var(--faint) 50%, transparent 100%); opacity: 0.8; }
.section-sub { margin: 10px 0 0; font-size: 14px; color: var(--muted); letter-spacing: 2px; }

.text-link { font-size: 14px; color: var(--muted); letter-spacing: 1px; white-space: nowrap; transition: color 0.2s; }
.text-link:hover { color: var(--text); }

/* ---------- Buttons & badges ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 999px; font-size: 13px; letter-spacing: 0.5px;
  border: 1px solid var(--accent); color: var(--accent); background: transparent;
  transition: background 0.2s, color 0.2s;
}
.btn--ghost:hover { background: var(--accent); color: var(--on-accent); }

.badge {
  display: inline-block; padding: 3px 12px; border-radius: 15px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase;
  background: var(--chip); color: var(--chip-text);
}
.badge--gold { background: var(--gold-soft); color: var(--gold); }
.badge--soon { background: var(--accent); color: var(--on-accent); }

/* ---------- News ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.news-card {
  display: flex; flex-direction: column; background: var(--surface);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.news-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.news-card__image { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--line); }
.news-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.news-card:hover .news-card__image img { transform: scale(1.05); }
.news-category {
  position: absolute; top: 14px; left: 14px; padding: 4px 12px; border-radius: 15px;
  background: var(--pill-bg); color: var(--chip-text);
  font-size: 12px; font-weight: 600; letter-spacing: 0.5px;
}
.news-card__body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.news-title { margin: 0 0 10px; font-size: 17px; font-weight: 600; line-height: 1.5; }
.news-excerpt {
  margin: 0 0 18px; color: var(--muted); font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card__footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.news-date { font-size: 13px; color: var(--faint); letter-spacing: 1px; }

/* ---------- Games ---------- */
.games-list { display: grid; gap: 32px; }
.game-card {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}
.game-card:hover { box-shadow: var(--shadow-hover); }
.game-card:nth-child(even) .game-card__media { order: 2; }

.game-card__media {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0;
  background: #1c2222; cursor: pointer; overflow: hidden;
}
.game-card__media video { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.game-card__media:hover video { transform: scale(1.03); }
.game-card__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.35); border: 1.5px solid rgba(255, 255, 255, 0.85);
  transition: background 0.2s, transform 0.2s;
}
.game-card__play svg { width: 22px; height: 22px; fill: #fff; margin-left: 3px; }
.game-card__media:hover .game-card__play { background: rgba(0, 0, 0, 0.55); transform: translate(-50%, -50%) scale(1.08); }

.game-card__body { padding: 32px 36px; display: flex; flex-direction: column; align-items: flex-start; }
.game-title { margin: 14px 0 8px; font-size: 26px; font-weight: 600; line-height: 1.3; }
.game-title small { display: block; margin-top: 4px; font-size: 14px; font-weight: 400; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }
.game-desc { margin: 0 0 10px; color: var(--text-soft); }
.game-meta { margin: 0 0 14px; font-size: 13px; color: var(--faint); letter-spacing: 1px; }
.game-awards { margin: 0 0 20px; padding: 0; list-style: none; font-size: 13px; color: var(--gold); }
.game-awards li { position: relative; padding-left: 18px; }
.game-awards li::before { content: "★"; position: absolute; left: 0; font-size: 11px; top: 2px; }
.game-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.about__text p { color: var(--text-soft); }
.about__quote { margin: 32px 0 24px; padding: 4px 0 4px 22px; border-left: 2px solid var(--accent); }
.about__quote p { margin: 0; font-size: 20px; font-weight: 300; line-height: 1.6; color: var(--text); }
.about__quote cite { display: block; margin-top: 10px; font-style: normal; font-size: 13px; letter-spacing: 1.5px; color: var(--muted); }
.about__stats { display: flex; gap: 40px; margin: 32px 0 0; }
.about__stats dt { font-size: 30px; font-weight: 300; color: var(--accent); line-height: 1.2; }
.about__stats dd { margin: 4px 0 0; font-size: 13px; color: var(--muted); letter-spacing: 1px; }
.about__photo { aspect-ratio: 4 / 3; border-radius: var(--radius); }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--bg); }
.gallery figure { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; background: var(--line); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease, filter 0.5s ease; filter: grayscale(0.35); }
.gallery figure:hover img { transform: scale(1.05); filter: none; }

/* ---------- Jobs ---------- */
.jobs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.job { background: var(--surface); border-radius: var(--radius); padding: 26px 26px 22px; box-shadow: var(--shadow); }
.job h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.job p { margin: 0; font-size: 13px; color: var(--muted); }
.job .job__desc { margin-top: 14px; font-size: 14px; color: var(--text-soft); }
.jobs__note { margin: 32px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- Footer ---------- */
.footer { background: var(--footer-bg); color: var(--footer-text); padding: 64px 0 28px; font-size: 14px; }
.footer__grid { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr; gap: 48px; }
.brand--footer .brand__word { color: #fff; }
.brand--footer .brand__mark { background: linear-gradient(160deg, #fff 0%, #fff 48%, transparent 52%), #6c757d; box-shadow: inset 0 0 0 1.5px #fff; }
.footer__brand p { margin: 12px 0 0; color: var(--footer-dim); }
.footer__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; align-content: start; }
.footer__nav a { font-size: 13px; letter-spacing: 1.5px; color: var(--footer-text); transition: color 0.2s; }
.footer__nav a:hover { color: #fff; }
.footer__contact h2 { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: 1.5px; color: #fff; }
.footer__contact p { margin: 0 0 6px; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.socials a { padding: 5px 12px; border: 1px solid #3d4a4a; border-radius: 999px; font-size: 12px; color: var(--footer-dim); transition: border-color 0.2s, color 0.2s; }
.socials a:hover { border-color: var(--footer-dim); color: #fff; }
.footer__legal { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--footer-line); font-size: 12px; color: var(--footer-faint); }
.footer__legal p { margin: 0 0 4px; }

/* ---------- Video modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(10, 14, 14, 0.85); animation: fade 0.25s ease; }
.modal__panel { position: relative; width: min(1100px, 100%); animation: rise 0.3s ease; }
.modal__video { width: 100%; max-height: 80vh; background: #000; border-radius: 6px; }
.modal__title { margin: 12px 0 0; color: #c9ced3; font-size: 14px; letter-spacing: 1px; text-align: center; }
.modal__close {
  position: absolute; top: -44px; right: -4px; width: 40px; height: 40px;
  border: 0; background: none; color: #fff; font-size: 32px; line-height: 1; cursor: pointer; opacity: 0.8;
}
.modal__close:hover { opacity: 1; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

body.no-scroll { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .news-grid, .jobs { grid-template-columns: 1fr 1fr; }
  .game-card { grid-template-columns: 1fr; }
  .game-card:nth-child(even) .game-card__media { order: 0; }
  .about { grid-template-columns: 1fr; gap: 40px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__contact { grid-column: 1 / -1; }
  .nav { gap: 24px; }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .nav-actions { margin-left: auto; }
  .menu-btn { display: flex; }
}

@media (max-width: 768px) {
  .section { padding: 72px 0; }
  .section-title { font-size: 1.5rem; }
  .gallery { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .navbar__inner { gap: 12px; }
  .brand__word { letter-spacing: 3px; font-size: 15px; }
  .toggle { padding: 4px 8px; }
  .news-grid, .jobs { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .game-card__body { padding: 24px 20px; }
  .game-title { font-size: 22px; }
  .about__stats { gap: 28px; }
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Brand artwork is supplied in separate light and dark variants. */
.theme-dark { display: none; }
:root[data-theme="dark"] .theme-light { display: none; }
:root[data-theme="dark"] .theme-dark { display: block; }
.brand__icon { width: 40px; height: 24px; object-fit: contain; flex-shrink: 0; }
.hero { padding: calc(var(--nav-h) + 72px) 0 72px; background: #fff; text-align: center; }
:root[data-theme="dark"] .hero { background: #000; }
.hero__logo { margin: 0; }
.hero__banner { width: 100%; height: auto; }
.hero__eyebrow { margin: 28px 0 0; color: var(--muted); font-size: 11px; letter-spacing: .22em; }
.hero__tagline { margin: 14px 0 0; font-size: clamp(18px, 2.2vw, 26px); letter-spacing: .06em; }
.hero__actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 24px; margin-top: 28px; }
.btn--solid { background: var(--accent); color: var(--on-accent); }
.btn--solid:hover { opacity: .82; }
.btn { cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 3px solid #798d9d; outline-offset: 5px; }
.game-card { align-items: center; }
.game-awards a { text-decoration: underline; text-underline-offset: 3px; }
.game-awards a:hover { color: var(--text); }
@media (min-width: 961px) {
  .game-card:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
}
.game-card--featured { scroll-margin-top: 24px; }
.game-card__embed { align-self: start; padding-top: 32px; min-width: 0; background: #000; }
.game-trailer { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.trailer-link { display: block; padding: 12px 20px; font-size: 13px; color: #d2d8dc; text-align: right; }
.trailer-link:hover { color: #fff; text-decoration: underline; }
.game-details { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 32px 36px; border-top: 1px solid var(--line); }
.game-details h4 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.game-details p { margin: 0 0 12px; color: var(--text-soft); font-size: 14px; line-height: 1.85; }
.game-details p:last-child { margin-bottom: 0; }
.about__photo { display: grid; align-items: center; padding: 40px; background: #fff; border: 1px solid var(--line); }
:root[data-theme="dark"] .about__photo { background: #000; }
.about__photo img { width: 100%; height: auto; }
.join-intro { max-width: 48em; margin: -8px 0 28px; color: var(--text-soft); }
.jobs { grid-template-columns: repeat(3, 1fr); }
.jobs__note a, .contact-email { text-decoration: underline; text-underline-offset: 4px; overflow-wrap: anywhere; }
.community { margin-top: 24px; scroll-margin-top: 80px; }
.community__number { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.community__number strong { font-size: 24px; font-weight: 500; letter-spacing: .08em; color: #fff; }
.copy-btn { padding: 5px 10px; background: transparent; border: 1px solid #7e8b8b; border-radius: 4px; color: #eef2f2; cursor: pointer; font-size: 12px; }
.copy-btn:hover { background: #354242; }
.community .community__hint { margin-top: 10px; font-size: 12px; color: #a0a8ae; }
.copy-status { min-height: 1.7em; font-size: 12px; color: #c9dcd3; }
.footer__legal a:hover { color: #fff; text-decoration: underline; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (max-width: 960px) {
  .game-card__embed { padding-top: 0; }
  .jobs { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hero { padding: calc(var(--nav-h) + 44px) 0 48px; }
  .hero__eyebrow { font-size: 9px; letter-spacing: .12em; margin-top: 24px; }
  .hero__actions { gap: 18px; }
  .hero__actions .btn { padding: 9px 16px; }
  .game-details { grid-template-columns: 1fr; gap: 24px; padding: 24px 20px; }
  .jobs { grid-template-columns: 1fr; }
  .brand { gap: 6px; }
  .brand__word { letter-spacing: 2px; font-size: 14px; }
  .brand__icon { width: 32px; height: 22px; }
  .navbar__inner { gap: 6px; }
  .nav-actions { gap: 4px; }
  .toggle { padding: 4px 6px; }
  .about__stats { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .navbar__inner { padding: 0 12px; gap: 4px; }
  .navbar .brand__word { font-size: 12px; letter-spacing: 1px; }
}
