/* =========================================================
   陞創智動科技 SCSA — 網站樣式 (2026 改版)
   ========================================================= */
:root {
  --brand: #224ea0;
  --brand-dark: #173a7c;
  --navy: #0c1a33;
  --navy-2: #13264a;
  --accent: #1fb5e9;
  --accent-soft: #e5f6fd;
  --bg: #ffffff;
  --bg-soft: #f4f7fc;
  --line: #e2e8f2;
  --text: #1b2536;
  --muted: #5b6880;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 35, 75, .08);
  --shadow-lg: 0 20px 50px rgba(15, 35, 75, .16);
  --maxw: 1200px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "微軟正黑體", "PingFang TC", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .6em; color: var(--navy); font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section.soft { background: var(--bg-soft); }
.section.dark { background: var(--navy); color: #cfd8ea; }
.section.dark h2, .section.dark h3 { color: #fff; }

.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .18em;
  color: var(--accent); text-transform: uppercase; margin-bottom: .8em;
}
.section-head { text-align: center; max-width: 760px; margin: 0 auto 56px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.section.dark .section-head p { color: #9fb0cf; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .85em 1.6em; border-radius: 999px; font-weight: 700; font-size: .98rem;
  border: 2px solid transparent; transition: all .25s; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #fff; color: var(--brand); transform: translateY(-2px); }
.btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); color: #fff; transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  background: rgba(255,255,255,.92); backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent; transition: box-shadow .3s, border-color .3s;
}
.site-header.scrolled { box-shadow: 0 6px 24px rgba(15,35,75,.08); border-color: var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--navy); }
.brand img { height: 42px; width: auto; border-radius: 6px; }
.brand .name { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.brand .name small { display: block; font-weight: 500; font-size: .68rem; letter-spacing: .08em; color: var(--muted); }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.main-nav li { position: relative; }
.main-nav a {
  display: block; padding: 10px 16px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: .98rem;
}
.main-nav a:hover, .main-nav a.active { color: var(--brand); background: var(--accent-soft); }
.main-nav .cta a { background: var(--brand); color: #fff; margin-left: 8px; }
.main-nav .cta a:hover { background: var(--accent); color: #fff; }
.main-nav .has-sub > a::after { content: "\f107"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-left: 6px; font-size: .75em; }
.main-nav .sub {
  position: absolute; top: 100%; left: 0; min-width: 210px; display: block;
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .2s;
}
.main-nav .sub a { padding: 9px 14px; }
.main-nav .sub a i { width: 22px; color: var(--accent); }
.main-nav .has-sub:hover .sub, .main-nav .has-sub:focus-within .sub { opacity: 1; visibility: visible; transform: none; }

.nav-toggle { display: none; background: none; border: 0; font-size: 1.5rem; color: var(--navy); cursor: pointer; padding: 8px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 92vh; display: flex; align-items: center;
  color: #fff; padding: calc(var(--header-h) + 60px) 0 90px; overflow: hidden;
  background: var(--navy) url(../../images/code-2.jpg) center/cover no-repeat;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(8,20,45,.95) 0%, rgba(20,50,110,.86) 55%, rgba(31,181,233,.45) 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; opacity: .18;
  background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%);
  mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 56px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: .02em; margin-bottom: .35em; }
.hero h1 span { color: var(--accent); }
.hero .lead { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: #d4def0; max-width: 620px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-tags span {
  font-size: .85rem; padding: 6px 14px; border-radius: 999px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #e6eefc;
}
.hero-card {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  border-radius: 20px; padding: 28px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.hero-card img.logo { width: 100%; max-width: 280px; margin: 0 auto 18px; }
.hero-card ul { list-style: none; margin: 0; padding: 0; }
.hero-card li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.12); color: #dbe4f5; font-size: .95rem; }
.hero-card li:first-child { border-top: 0; }
.hero-card li i { color: var(--accent); margin-top: 6px; width: 18px; }

/* ---------- Stats ---------- */
.stats { margin-top: -56px; position: relative; z-index: 2; }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); background: #fff;
  border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.stat { padding: 30px 24px; text-align: center; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font-size: 2.2rem; color: var(--brand); line-height: 1.1; font-weight: 800; }
.stat b small { font-size: 1rem; font-weight: 700; margin-left: 2px; }
.stat span { color: var(--muted); font-size: .92rem; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 28px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); overflow: hidden; transition: transform .3s, box-shadow .3s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card .thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--bg-soft); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .thumb img { transform: scale(1.06); }
.card .body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.card h3 { font-size: 1.2rem; }
.card p { color: var(--muted); font-size: .95rem; }
.card .more { margin-top: auto; font-weight: 700; font-size: .92rem; }
.card .more i { transition: transform .2s; }
.card:hover .more i { transform: translateX(4px); }

.icon-card { padding: 32px 28px; }
.icon-badge {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-size: 1.4rem; margin-bottom: 18px;
}

/* ---------- Scope chips ---------- */
.scope { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 960px) { .scope { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .scope { grid-template-columns: 1fr; } }
.scope div {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); color: #e8eefa; font-weight: 500;
}
.scope i { color: var(--accent); font-size: 1.15rem; width: 24px; text-align: center; }

/* ---------- Split layout ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split .media img { border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.check { list-style: none; padding: 0; margin: 1.2em 0; }
.check li { padding-left: 32px; position: relative; margin-bottom: .6em; }
.check li::before {
  content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; left: 0; top: 2px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--brand);
  font-size: .7rem; display: grid; place-items: center;
}

/* ---------- Clients ---------- */
.clients { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.clients > div { flex: 0 1 172px; }
@media (max-width: 600px) { .clients > div { flex-basis: calc(50% - 9px); } }
.clients div {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; height: 104px;
  display: grid; place-items: center; padding: 16px 20px; transition: all .3s;
}
.clients img { max-height: 64px; width: auto; object-fit: contain; filter: grayscale(1); opacity: .75; transition: all .3s; }
.clients div:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.clients div:hover img { filter: none; opacity: 1; }

/* ---------- News / timeline ---------- */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: flex; gap: 20px; padding: 18px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.news time { flex: 0 0 auto; font-weight: 700; color: var(--brand); font-size: .92rem; background: var(--accent-soft); padding: 2px 12px; border-radius: 999px; }

.timeline { position: relative; margin: 0; padding: 0 0 0 28px; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), var(--brand)); }
.timeline li { position: relative; padding: 0 0 26px 18px; }
.timeline li::before {
  content: ""; position: absolute; left: -27px; top: 7px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand);
}
.timeline time { font-weight: 700; color: var(--brand); display: block; font-size: .95rem; }

/* ---------- Page banner ---------- */
.page-banner {
  position: relative; color: #fff; padding: calc(var(--header-h) + 64px) 0 64px;
  background: var(--navy) url(../../images/code-2.jpg) center/cover no-repeat; overflow: hidden;
}
.page-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(8,20,45,.94), rgba(34,78,160,.82)); }
.page-banner .container { position: relative; }
.page-banner h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: .2em; }
.page-banner p { color: #cad6ee; font-size: 1.1rem; margin: 0; }
.crumbs { font-size: .88rem; color: #9fb3d8; margin-bottom: 14px; }
.crumbs a { color: #cfe2ff; }
.crumbs i { font-size: .7em; margin: 0 8px; }

/* ---------- Sub-page layout ---------- */
.layout { display: grid; grid-template-columns: 280px 1fr; gap: 48px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--header-h) + 24px); }
.side-card { background: var(--bg-soft); border-radius: var(--radius); padding: 26px; border: 1px solid var(--line); }
.side-card h3 { font-size: 1.15rem; margin-bottom: .4em; }
.side-card p { color: var(--muted); font-size: .92rem; }
.side-links { list-style: none; margin: 0; padding: 0; }
.side-links a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  color: var(--text); font-weight: 500; font-size: .95rem;
}
.side-links a::before { content: "\f105"; font-family: "Font Awesome 6 Free"; font-weight: 900; color: var(--accent); font-size: .8em; }
.side-links a:hover, .side-links a.active { background: #fff; color: var(--brand); box-shadow: 0 4px 14px rgba(15,35,75,.07); }
.side-contact { margin-top: 20px; background: linear-gradient(135deg, var(--brand), var(--navy-2)); color: #dbe6fb; border-radius: var(--radius); padding: 24px; }
.side-contact h4 { color: #fff; margin-bottom: .3em; }
.side-contact p { font-size: .9rem; margin-bottom: 1em; }

.article { min-width: 0; }
.article > header, .article section > header { margin-bottom: 1.2em; }
.article h2 { font-size: 1.7rem; }
.article h3 { font-size: 1.25rem; color: var(--brand); margin-top: 1.4em; }
.article header h2 + h3 { margin-top: -.3em; color: var(--muted); font-weight: 500; font-size: 1.05rem; }
.article p, .article li { color: #36425a; }
.article img { border-radius: 12px; box-shadow: var(--shadow); margin: 1.2em 0; cursor: zoom-in; width: auto; max-width: 100%; }
.article ol, .article ul { padding-left: 1.2em; }
.article ol { list-style: none; padding-left: 0; }
.article ol li { padding: 6px 0 6px 14px; border-left: 3px solid var(--accent-soft); margin-bottom: 4px; }
.article table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.article th, .article td { border: 1px solid var(--line); padding: 8px 12px; }
.article th { background: var(--bg-soft); }

/* ---------- Projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 44px; }
.filters button {
  font: inherit; font-size: .95rem; font-weight: 500; padding: 9px 20px; border-radius: 999px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); color: var(--text); transition: all .2s;
}
.filters button:hover { border-color: var(--brand); color: var(--brand); }
.filters button.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.cat-block { margin-bottom: 72px; }
.cat-block.hidden { display: none; }
.cat-intro {
  display: flex; gap: 22px; align-items: flex-start; padding: 26px 30px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy-2), var(--brand)); color: #d7e2f7; margin-bottom: 32px;
}
.cat-intro .icon-badge { flex: 0 0 56px; margin: 0; background: rgba(255,255,255,.14); }
.cat-intro h2 { color: #fff; font-size: 1.45rem; margin-bottom: .25em; }
.cat-intro p { margin: 0; }
.cat-intro .note { color: #ffd98a; font-weight: 700; margin-top: .5em; }

.project {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 0; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 28px;
}
.project.no-media { grid-template-columns: 1fr; }
.project .p-media { background: var(--bg-soft); display: flex; flex-direction: column; gap: 10px; padding: 18px; justify-content: center; }
.project .p-media img { border-radius: 10px; cursor: zoom-in; box-shadow: 0 4px 16px rgba(15,35,75,.1); background: #fff; }
.project .p-body { padding: 30px 32px; }
.project h3 { font-size: 1.3rem; margin-bottom: .5em; }
.project h4 { font-size: .85rem; letter-spacing: .1em; color: var(--accent); margin: 1.1em 0 .3em; text-transform: uppercase; }
.project p { color: #3b475e; font-size: .96rem; margin-bottom: .4em; }
.project ul { margin: 0; padding-left: 1.1em; color: #3b475e; font-size: .96rem; }
.project .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tags span { font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--brand-dark); font-weight: 500; }
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.project-grid .project { grid-template-columns: 1fr; margin: 0; }

/* ---------- Info table / contact ---------- */
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.info-list i { color: var(--brand); width: 22px; margin-top: 6px; text-align: center; }
.info-list b { display: block; font-size: .82rem; color: var(--muted); font-weight: 500; }
.map-frame { width: 100%; height: 100%; min-height: 380px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }

.cta-band { background: linear-gradient(120deg, var(--brand), var(--navy-2)); color: #fff; border-radius: 22px; padding: 48px 52px; display: flex; gap: 32px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: .2em; font-size: 1.7rem; }
.cta-band p { color: #cfdbf3; margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #9eadc9; padding: 72px 0 0; font-size: .94rem; }
.site-footer h4 { color: #fff; font-size: 1.02rem; margin-bottom: 1em; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 40px; }
.site-footer .f-logo { width: 190px; margin-bottom: 18px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .6em; }
.site-footer a { color: #c4d1ea; }
.site-footer a:hover { color: var(--accent); }
.site-footer .contact li { display: flex; gap: 12px; }
.site-footer .contact i { color: var(--accent); margin-top: 6px; width: 16px; }
.social { display: flex; gap: 10px; margin-top: 18px; }
.social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); }
.social a:hover { background: var(--accent); color: #fff; }
.copyright { border-top: 1px solid rgba(255,255,255,.08); margin-top: 56px; padding: 22px 0; font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

.to-top {
  position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: var(--brand); color: #fff; box-shadow: var(--shadow-lg); cursor: pointer; z-index: 90;
  opacity: 0; visibility: hidden; transition: all .3s; font-size: 1rem;
}
.to-top.show { opacity: 1; visibility: visible; }
.to-top:hover { background: var(--accent); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(6,14,30,.92); z-index: 200; display: none; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.lightbox .close { position: absolute; top: 18px; right: 24px; color: #fff; font-size: 2rem; background: none; border: 0; cursor: pointer; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { display: none; }
}
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; background: #fff; box-shadow: var(--shadow-lg);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  .main-nav.open { max-height: 80vh; overflow-y: auto; }
  .main-nav ul { flex-direction: column; align-items: stretch; padding: 12px 16px 20px; gap: 2px; }
  .main-nav .sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; padding: 0 0 0 16px; }
  .main-nav .has-sub > a::after { display: none; }
  .main-nav .cta a { margin: 8px 0 0; text-align: center; }
  .grid-3, .grid-2, .split, .project, .project-grid { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; order: 2; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .section { padding: 72px 0; }
}
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .brand .name small { display: none; }
  .brand img { height: 36px; }
  .brand .name { font-size: .95rem; }
  .hero { min-height: auto; }
  .stat b { font-size: 1.7rem; }
  .cta-band { padding: 34px 26px; }
  .project .p-body { padding: 24px 22px; }
  .cat-intro { flex-direction: column; padding: 22px; }
  .news li { flex-direction: column; gap: 6px; }
}
