/* ==========================================================================
   腦內飛制作 endorphin Creatives — 主樣式
   色彩：endorphin Blue #0046AD ／ Canvas #E0E0E0 ／ Ink #222
   字體：Outfit（拉丁）+ Noto Sans TC（中文）
   ========================================================================== */

:root {
  --blue: #0046AD;
  --blue-deep: #003280;
  --blue-soft: #d6e2f7;
  --canvas: #E0E0E0;
  --paper: #F4F4F3;
  --white: #ffffff;
  --ink: #222222;
  --muted: #6b6b6b;
  --line: rgba(34, 34, 34, 0.12);
  --accent: var(--blue);

  --font: "Outfit", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --radius: 14px;
  --radius-lg: 22px;
  --container: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
  --section: clamp(72px, 10vw, 140px);
  --nav-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, picture, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
.lang-zh h1, .lang-zh h2 { letter-spacing: 0; }

.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; }
.h3 { font-size: 1.25rem; }
img[data-lightbox]:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--blue); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.container { width: min(100% - var(--gutter) * 2, var(--container)); margin-inline: auto; }
.section { padding-block: var(--section); }
.section.pt-0 { padding-top: 0; }
.section-gray { background: var(--canvas); }
.section-blue { background: var(--blue); color: #fff; }
.section-blue .eyebrow { color: rgba(255, 255, 255, 0.7); }
.center { text-align: center; }
.mt-lg { margin-top: clamp(32px, 5vw, 56px); }

.eyebrow {
  display: inline-block; margin: 0 0 14px; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--blue);
}
.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 44ch; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-sub { margin-top: 12px; color: var(--muted); max-width: 52ch; }
.section-blue .section-sub { color: rgba(255, 255, 255, 0.75); }
.link-arrow { font-weight: 600; color: var(--blue); white-space: nowrap; border-bottom: 2px solid transparent; transition: border-color 0.2s; }
.link-arrow:hover { border-color: currentColor; }
.section-blue .link-arrow { color: #fff; }

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px; font-weight: 600; font-size: 0.98rem;
  border: 2px solid transparent; transition: transform 0.25s var(--ease), background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); }
.btn-ghost { background: rgba(0, 70, 173, 0.08); color: var(--blue); }
.btn-ghost:hover { background: rgba(0, 70, 173, 0.14); }
.btn-outline { border-color: var(--blue); color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-lg { padding: 18px 36px; font-size: 1.08rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.btn-row.center { justify-content: center; }

/* Nav -------------------------------------------------------------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  background: rgba(244, 244, 243, 0.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color 0.3s, background 0.3s;
}
.nav.is-scrolled { border-color: var(--line); background: rgba(244, 244, 243, 0.94); }
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand img { height: 34px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 34px; font-weight: 500; }
.nav-links a { position: relative; padding: 6px 0; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform 0.25s var(--ease); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.lang-switch { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.08em; padding: 6px 14px !important; border: 1.5px solid var(--ink); border-radius: 999px; }
.nav-links .lang-switch::after { display: none; }
.lang-switch:hover { background: var(--ink); color: #fff; }
.nav-toggle { display: none; width: 44px; height: 44px; position: relative; }
.nav-toggle span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); transition: transform 0.3s, top 0.3s; }
.nav-toggle span:first-child { top: 16px; }
.nav-toggle span:last-child { top: 26px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }
.mobile-menu {
  position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 49;
  height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h));
  background: var(--paper); padding: 24px var(--gutter);
  display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu > a { font-size: 1.8rem; font-weight: 700; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mobile-menu > a.lang-switch { align-self: flex-start; margin-top: 18px; font-size: 0.9rem; border-bottom: 1.5px solid var(--ink); padding: 10px 18px !important; }
.mobile-social { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: auto; padding-top: 30px; color: var(--muted); font-weight: 500; }
.mobile-social a { padding: 10px 0; }
body.menu-open { overflow: hidden; }

/* Hero ------------------------------------------------------------------- */
.hero { position: relative; padding-top: calc(var(--nav-h) + clamp(40px, 8vw, 96px)); padding-bottom: clamp(48px, 8vw, 96px); background: var(--canvas); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { color: var(--blue); margin-bottom: 22px; font-size: clamp(2.3rem, 5vw, 4rem); }
.lang-en .hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.7rem); }
.hero .lead { color: var(--ink); opacity: 0.8; }
.hero-art { margin: 0; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0, 50, 128, 0.45); }
.hero-art img { width: 100%; aspect-ratio: 1200 / 787; object-fit: cover; }
.hero-scroll { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* Marquee ---------------------------------------------------------------- */
.marquee { background: var(--blue); color: #fff; overflow: hidden; padding: 16px 0; }
.marquee-track { display: flex; align-items: center; gap: 36px; width: max-content; animation: marquee 38s linear infinite; font-size: 1.05rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.marquee-track img { width: 22px; height: 22px; filter: brightness(0) invert(1); opacity: 0.85; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Grid & cards ----------------------------------------------------------- */
.grid { display: grid; gap: clamp(20px, 3vw, 36px); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-feature { grid-template-columns: repeat(2, 1fr); }
.grid-work { grid-template-columns: repeat(3, 1fr); }
.grid-team { grid-template-columns: repeat(2, 1fr); max-width: 900px; }

.card { display: block; border-radius: var(--radius-lg); overflow: hidden; background: var(--white); box-shadow: 0 1px 0 var(--line); transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.card:hover { transform: translateY(-6px); box-shadow: 0 30px 50px -30px rgba(0, 50, 128, 0.35); }
.card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--canvas); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.card:hover .card-media img { transform: scale(1.04); }
.card-media::after { content: ""; position: absolute; inset: auto 0 0 0; height: 4px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease); }
.card:hover .card-media::after { transform: scaleX(1); }
.card-body { padding: 18px 22px 22px; }
.card-cat { display: inline-block; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; }
.card-title { font-size: 1.25rem; }
.card-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }
.card.is-hidden { display: none; }

/* Service list (home) ---------------------------------------------------- */
.service-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255, 255, 255, 0.25); }
.service-item a { display: grid; grid-template-columns: 70px 1.1fr 1fr 1.6fr; gap: 24px; align-items: baseline; padding: 30px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.25); transition: padding-left 0.35s var(--ease); }
.service-item a:hover { padding-left: 14px; }
.service-num { font-weight: 300; font-size: 1.1rem; opacity: 0.7; }
.service-name { font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 700; }
.service-tag { font-size: 1.05rem; opacity: 0.85; }
.service-item .service-blurb { font-size: 0.95rem; opacity: 0.75; line-height: 1.65; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.chip { padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.4); font-size: 0.9rem; }

/* About teaser ----------------------------------------------------------- */
.about-teaser { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.about-teaser-art { background: var(--canvas); border-radius: var(--radius-lg); padding: clamp(32px, 6vw, 80px); }
.about-teaser-art img { width: 100%; max-width: 380px; margin-inline: auto; }
.about-teaser-copy h2 { margin-bottom: 20px; }
.about-teaser-copy p { color: var(--muted); }
.about-teaser-copy .link-arrow { display: inline-block; margin-top: 10px; }

/* Steps / values --------------------------------------------------------- */
.step, .value { padding: 32px; border-radius: var(--radius-lg); background: var(--white); }
.value { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2); }
.step-num, .value-num { display: block; font-weight: 300; font-size: 2rem; color: var(--blue); margin-bottom: 14px; line-height: 1; }
.value-num { color: rgba(255, 255, 255, 0.6); }
.step h3, .value h3 { margin-bottom: 10px; }
.step p { color: var(--muted); }
.value p { opacity: 0.85; }

/* CTA -------------------------------------------------------------------- */
.cta { background: var(--paper); }
.cta-inner { text-align: center; padding: clamp(40px, 6vw, 80px) clamp(24px, 4vw, 64px); border-radius: var(--radius-lg); background: var(--canvas); position: relative; overflow: hidden; }
.cta-inner::before { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; top: -160px; background: url("/static/img/brand/mark.png") center / contain no-repeat; opacity: 0.07; pointer-events: none; }
.cta-inner h2 { margin-bottom: 12px; position: relative; }
.cta-inner p { color: var(--muted); margin-bottom: 26px; position: relative; }
.cta-inner .btn { position: relative; }

/* Page head -------------------------------------------------------------- */
.page-head { padding-top: calc(var(--nav-h) + clamp(36px, 6vw, 80px)); padding-bottom: clamp(36px, 6vw, 72px); }
.page-head h1 { margin-bottom: 16px; }
.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a:hover { color: var(--blue); }

/* Work filters ----------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filter { padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 500; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.filter small { opacity: 0.6; margin-left: 4px; font-size: 0.8em; }
.filter:hover { border-color: var(--blue); color: var(--blue); }
.filter.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
.filter.is-active small { opacity: 0.8; }
.filter-tag { min-height: 1.7em; color: var(--muted); margin-bottom: 28px; font-size: 1.05rem; }

/* Project page ----------------------------------------------------------- */
.project-head { padding-top: calc(var(--nav-h) + clamp(36px, 6vw, 72px)); padding-bottom: clamp(28px, 4vw, 48px); }
.project-head h1 { margin-bottom: 10px; }
.project-hero { margin: 0 0 clamp(36px, 5vw, 64px); border-radius: var(--radius-lg); overflow: hidden; background: var(--canvas); box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.35); }
.project-hero img { width: 100%; cursor: zoom-in; }
.project-grid { display: grid; grid-template-columns: 300px 1fr; gap: clamp(32px, 6vw, 96px); margin-bottom: clamp(36px, 5vw, 64px); }
.project-meta dl { margin: 0; }
.project-meta dl > div { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--line); }
.project-meta dt { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.project-meta dd { margin: 2px 0 0; font-weight: 500; }
.project-meta dd a:hover { color: var(--blue); }
.palette { margin-top: 26px; }
.palette .palette-title { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; font-weight: 600; }
.palette ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.palette li { display: flex; align-items: center; gap: 12px; font-size: 0.92rem; }
.palette li small { display: block; color: var(--muted); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.75rem; }
.swatch { width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, 0.08); flex: none; }
.project-meta .btn { margin-top: 26px; }
.project-desc { font-size: clamp(1.05rem, 1.5vw, 1.25rem); line-height: 1.85; max-width: 62ch; }
.project-gallery { display: grid; gap: clamp(20px, 3vw, 36px); margin-bottom: clamp(36px, 5vw, 64px); }
.project-gallery figure { margin: 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--canvas); }
.project-gallery figure.is-tall { max-width: 720px; margin-inline: auto; }
.project-gallery img { width: 100%; cursor: zoom-in; }
.project-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: var(--section); }
.project-nav-link { display: flex; flex-direction: column; }
.project-nav-link small { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.project-nav-link span { font-weight: 700; font-size: 1.15rem; transition: color 0.2s; }
.project-nav-link:hover span { color: var(--blue); }
.project-nav-link.next { text-align: right; }
.project-nav-all { font-weight: 600; color: var(--blue); }

/* About page ------------------------------------------------------------- */
.story { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.story-art { border-radius: var(--radius-lg); overflow: hidden; }
.story-copy h2 { margin-bottom: 20px; }
.story-copy p { color: var(--muted); }
.member { display: flex; gap: 20px; align-items: flex-start; padding: 28px; border-radius: var(--radius-lg); background: var(--white); }
.avatar { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; }
.member-role { color: var(--blue); font-weight: 600; margin: 4px 0 2px; }
.member-focus { color: var(--muted); font-size: 0.95rem; }
.parent { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.parent-copy h2 { margin-bottom: 16px; }
.parent-copy p { color: var(--muted); margin-bottom: 24px; }
.parent-art img { width: 100%; max-width: 280px; margin-inline: auto; opacity: 0.9; }

/* Contact ---------------------------------------------------------------- */
.contact-cards { margin-bottom: clamp(36px, 5vw, 64px); }
.contact-card { display: block; padding: 30px; border-radius: var(--radius-lg); background: var(--white); border: 1px solid var(--line); transition: transform 0.3s var(--ease), border-color 0.3s; }
.contact-card:hover { transform: translateY(-4px); border-color: var(--blue); }
.contact-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-weight: 700; margin-bottom: 18px; }
.contact-card h2 { margin-bottom: 4px; }
.contact-value { color: var(--blue); font-weight: 600; word-break: break-all; }
.contact-card p:last-child { color: var(--muted); font-size: 0.95rem; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.tips { padding: 32px; border-radius: var(--radius-lg); background: var(--canvas); }
.tips h2 { margin-bottom: 14px; }
.tips ul { margin: 0; padding-left: 1.2em; color: var(--muted); }
.tips li + li { margin-top: 6px; }
.tips-alt .btn { white-space: normal; overflow-wrap: anywhere; max-width: 100%; text-align: center; }
.form { padding: 32px; border-radius: var(--radius-lg); background: var(--white); border: 1px solid var(--line); display: grid; gap: 16px; }
.form h2 { margin-bottom: 4px; }
.form label { display: grid; gap: 6px; font-size: 0.9rem; font-weight: 600; }
.form input, .form select, .form textarea { font: inherit; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--blue); }
.form .hp { position: absolute; left: -9999px; }
.form-note { font-size: 0.8rem; color: var(--muted); }

/* 404 -------------------------------------------------------------------- */
.e404 { min-height: 80vh; display: grid; place-items: center; padding-top: calc(var(--nav-h) + 40px); }
.e404-mark { width: 120px; margin: 0 auto 20px; opacity: 0.9; }
.e404 .lead { margin-inline: auto; }

/* Footer ----------------------------------------------------------------- */
.footer { background: var(--blue); color: #fff; padding: clamp(56px, 8vw, 96px) 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-brand img { width: 150px; margin-bottom: 18px; }
.footer-tagline { opacity: 0.8; max-width: 32ch; }
.footer-col .footer-title { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.6; margin: 0 0 14px; }
.footer-col a { display: block; padding: 5px 0; opacity: 0.9; }
.footer-col a:hover { opacity: 1; text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.2); font-size: 0.85rem; opacity: 0.92; }
.footer-bottom a { text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom p { margin: 0; }
.footer-legal { font-size: 0.8rem; opacity: 0.9; margin-top: 4px !important; }

/* Lightbox --------------------------------------------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(10, 20, 40, 0.94); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.lightbox-close { position: absolute; top: 14px; right: 18px; font-size: 2.4rem; line-height: 1; color: #fff; opacity: 0.8; }

/* Reveal ----------------------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-in, .no-io .reveal { opacity: 1; transform: none; }
.card.reveal.is-in { transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), opacity 0.7s var(--ease); }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1024px) {
  .grid-work { grid-template-columns: repeat(2, 1fr); }
  .service-item a { grid-template-columns: 56px 1fr 1fr; }
  .service-blurb { grid-column: 2 / -1; }
  .project-grid { grid-template-columns: 260px 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  :root { --nav-h: 66px; }
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .brand img { height: 30px; }
  .hero-grid, .about-teaser, .story, .parent { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: calc(var(--nav-h) + 40px); }
  .hero-scroll { display: none; }
  .js .hero-art.fx-in { animation: fxFade 1.1s var(--ease) 0.35s forwards; }
  .grid-3, .grid-feature, .grid-team { grid-template-columns: 1fr 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .project-grid { grid-template-columns: 1fr; }
  .project-nav { grid-template-columns: 1fr 1fr; }
  .project-nav-all { grid-column: 1 / -1; order: 3; text-align: center; }
  .parent-art { order: -1; }
  .parent-tile { max-width: 220px; margin: 0 0 8px; padding: 14%; }
  .about-teaser-art { order: 2; }
  .about-teaser-art img { max-width: 260px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .grid-3, .grid-feature, .grid-work, .grid-team { grid-template-columns: 1fr; }
  .service-item a { grid-template-columns: 44px 1fr; gap: 12px; padding: 22px 0; }
  .service-tag { grid-column: 2; }
  .service-blurb { grid-column: 2; }
  .btn-row .btn { flex: 1 1 auto; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; }
  .card-body { padding: 16px 18px 20px; }
  .step, .value, .member, .tips, .form, .contact-card { padding: 24px; }
  .marquee-track { font-size: 0.9rem; gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-art, .marquee-track { animation: none; }
  .card, .btn, .card-media img { transition: none; }
}

/* Brief（需求訪談對話）--------------------------------------------------- */
.brief-wrap { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.brief-intro h2 { margin-bottom: 14px; }
.brief-intro p { color: var(--muted); }
.brief-intro ul { margin: 18px 0 0; padding-left: 1.2em; color: var(--muted); }
.brief-intro li + li { margin-top: 6px; }
.brief { background: var(--white); border-radius: var(--radius-lg); box-shadow: 0 30px 60px -40px rgba(0, 50, 128, 0.4); border: 1px solid var(--line); overflow: hidden; }
.brief-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--paper); font-size: 0.9rem; font-weight: 600; }
.brief-head img { width: 26px; height: 26px; }
.brief-head .dot { width: 8px; height: 8px; border-radius: 50%; background: #2fbf71; margin-left: auto; box-shadow: 0 0 0 3px rgba(47, 191, 113, 0.2); }
.brief-log { padding: 20px 20px 4px; max-height: 420px; overflow-y: auto; scroll-behavior: smooth; }
.brief-msg { display: flex; margin-bottom: 12px; }
.brief-msg.user { justify-content: flex-end; }
.brief-bubble { max-width: 85%; padding: 12px 16px; border-radius: 18px; line-height: 1.6; font-size: 0.98rem; white-space: pre-line; }
.brief-msg.bot .brief-bubble { background: var(--canvas); border-bottom-left-radius: 6px; }
.brief-msg.user .brief-bubble { background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.brief-input { padding: 12px 20px 20px; border-top: 1px dashed var(--line); }
.brief-form { display: grid; gap: 14px; }
.brief-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.brief-chip { padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 500; font-size: 0.95rem; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.brief-chip:hover { border-color: var(--blue); color: var(--blue); }
.brief-chip.is-on { background: var(--blue); border-color: var(--blue); color: #fff; }
.brief-field { font: inherit; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); }
.brief-field:focus { border-color: var(--blue); background: #fff; }
.brief-field:focus-visible, .form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.brief-contact { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.brief-contact .brief-field:nth-child(3) { grid-column: 1 / -1; }
.brief-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.brief-nav { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.brief-back, .brief-skip { padding: 10px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.brief-back:hover, .brief-skip:hover { color: var(--blue); }
.brief-back { margin-right: auto; }
.brief-next:disabled, .brief-actions .btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.brief-summary-title { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.brief-summary dl { margin: 0 0 16px; display: grid; gap: 6px; }
.brief-summary dl > div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; font-size: 0.95rem; }
.brief-summary dt { color: var(--muted); }
.brief-summary dd { margin: 0; white-space: pre-line; }
.brief-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.brief-actions .brief-back { margin-right: auto; }
.brief-note { font-size: 0.8rem; color: var(--muted); margin-top: 12px; }
.brief-pre { font: inherit; font-size: 0.92rem; white-space: pre-wrap; background: var(--paper); border-radius: 12px; padding: 14px 16px; margin: 0 0 14px; }
.brief-done p { margin-bottom: 12px; }
@media (max-width: 860px) {
  .brief-wrap { grid-template-columns: 1fr; }
  .brief-log { max-height: none; }
  .brief-contact { grid-template-columns: 1fr; }
  .brief-contact .brief-field:nth-child(3) { grid-column: auto; }
  .brief-summary dl > div { grid-template-columns: 1fr; gap: 2px; }
}


/* 品牌家族（跨站串接）--------------------------------------------------- */
/* 對方的「符號」用 CSS mask 上色：靜止時跟主站中性色，hover 才變成對方的 app icon。
   小尺寸版 X（筆畫加粗）最小 20px；不支援 mask 的舊瀏覽器退回白色 PNG。 */
.brand-mask { display: inline-block; width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--mask) center / contain no-repeat; mask: var(--mask) center / contain no-repeat; }
.brand-mask img { display: none; }
@supports not (mask: url("x.png")) { .brand-mask { background: none; } .brand-mask img { display: block; width: 100%; height: 100%; } }
.frame { display: grid; place-items: center; flex: none; border-radius: 8px; transition: background 0.18s, border-color 0.18s; }

/* 頁尾母公司徽章 */
.parent-badge { display: inline-flex; align-items: center; gap: 14px; margin-top: 22px; padding: 9px 16px 9px 10px; min-height: 44px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 12px; transition: background 0.18s, border-color 0.18s; }
.parent-badge .frame { width: 36px; height: 36px; border: 1px solid rgba(255, 255, 255, 0.35); }
.parent-badge .brand-mask { color: rgba(255, 255, 255, 0.85); }
.parent-badge:hover, .parent-badge:focus-visible { border-color: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.06); }
.parent-badge:hover .frame, .parent-badge:focus-visible .frame { background: #050505; border-color: #050505; }
.parent-badge:hover .brand-mask, .parent-badge:focus-visible .brand-mask { color: #bfff50; }
.parent-badge-text { display: flex; flex-direction: column; line-height: 1.25; }
.parent-badge-text small { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.6; }
.parent-badge-text strong { font-size: 0.95rem; font-weight: 600; }
.parent-badge-text span { font-size: 0.8rem; opacity: 0.7; }

/* 關於頁「窗口」方塊 */
.parent-tile { display: grid; place-items: center; aspect-ratio: 1; padding: 16%; background: #050505; border-radius: var(--radius-lg); max-width: 380px; margin-inline: auto; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.parent-tile img { width: 100%; height: auto; }
.parent-tile:hover { transform: translateY(-4px); box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.6); }

/* 聯絡頁「也需要技術？」 */
.family-link { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.family-link .frame { width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; }
.family-link .brand-mask { width: 20px; height: 20px; color: var(--ink); }
.family-link:hover .frame { background: #050505; border-color: #050505; }
.family-link:hover .brand-mask { color: #bfff50; }
.family-link small { display: block; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.family-link span { font-size: 0.92rem; }
.project-note { margin-top: 22px; padding-left: 12px; border-left: 2px solid var(--accent); font-size: 0.85rem; color: var(--muted); }
@media (max-width: 600px) {
  .parent-badge { display: flex; }
}

/* ==========================================================================
   視覺特效與新頁面（服務／加入我們／隱私）
   ========================================================================== */

/* 頁面載入淡入 */
.js body { opacity: 0; animation: bodyIn 0.5s ease 0.05s forwards; }
@keyframes bodyIn { to { opacity: 1; } }

/* 主視覺背景雲霧 */
.hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
/* 不用 filter: blur（很吃 GPU），改用本身就柔和的放射漸層；只動 transform，並固定在合成層 */
.blob { position: absolute; border-radius: 50%; will-change: transform; transform: translateZ(0); }
.b1 { width: 60vw; height: 60vw; max-width: 900px; max-height: 900px; left: -18vw; top: -24vw; background: radial-gradient(circle, rgba(0, 70, 173, 0.16) 0%, rgba(0, 70, 173, 0.06) 40%, rgba(0, 70, 173, 0) 68%); animation: drift1 26s ease-in-out infinite; }
.b2 { width: 50vw; height: 50vw; max-width: 760px; max-height: 760px; right: -14vw; top: 6vw; background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0) 68%); animation: drift2 32s ease-in-out infinite; }
@keyframes drift1 { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(6vw, 4vw, 0); } }
@keyframes drift2 { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(-5vw, 6vw, 0); } }
.hero .container { position: relative; }

/* 主標題逐行升起、文字與按鈕依序浮現、主視覺淡入 */
.fx-lines .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.js .fx-lines .line > span { display: inline-block; transform: translateY(110%); animation: fxRise 0.9s var(--ease) forwards; animation-delay: calc(0.1s + var(--i) * 0.11s); }
.js .fx-up { opacity: 0; transform: translateY(18px); animation: fxUp 0.8s var(--ease) forwards; animation-delay: calc(0.25s + var(--i) * 0.1s); }
.js .fx-in { opacity: 0; transform: translateY(24px) scale(0.98); animation: fxIn 1.1s var(--ease) 0.35s forwards; }
@keyframes fxRise { to { transform: translateY(0); } }
@keyframes fxUp { to { opacity: 1; transform: translateY(0); } }
@keyframes fxIn { to { opacity: 1; transform: translateY(0) scale(1); } }

/* 滑鼠視差 */
[data-parallax] { transform: translate(var(--px, 0), var(--py, 0)); transition: transform 0.9s var(--ease); will-change: transform; }
/* 主視覺：淡入只動 opacity，transform 留給滑鼠視差；上下漂浮用 translate 屬性，互不干擾 */
.js .hero-art.fx-in { opacity: 0; transform: translate(var(--px, 0), var(--py, 0)); animation: floaty 9s ease-in-out infinite, fxFade 1.1s var(--ease) 0.35s forwards; }
@keyframes fxFade { to { opacity: 1; } }
.js .reveal.is-in[data-parallax] { transform: translate(var(--px, 0), var(--py, 0)); }
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

/* 導覽列往下捲隱藏 */
.nav { transition: border-color 0.3s, background 0.3s, transform 0.4s var(--ease); }
.nav.is-hidden { transform: translateY(-100%); }

/* 卡片 3D 傾斜 */
[data-tilt] { perspective: 1000px; }
[data-tilt] .card { transform-style: preserve-3d; }
[data-tilt] .card.is-tilt { transform: rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) translateY(-6px); transition: box-shadow 0.4s var(--ease); }

/* 自訂游標（只在精準指標裝置出現） */
.cursor { position: fixed; left: 0; top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); pointer-events: none; z-index: 300; opacity: 0; will-change: transform; transition: width 0.25s var(--ease), height 0.25s var(--ease), opacity 0.25s, background 0.25s, border-color 0.25s; }
.cursor.is-on { opacity: 1; }
.cursor.is-link { width: 40px; height: 40px; background: rgba(0, 70, 173, 0.12); border: 1.5px solid var(--blue); }
.cursor.is-down { width: 6px; height: 6px; }
.cursor.is-dark { background: #fff; }
.cursor.is-dark.is-link { background: rgba(255, 255, 255, 0.15); border-color: #fff; }



/* 品牌圖標脈動 */
.mark-pulse { animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* 服務頁 */
.service-cards { display: grid; gap: clamp(20px, 3vw, 32px); }
.service-card { padding: clamp(24px, 4vw, 44px); border-radius: var(--radius-lg); background: var(--white); border: 1px solid var(--line); scroll-margin-top: 100px; }
.service-card-head { display: flex; gap: 20px; align-items: baseline; margin-bottom: 14px; }
.service-card-head .service-num { color: var(--blue); font-weight: 300; font-size: 1.4rem; }
.service-card h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.service-tagline { color: var(--blue); font-weight: 600; margin: 4px 0 0; }
.service-card .service-blurb { color: var(--muted); max-width: 60ch; }
.service-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; margin: 22px 0; padding-top: 22px; border-top: 1px solid var(--line); }
.service-grid h3 { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.service-grid h3 + p { margin-bottom: 18px; }
.service-grid ul { margin: 0; padding-left: 1.2em; }
.service-grid li + li { margin-top: 4px; }
.service-extra { margin-top: clamp(36px, 5vw, 56px); }
.chips-dark .chip { border-color: var(--line); color: var(--ink); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.pricing { max-width: 760px; }
.pricing h2 { margin-bottom: 14px; }
.pricing p { color: var(--muted); margin-bottom: 24px; }
.faq-wrap { max-width: 860px; }
.faq { display: grid; gap: 10px; }
.faq-item { background: var(--white); border-radius: var(--radius); border: 1px solid var(--line); padding: 0 22px; }
.faq-item summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; font-weight: 600; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-icon { position: relative; width: 18px; height: 18px; flex: none; }
.faq-icon::before, .faq-icon::after { content: ""; position: absolute; background: var(--blue); left: 50%; top: 50%; transform: translate(-50%, -50%); transition: transform 0.25s var(--ease); }
.faq-icon::before { width: 18px; height: 2px; }
.faq-icon::after { width: 2px; height: 18px; }
.faq-item[open] .faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item p { padding: 0 0 18px; color: var(--muted); }

/* 加入我們 */
.roles { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2.5vw, 28px); margin-bottom: 24px; }
.role { display: flex; flex-direction: column; gap: 12px; padding: 28px; border-radius: var(--radius-lg); background: var(--white); border: 1px solid var(--line); transition: transform 0.3s var(--ease), border-color 0.3s; }
.role:hover { transform: translateY(-4px); border-color: var(--blue); }
.role-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.role p { color: var(--muted); flex: 1; }
.chip-small { font-size: 0.78rem; padding: 5px 12px; border-color: var(--line); color: var(--muted); }
.how { max-width: 760px; }
.how h2 { margin-bottom: 16px; }
.how-steps { margin: 0 0 24px; padding-left: 1.4em; color: var(--muted); }
.how-steps li + li { margin-top: 8px; }

/* 隱私權政策 */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.3rem; margin: 32px 0 10px; }
.prose p { color: var(--muted); }

/* 頁尾底列連結 */
.footer-links { display: flex; gap: 22px; align-items: center; }
.footer-links a { padding: 10px 0; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .service-grid, .roles { grid-template-columns: 1fr; }
  .blob { display: none; }
}
@media (max-width: 600px) {
  .grid-4 { grid-template-columns: 1fr; }
  .service-card-head { gap: 12px; }
  .footer-links { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .blob, .mark-pulse, .marquee-track { animation: none; }
  .js .hero-art.fx-in { animation: none; opacity: 1; transform: none; }
  .js .fx-lines .line > span, .js .fx-up, .js .fx-in { animation: none; opacity: 1; transform: none; }
  [data-parallax] { transform: none; }
  .js body { opacity: 1; animation: none; }
}
