/* Home page only: compact hero, project carousel with a thumbnail index, scenario-led services.
   Without JS the slides stack as a plain list and the controls stay hidden. */

/* Compact hero */
.hero.hero-compact{padding:22px 0 14px;max-width:none}
.hero-compact h1{font-size:clamp(28px,3.3vw,40px);line-height:1.18;margin:0;max-width:none}
html[lang="zh-Hant"] .hero-compact h1,html[lang="zh-Hant"] .thumb-name{word-break:keep-all}
.hero-compact .hero-sub{font-size:18px;line-height:1.6;max-width:none;margin:8px 0 0;-webkit-hyphens:manual;hyphens:manual}

/* Section head with the arrow controls on the right */
.showcase{padding:4px 0 36px}
.showcase .section-heading{align-items:center;margin-bottom:14px}
.carousel-nav{display:flex;align-items:center;gap:10px}
.carousel-nav[hidden],.carousel-dots[hidden]{display:none}
.carousel-count{font-size:14px;color:var(--muted);min-width:52px;text-align:center;font-variant-numeric:tabular-nums}
.carousel-arrow{width:44px;height:44px;border-radius:50%;border:1px solid #b9d3d0;background:#fff;color:var(--teal);font-size:22px;line-height:1;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 12px #263c440d;transition:background .15s ease,color .15s ease}
.carousel-play{font-size:12px;letter-spacing:-1px}
.carousel-arrow:hover{background:var(--teal);color:#fff}
.carousel-arrow:focus-visible,.carousel-dot:focus-visible,.thumb:focus-visible,.slide-cta:focus-visible{outline:3px solid #b46c13;outline-offset:3px}

/* Slides: stacked list by default (no JS) */
.carousel-viewport{position:relative}
.carousel-track{display:grid;gap:24px}
.slide{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);background:#ffffffe8;border:1px solid #fff;border-radius:16px;box-shadow:0 8px 28px #263c440a;overflow:hidden;scroll-margin-top:16px}
.slide:focus{outline:none}
.slide-media{position:relative;min-height:340px;background:#e6eeed;border-right:1px solid var(--line)}
.slide-media img{position:absolute;inset:20px;width:calc(100% - 40px);height:calc(100% - 40px);object-fit:contain;object-position:center;filter:drop-shadow(0 8px 16px #153c3924)}
.slide-media.is-cover img{inset:0;width:100%;height:100%;object-fit:cover;filter:none}
.slide-body{display:flex;flex-direction:column;justify-content:center;gap:4px;min-width:0;padding:22px 28px 22px}
.slide-kicker{font-size:12px;font-weight:700;letter-spacing:.06em;color:var(--teal);margin:0 0 8px}
.slide h3{font-size:28px;line-height:1.25;letter-spacing:-.01em;margin:0 0 6px}
html[lang="zh-Hant"] .slide h3{letter-spacing:0}
.slide h3 a{color:var(--text);text-decoration:none}
.slide h3 a:hover{text-decoration:underline;text-decoration-color:var(--mint);text-underline-offset:4px}
.slide-cta{margin-top:6px;align-self:flex-start;display:inline-flex;align-items:center;gap:10px;padding:10px 18px;border-radius:999px;background:var(--teal);color:#fff;font-size:15px;font-weight:700;text-decoration:none;transition:background .15s ease}
.slide-cta:hover{background:#21566a}

/* Stat tiles inside a slide (base look comes from stat-tiles.css) */
html body ul.stat-tiles li,html body ul.stat-tiles li span{text-align:start!important;-webkit-hyphens:manual!important;hyphens:manual!important}
.slide .stat-tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0 18px}
.slide .stat-tiles:has(>li:nth-child(3):last-child){grid-template-columns:repeat(3,minmax(0,1fr))}
.slide .stat-tiles li{padding:16px 16px}
.slide .stat-num{font-size:clamp(24px,2.5vw,32px);white-space:normal}
.slide .stat-label{font-size:13px}
/* A lead tile (before → after) spans the full row and the others share the next row. */
.slide .stat-tiles.has-lead{grid-template-columns:repeat(6,minmax(0,1fr))}
.slide .stat-tiles.has-lead>li{grid-column:span 2}
.slide .stat-tiles.has-lead>li:first-child{grid-column:1/-1;background:#e7f4f0;border-color:#a9d6ca}
.slide .stat-tiles.has-lead>li:first-child .stat-num{font-size:clamp(26px,2.7vw,34px);white-space:nowrap}
.slide .stat-tiles.has-lead:has(>li:nth-child(3):last-child)>li:not(:first-child),
.slide .stat-tiles.has-lead:has(>li:nth-child(5):last-child)>li:not(:first-child){grid-column:span 3}

/* Dots and the synthetic-data note */
.carousel-dots{display:flex;justify-content:center;gap:4px;margin:14px 0 0}
.carousel-dot{width:28px;height:28px;padding:0;border:0;background:transparent;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.carousel-dot::before{content:"";width:10px;height:10px;border-radius:50%;border:2px solid var(--teal);background:transparent;transition:width .2s ease,background .2s ease}
.carousel-dot[aria-current="true"]::before{width:24px;border-radius:6px;background:var(--teal)}
.carousel-note{font-size:13px;line-height:1.55;color:var(--muted);margin:10px 0 0}

/* Thumbnail index: all eight projects at a glance */
nav.carousel-thumbs{display:block;max-width:none;margin:16px 0 0;padding:0}
.carousel-thumbs ol{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:10px;list-style:none;margin:0;padding:0}
.carousel-thumbs li{margin:0;min-width:0}
nav.carousel-thumbs a.thumb{display:flex;flex-direction:column;gap:6px;height:100%;padding:6px;border-radius:10px;border:1px solid #ffffff;background:#ffffffa6;color:var(--text);text-decoration:none;font-weight:400;transition:border-color .15s ease,background .15s ease}
.thumb img{display:block;width:100%;aspect-ratio:16/10;object-fit:cover;object-position:center top;border-radius:6px;background:#e6eeed}
.thumb-name{display:block;font-size:12px;line-height:1.35;font-weight:700;overflow-wrap:break-word;-webkit-hyphens:manual;hyphens:manual}
.thumb-no{display:block;font-size:12px;line-height:1;color:var(--muted);font-variant-numeric:tabular-nums}
nav.carousel-thumbs a.thumb:hover{border-color:#a8c9c7;background:#fff}
nav.carousel-thumbs a.thumb[aria-current="true"]{border-color:var(--teal);background:#fff;box-shadow:0 0 0 1px var(--teal)}
nav.carousel-thumbs a.thumb[aria-current="true"] .thumb-name{color:var(--teal)}

/* JS on: one slide at a time */
.carousel.is-ready .carousel-viewport{overflow:hidden;overflow:clip;touch-action:pan-y}
.carousel.is-ready .carousel-track{display:flex;gap:24px;transition:transform .45s cubic-bezier(.22,.7,.2,1);will-change:transform}
.carousel.is-ready .slide{flex:0 0 100%;min-width:0}

/* Services: scenario first, then how, then one proof number */
.help h2{margin-bottom:6px}
.help-intro{font-size:16px;color:var(--muted);margin:0 0 16px;max-width:820px}
.help-item h3{font-size:20px}
.help-item p.see{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;margin-top:4px;padding-top:12px;border-top:1px solid var(--line);font-weight:400;color:var(--muted)}
.help-item .see-num{font-size:22px;line-height:1.2;font-weight:700;color:var(--teal);white-space:nowrap}
.help-item .see-label{font-size:14px}
.help-item .see a{margin-left:auto;font-size:14px;font-weight:700;text-decoration:none;border-bottom:2px solid var(--mint);padding-bottom:1px}
.about{padding-top:12px}

@media(max-width:760px){
  .hero.hero-compact{padding:22px 0 14px}
  .hero-compact h1{font-size:clamp(26px,7vw,32px)}
  .hero-compact .hero-sub{font-size:16px}
  .showcase .section-heading{margin-bottom:12px}
  .carousel-arrow{width:40px;height:40px}
  .carousel-count{min-width:44px;font-size:13px}
  .slide{grid-template-columns:minmax(0,1fr)}
  .slide-media{min-height:0;aspect-ratio:16/10;border-right:0;border-bottom:1px solid var(--line)}
  .slide-media img{inset:12px;width:calc(100% - 24px);height:calc(100% - 24px)}
  .slide-body{padding:20px 18px 20px}
  .slide h3{font-size:22px}
  .slide .stat-tiles,.slide .stat-tiles:has(>li:nth-child(3):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
  .slide .stat-tiles:not(.has-lead)>li:last-child:nth-child(odd):not(:first-child){grid-column:1/-1}
  .slide .stat-tiles.has-lead>li,.slide .stat-tiles.has-lead:has(>li:nth-child(3):last-child)>li:not(:first-child){grid-column:span 3}
  .slide .stat-tiles.has-lead>li:first-child{grid-column:1/-1}
  .slide .stat-tiles.has-lead>li:last-child:nth-child(even){grid-column:1/-1}
  .slide .stat-tiles.has-lead>li:first-child .stat-num{white-space:normal}
  .carousel-thumbs ol{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
  nav.carousel-thumbs a.thumb{padding:3px}
  .carousel-thumbs ol{gap:6px}
  .help-item .see a{margin-left:0}
}
@media(prefers-reduced-motion:reduce){
  .carousel.is-ready .carousel-track,.carousel-dot::before,.carousel-arrow,.slide-cta,nav.carousel-thumbs a.thumb{transition:none}
}
