:root{
  --bg: #000000;
  --bg-2: #0a0a0a;
  --text: #fafafa;
  --muted: #a1a1aa;
  --border: #27272a;
  --orange: #fb923c;
  --sky: #38bdf8;
  --green: #34d399;
  --card: #111114;
  --card-2: #0f0f12;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.02);
  --nav-h: 64px; /* JS 會覆寫為實際高度 */
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
  padding-top: var(--nav-h); /* 讓內容不被 fixed 導覽列遮住 */
}

/* Layout helpers */
.container{ width:100%; max-width: 1120px; padding: 0 20px; margin: 0 auto; }
.section{ padding: 72px 0; }
.text-center{ text-align:center; }
.max-600{ max-width: 600px; margin-inline: auto; }
.mt-8{ margin-top: 8px; } .mt-16{ margin-top: 16px; }

/* Typography */
.title-xl{ font-size: clamp(36px, 6vw, 64px); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.title-lg{ font-size: clamp(24px, 4vw, 34px); font-weight: 700; }
.subtitle{ font-size: clamp(16px, 2.4vw, 20px); color: var(--muted); max-width: 840px; margin: 12px auto 0; }
.muted{ color: var(--muted); }
.small{ font-size: 14px; }
.xsmall{ font-size: 12px; }

/* Navbar (fixed) */
.navbar{
  position: fixed;
  top:0; left:0; right:0; width:100%;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(0,0,0,.35);
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: box-shadow .24s ease, background .24s ease;
}
.navbar.scrolled{
  background: rgba(0,0,0,.6);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.nav-inner{
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; padding: 14px 20px; max-width: 1120px; margin: 0 auto;
}
.brand{ display:flex; align-items:center; gap: 10px; text-decoration:none; color: var(--text); }
.brand-mark{ width: 28px; height: 28px; border-radius: 8px; }
.brand-name{ font-weight: 800; letter-spacing: .2px;}
.badge{
  font-size: 12px; color: #111; background: #fff; border-radius: 999px; padding: 4px 8px; font-weight: 700;
}
.nav-links{ display:flex; align-items:center; gap:16px; }
.nav-link{ color: var(--muted); text-decoration: none; font-size: 14px; }
.nav-link:hover{ color: var(--text); }

/* Buttons */
.btn{
  --padx: 18px; --pady: 11px;
  display:inline-flex; align-items:center; gap:8px;
  padding: var(--pady) var(--padx);
  border-radius: 999px; text-decoration:none; border: 1px solid transparent;
  font-weight: 700; font-size: 14px; line-height: 1;
  transition: transform .15s ease, box-shadow .15s ease, border-color .2s;
  will-change: transform;
  cursor: pointer;
}
.btn .icon{ display:block; }
.btn--primary{
  color: #111; background: var(--orange);
  box-shadow: 0 6px 24px rgba(251,146,60,.35);
}
.btn--primary:hover{ transform: translateY(-2px); }
.btn--secondary{
  color: #111; background: #e5e7eb;
}
.btn--ghost{
  color: var(--text); background: transparent; border-color: var(--border);
}
.btn-row{ display:flex; gap:12px; flex-wrap:wrap; }
.btn-row.center{ justify-content:center; }

/* Hero specific */
.hero{ position:relative; padding-top: 112px; padding-bottom: 48px; }
.hero-glows{ position:absolute; inset:0; overflow:hidden; pointer-events:none; }
.glow{
  position:absolute; width: 56rem; height: 56rem; border-radius: 9999px; filter: blur(140px);
  opacity: .14; transform: translate(-50%, -50%);
}
.glow--orange{ background: var(--orange); left: 55%; top: 35%; }
.glow--sky{ background: var(--sky); left: 30%; top: 70%; opacity: .12; }

.hero-body{ text-align:center; }
.hero-ctas{ display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin-top: 18px; }
.hero-badges{ display:flex; gap:10px; justify-content:center; margin-top: 14px; flex-wrap:wrap; }
.badge--outline{
  color: var(--muted); border: 1px solid var(--border); background: rgba(255,255,255,.04); border-radius: 999px; padding: 6px 10px; display:inline-flex; gap:6px; align-items:center;
}
.badge--link{ color: var(--muted); display:inline-flex; align-items:center; gap:6px; text-decoration:none; }
.badge--link:hover{ color: var(--text); }

/* Teaser */
.teaser-wrap{ margin-top: 28px; }
.teaser-tilt{ perspective: 1200px; }
.teaser-card{
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(135deg, #0e0e12, #0b0b0d);
  overflow:hidden;
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  transition: transform 180ms ease;
}
.teaser-cover{ width:100%; display:block; aspect-ratio: 16/9; object-fit: cover; }
.teaser-center{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center; gap:10px;
  color: var(--muted);
}

/* Cards / Panels */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
}
.card-title{ font-weight: 700; display:flex; align-items:center; gap:8px; }
.card--hoverrise{ transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card--hoverrise:hover{
  transform: translateY(-4px);
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 16px 36px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.03);
}

.panel{
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel-row{ display:flex; align-items:flex-start; gap:12px; }
.panel-title{ font-weight: 700; }

/* Steps list */
.steps{ list-style: none; padding:0; margin:0; display:grid; gap:12px; }
.steps .num{
  display:inline-flex; align-items:center; justify-content:center;
  width: 22px; height:22px; border-radius:999px;
  background: rgba(251,146,60,.16); color: var(--orange); font-weight:800; margin-right: 10px;
}

/* Chips */
.chip-row{ display:flex; gap:8px; flex-wrap:wrap; margin-top: 16px; }
.chip{
  border-radius: 999px; padding: 6px 10px; border:1px solid transparent; display:inline-flex; gap:6px; align-items:center;
}
.chip--green {
  background: rgba(77, 255, 166, 0.08);
  border: 1px solid rgba(77, 255, 166, 0.35);
  color: #4dffa6;
  backdrop-filter: blur(6px);
}

.chip--orange {
  background: rgba(255, 180, 70, 0.08);
  border: 1px solid rgba(255, 180, 70, 0.35);
  color: #ffb546;
  backdrop-filter: blur(6px);
}

.chip--sky {
  background: rgba(115, 190, 255, 0.08);
  border: 1px solid rgba(115, 190, 255, 0.35);
  color: #73beff;
  backdrop-filter: blur(6px);
}

/* Keep outline neutral gray for balance */
.chip--outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
}

/* === Divider & Footnote === */
.divider-glass {
  width: 60%;
  margin: 0 auto;
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  backdrop-filter: blur(4px);
}

.muted.xsmall {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.78rem;
  line-height: 1.5;
  letter-spacing: 0.2px;
}

/* Team */
.team{ text-align:center; }
.avatar{
  width: 128px; height:128px; border-radius: 999px; display:block; margin: 8px auto 12px; background:#1b1b1f; border: 1px solid var(--border);
}
.team-name{ font-weight: 700; }

/* Footer */
.footer{ border-top: 1px solid rgba(255,255,255,.06); padding: 28px 0; background: rgba(0,0,0,.45); }
.footer-inner{ display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.footer-links{ display:flex; gap:12px; }
.link{ color: var(--muted); text-decoration:none; }
.link:hover{ color: var(--text); }

/* Grids */
.grid-4{ display:grid; grid-template-columns: 1fr; }
.grid-3{ display:grid; grid-template-columns: 1fr; }
.grid-2{ display:grid; grid-template-columns: 1fr; }
.grid-story{ display:grid; grid-template-columns: 1fr; }

.gap-lg{ gap:16px; } .gap-xl{ gap:24px; }

/* Responsive */
@media (min-width: 700px){
  .grid-2{ grid-template-columns: 1fr 1fr; }
  .grid-3{ grid-template-columns: repeat(3,1fr); }
}
@media (min-width: 920px){
  .grid-4{ grid-template-columns: repeat(4,1fr); }
  .grid-story{ grid-template-columns: 1.2fr 1fr; }
}

/* In-view animations with IntersectionObserver */
.fade-up{ opacity:0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.fade-up.is-inview{ opacity:1; transform: none; }
.stagger[data-stagger] > *{ transition-delay: var(--d, 0ms); }
.inview-on-load{ opacity:1 !important; transform:none !important; }

/* Magnetic wrapper */
.magnet-wrap{ position: relative; }
.magnet{ display:inline-flex; will-change: transform; }

/* --- Mobile Navigation --- */
.hamburger{
  display:none; position:relative; width:44px; height:36px; border:0; background:transparent; cursor:pointer;
  border-radius:10px;
}
.hamburger:focus-visible{ outline: 2px solid var(--orange); outline-offset: 2px; }
.hamburger-bar{
  display:block; width:22px; height:2px; background:#e5e7eb; margin:5px auto; transition:transform .25s ease, opacity .2s;
}
.hamburger.is-open .hamburger-bar:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.hamburger.is-open .hamburger-bar:nth-child(2){ opacity:0; }
.hamburger.is-open .hamburger-bar:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

.mobile-menu{
  display:none;
  position: absolute; top: var(--nav-h); left:0; right:0;
  background: rgba(0,0,0,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 12px 20px 18px;
}
.mobile-menu.is-open{ display:block; animation: menuFade .18s ease; }
@keyframes menuFade{ from{opacity:0; transform: translateY(-6px);} to{opacity:1; transform:none;} }

.mobile-link{
  display:block; padding: 12px 6px; color: var(--text); text-decoration:none; border-radius: 10px;
}
.mobile-link:hover{ background: rgba(255,255,255,.06); }
.mobile-cta{ display:block; text-align:center; margin-top: 6px; }

/* RWD: 折疊成漢堡選單 */
@media (max-width: 920px){
  .nav-links[data-desktop]{ display:none; }
  .hamburger{ display:inline-flex; align-items:center; justify-content:center; }
}

/* 小螢幕排版增強 */
@media (max-width: 420px){
  .title-xl{ font-size: clamp(28px, 9vw, 40px); }
  .subtitle{ font-size: 15px; }
  .btn{ --padx: 14px; --pady: 10px; font-size: 13px; }
  .badge{ font-size: 11px; }
}

/* 大桌面寬度優化 */
@media (min-width: 1280px){
  .container{ max-width: 1200px; }
}

/* Back to Top Button */
.backtotop{
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 60;
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  color: #111; background: var(--orange);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 24px rgba(251,146,60,.35), 0 2px 0 rgba(255,255,255,.06) inset;
  opacity: 0; transform: translateY(10px) scale(.9);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, box-shadow .2s ease;
}
.backtotop:hover{ box-shadow: 0 14px 30px rgba(251,146,60,.45), 0 2px 0 rgba(255,255,255,.06) inset; }
.backtotop:focus-visible{ outline: 2px solid #fff; outline-offset: 3px; }
.backtotop.show{ opacity: 1; transform: none; pointer-events: auto; }

@media (max-width: 420px){
  .backtotop{ width: 44px; height: 44px; bottom: calc(12px + env(safe-area-inset-bottom)); right: max(12px, env(safe-area-inset-right)); }
}

/* Figure (for architecture diagram) */
.figure{ margin: 20px 0 0; }
.figure-img{
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: #0e0e12;
}
.figure-cap{ margin-top: 8px; text-align: center; }

/* Video grid */
.video-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}
.video-card .card-title{ margin-top: 10px; }
.video-embed{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;            /* responsive iframe */
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
}
.video-embed iframe{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  background: #000;
}

/* Wider grids on larger screens */
@media (min-width: 700px){
  .video-grid{ grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1120px){
  .video-grid{ grid-template-columns: 1fr 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .fade-up{ transition:none; opacity:1; transform:none; }
  .teaser-card{ transition:none; }
  .navbar, .btn{ transition:none; }
  .backtotop{ transition: opacity .1s linear; transform: none; }
}

/* --- Modal (beta) --- */
.modal{ position: fixed; inset: 0; display: none; z-index: 80; }
.modal.is-open{ display: block; }
.modal__backdrop{ position:absolute; inset:0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.modal__dialog{
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 32px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 20px 16px;
}
.modal__body{ margin-bottom: 14px; }
.modal__actions{ display:flex; justify-content:flex-end; gap:10px; }
.modal__close{
  position:absolute; right: 10px; top: 8px; width: 36px; height: 36px;
  border-radius: 10px; border: 1px solid var(--border);
  background: rgba(255,255,255,.04); color: var(--text); font-size: 20px; line-height: 1;
  cursor: pointer;
}
.modal__close:hover{ background: rgba(255,255,255,.08); }

/* =========================================================
   MemoSpace — Styles Add-on (non-destructive)
   ========================================================= */

/* ---------------- Modal (Public Beta) ------------------- */
.modal{ position: fixed; inset: 0; display: none; z-index: 80; }
.modal.is-open{ display: block; }
.modal__backdrop{ position:absolute; inset:0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.modal__dialog{
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 32px));
  background: var(--card, rgba(20,20,20,.9));
  border: 1px solid var(--border, rgba(255,255,255,.12));
  border-radius: var(--radius, 16px);
  box-shadow: var(--shadow, 0 10px 40px rgba(0,0,0,.35));
  padding: 20px 20px 16px;
}
.modal__body{ margin-bottom: 14px; }
.modal__actions{ display:flex; justify-content:flex-end; gap:10px; }
.modal__close{
  position:absolute; right: 10px; top: 8px; width: 36px; height: 36px;
  border-radius: 10px; border: 1px solid var(--border, rgba(255,255,255,.12));
  background: rgba(255,255,255,.04); color: var(--text, #fff); font-size: 20px; line-height: 1;
  cursor: pointer;
}
.modal__close:hover{ background: rgba(255,255,255,.08); }

/* --------------- Fade-up & Stagger (safe) --------------- */
/* 使用 :where 降低優先度，避免覆寫你既有規則 */
:where(.fade-up){
  opacity: 0; transform: translateY(20px);
  transition: opacity .8s ease, transform .8s ease;
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
:where(.fade-up).is-inview,
:where(.fade-up).inview-on-load{
  opacity: 1; transform: translateY(0);
}

/* 降低動畫在減少動效偏好下的負擔 */
@media (prefers-reduced-motion: reduce){
  :where(.fade-up){ transition: none !important; transform: none !important; opacity: 1 !important; }
}

/* ----------------- Chips (refined colors) --------------- */
/* 深色玻璃風，與現有 chip 系列相容 */
.chip--green{
  background: rgba(77, 255, 166, 0.08);
  border: 1px solid rgba(77, 255, 166, 0.35);
  color: #4dffa6;
  backdrop-filter: blur(6px);
}
.chip--orange{ /* SDG 11 */
  background: rgba(255, 180, 70, 0.08);
  border: 1px solid rgba(255, 180, 70, 0.35);
  color: #ffb546;
  backdrop-filter: blur(6px);
}
.chip--sky{
  background: rgba(115, 190, 255, 0.08);
  border: 1px solid rgba(115, 190, 255, 0.35);
  color: #73beff;
  backdrop-filter: blur(6px);
}
.chip--outline{
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
}

/* -------------- Footnote & Divider (glass) -------------- */
.divider-glass{
  width: 60%; margin: 0 auto; border: none; height: 1px;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  backdrop-filter: blur(4px);
}
.muted.xsmall{
  color: rgba(255,255,255,.45);
  font-size: 0.78rem;
  line-height: 1.5;
  letter-spacing: .2px;
}

/* -------- Back-to-top (only show when .show) ------------ */
/* 若你已有此類別，以下為兼容強化 */
.backtotop{ opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease; }
.backtotop.show{ opacity: 1; pointer-events: auto; transform: translateY(0); }

/* -------- Panel title subtle weight consistency ---------- */
.panel-title{ font-weight: 600; }

/* -------------- Small accessibility niceties ------------- */
.badge--link{ text-decoration: none; }
.badge--link:focus-visible,
.btn:focus-visible,
.modal__close:focus-visible{ outline: 2px solid rgba(255,255,255,.5); outline-offset: 2px; border-radius: 12px; }

/* =========================================================
   MemoSpace — Interactive Hover Enhancements (non-destructive)
   ========================================================= */

/* ----- Chips hover: 微亮＋輕微放大 ----- */
.chip:hover,
.chip:focus-visible {
  transform: scale(1.05);
  filter: brightness(1.25);
  transition: transform 0.25s ease, filter 0.25s ease;
}

/* SDG glass chips在hover時邊框加亮一點 */
.chip--green:hover { border-color: rgba(77, 255, 166, 0.55); }
.chip--orange:hover { border-color: rgba(255, 180, 70, 0.55); }
.chip--sky:hover { border-color: rgba(115, 190, 255, 0.55); }

/* ----- Buttons hover: 亮度＋輕浮效果 ----- */
.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  transition: transform 0.25s ease, filter 0.25s ease;
}

.btn:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

/* ----- Cards hoverrise (already present, but enhance subtly) ----- */
.card--hoverrise:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

/* ----- Hero CTA magnet subtle glow when hover ----- */
.magnet:hover {
  box-shadow: 0 0 20px rgba(255, 170, 80, 0.3);
  filter: brightness(1.2);
  transition: all 0.3s ease;
}

/* ----- Modal OK button hover ----- */
.modal__actions .btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* ----- Focus-visible consistency ----- */
:focus-visible {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
  border-radius: 8px;
}

/* =========================================================
   Chips scroll-in animation (non-destructive)
   ========================================================= */
.chip {
  will-change: transform, opacity, box-shadow, filter;
}

/* 進場：逐一淡入＋微位移，延遲用 CSS 變數 --i 控制 */
.chip.chip-reveal {
  animation: chipFadeIn 600ms ease both, chipGlow 1500ms ease-out both;
  animation-delay: calc(var(--i, 0) * 90ms), calc(var(--i, 0) * 90ms);
}

@keyframes chipFadeIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* 微光暈一閃而過（非常輕微，保持高級感） */
@keyframes chipGlow {
  0%   { box-shadow: 0 0 0 rgba(255,255,255,0); filter: brightness(1.0); }
  30%  { box-shadow: 0 6px 20px rgba(255,255,255,0.06); filter: brightness(1.06); }
  100% { box-shadow: 0 0 0 rgba(255,255,255,0); filter: brightness(1.0); }
}

/* 與既有 hover 效果相容：進場完成後 hover 才加強 */
.chip.chip-reveal:hover {
  transform: translateY(-1px) scale(1.05);
  filter: brightness(1.22);
  transition: transform .25s ease, filter .25s ease, box-shadow .25s ease;
}

/* === YouTube Embed sizing (non-destructive) === */
.yt-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: inherit;
  overflow: hidden;
  background: rgba(0,0,0,0.35);
}

.yt-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* === Lazy YouTube Preview Styles === */
.yt-lazy {
  position: relative;
  cursor: pointer;
  display: block;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.yt-thumb {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.3s ease;
}

.yt-lazy:hover .yt-thumb {
  opacity: 0.8;
}

.yt-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: none;
  background: none;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.yt-lazy:hover .yt-play {
  transform: translate(-50%, -50%) scale(1.08);
}

/* ================================
   Ferryman Academy Gradient Button
   ================================ */
.btn--gradient {
  background: linear-gradient(135deg, #3bc8e7 0%, #5df5b5 100%);
  color: #000;
  font-weight: 500;
  border: none;
  box-shadow: 0 4px 16px rgba(59, 200, 231, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.btn--gradient:hover,
.btn--gradient:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 200, 231, 0.45);
  opacity: 0.95;
}

.btn--gradient:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(59, 200, 231, 0.25);
}

/* ============================
   Instagram Gradient Button
   ============================ */
.btn--instagram {
  background: linear-gradient(135deg, #f58529 0%, #dd2a7b 40%, #8134af 80%, #515bd4 100%);
  color: #fff;
  font-weight: 500;
  border: none;
  box-shadow: 0 4px 12px rgba(221, 42, 123, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.btn--instagram:hover,
.btn--instagram:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(221, 42, 123, 0.55);
  opacity: 0.95;
}

.btn--instagram:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(221, 42, 123, 0.35);
}

/* ============================================================
   14) Language Switcher Styles (NEW)
   ============================================================ */

/* --- Desktop Switcher --- */
.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.lang-btn:hover,
.lang-switcher.is-open .lang-btn {
  color: var(--text);
  border-color: #444;
  background: rgba(255, 255, 255, 0.05);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: none;
  width: max-content;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow);
  z-index: 60;
  overflow: hidden;
  animation: menuFade .15s ease;
}

.lang-switcher.is-open .lang-dropdown {
  display: block;
}

.lang-option {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.lang-option.is-active {
  color: var(--orange);
  font-weight: 700;
  background: rgba(251, 146, 60, .1);
}

/* --- Mobile Switcher --- */
.lang-switcher-mobile {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 6px;
  padding-top: 6px;
}

.lang-btn-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding-left: 6px; /* 保持與 .mobile-link 一致的 padding */
  padding-right: 6px;
}
.lang-btn-mobile:hover {
  background: rgba(255,255,255,.06);
}

.lang-btn-mobile .chevron {
  transition: transform .2s ease;
}

.lang-switcher-mobile.is-open .lang-btn-mobile .chevron {
  transform: rotate(180deg);
}

.lang-dropdown-mobile {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease-out;
  padding-left: 20px; /* 縮排 */
}

.lang-switcher-mobile.is-open .lang-dropdown-mobile {
  max-height: 200px; /* 展開 */
}

/* 行動版選單中的選項 */
.lang-dropdown-mobile .lang-option {
  padding-top: 10px;
  padding-bottom: 10px;
}

/* ============================================================
   15) Hero Crossover Logo (RWD Update)
   ============================================================ */
.hero-crossover-logo {
  text-align: center;
  margin-bottom: 24px; /* 恢復適當的 logo 和標題間距 */
}

.hero-crossover-logo img {
  width: 60%;         /* <--- 主要寬度設為容器的 60% */
  max-width: 2400px;   /* <--- 但最大不超過 320px */
  height: auto;
  opacity: 0.9;
}

/* ============================================================
   15) Hero Crossover Logo (RWD Update)
   ============================================================ */
/* [ ... Crossover Logo 的 CSS ... ] */
.hero-crossover-logo img {
  width: 60%;         
  max-width: 320px;   
  height: auto;
  opacity: 0.9;
}

/* ============================================================
   16) QR Code Modal Image (NEW)
   ============================================================ */
.qr-code-img {
  display: block;
  max-width: 280px; /* 控制 QR Code 最大寬度 */
  width: 80%;       /* 響應式寬度 */
  height: auto;
  margin: 0 auto;   /* 置中 */
  border-radius: 8px; /* 輕微圓角 */
}

/* ============================================================
   17) Badge Link Style (UPDATED for nesting)
   ============================================================ */
.badge-link {
  text-decoration: none; /* 移除底線 */
  display: inline-flex; /* 讓它可以和 Logo/Name 排在一起 */
  vertical-align: middle; /* 垂直對齊 */
}
.badge-link .badge {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.badge-link:hover .badge {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.2);
}

/* =========================================================
   Custom Glowing Cards (User Request)
   ========================================================= */

.card--glow-orange,
.card--glow-dream {
  /* Add the hoverrise transition */
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.card--glow-orange {
  border: 1px solid rgba(251, 146, 60, 0.4); /* var(--orange) */
  box-shadow: 0 0 24px rgba(251, 146, 60, 0.2), /* Soft glow */
              var(--shadow); /* Keep existing base shadow */
}
.card--glow-orange:hover {
  transform: translateY(-4px); /* Add hoverrise */
  border-color: rgba(251, 146, 60, 0.7);
  box-shadow: 0 8px 32px rgba(251, 146, 60, 0.35), /* Stronger glow on hover */
              inset 0 1px 0 rgba(255, 255, 255, .03);
}

.card--glow-dream {
  --glow-dream-1: #8b5cf6; /* Indigo */
  --glow-dream-2: #38bdf8; /* var(--sky) */
  
  border: 1px solid var(--glow-dream-1);
  background: linear-gradient(135deg, #111114, #101015);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.2), /* Indigo glow */
              0 0 20px rgba(56, 189, 248, 0.15), /* Sky glow */
              var(--shadow); /* Keep existing base shadow */
}
.card--glow-dream:hover {
  transform: translateY(-4px); /* Add hoverrise */
  border-color: var(--glow-dream-2);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3), 
              0 4px 28px rgba(56, 189, 248, 0.25),
              inset 0 1px 0 rgba(255, 255, 255, .03);
}

/* =========================================================
   [NEW] Generic Responsive Embed (for Luma, etc.)
   (Copies .yt-embed styles but uses different class)
   ========================================================= */

.responsive-embed-16x9 {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: inherit; /* 繼承卡片的圓角 */
  overflow: hidden;
  background: #0a0a0d; /* 載入時的深色背景 */
}

.responsive-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0; /* 確保無邊框 */
}

/* =========================================================
   [NEW] Generic Responsive Embed (for Luma, etc.)
   (Copies .yt-embed styles but uses different class)
   ========================================================= */

.responsive-embed-16x9 {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: inherit; /* 繼承卡片的圓角 */
  overflow: hidden;
  background: #0a0a0d; /* 載入時的深色背景 */
}

.responsive-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0; /* 確保無邊框 */
}

/* =========================================================
   [NEW] 額外光暈卡片 (使用者請求)
   ========================================================= */

.card--glow-gold {
  --glow-gold-color: #f59e0b; /* 淺黃金色 (Amber 500) */
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.2),
              var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card--glow-gold:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, .03);
}

.card--glow-lightblue {
  --glow-sky-color: #38bdf8; /* var(--sky) 淺藍色 */
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.2),
              var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card--glow-lightblue:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 8px 32px rgba(56, 189, 248, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, .03);
}