/* Tag2 Technology — responsive one-page site */
:root {
  --bg: #0b1220;
  --bg2: #111a2e;
  --card: #162038;
  --text: #e8eef8;
  --muted: #9aabbf;
  --green: #1a9b4a;
  --green2: #22c55e;
  --gold: #a67c3d;
  --gold-light: #c4a35a;
  --line: rgba(255, 255, 255, 0.08);
  --max: 1100px;
  --nav-h: 3.5rem;
  font-family: "Segoe UI", system-ui, -apple-system, "Noto Sans TC", "PingFang TC",
    "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--green2);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* —— Nav —— */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--nav-h);
  padding: 0.5rem 1rem;
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
}
.brand img {
  border-radius: 50%;
  width: 36px;
  height: 36px;
}
.brand span {
  white-space: nowrap;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.9rem;
  justify-content: flex-end;
}
.nav nav a {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.25rem 0;
}
.nav nav a:hover {
  color: var(--text);
}

.lang-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.lang-wrap select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
  max-width: 9.5rem;
}

/* —— Hero —— */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1rem 3rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  color: var(--green2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin: 0 0 0.5rem;
}

.hero h1 {
  font-size: clamp(1.65rem, 5vw, 2.75rem);
  line-height: 1.2;
  margin: 0.25rem 0 1rem;
  font-weight: 700;
}

.grad {
  background: linear-gradient(90deg, var(--green2), #6ee7b7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  color: var(--muted);
  font-size: clamp(0.95rem, 2.5vw, 1.08rem);
  max-width: 36rem;
  margin: 0;
}

.cta-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  text-align: center;
  min-height: 44px;
  line-height: 1.3;
}
.btn.primary {
  background: var(--green);
  color: #fff;
}
.btn.primary:hover {
  background: var(--green2);
  text-decoration: none;
}
.btn.ghost {
  border-color: var(--line);
  color: var(--text);
}
.btn.ghost:hover {
  border-color: var(--green2);
  text-decoration: none;
}

.hero-visual {
  position: relative;
  min-height: 260px;
  height: clamp(240px, 40vw, 340px);
  display: grid;
  place-items: center;
}

.orb {
  position: absolute;
  width: min(70vw, 280px);
  height: min(70vw, 280px);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(34, 197, 94, 0.45), transparent 60%);
  animation: float 6s ease-in-out infinite;
}

.logo-float {
  position: absolute;
  width: clamp(80px, 22vw, 120px);
  height: clamp(80px, 22vw, 120px);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  animation: float 5s ease-in-out infinite reverse;
}

.net-anim {
  width: min(100%, 320px);
  height: auto;
  opacity: 0.95;
  animation: spin-slow 28s linear infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* —— Sections —— */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.75rem 1rem;
}
.section.alt {
  background: var(--bg2);
  max-width: none;
  padding-left: max(1rem, calc(50% - var(--max) / 2));
  padding-right: max(1rem, calc(50% - var(--max) / 2));
}
.section h2 {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  margin: 0 0 0.5rem;
}
.section-lead {
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: 0.98rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.card,
.feature,
.sample-card,
.out-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem 1.2rem;
}

.checks {
  padding-left: 1.1rem;
  color: var(--muted);
  margin: 0;
}
.checks li {
  margin: 0.35rem 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.feature .ico {
  font-size: 1.35rem;
}
.feature h3 {
  margin: 0.4rem 0;
  font-size: 1.02rem;
}
.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.75rem;
  justify-content: center;
}
.pipe-step {
  background: rgba(26, 155, 74, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
}
.pipe-arrow {
  color: var(--muted);
}

.sample-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.sample-visual {
  height: 110px;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  background-size: 200% 200%;
  animation: shimmer 8s ease infinite;
}
.v1 {
  background-image: linear-gradient(135deg, #14532d, #1e3a5f, #22c55e);
}
.v2 {
  background-image: linear-gradient(135deg, #1e3a5f, #312e81, #22d3ee);
}
.v3 {
  background-image: linear-gradient(135deg, #713f12, #1a9b4a, #fbbf24);
}
.v4 {
  background-image: linear-gradient(135deg, #4c1d95, #0f766e, #e2e8f0);
}
@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
.sample-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.sample-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.output-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1rem;
}
.code-block {
  background: #0a0f18;
  border-radius: 10px;
  padding: 0.85rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.75rem;
  color: #a7f3d0;
  margin: 0;
  max-width: 100%;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 100px;
  margin: 1rem 0;
}
.bars span {
  flex: 1;
  height: var(--h);
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--green2), var(--green));
  animation: bounce 1.8s ease-in-out infinite;
}
.bars span:nth-child(2) {
  animation-delay: 0.15s;
}
.bars span:nth-child(3) {
  animation-delay: 0.3s;
}
.bars span:nth-child(4) {
  animation-delay: 0.45s;
}
.bars span:nth-child(5) {
  animation-delay: 0.6s;
}
@keyframes bounce {
  0%,
  100% {
    transform: scaleY(0.85);
  }
  50% {
    transform: scaleY(1.05);
  }
}

.contact {
  text-align: center;
}
.email {
  display: inline-block;
  font-size: clamp(1.15rem, 4vw, 1.5rem);
  font-weight: 700;
  color: var(--green2);
  margin: 1rem 0;
  word-break: break-all;
}
.fine {
  color: var(--muted);
  font-size: 0.9rem;
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}
footer img {
  border-radius: 50%;
  width: 28px;
  height: 28px;
}

/* —— Tablet —— */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 1.75rem;
    text-align: center;
  }
  .lead {
    margin-left: auto;
    margin-right: auto;
  }
  .cta-row {
    justify-content: center;
  }
  .hero-visual {
    order: -1;
    min-height: 220px;
  }
  .grid-2,
  .feature-grid,
  .sample-track,
  .output-grid {
    grid-template-columns: 1fr;
  }
  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* —— Mobile —— */
@media (max-width: 640px) {
  .brand span {
    font-size: 0.9rem;
  }
  .nav {
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
  }
  .nav-right {
    width: 100%;
    justify-content: space-between;
  }
  .nav nav {
    width: 100%;
    justify-content: flex-start;
    gap: 0.5rem 0.75rem;
    padding-top: 0.25rem;
  }
  .nav nav a {
    font-size: 0.82rem;
  }
  .lang-label {
    display: none;
  }
  .feature-grid,
  .sample-track {
    grid-template-columns: 1fr;
  }
  .pipe-arrow {
    display: none;
  }
  .pipeline {
    flex-direction: column;
    align-items: stretch;
  }
  .pipe-step {
    text-align: center;
  }
  .btn {
    width: 100%;
  }
  .cta-row {
    flex-direction: column;
  }
  /* reduce motion-heavy anim on small screens optional */
  .net-anim {
    animation-duration: 40s;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-short { font-size: 1.05rem; font-weight: 700; }
.brand-full { font-size: 0.65rem; color: var(--muted); font-weight: 500; max-width: 11rem; }
@media (max-width: 640px) {
  .brand-full { display: none; }
}
.hero-visual { isolation: isolate; }
.hero-ring {
  position: absolute;
  width: min(75vw, 300px);
  height: min(75vw, 300px);
  border-radius: 50%;
  border: 2px solid rgba(34, 197, 94, 0.35);
  animation: float 7s ease-in-out infinite;
}
.hero-ring.r2 {
  width: min(55vw, 220px);
  height: min(55vw, 220px);
  border-color: rgba(255,255,255,0.12);
  animation-direction: reverse;
  animation-duration: 5s;
}
.sample-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 0.75rem;
}
.svc-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .svc-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .svc-grid { grid-template-columns: 1fr; }
}

.brand-desktop { color: var(--gold-light); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.02em; }
.brand-mobile-only { display: none; color: var(--gold-light); font-weight: 700; }
@media (max-width: 720px) {
  .brand-desktop { display: none; }
  .brand-mobile-only { display: inline; }
}
.grad {
  background: linear-gradient(90deg, var(--gold-light), #e8d5a3, var(--green2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.email { color: var(--gold-light); }
.letterhead-bar {
  margin-top: 1.75rem; padding: 1rem;
  background: #fff; border-radius: 12px; text-align: center;
}
.letterhead-bar img { margin: 0 auto; max-height: 72px; width: auto; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.gal-item { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.gal-item img { width: 100%; height: 180px; object-fit: cover; display: block; }
.svc-grid-6 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .svc-grid-6 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .gallery-grid, .svc-grid-6 { grid-template-columns: 1fr; }
  .gal-item img { height: 200px; }
}
.hero-visual .net-anim {
  width: min(70%, 280px); border-radius: 50%;
  animation: float 6s ease-in-out infinite;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}

.gal-item figcaption {
  padding: 0.5rem 0.75rem 0.75rem;
  font-size: 0.85rem;
  color: var(--gold-light);
  background: var(--card);
}
.hero-mesh {
  width: min(100%, 420px);
  height: auto;
  border-radius: 20px;
  position: relative;
  z-index: 1;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.svc-thumb {
  width: 100%;
  height: 72px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  background: #fff;
}

.hero-photo {
  width: min(100%, 480px);
  height: auto;
  border-radius: 20px;
  position: relative;
  z-index: 1;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  object-fit: cover;
}
