:root {
  --bg:#fafafa;scale
  --panel:#ffffff;
  --panel-2:#f6f6f7;
  --text:#111111;
  --muted:#666b73;
  --line:#e6e8eb;
  --soft:#f1f2f4;
  --accent:#0a84ff;
  --accent-2:#6e5ce7;
  --blue:#0a84ff;
  --green:#1f9d55;
  --radius:22px;
  --max:1180px;
}

* {
  box-sizing:border-box;
}

html {
  scroll-behavior:smooth;
}

body {
  margin:0;
  background:linear-gradient(180deg,#ffffff 0%,var(--bg) 42%,#f7f8fa 100%);
  color:var(--text);
  font-family:Inter,'Noto Sans TC',system-ui,sans-serif;
  letter-spacing:-.02em;
}

a {
  color:inherit;
  text-decoration:none;
}

.noise {
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.018;
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.section-pad {
  max-width:var(--max);
  margin:0 auto;
  padding:112px 24px;
}

.nav {
  position:sticky;
  top:0;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 28px;
  background:rgba(250,250,250,.82);
  backdrop-filter:blur(18px);
  border-bottom:1px solid rgba(0,0,0,.06);
}

.brand {
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
}

.brand-mark {
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border-radius:10px;
  background:linear-gradient(135deg,#111,#6b7280);
  color:#fff;
}

.nav-links {
  display:flex;
  align-items:center;
  gap:24px;
  color:var(--muted);
  font-size:14px;
}

.nav-links a:hover {
  color:var(--text);
}

.nav-cta {
  padding:9px 14px;
  border:1px solid var(--line);
  border-radius:10px;
  background:rgba(255,255,255,.72);
  box-shadow:0 1px 2px rgba(0,0,0,.04);
}

.hero {
  min-height:92vh;
  display:grid;
  grid-template-columns:1fr .92fr;
  gap:56px;
  align-items:center;
}

.eyebrow,.section-label {
  color:var(--accent);
  text-transform:uppercase;
  font-size:12px;
  font-weight:800;
  letter-spacing:.16em;
}

.hero h1,.case-hero h1 {
  font-size:clamp(48px,7vw,88px);
  line-height:.94;
  margin:18px 0 22px;
  max-width:820px;
}

.hero p,.case-hero p,.section-head p,.intro h2+p {
  font-size:20px;
  line-height:1.65;
  color:var(--muted);
  max-width:680px;
}

.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:13px 18px;
  border-radius:10px;
  font-weight:700;
  font-size:14px;
}

.primary {
  background:#111;
  color:#fff;
  box-shadow:0 10px 24px rgba(0,0,0,.12);
}

.secondary {
  background:rgba(255,255,255,.82);
  border:1px solid var(--line);
  color:var(--text);
  box-shadow:0 1px 2px rgba(0,0,0,.04);
}

.hero-actions,.contact-actions {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:32px;
}

.command-card {
  border:1px solid var(--line);
  border-radius:10px;
  background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(247,248,250,.92));
  box-shadow:0 36px 90px rgba(17,24,39,.10),inset 0 1px 0 rgba(255,255,255,.9);
  overflow:hidden;
}

.command-topbar {
  display:flex;
  gap:8px;
  align-items:center;
  padding:16px;
  border-bottom:1px solid var(--line);
  color:var(--muted);
}

.command-topbar span {
  width:10px;
  height:10px;
  border-radius:50%;
  background:#d5d9df;
}

.command-topbar small {
  margin-left:auto;
}

.search-row {
  display:flex;
  gap:12px;
  padding:22px 20px;
  border-bottom:1px solid var(--line);
  color:var(--muted);
}

.command-list {
  padding:10px;
}

.command-list a {
  display:grid;
  grid-template-columns:42px 1fr auto;
  gap:14px;
  align-items:center;
  padding:14px;
  border-radius:10px;
}

.command-list a:hover {
  background:rgba(10,132,255,.055);
}

.icon {
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  border-radius:10px;
  font-weight:800;
  font-size:12px;
}

.blue {
  background:rgba(10,132,255,.12);
  color:#075ec9;
}

.red {
  background:rgba(255,69,58,.12);
  color:#c6281f;
}

.green {
  background:rgba(31,157,85,.13);
  color:#12733b;
}

.brown {
  background:rgba(139,94,60,.14);
  color:#7a4b2a;
}

.purple {
  background:rgba(255, 61, 249, 0.14);
  color:hsl(292, 94%, 32%);
}

.command-list b {
  display:block;
}

.command-list em {
  font-style:normal;
  color:var(--muted);
  font-size:13px;
}

.command-list kbd {
  color:var(--muted);
  border:1px solid var(--line);
  border-radius:10px;
  padding:4px 7px;
  background:#fff;
}

.intro {
  padding-top:20px;
}

.intro h2,.section-head h2,.experience h2,.contact h2,.case-section h2 {
  font-size:clamp(34px,5vw,64px);
  line-height:1;
  margin:12px 0 20px;
}

.metrics {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:16px;
  margin-top:32px;
}

.metrics div,.cap-card,.timeline div,.case-summary div {
  border:1px solid var(--line);
  background:rgba(255,255,255,.86);
  border-radius:10px;
  padding:24px;
  box-shadow:0 12px 28px rgba(17,24,39,.04);
}

.metrics strong {
  font-size:38px;
}

.metrics span,.cap-card p,.timeline p,.case-summary p,.case-section p {
  display:block;
  color:var(--muted);
  line-height:1.7;
}

.section-head {
  display:flex;
  /* justify-content:space-between; */
  gap:48px;
  align-items:end;
  margin-bottom:28px;
}

.section-head h2 {
  margin-bottom:0;
}

.project-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:22px;
}

.project-card {
  border:1px solid var(--line);
  background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(249,250,251,.92));
  border-radius:10px;
  overflow:hidden;
  box-shadow:0 14px 36px rgba(17,24,39,.055);
}

.project-card.large {
  grid-column:1/-1;
  display:grid;
  grid-template-columns:1.15fr .85fr;
}

.visual {
  min-height:320px;
  display:grid;
  place-items:center;
  position:relative;
  overflow:hidden;
}

.visual span,.mock-img {
  color:rgba(17,17,17,.56);
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.1em;
  font-size:12px;
}

.visual:before {
  content:"";
  position:absolute;
  inset:18%;
  filter:blur(60px);
  opacity:.42;
}

.visual-station {
  background:linear-gradient(135deg,#f7fbff,#eef3f8 55%,#ffffff);
}

.visual-station:before {
  background:#9cc9ff;
}

.visual-ipc {
  background:linear-gradient(135deg,#f6f8fb,#e8edf5);
}

.visual-ipc:before {
  background:#8ab4f8;
}

.visual-ev {
  background:linear-gradient(135deg,#f3fbf7,#e7f4ed);
}

.visual-ev:before {
  background:#7ed9aa;
}

.visual-ai {
  background:linear-gradient(135deg,#f6f3ff,#edf0ff);
}

.visual-ai:before {
  background:#b7a8ff;
}

.visual-bank {
  background:linear-gradient(135deg,#fff8ef,#fff1dc);
}

.visual-bank:before {
  background:#ffc36b;
}

.project-content {
  padding:28px;
}

.project-meta {
  display:flex;
  justify-content:space-between;
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.12em;
}

.project-content h3 {
  font-size:30px;
  line-height:1.05;
  margin:18px 0 12px;
}

.project-content p {
  color:var(--muted);
  line-height:1.65;
}

.project-content a {
  display:inline-flex;
  margin-top:16px;
  color:var(--text);
  font-weight:800;
}

.project-content a:hover {
  color:var(--accent);
}

.cap-grid {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
}

.cap-card span {
  color:var(--muted);
  font-weight:800;
}

.cap-card h3 {
  font-size:22px;
  margin:30px 0 8px;
}

.timeline {
  display:grid;
  gap:16px;
}

.timeline time,.case-summary span {
  color:var(--accent);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.14em;
  font-weight:800;
}

.timeline h3 {
  font-size:24px;
  margin:12px 0 6px;
}

.contact {
  padding-bottom:140px;
}

.footer {
  display:flex;
  justify-content:space-between;
  gap:16px;
  padding:28px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:14px;
  background:rgba(250,250,250,.7);
}

.case-hero {
  padding-bottom:30px;
}

.case-cover {
  margin-top:40px;
  border:0 px solid var(--line); /* 子頁hero圖片外框 */
  border-radius:10px;
  min-height:520px;
  box-shadow:0 24px 60px rgba(17,24,39,.08);
}

.case-summary {
  padding-top:20px;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
}

.case-section {
  padding-top:70px;
  padding-bottom:70px;
}

.process-grid {
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:12px;
  margin-top:28px;
}

.process-grid div {
  border:1px solid var(--line);
  background:rgba(255,255,255,.88);
  border-radius:10px;
  padding:20px;
  text-align:center;
  color:var(--muted);
  font-weight:700;
  box-shadow:0 8px 18px rgba(17,24,39,.035);
}

.image-row {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:16px;
  margin-top:28px;
}

.mock-img {
  min-height:240px;
  display:grid;
  place-items:center;
  border:0px solid var(--line); /* 子頁內小圖片外框 */
  border-radius:10px;
  background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(241,243,246,.9));
  box-shadow:0 10px 24px rgba(17,24,39,.04);
}

.reveal {
  opacity:0;
  transform:translateY(18px);
  transition:opacity .7s ease,transform .7s ease;
}

.reveal.show {
  opacity:1;
  transform:none;
}

@media(max-width:900px) {
  .hero,.project-card.large,.project-grid,.section-head,.case-summary {
    grid-template-columns:1fr;
  }

  .hero {
    gap:26px;
    padding-top:60px;
  }

  .cap-grid {
    grid-template-columns:1fr 1fr;
  }

  .metrics {
    grid-template-columns:1fr;
  }

  .process-grid,.image-row {
    grid-template-columns:1fr 1fr;
  }

  .nav-links a:not(.nav-cta) {
    display:none;
  }

  .hero h1,.case-hero h1 {
    font-size:48px;
  }

  .section-pad {
    padding-left:18px;
    padding-right:18px;
  }

}

@media(max-width:560px) {
  .cap-grid,.process-grid,.image-row {
    grid-template-columns:1fr;
  }

  .footer {
    flex-direction:column;
  }

  .case-cover {
    min-height:320px;
  }

  .visual {
    min-height:240px;
  }

}

/* Metrics animation */

/* Portfolio metrics micro-interactions
   Add-on only: keeps your existing style.css intact. */
.metrics-animated .metric-card {
  position: relative;
  overflow: hidden;
  transform: translateY(14px);
  opacity: 0;
  transition:
    transform 700ms cubic-bezier(.22, 1, .36, 1),
    opacity 600ms ease,
    box-shadow 260ms ease,
    border-color 260ms ease;
  will-change: transform, opacity;
}

.metrics-animated.is-visible .metric-card {
  transform: translateY(0);
  opacity: 1;
}

.metrics-animated.is-visible .metric-card:nth-child(1) {
  transition-delay: 0ms;
}

.metrics-animated.is-visible .metric-card:nth-child(2) {
  transition-delay: 100ms;
}

.metrics-animated.is-visible .metric-card:nth-child(3) {
  transition-delay: 200ms;
}

.metrics-animated .metric-card::after {
  content: \"\";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.48) 48%, transparent 76%);
  transform: translateX(-110%);
}

.metrics-animated.is-visible .metric-card::after {
  animation: metric-sheen 900ms cubic-bezier(.22, 1, .36, 1) both;
}

.metrics-animated.is-visible .metric-card:nth-child(2)::after {
  animation-delay: 100ms;
}

.metrics-animated.is-visible .metric-card:nth-child(3)::after {
  animation-delay: 200ms;
}

.metrics-animated .metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(20, 28, 45, .08);
}

.metrics-animated .metric-number {
  font-variant-numeric: tabular-nums;
}

.metrics-animated .metric-symbol {
  display: inline-block;
  transform-origin: center;
}

.metrics-animated.is-visible .metric-infinity .metric-symbol {
  animation: infinity-breathe 1.2s cubic-bezier(.22, 1, .36, 1) 320ms 1 both;
}

@keyframes metric-sheen {
  0% {
    opacity: 0;
    transform: translateX(-110%);
  }

  30% {
    opacity: .55;
  }

  100% {
    opacity: 0;
    transform: translateX(110%);
  }

}

@keyframes infinity-breathe {
  0% {
    opacity: .35;
    transform: scale(.86);
  }

  55% {
    opacity: 1;
    transform: scale(1.07);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }

}

@media (prefers-reduced-motion: reduce) {
  .metrics-animated .metric-card,
  .metrics-animated .metric-card::after,
  .metrics-animated .metric-symbol {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }

}

/* Project hero images — full bleed (Case 01–05) */
.project-card .visual.has-image {
  position: relative;
  overflow: hidden;
}

.project-card .visual.has-image > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.project-card .visual.has-image:before {
  display: none;
}


/* Case study content images */
.case-cover {
  position: relative;
  overflow: hidden;
}

.case-cover > img,
.mock-img > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.case-cover > img {
  position: absolute;
  inset: 0;
}

.mock-img {
  overflow: hidden;
  padding: 0;
}

.mock-img > img {
  min-height: 240px;
}


/* Visible image specification hint */
.case-cover,
.mock-img {
  position: relative;
}

.image-spec {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 2;
  padding: 5px 8px;
  border-radius:10px;
  background: rgba(255,255,255,.82);
  color: rgba(17,17,17,.68);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  backdrop-filter: blur(8px);
  pointer-events: none;
}


/* Case 01 Hero — preserve full 1920 × 1080 image */
.case-hero .hero-cover {
  aspect-ratio: 16 / 9;
  min-height: 0;
  overflow: hidden;
}

.case-hero .hero-cover > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Case 01–05 images — unified 10px corner radius */
.case-cover,
.mock-img,
.case-cover > img,
.mock-img > img,
.case-hero .hero-cover,
.case-hero .hero-cover > img {
  border-radius:10px;
}

/* Case summary cards — unified 10px corner radius */
.case-summary div {
  border-radius:10px;
}

/* Case content images — show the full image without cropping */
.mock-img {
  background: #ffffff;
}

.mock-img > img {
  object-fit: contain;
  object-position: center;
}

/* Case 01–05 three-column UI screenshots:
   frame follows the screenshot ratio so the full image is visible */
.image-row .mock-img {
  aspect-ratio: 16 / 9;
  min-height: 0;
  height: auto;
  overflow: hidden;
  padding: 0;
  border-radius: 10px;
  background: #ffffff;
}

.image-row .mock-img > img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 10px;
}



/* Case study large content images — fill the full content width without side gaps or cropping */
.case-section .content-cover {
  min-height: 0;
  height: auto;
  overflow: hidden;
  background: transparent;
}

.case-section .content-cover > img {
  position: relative;
  inset: auto;
  width: 100%;
  height: auto;
  object-fit: unset;
  object-position: center;
  display: block;
}

/* Image caption tooltip — portfolio content images (fixed) */
.image-tooltip {
  position: relative;
  overflow: hidden;
}

.image-tooltip > img {
  display: block;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
}

.tooltip-caption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 20;
  width: auto;
  max-width: calc(100% - 28px);
  padding: 10px 12px;
  border: 1px solid rgba(241, 215, 134, 0.542); 
  border-radius: 10px;
  background: rgba(255, 252, 203, 0.589);
  /* box-shadow: 0 8px 24px rgba(17,24,39,.10); */
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
  pointer-events: none;
}

.tooltip-caption strong {
  display: block;
  margin: 0;
  color: #111;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.01em;
  text-transform: none;
}

.tooltip-caption span {
  display: block;
  margin-top: 3px;
  color: #666b73;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
}

.image-tooltip:hover .tooltip-caption,
.image-tooltip:focus-within .tooltip-caption {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.image-tooltip:hover > img,
.image-tooltip:focus-within > img {
  transform: scale(1.02); /* image hover scale */
}

/* On touch devices, captions stay visible because there is no reliable hover. */
@media (hover: none) {
  .tooltip-caption {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-tooltip > img,
  .tooltip-caption {
    transition: none !important;
  }
}
