/*
  Design reminder: 演算日光 —— 現代企業資訊設計，深海軍藍骨架、暖白閱讀面、金砂節點；六個分頁 Banner 採左側深色標題安全區與右側對應企業插圖，既有高度與闊度不可變更。
*/
:root {
  --navy: #113c58;
  --ink: #0b273b;
  --gold: #c89655;
  --sand: #ded6cb;
  --mist: #f7f4ef;
  --paper: #fffdfa;
  --muted: #627180;
  --header-h: 78px;
  --radius: 2px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Microsoft JhengHei", "PingFang TC", "Segoe UI", Arial, sans-serif; font-size: 15px; line-height: 1.85; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

.site-header { position: sticky; top: 0; z-index: 20; height: var(--header-h); display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 17px; padding: 10px 18px; background: rgba(255, 253, 250, .96); border-bottom: 1px solid rgba(222, 214, 203, .82); transition: box-shadow 200ms var(--ease-out), background 200ms var(--ease-out); }
.site-header.is-scrolled { box-shadow: 0 8px 24px rgba(11, 39, 59, .09); }
.brand { display: flex; min-width: 0; align-items: center; }
.brand img { width: min(220px, 53vw); height: auto; }
.language-link { display: inline-grid; place-items: center; min-width: 44px; height: 38px; padding: 0 10px; border: 1px solid var(--sand); color: var(--navy); font-family: "Segoe UI", Arial, sans-serif; font-size: 12px; font-weight: 800; letter-spacing: .08em; transition: background 180ms var(--ease-out), color 180ms var(--ease-out), transform 160ms var(--ease-out); }
.language-link:hover { background: var(--navy); color: white; }
.language-link:active, .button:active { transform: scale(.97); }
.menu-toggle { display: inline-grid; gap: 5px; width: 40px; height: 38px; align-content: center; justify-content: center; padding: 0; background: transparent; border: 1px solid var(--sand); color: var(--navy); }
.menu-toggle span { display: block; width: 16px; height: 1px; background: currentColor; transition: transform 180ms var(--ease-out); }
.menu-toggle.is-open span:first-child { transform: translateY(3px) rotate(45deg); }
.menu-toggle.is-open span:last-child { transform: translateY(-3px) rotate(-45deg); }
.site-nav { position: absolute; z-index: 21; top: calc(var(--header-h) - 1px); right: 0; left: 0; display: grid; max-height: 0; overflow: hidden; background: var(--paper); border-bottom: 0 solid var(--sand); opacity: 0; transform: translateY(-6px); transition: max-height 220ms var(--ease-out), opacity 180ms var(--ease-out), transform 220ms var(--ease-out), border 180ms var(--ease-out); }
.site-nav.is-open { max-height: 430px; padding: 8px 18px 16px; border-bottom-width: 1px; opacity: 1; transform: translateY(0); }
.site-nav a { position: relative; padding: 10px 0; color: var(--navy); font-size: 14px; font-weight: 600; }
.site-nav a::after { position: absolute; right: 0; bottom: 6px; left: 0; height: 2px; background: var(--gold); content: ""; transform: scaleX(0); transform-origin: left; transition: transform 180ms var(--ease-out); }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }

.hero { position: relative; min-height: 630px; overflow: hidden; isolation: isolate; background: var(--ink); }
.hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 53% center; }
.hero-shade { position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(5, 28, 44, .93) 0%, rgba(11, 39, 59, .79) 39%, rgba(11, 39, 59, .31) 76%, rgba(11, 39, 59, .2) 100%); }
.hero-grid, .cover-grid { position: absolute; z-index: 2; inset: 0; opacity: .36; background-image: linear-gradient(rgba(255,255,255,.14) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px); background-size: 68px 68px; mask-image: linear-gradient(90deg, black, transparent 71%); }
.hero-content, .cover-content { position: relative; z-index: 3; max-width: 770px; padding: 100px 24px 64px; color: white; }
.eyebrow, .section-index { color: var(--gold); font-family: "Segoe UI", Arial, sans-serif; font-size: 12px; font-weight: 800; letter-spacing: .18em; }
.eyebrow::after { display: inline-block; width: 46px; height: 1px; margin-left: 11px; vertical-align: middle; background: currentColor; content: ""; }
h1, h2, h3 { margin: 0; color: var(--navy); font-family: "Segoe UI", "Microsoft JhengHei", "PingFang TC", Arial, sans-serif; font-weight: 800; line-height: 1.22; letter-spacing: -.04em; }
.hero h1, .page-cover h1 { margin-top: 0; color: white; font-size: clamp(40px, 11vw, 74px); }
.hero-copy { max-width: 700px; margin-top: 27px; color: rgba(255,255,255,.94); font-size: 15px; line-height: 1.8; }
.hero-copy p { margin: 0 0 12px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 11px 18px; font-weight: 700; line-height: 1; transition: transform 160ms var(--ease-out), box-shadow 180ms var(--ease-out), background 180ms var(--ease-out), color 180ms var(--ease-out); }
.button-primary { background: var(--gold); color: var(--ink); }
.button-primary:hover { box-shadow: 0 10px 22px rgba(0,0,0,.23); }
.button-secondary { border: 1px solid rgba(255,255,255,.75); color: white; }
.button-secondary:hover { background: white; color: var(--ink); }

.directory { position: relative; z-index: 4; padding: 0 18px; background: var(--paper); }
.directory-inner { position: relative; display: grid; grid-template-columns: 1fr 1fr; max-width: 1180px; margin: -35px auto 0; background: white; box-shadow: 0 20px 42px rgba(11, 39, 59, .1); }
.directory-card { position: relative; display: grid; min-height: 130px; align-content: end; gap: 14px; padding: 17px; overflow: hidden; border-right: 1px solid var(--sand); border-bottom: 1px solid var(--sand); transition: background 180ms var(--ease-out), color 180ms var(--ease-out); }
.directory-card:nth-child(2n) { border-right: 0; }
.directory-card:nth-last-child(-n + 2) { border-bottom: 0; }
.directory-card::before { position: absolute; z-index: 1; inset: 0 0 0 auto; width: 58%; background: linear-gradient(90deg, var(--paper) 0%, rgba(255, 253, 250, .12) 42%, rgba(255, 253, 250, 0) 100%); content: ""; pointer-events: none; }
.directory-art { position: absolute; z-index: 0; top: 0; right: 0; width: 50%; height: 100%; object-fit: cover; object-position: center; transition: transform 360ms var(--ease-out), filter 180ms var(--ease-out); }
.directory-card strong { position: relative; z-index: 2; max-width: 52%; color: var(--navy); font-size: 14px; line-height: 1.42; }
.directory-card i { position: absolute; z-index: 3; right: 16px; bottom: 15px; color: var(--gold); font-style: normal; transition: transform 180ms var(--ease-out); }
.directory-card:hover { background: var(--navy); }
.directory-card:hover strong { color: white; }
.directory-card:hover::before { background: linear-gradient(90deg, var(--navy) 0%, rgba(17, 60, 88, .18) 50%, rgba(17, 60, 88, 0) 100%); }
.directory-card:hover .directory-art { transform: scale(1.06); filter: saturate(1.08); }
.directory-card:hover i { transform: translate(3px, -3px); }
.directory-card, .button, .office-card { will-change: transform; }

.home-flow { max-width: 1180px; margin: 0 auto; padding: 70px 18px 34px; }
.home-section { position: relative; display: grid; gap: 23px; padding: 56px 0; border-bottom: 1px solid var(--sand); }
.home-section:first-child { padding-top: 10px; }
.home-copy { grid-row: 1; }
.home-copy h2 { margin-bottom: 22px; font-size: clamp(28px, 6vw, 44px); }
.home-copy p, .detail-copy p, .contact-content > div > p { max-width: 750px; margin: 0 0 1.1em; color: #40515e; }
.section-visual { position: relative; margin: 4px 0 0; overflow: hidden; background: var(--mist); }
.section-visual::before { position: absolute; z-index: 1; top: 16px; right: 16px; width: 41px; height: 41px; border: 1px solid rgba(200, 150, 85, .9); border-radius: 50%; box-shadow: 0 0 0 7px rgba(17, 60, 88, .28); content: ""; }
.section-visual::after { position: absolute; z-index: 1; right: 0; bottom: 0; left: 0; height: 30%; background: linear-gradient(90deg, rgba(17,60,88,.31), transparent); content: ""; pointer-events: none; }
.section-visual img, .lead-visual img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; transition: transform 600ms var(--ease-out); }
.home-section:hover .section-visual img { transform: scale(1.025); }
.text-link, .inline-link { display: inline-block; color: var(--navy); font-weight: 800; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.text-link { margin-top: 12px; }

.page-cover { position: relative; min-height: 285px; overflow: hidden; isolation: isolate; background-color: var(--ink); background-position: center; background-size: cover; }
.page-detail[data-page="about"] .page-cover { background-image: url("assets/gp-banner-about.jpg"); }
.page-detail[data-page="services"] .page-cover { background-image: url("assets/gp-banner-services.jpg"); }
.page-detail[data-page="strengths"] .page-cover { background-image: url("assets/gp-banner-strengths.jpg"); }
.page-detail[data-page="csr"] .page-cover { background-image: url("assets/gp-banner-csr.jpg"); }
.page-detail[data-page="information-center"] .page-cover { background-image: url("assets/gp-banner-information-center.jpg"); }
.page-detail[data-page="contact"] .page-cover { background-image: url("assets/gp-banner-contact.jpg"); }
.page-cover::before { position: absolute; z-index: 0; inset: 0; background: linear-gradient(90deg, rgba(5, 28, 44, .94) 0%, rgba(11, 39, 59, .84) 38%, rgba(11, 39, 59, .42) 68%, rgba(11, 39, 59, .2) 100%); content: ""; pointer-events: none; }
.page-cover::after { position: absolute; z-index: 1; width: 380px; height: 380px; right: -120px; bottom: -260px; border: 1px solid rgba(200, 150, 85, .75); border-radius: 50%; box-shadow: 0 0 0 52px rgba(200, 150, 85, .08), 0 0 0 110px rgba(200, 150, 85, .05); content: ""; }
.cover-content { padding-top: 78px; padding-bottom: 54px; }
.content-shell { max-width: 980px; margin: 0 auto; padding: 61px 22px 84px; }
.detail-layout { position: relative; max-width: 930px; margin: 0 auto; }
.detail-rail { display: none; }
.detail-copy { position: relative; max-width: 830px; margin: 0 auto; }
.detail-copy::before { position: absolute; top: 0; bottom: 0; left: -18px; width: 1px; background: linear-gradient(to bottom, transparent, var(--gold) 3%, var(--sand) 14%, var(--sand) 86%, transparent); content: ""; }
.detail-copy h2 { position: relative; margin: 58px 0 20px; padding: 16px 0 0; border-top: 1px solid var(--sand); font-size: clamp(28px, 5vw, 42px); }
.detail-copy h2::before { position: absolute; top: -5px; left: -23px; width: 10px; height: 10px; border: 2px solid var(--paper); border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1px var(--gold); content: ""; }
.detail-copy h2::after { display: block; width: 38px; height: 2px; margin-top: 15px; background: var(--gold); content: ""; }
.detail-copy h3 { margin: 32px 0 13px; font-size: 20px; letter-spacing: -.02em; }
.detail-copy h3 + p { margin-top: 0; }
.detail-copy h2 + h3 { margin-top: 25px; }
.detail-copy .lead-visual { margin: 0 0 36px; overflow: hidden; background: var(--mist); }
.detail-copy p { font-size: 15px; }
.career-table { width: 100%; margin: 32px 0 12px; border-collapse: collapse; table-layout: fixed; background: var(--paper); box-shadow: 0 14px 28px rgba(17, 60, 88, .07); }
.career-table th, .career-table td { padding: 18px 20px; border: 1px solid var(--sand); text-align: left; vertical-align: top; }
.career-table th { background: var(--navy); color: white; font-family: "Segoe UI", "Microsoft JhengHei", "PingFang TC", Arial, sans-serif; font-size: 13px; font-weight: 800; letter-spacing: .03em; }
.career-table td { color: #40515e; font-size: 15px; line-height: 1.65; }
.career-table th:first-child, .career-table td:first-child { width: 38%; }
.career-table tbody tr:nth-child(even) td { background: var(--mist); }

.contact-content { max-width: 1210px; }
.network-content { position: relative; }
.network-content > p { max-width: 750px; margin: 0 0 1.1em; color: #40515e; }
.network-panel { position: relative; margin-top: 42px; padding: 30px 18px 18px; overflow: hidden; background-color: var(--mist); background-image: linear-gradient(rgba(17,60,88,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(17,60,88,.08) 1px, transparent 1px); background-size: 42px 42px; }
.network-panel::before { position: absolute; top: 0; right: 0; width: 38%; height: 100%; background: linear-gradient(140deg, transparent 34%, rgba(200,150,85,.22) 34.1%, rgba(200,150,85,.22) 34.7%, transparent 34.8%, transparent 60%, rgba(200,150,85,.18) 60.1%, rgba(200,150,85,.18) 60.7%, transparent 60.8%); content: ""; pointer-events: none; }
.network-panel h2 { position: relative; z-index: 1; margin-bottom: 24px; font-size: clamp(28px, 5vw, 42px); }
.network-panel h2::after { display: block; width: 42px; height: 2px; margin-top: 15px; background: var(--gold); content: ""; }
.office-grid { position: relative; z-index: 1; display: grid; gap: 1px; margin-top: 18px; background: rgba(200,150,85,.43); }
.office-card { position: relative; padding: 26px 19px 22px; background: rgba(255,253,250,.94); }
.office-node { position: absolute; top: 15px; right: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(200,150,85,.14); }
.office-card h3 { margin-bottom: 18px; padding-right: 20px; font-size: 22px; }
.office-card dl { margin: 0; }
.office-card dl > div { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--sand); }
.office-card dt { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.office-card dd { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }

.site-footer { display: grid; min-height: 164px; place-items: center; padding: 40px 20px; background: var(--mist); border-top: 1px solid var(--sand); }
.site-footer img { width: min(280px, 65vw); height: auto; opacity: .9; }

.reveal { opacity: 1; transform: none; }
.reveal.is-visible { opacity: 1; transform: none; transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out); }

@media (min-width: 620px) {
  .site-header { grid-template-columns: minmax(220px, 1fr) auto auto; padding-right: 30px; padding-left: 30px; }
  .hero-content, .cover-content { padding-right: 44px; padding-left: 44px; }
  .directory { padding: 0 32px; }
  .directory-inner { grid-template-columns: repeat(3, 1fr); }
  .directory-card:nth-child(2n) { border-right: 1px solid var(--sand); }
  .directory-card:nth-child(3n) { border-right: 0; }
  .directory-card:nth-last-child(-n + 2) { border-bottom: 1px solid var(--sand); }
  .directory-card:nth-last-child(-n + 3) { border-bottom: 0; }
  .home-flow { padding-right: 32px; padding-left: 32px; }
  .home-section { grid-template-columns: minmax(0, 1fr) minmax(220px, .78fr); align-items: start; gap: 28px; padding: 77px 0; }
  .home-copy { grid-column: 1; grid-row: 1; }
  .section-visual { grid-column: 2; grid-row: 1; margin: 0; }
  .home-section:nth-child(2n) .home-copy { grid-column: 2; }
  .home-section:nth-child(2n) .section-visual { grid-column: 1; }
  .office-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
  :root { --header-h: 86px; }
  body { font-size: 16px; }
  .site-header { grid-template-columns: 255px minmax(0, 1fr) auto; gap: 30px; padding-right: 5.3vw; padding-left: 5.3vw; }
  .brand img { width: 243px; }
  .menu-toggle { display: none; }
  .site-nav { position: static; display: flex; max-height: none; align-items: center; justify-content: center; gap: clamp(15px, 2vw, 30px); overflow: visible; background: transparent; border: 0; opacity: 1; transform: none; }
  .site-nav a { padding: 10px 0; font-size: 12px; white-space: nowrap; }
  .hero { min-height: min(81vh, 735px); }
  .hero-content { max-width: 790px; padding-top: clamp(125px, 14vh, 162px); padding-left: max(5.3vw, calc((100vw - 1280px) / 2)); }
  .hero-copy { font-size: 16px; }
  .directory-inner { grid-template-columns: repeat(6, 1fr); }
  .directory-card { min-height: 162px; padding: 21px; border-bottom: 0 !important; }
  .directory-card:nth-child(3n) { border-right: 1px solid var(--sand); }
  .directory-card:last-child { border-right: 0; }
  .home-flow { padding-top: 112px; }
  .home-section { grid-template-columns: minmax(0, 1.05fr) minmax(300px, .9fr); gap: 44px; padding: 101px 0; }
  .home-copy h2 { margin-bottom: 27px; }
  .home-copy p, .detail-copy p, .contact-content > div > p { font-size: 16px; }
  .page-cover { min-height: 340px; }
  .cover-content { max-width: 1160px; margin: 0 auto; padding: 102px 30px 72px; }
  .content-shell { padding-top: 100px; }
  .detail-layout { display: grid; grid-template-columns: 78px minmax(0, 830px); gap: 40px; }
  .detail-rail { position: relative; display: flex; flex-direction: column; align-items: center; gap: 42px; padding-top: 13px; }
  .detail-rail::before { position: absolute; top: 12px; bottom: 12px; width: 1px; background: linear-gradient(to bottom, var(--gold), var(--sand), transparent); content: ""; }
  .detail-rail span { position: relative; z-index: 1; width: 9px; height: 9px; border: 2px solid var(--paper); border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
  .detail-copy { margin: 0; }
  .detail-copy::before { display: none; }
  .detail-copy h2::before { left: -54px; }
  .network-content { min-width: 0; }
  .network-panel { padding: 39px 30px 30px; }
  .office-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .office-card { padding: 25px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
