/* Core dark cyber theme – Barry X v3 (with animations) */

/* Reset / basics */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body.theme-dark {
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Noto Sans TC",
    "Microsoft JhengHei", sans-serif;
  background: radial-gradient(circle at top, #050b12 0, #020308 45%, #000 100%);
  color: #f5f5f7;
  line-height: 1.6;
  scroll-behavior: smooth;
}

/* Layout helpers */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0 4rem;
}

.section-alt {
  background: radial-gradient(circle at top, rgba(0,255,255,0.05), transparent 60%);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h1,
.section-header h2 {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
}

.section-header p {
  color: #9ea3b5;
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.88));
  border-bottom: 1px solid rgba(0, 255, 255, 0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

/* Logo with subtle glow */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #e5faff;
  letter-spacing: 0.14em;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  animation: logoPulse 3.5s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { text-shadow: 0 0 10px rgba(0,255,255,0.5); }
  50% { text-shadow: 0 0 18px rgba(0,255,255,0.9); }
}

.logo-img {
  height: 28px;
  margin-right: 0.6rem;
}

.main-nav {
  position: relative;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  font-size: 0.95rem;
}

.nav-list a {
  color: #c3c8e0;
  text-decoration: none;
  position: relative;
  padding-bottom: 0.1rem;
  overflow: hidden;
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15rem;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #00f5ff, #00ffa3);
  transition: width 0.2s ease-out;
}

.nav-list a:hover::after,
.nav-list a:focus-visible::after {
  width: 100%;
}

/* Language switch */
.language-switch {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.lang-link {
  color: #9bdcff;
  text-decoration: none;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  border: 1px solid transparent;
}

.lang-link.active {
  border-color: rgba(0,255,255,0.6);
  background: rgba(0,255,255,0.12);
  color: #e5faff;
}

.lang-divider {
  color: #6c738b;
}

/* Mobile nav */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(0,255,255,0.6);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.nav-line {
  width: 18px;
  height: 2px;
  background: #e5faff;
}

/* Buttons */
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out,
              background 0.15s ease-out, border-color 0.15s ease-out;
}

.btn-primary {
  background: radial-gradient(circle at 0 0, #00f5ff, #00a3ff);
  color: #020308;
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.45);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(0, 255, 255, 0.6);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(0,255,255,0.4);
  color: #d4e8ff;
}

.btn-ghost:hover {
  background: rgba(0,255,255,0.08);
}

.btn-large {
  padding-inline: 2rem;
}

/* Hero with animated gradient text */
.hero {
  padding: 5.5rem 0 4.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: center;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: #7cecff;
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: clamp(2.3rem, 3.2vw, 2.9rem);
  margin-bottom: 1rem;
}

.accent {
  background-image: linear-gradient(120deg, #00f5ff, #00ffa3, #00f5ff);
  -webkit-background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: accentFlow 5.5s ease-in-out infinite;
}

@keyframes accentFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-sub {
  color: #a0a7c2;
  max-width: 34rem;
  margin-bottom: 1.8rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.hero-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hero-tags li {
  font-size: 0.75rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(0,255,255,0.26);
  color: #9bdcff;
  background: radial-gradient(circle at 0 0, rgba(0,255,255,0.12), transparent);
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-photo-frame {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  padding: 4px;
  background: radial-gradient(circle at 0 0, #00f5ff, #0040ff 55%, #000 100%);
  box-shadow: 0 0 24px rgba(0,0,0,0.9);
}

.hero-photo {
  display: block;
  width: 100%;
  max-width: 320px;
  border-radius: 22px;
}

.hero-glow {
  position: absolute;
  inset: 20%;
  background: radial-gradient(circle, rgba(0,255,255,0.18), transparent 70%);
  mix-blend-mode: screen;
  pointer-events: none;
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.8rem;
}

.card {
  padding: 1.8rem 1.6rem;
  border-radius: 18px;
  background: radial-gradient(circle at 0 0, rgba(0,255,255,0.12), rgba(7,10,20,0.98));
  border: 1px solid rgba(0,255,255,0.3);
  box-shadow: 0 0 18px rgba(0,0,0,0.8);
}

.card h3,
.card h2 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}

.card p {
  color: #b1b7cd;
}

/* Locations */
.locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.6rem;
}

.location-card {
  padding: 1.5rem 1.4rem;
  border-radius: 16px;
  border: 1px solid rgba(0,255,255,0.25);
  background: rgba(2, 6, 15, 0.92);
}

/* CTA */
.cta-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  padding: 2.2rem 2rem;
  border-radius: 20px;
  background: linear-gradient(120deg, rgba(0,255,255,0.16), rgba(0,0,0,0.96));
  border: 1px solid rgba(0,255,255,0.35);
}

/* About layout */
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  gap: 2.5rem;
}

.about-text p + p {
  margin-top: 1rem;
}

.about-aside {
  padding: 1.6rem 1.4rem;
  border-radius: 18px;
  background: rgba(2, 7, 17, 0.96);
  border: 1px solid rgba(0,255,255,0.3);
}

.about-aside h2 {
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
}

.about-aside ul {
  list-style: none;
  color: #bcc3dd;
}

.about-aside li + li {
  margin-top: 0.4rem;
}

/* Contact layout */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr);
  gap: 2.5rem;
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea {
  background: rgba(6, 10, 24, 0.95);
  border-radius: 10px;
  border: 1px solid rgba(0,255,255,0.3);
  padding: 0.6rem 0.75rem;
  color: #e5faff;
  font: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #00f5ff;
  box-shadow: 0 0 0 1px rgba(0,255,255,0.4);
}

.contact-aside {
  padding: 1.6rem 1.4rem;
  border-radius: 16px;
  background: rgba(2, 7, 17, 0.96);
  border: 1px solid rgba(0,255,255,0.3);
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(0,255,255,0.25);
  margin-top: 3rem;
  padding: 2.8rem 0 1.8rem;
  background: radial-gradient(circle at 50% -60%, rgba(0,255,255,0.15), #020308 55%);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.8rem;
  margin-bottom: 1.5rem;
}

.site-footer h3,
.site-footer h4 {
  margin-bottom: 0.7rem;
}

.site-footer p,
.site-footer li {
  color: #a6afc9;
}

.site-footer a {
  color: #e5faff;
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1rem;
  font-size: 0.8rem;
  color: #7b8198;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
  }

  .about-layout,
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-inner {
    height: 60px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-list {
    position: absolute;
    right: 0;
    top: 110%;
    flex-direction: column;
    background: rgba(3, 6, 15, 0.98);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(0,255,255,0.35);
    min-width: 184px;
    display: none;
  }

  .nav-list.nav-open {
    display: flex;
  }

  .language-switch {
    display: none;
  }
}
