:root {
  color-scheme: light;
  --ink: #172d2b;
  --ink-soft: #314a46;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --radius: 36px;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-width: 320px;
  background: #7c9993;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", sans-serif;
  letter-spacing: 0;
}
button, a { font: inherit; -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; border: 0; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 3px solid #176d62; outline-offset: 5px; }
.lucide { width: 22px; height: 22px; stroke-width: 1.7; flex-shrink: 0; pointer-events: none; }
.social-app {
  min-height: 100svh;
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding: 28px 40px 22px;
  display: flex;
  flex-direction: column;
}
.wallpaper { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: -2; }
.social-app::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: rgba(231, 242, 238, .12); }

/* A clear face, a beveled rim, and a moving specular reflection. */
.glass {
  position: relative;
  isolation: isolate;
  background: linear-gradient(145deg, rgba(255,255,255,.28), rgba(245,255,251,.05) 52%, rgba(255,255,255,.16));
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: 0 12px 32px rgba(13,40,32,.14), inset 0 1px 1px rgba(255,255,255,.95), inset 0 -1px 1px rgba(255,255,255,.35);
  backdrop-filter: blur(12px) saturate(1.35);
  -webkit-backdrop-filter: blur(12px) saturate(1.35);
}
.glass::before, .glass::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; }
.glass::before {
  background: radial-gradient(260px 190px at var(--gx, 30%) var(--gy, 0%), rgba(255,255,255,.6), transparent 75%);
  opacity: var(--glow, .25);
  transition: opacity .25s;
}
.glass::after {
  padding: 4px;
  background: linear-gradient(var(--shine-angle, 135deg), rgba(255,255,255,.95), rgba(255,255,255,.1) 28%, rgba(255,255,255,.05) 60%, rgba(255,255,255,.7));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  opacity: .65;
}
.topbar { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1440px; margin: 0 auto; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: #fff; text-shadow: 0 1px 8px #233c35; }
.brand .lucide { width: 28px; height: 28px; }
.contact-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.contact-button:hover { background-color: rgba(255,255,255,.3); }
.hero { width: 100%; margin: auto; display: flex; flex-direction: column; align-items: center; padding: 32px 0 20px; }
.hero-copy { position: relative; z-index: 6; text-align: center; }
.eyebrow { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: #243e39; }
h1 { margin: 0; font-size: 52px; font-weight: 650; line-height: 1.25; text-shadow: 0 1px 16px rgba(255,255,255,.35); }
.lead { margin: 14px 0 0; font-size: 16px; line-height: 1.8; color: var(--ink-soft); }
.stack-panel { width: min(580px, 100%); position: relative; }
.scene { --rx: -5deg; --ry: 0deg; --lift: 0px; position: relative; height: 396px; perspective: 1400px; }
.layer-stack { position: absolute; inset: 0; display: grid; place-items: center; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift)); transition: transform .5s var(--ease); touch-action: pan-y; }
.layer-stack.is-dragging { transition: none; cursor: grabbing; }
.layer-card {
  position: absolute;
  width: 470px;
  height: 278px;
  border-radius: var(--radius);
  padding: 26px 30px;
  display: flex;
  flex-direction: column;
  text-align: left;
  background: rgba(240,255,247,.1);
  transform: translate3d(calc(var(--i) * 12px), calc(var(--i) * 20px), calc(var(--i) * -45px)) rotateZ(calc(var(--i) * 1.3deg));
  transition: transform .55s var(--ease), background-color .25s, box-shadow .35s;
  user-select: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.layer-card:not(.is-active)::before { opacity: 0; }
.layer-card.is-active { transform: translate3d(0,-12px,45px); backdrop-filter: blur(12px) saturate(1.3); -webkit-backdrop-filter: blur(12px) saturate(1.3); background: linear-gradient(145deg, rgba(255,255,255,.62), rgba(245,255,251,.4) 52%, rgba(255,255,255,.48)); box-shadow: 0 24px 50px rgba(13,40,32,.2), inset 0 2px 3px rgba(255,255,255,.95), inset 0 -2px 2px rgba(255,255,255,.5); }
.layer-card > * { position: relative; z-index: 1; opacity: 0; transition: opacity .18s; }
.layer-card.is-active > * { opacity: 1; }
.layer-kicker { display: flex; align-items: center; justify-content: space-between; width: 100%; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.layer-kicker .lucide { width: 25px; height: 25px; }
.layer-card strong { display: block; margin-top: 14px; font-size: 56px; font-weight: 600; line-height: 1.15; }
.layer-card > span:not(.layer-kicker) { max-width: 360px; margin-top: 10px; font-size: 16px; line-height: 1.65; color: var(--ink-soft); }
.layer-card em { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: auto; font-style: normal; font-size: 12px; font-weight: 600; }
.layer-card em .lucide { border-radius: 50%; width: 32px; height: 32px; padding: 6px; background: rgba(255,255,255,.5); }
.stack-hint { display: flex; justify-content: center; align-items: center; gap: 22px; padding-top: 5px; }
#layerCounter { font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 600; color: #fff; text-shadow: 0 1px 5px #142d27; }
.stack-controls { display: flex; gap: 8px; }
.stack-controls button { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; }
.stack-controls button:active, .contact-button:active { transform: scale(.94); }
.mini-map { --lens-x: 0px; --lens-size: 64px; --slot-size: 100px; width: min(560px, 100%); display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 0; padding: 8px; margin: 0 auto; border-radius: 999px; background-color: rgba(255,255,255,.18); touch-action: pan-y; user-select: none; cursor: grab; }
.mini-map.is-dragging { cursor: grabbing; }
.nav-lens {
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 3;
  width: var(--lens-size);
  height: var(--lens-size);
  border-radius: 50%;
  overflow: hidden;
  transform: translate(var(--lens-x), -50%);
  pointer-events: none;
  background: rgba(228,246,238,.48);
  box-shadow: 0 8px 13px rgba(13,40,32,.25), 0 2px 3px rgba(13,40,32,.18), inset 0 0 0 1px rgba(255,255,255,.85);
}
.mini-map:is(.is-dragging,.is-snapping) .nav-lens { will-change: transform; }
.nav-lens::before, .nav-lens::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.nav-lens::before {
  z-index: 1;
  background: radial-gradient(ellipse at 34% 23%, rgba(255,255,255,.65), transparent 56%), radial-gradient(ellipse at 68% 84%, rgba(216,255,239,.55), transparent 44%);
  box-shadow: inset 3px 4px 6px rgba(255,255,255,.66), inset -4px -5px 7px rgba(22,62,47,.28);
}
.nav-lens::after {
  z-index: 4;
  background: radial-gradient(ellipse 28% 12% at 35% 16%, rgba(255,255,255,.95), rgba(255,255,255,.25) 68%, transparent 100%), radial-gradient(ellipse 16% 5% at 67% 89%, rgba(255,255,255,.75), transparent 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.86), inset 0 -2px 2px rgba(255,255,255,.6);
}
.lens-optics { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.lens-content { position: absolute; left: 0; top: 0; z-index: 2; display: flex; width: calc(var(--slot-size) * 5); height: 100%; transform: translateX(calc(8px - var(--lens-x))) scale(1.08); transform-origin: calc(var(--lens-x) - 8px + var(--lens-size) / 2) 50%; }
.lens-item { width: var(--slot-size); flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: #102f25; font-size: 11px; font-weight: 650; text-shadow: 0 1px 2px rgba(255,255,255,.7); }
.lens-item .lucide { width: 20px; height: 20px; }
.mini-map button { position: relative; z-index: 2; background: transparent; border-radius: 999px; min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: #244039; font-size: 11px; font-weight: 600; padding: 4px 0; cursor: inherit; }
.mini-map button:hover { color: #102f25; }
.mini-map button:focus-visible { outline-offset: 2px; }
.mini-map button.is-active { color: #102d24; }
.mini-map button .lucide { width: 20px; height: 20px; }
.page-footer { display: flex; justify-content: space-between; gap: 14px; margin-top: 28px; color: #fff; text-shadow: 0 1px 6px #173629; font-size: 11px; }
.page-footer a { opacity: .8; }

.detail-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; overflow: clip; opacity: 0; visibility: hidden; transition: opacity .28s, visibility .28s; }
.detail-overlay.is-open { visibility: visible; opacity: 1; }
.overlay-backdrop { position: absolute; inset: 0; background: rgba(14,33,28,.22); }
.detail-panel { width: min(600px, 100%); max-height: calc(100dvh - 48px); overflow: auto; border-radius: var(--radius); padding: 44px; background-color: rgba(240,255,247,.72); transform-origin: var(--origin-x, 50%) var(--origin-y, 50%); transform: translate(var(--from-x, 0px),var(--from-y, 12px)) scale(var(--from-scale, .92)); transition: transform .48s var(--ease); }
.detail-overlay.is-open .detail-panel { transform: translate(0,0) scale(1); }
.close-button { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; }
.detail-kicker { margin: 0; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.detail-panel h2 { font-size: 44px; font-weight: 600; margin: 16px 0 18px; line-height: 1.2; }
.detail-panel > p:not(.detail-kicker) { margin: 0; font-size: 17px; line-height: 1.85; color: var(--ink-soft); }
.detail-tags { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; color: #345b4e; }
.detail-tags span::before { content: "#"; margin-right: 2px; opacity: .65; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.detail-actions a, .detail-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 999px; padding: 0 18px; font-weight: 600; font-size: 13px; background: #244b3f; color: #fff; }
.detail-actions .lucide { width: 16px; height: 16px; }
body.has-open-detail { overflow: hidden; }

@media (max-width: 900px) {
  .social-app { padding: 24px; }
  .hero { padding-top: 34px; }
  .stack-hint { margin-top: 24px; }
}
@media (max-width: 640px) {
  .social-app { padding: 18px 18px 16px; }
  .brand { font-size: 13px; gap: 7px; }
  .brand .lucide { width: 23px; height: 23px; }
  .contact-button { min-height: 44px; padding: 0 13px; font-size: 12px; }
  .contact-button .lucide { width: 17px; height: 17px; }
  .hero { padding: 36px 0 24px; }
  .eyebrow { font-size: 11px; margin-bottom: 10px; }
  h1 { font-size: 34px; }
  .lead { font-size: 14px; line-height: 1.8; margin-top: 12px; }
  .scene { height: 364px; }
  .stack-hint { margin-top: 12px; }
  .layer-card { width: calc(100% - 48px); height: 254px; padding: 23px; border-radius: 30px; }
  .layer-card strong { font-size: 39px; margin-top: 16px; }
  .layer-card > span:not(.layer-kicker) { font-size: 14px; }
  .mini-map button { font-size: 10px; min-height: 64px; }
  .lens-item { font-size: 10px; }
  .page-footer { text-align: center; flex-direction: column; gap: 7px; margin-top: 22px; font-size: 10px; }
  .detail-overlay { padding: 16px; }
  .detail-panel { padding: 36px 26px 28px; border-radius: 30px; max-height: calc(100dvh - 32px); }
  .detail-panel h2 { font-size: 36px; }
  .detail-panel > p:not(.detail-kicker) { font-size: 16px; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: #eaf2ee; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .layer-card.is-active, .detail-panel { background: #eaf2ee; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-lens { background: #eaf2ee; }
  .lens-optics { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .layer-stack { transform: none; }
}
@supports not (backdrop-filter: blur(1px)) {
  .glass, .layer-card.is-active, .detail-panel { background-color: rgba(240,250,246,.94); }
}
