/* Flow Studio — 互動導覽（3D 小島）
   色系與字體沿用原本 flowstudio.design：黑色場域 #050507、銀白墨色 #E8E8EA、細線與玻璃面板。
   只有一種主題（深色），沒有額外的強調色。 */
:root {
  --paper: #050507;
  --paper-2: #121218;
  --card: #0f0f14;
  --ink: #e8e8ea;
  --ink-2: rgba(232, 232, 234, 0.7);
  --ink-3: rgba(232, 232, 234, 0.46);
  --rule: rgba(232, 232, 234, 0.08);
  --rule-2: rgba(232, 232, 234, 0.14);
  --accent: #e8e8ea;
  --accent-ink: #e8e8ea;
  --accent-soft: rgba(232, 232, 234, 0.08);
  --ok: rgba(232, 232, 234, 0.92);
  --off: rgba(232, 232, 234, 0.4);
  --scrim: rgba(0, 0, 0, 0.62);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);

  --display: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Noto Sans", Helvetica, Arial, sans-serif;
  --sans: var(--display);
  --mono: var(--display);

  --gutter: clamp(16px, 4.5vw, 64px);
  --max: 1440px;
  --r: 20px;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {html:not(.motion-on){ scroll-behavior: auto; } }
body {
  margin: 0;
  background: radial-gradient(1200px 900px at 50% 20%, #0d0d12 0%, #0b0b0d 45%, #050507 100%) fixed;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ── Nav ─────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; min-width: 0; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 999px; flex-shrink: 0;
  background:
    radial-gradient(circle at 55% 45%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 42%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.95) 52%, rgba(255, 255, 255, 0.08) 55%, rgba(255, 255, 255, 0) 72%);
  border: 1px solid rgba(232, 232, 234, 0.14);
  box-shadow: 0 0 0 6px rgba(232, 232, 234, 0.03);
}
.brand-name { font-weight: 600; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; }
.brand-sub { font-size: 12px; color: var(--ink-3); letter-spacing: 0.2em; white-space: nowrap; }
.primary-nav { display: flex; gap: 4px; }
.primary-nav a {
  text-decoration: none; font-size: 13px; color: var(--ink-2); padding: 6px 12px; border-radius: 999px;
  transition: background-color 0.2s, color 0.2s;
}
.primary-nav a:hover { background: var(--accent-soft); color: var(--ink); }
.nav-tools { display: flex; gap: 6px; }
.tool {
  appearance: none; border: 1px solid var(--rule-2); background: transparent; border-radius: 999px;
  height: 32px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--ink-2);
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.tool:hover { color: var(--ink); border-color: var(--ink-3); }
.tool .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.tool[aria-pressed="true"] .dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (max-width: 860px) {
  .primary-nav { display: none; }
  .brand-sub { display: none; }
}

/* ── Island hero ─────────────────────────────────────── */
.isle {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas:
    "mast  board"
    "stage stage"
    "spec  hint"
    "index index";
  padding: 28px var(--gutter) 18px;
  max-width: var(--max);
  margin: 0 auto;
  min-height: min(880px, calc(100svh - 58px));
}
.isle-stage {
  grid-area: 1 / 1 / 4 / 3;
  position: relative;
  margin: 0 calc(var(--gutter) * -1);
  min-height: 520px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.isle-stage.dragging { cursor: grabbing; }
.isle-stage.hovering { cursor: pointer; }
.isle-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.isle-loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; color: var(--ink-3);
}
.isle-masthead, .board, .spec, .isle-hint { position: relative; z-index: 2; pointer-events: none; }
.isle-masthead > *, .board > *, .spec, .isle-hint > * { pointer-events: auto; }
.isle-masthead { grid-area: mast; align-self: start; max-width: 520px; }
.isle-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--ink-3); margin: 0 0 10px; }
.isle-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 520;
  font-size: clamp(40px, 6.4vw, 92px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.isle-name small { display: block; margin-top: 10px; font-family: var(--sans); font-weight: 500; font-size: clamp(14px, 1.4vw, 17px); letter-spacing: 0.42em; color: var(--ink-2); }
.isle-role { margin: 14px 0 0; font-size: 13px; color: var(--ink-2); letter-spacing: 0.06em; }
.isle-role em { font-style: normal; color: var(--accent-ink); }
.isle-tagline { margin: 16px 0 0; font-size: clamp(17px, 1.7vw, 21px); line-height: 1.55; font-weight: 500; text-wrap: balance; }

.isle-hint {
  grid-area: hint; justify-self: end; align-self: end; text-align: right;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--ink-3); line-height: 1.8;
}
.isle-hint b { display: block; font-family: var(--sans); font-weight: 500; letter-spacing: 0.04em; font-size: 12.5px; color: var(--ink-2); }

/* Field guide card */
.spec {
  grid-area: spec; align-self: end; width: min(420px, 100%);
  background: var(--card); border: 1px solid var(--rule-2); border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s;
}
.spec.flash { transform: translateY(-4px); border-color: var(--accent); }
.spec-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px dashed var(--rule-2); }
.spec-head span { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; color: var(--ink-3); }
.spec-head i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.spec-body { padding: 14px 16px 6px; }
.spec-title { font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.15; margin: 0; }
.spec-title small { display: block; margin-top: 4px; font-family: var(--sans); font-weight: 500; font-size: 13px; color: var(--ink-2); letter-spacing: 0.04em; }
.spec-desc { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.spec-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px 14px; }
.spec-foot .mono { color: var(--ink-3); font-size: 10.5px; }
.spec-cta {
  appearance: none; border: 0; cursor: pointer; border-radius: 999px; padding: 8px 14px;
  background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px; transition: transform 0.15s, background-color 0.2s;
}
.spec-cta:hover { transform: translateY(-1px); }
.spec-cta:disabled { opacity: 0.4; cursor: default; transform: none; }

/* Highlights board */
.board { grid-area: board; align-self: start; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.board-h { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; color: var(--ink-3); margin-bottom: 4px; }
.strip {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; line-height: 1.4;
  background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: 6px 10px;
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.35);
  transform: rotate(var(--tilt, 0deg));
}
.strip b { font-family: var(--display); font-weight: 600; }
.strip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.social { display: flex; gap: 6px; margin-top: 6px; }
.social a {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--rule-2);
  background: var(--card); color: var(--ink-2); transition: color 0.2s, border-color 0.2s;
}
.social a:hover { color: var(--ink); border-color: var(--ink-3); }
.social svg { width: 15px; height: 15px; }

/* Quick index */
.isle-index { grid-area: index; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; position: relative; z-index: 2; }
.isle-index .group-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--ink-3); align-self: center; margin: 0 4px 0 10px; }
.isle-index .group-label:first-child { margin-left: 0; }
.chip {
  appearance: none; cursor: pointer; border: 1px solid var(--rule-2); background: var(--card); border-radius: 999px;
  padding: 5px 11px 5px 9px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2);
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.chip .n { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chip[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip[aria-current="true"] .n { color: var(--accent); }

/* 3D 上的標籤與小流的對話框 */
.pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pin {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center; gap: 3px; white-space: nowrap;
  transition: opacity 0.25s;
}
.pin .no {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.06em; color: var(--ink-2);
  background: var(--card); border: 1px solid var(--rule-2); border-radius: 4px; padding: 1px 5px;
}
.pin .nm {
  font-size: 12px; font-weight: 700; background: var(--ink); color: var(--paper); border-radius: 6px; padding: 3px 8px;
  opacity: 0; transform: translateY(4px); transition: opacity 0.2s, transform 0.2s;
}
.pin.on .nm, .pin.sel .nm { opacity: 1; transform: none; }
.pin.sel .no { background: var(--accent); color: #050507; border-color: var(--accent); }
.pin.behind { opacity: 0.25; }
.bubble {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none;
  max-width: 230px; padding: 7px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5;
  background: var(--card); color: var(--ink); border: 1px solid var(--rule-2); box-shadow: var(--shadow);
  transform: translate(-50%, calc(-100% - 14px));
}
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; margin-left: -5px;
  background: var(--card); border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); transform: rotate(45deg);
}
.no-webgl .isle-stage { min-height: 0; cursor: default; }
.no-webgl .isle-stage canvas, .no-webgl .pins { display: none; }

@media (max-width: 900px) {
  .isle {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto;
    grid-template-areas: "mast" "stage" "spec" "index" "board";
    min-height: 0;
    padding-top: 22px;
    gap: 14px;
  }
  .isle-stage { grid-area: stage; min-height: 0; height: min(58svh, 500px); }
  .isle-hint { display: none; }
  .spec { width: 100%; }
  .board { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .board-h { width: 100%; }
  .strip { transform: none; }
}

/* ── Sections ────────────────────────────────────────── */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(56px, 8vw, 104px) var(--gutter) 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: end; margin-bottom: 28px; }
.section-head h2 { margin: 0; font-family: var(--display); font-weight: 520; font-size: clamp(30px, 4vw, 52px); line-height: 0.98; letter-spacing: -0.01em; text-wrap: balance; }
.section-head h2 .mono { display: block; font-weight: 400; color: var(--ink-3); margin-bottom: 10px; font-size: 11px; }
.section-head p { margin: 0; color: var(--ink-2); max-width: 58ch; }
@media (max-width: 760px) { .section-head { grid-template-columns: 1fr; } }

/* Works index */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.filters .chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.district { margin-top: 30px; }
.district-h { display: flex; align-items: baseline; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--rule-2); margin-bottom: 4px; }
.district-h h3 { margin: 0; font-size: 17px; font-weight: 700; }
.district-h .mono { color: var(--ink-3); }
.district-h p { margin: 0 0 0 auto; font-size: 13px; color: var(--ink-3); }
.work-list { list-style: none; margin: 0; padding: 0; }
.work {
  display: grid; grid-template-columns: 70px 52px minmax(0, 1.1fr) minmax(0, 1.4fr) auto; gap: 18px; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--rule);
}
.work-no { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; }
.glyph {
  width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; overflow: hidden;
  background: var(--paper-2); border: 1px solid var(--rule); font-family: var(--display); font-weight: 520; font-size: 20px;
}
.glyph img { width: 100%; height: 100%; object-fit: cover; }
.work-title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; }
.work-title small { display: block; font-weight: 400; font-size: 13px; color: var(--ink-2); }
.work-tag { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.badge { font-family: var(--mono); font-size: 10px; letter-spacing: 0.05em; padding: 2px 7px; border-radius: 4px; border: 1px solid var(--rule-2); color: var(--ink-2); white-space: nowrap; }
.badge.live { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.badge.lock { border-style: dashed; }
.work-actions { display: flex; gap: 6px; }
.btn {
  appearance: none; cursor: pointer; text-decoration: none; border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  transition: transform 0.15s, background-color 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.btn.ghost:hover { border-color: var(--ink-3); }
.btn.small { padding: 6px 11px; font-size: 12.5px; }
@media (max-width: 900px) {
  .work { grid-template-columns: 52px minmax(0, 1fr); grid-template-areas: "g t" "g d" "a a"; row-gap: 6px; column-gap: 14px; }
  .work-no { display: none; }
  .work .glyph { grid-area: g; align-self: start; }
  .work-main { grid-area: t; }
  .work-detail { grid-area: d; }
  .work-actions { grid-area: a; margin-top: 4px; }
}

/* Stack diagram */
.stack-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.diagram { border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--card); padding: 18px; overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 620px; height: auto; }
.diagram text { font-family: var(--sans); fill: var(--ink); }
.diagram .t-mono { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; fill: var(--ink-3); }
.diagram .box { fill: var(--paper); stroke: var(--rule-2); }
.diagram .box-accent { fill: var(--accent-soft); stroke: var(--accent); }
.diagram .wall { fill: none; stroke: var(--accent); stroke-dasharray: 4 4; }
.diagram .flow { fill: none; stroke: var(--ink-2); stroke-width: 1.4; marker-end: url(#arrow); }
.diagram .flow-x { fill: none; stroke: var(--off); stroke-width: 1.4; stroke-dasharray: 3 3; }
.diagram #arrow path { fill: var(--ink-2); }
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.points li { border-top: 1px solid var(--rule-2); padding-top: 12px; }
.points b { display: block; font-size: 15px; margin-bottom: 3px; }
.points span { font-size: 13.5px; color: var(--ink-2); }
@media (max-width: 900px) { .stack-grid { grid-template-columns: 1fr; } }

/* Studio */
.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.process { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 0; }
.process li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.process li::before { counter-increment: step; content: "0" counter(step); font-family: var(--mono); font-size: 12px; color: var(--accent-ink); padding-top: 3px; }
.process b { display: block; font-size: 15px; }
.process span { font-size: 13.5px; color: var(--ink-2); }
.about p { margin: 0 0 14px; max-width: 60ch; }
.services { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
@media (max-width: 900px) { .studio-grid { grid-template-columns: 1fr; } }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.form { display: grid; gap: 12px; background: var(--card); border: 1px solid var(--rule-2); border-radius: var(--r); padding: 20px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label { font-size: 12.5px; color: var(--ink-2); }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--paper); border: 1px solid var(--rule-2); border-radius: 10px; padding: 9px 12px;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 12.5px; color: var(--ink-3); margin: 0; }
.form-status { font-size: 13.5px; margin: 0; min-height: 1.4em; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--off); }
.direct { display: grid; gap: 10px; }
.direct-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.direct-item .mono { color: var(--ink-3); font-size: 10.5px; }
.direct-item a, .direct-item span.v { font-size: 15px; text-decoration: none; word-break: break-all; }
.direct-item a:hover { text-decoration: underline; text-underline-offset: 3px; }
.copy { appearance: none; border: 1px solid var(--rule-2); background: transparent; border-radius: 999px; padding: 4px 10px; font-size: 11.5px; cursor: pointer; color: var(--ink-2); }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } .form .row { grid-template-columns: 1fr; } }

footer.site-foot {
  max-width: var(--max); margin: clamp(56px, 8vw, 104px) auto 0; padding: 22px var(--gutter) calc(96px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--rule-2); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--ink-3);
}

/* ── Detail sheet ────────────────────────────────────── */
.sheet {
  width: min(1120px, calc(100vw - 32px)); max-height: calc(100svh - 32px); padding: 0; border: 1px solid var(--rule-2);
  border-radius: 20px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); overflow: hidden;
}
.sheet::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheetIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
.sheet-inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); max-height: calc(100svh - 34px); }
.sheet-stage { background: var(--paper-2); border-right: 1px solid var(--rule); padding: 22px; display: grid; place-items: center; min-height: 0; overflow: auto; }
.sheet-info { padding: 22px 26px 26px; overflow-y: auto; min-width: 0; }
.sheet-top { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.sheet-top .mono { color: var(--ink-3); margin-right: auto; }
.icon-btn {
  appearance: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--rule-2); background: transparent; cursor: pointer;
  display: grid; place-items: center; color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.sheet h2 { margin: 0; font-family: var(--display); font-weight: 520; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.02; }
.sheet h2 small { display: block; margin-top: 6px; font-family: var(--sans); font-weight: 500; font-size: 15px; color: var(--ink-2); }
.sheet .tagline { font-size: 17px; font-weight: 500; margin: 16px 0 8px; }
.sheet .desc { color: var(--ink-2); margin: 0 0 16px; }
.feat { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 6px; }
.feat li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; font-size: 14px; }
.feat li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 9px; }
.meta { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 6px 12px; font-size: 13.5px; margin: 0 0 18px; padding: 12px 0; border-top: 1px dashed var(--rule-2); border-bottom: 1px dashed var(--rule-2); }
.meta dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--ink-3); padding-top: 3px; }
.meta dd { margin: 0; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.note { font-size: 12.5px; color: var(--ink-3); margin: 14px 0 0; }
@media (max-width: 860px) {
  .sheet { width: 100vw; max-width: 100vw; max-height: 100svh; height: 100svh; border-radius: 0; margin: 0; }
  .sheet-inner { grid-template-columns: 1fr; max-height: 100svh; overflow-y: auto; }
  .sheet-stage { border-right: 0; border-bottom: 1px solid var(--rule); overflow: visible; }
  .sheet-info { overflow: visible; }
}

/* Device frames */
.phone {
  position: relative; width: min(330px, 78vw); aspect-ratio: 9 / 19; max-width: 100%; border-radius: 42px; padding: 26px 11px 16px;
  background: #0d0f13; box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.55), inset 0 0 0 1.5px #2b2f37;
}
.phone::before { content: ""; position: absolute; top: 10px; left: 50%; width: 56px; height: 8px; margin-left: -28px; border-radius: 6px; background: #2b2f37; z-index: 2; }
.phone .screen { position: relative; width: 100%; height: 100%; border-radius: 22px; overflow: hidden; background: #f4f4f2; }
.desktop { width: 100%; max-width: 640px; border-radius: 12px; overflow: hidden; background: #0d0f13; box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.55); }
.desktop .bar { height: 28px; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: #1b1f26; }
.desktop .bar i { width: 9px; height: 9px; border-radius: 50%; background: #3a404a; }
.desktop .bar span { margin-left: 8px; font-family: var(--mono); font-size: 10.5px; color: #8b92a0; letter-spacing: 0.06em; }
.desktop .screen { position: relative; aspect-ratio: 16 / 10; background: #0b0d11; overflow: hidden; }
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.poster {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 26px;
  background: radial-gradient(circle at 50% 38%, #1b2029, #0b0d11 70%); color: #e7e9ee;
}
.poster .ic { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto 14px; overflow: hidden; background: #16161c; display: grid; place-items: center; font-family: var(--display); font-weight: 520; font-size: 30px; }
.poster .ic img { width: 100%; height: 100%; object-fit: cover; }
.poster h3 { margin: 0 0 4px; font-size: 18px; }
.poster p { margin: 0 0 16px; font-size: 12.5px; color: #a8aeb9; }
.poster .btn { background: #e8e8ea; border-color: #e8e8ea; color: #050507; }
.shots { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.shots img { height: 84px; width: auto; border-radius: 8px; border: 1px solid var(--rule-2); }
.shots button { padding: 0; border: 2px solid transparent; border-radius: 10px; background: none; cursor: pointer; flex-shrink: 0; }
.shots button[aria-current="true"] { border-color: var(--accent); }
.screen .shot-main { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0b0d11; }
.shot-cap { margin: 0; font-size: 12.5px; color: var(--ink-2); text-align: center; }
.stage-col { display: grid; gap: 12px; justify-items: center; width: 100%; }

/* Mock previews for desktop works (示意動畫) */
.mock { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(160deg, #1c1c22, #0b0b0d); font-family: var(--sans); }
.mock .tag { position: absolute; left: 12px; top: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: #8b92a0; }
.mock-pet .pet { position: absolute; right: 12%; bottom: 14%; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #cfe8dd 60%, #8fc7b0); animation: bob 2.4s ease-in-out infinite; }
.mock-pet .pet::before, .mock-pet .pet::after { content: ""; position: absolute; top: 28px; width: 8px; height: 12px; border-radius: 6px; background: #050507; }
.mock-pet .pet::before { left: 22px; } .mock-pet .pet::after { right: 22px; }
.mock-pet .say { position: absolute; right: calc(12% + 80px); bottom: calc(14% + 50px); max-width: 52%; background: #fff; color: #050507; font-size: 12.5px; padding: 8px 11px; border-radius: 12px 12px 2px 12px; animation: fadeUp 6s infinite; }
.mock-pet .win { position: absolute; left: 8%; top: 18%; width: 46%; height: 52%; border-radius: 8px; background: #e9ebef; opacity: 0.9; }
.mock-pet .win::before { content: ""; position: absolute; inset: 0 0 auto; height: 16px; background: #cfd3da; border-radius: 8px 8px 0 0; }
.mock-dj .disc { position: absolute; left: 50%; top: 46%; width: 44%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: repeating-radial-gradient(circle, #111 0 2px, #1d1d1f 3px 5px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); animation: spin 3.2s linear infinite; }
.mock-dj .disc::after { content: ""; position: absolute; inset: 38%; border-radius: 50%; background: #e8e8ea; }
.mock-dj .q { position: absolute; left: 6%; right: 6%; bottom: 8%; background: rgba(255, 255, 255, 0.92); color: #050507; font-size: 12.5px; padding: 8px 12px; border-radius: 10px; }
.mock-dj .q b { color: #e8e8ea; }
.mock-lyrics { background: linear-gradient(160deg, #1c1c22, #0b0b0d); }
.mock-lyrics .ovl { position: absolute; left: 10%; right: 10%; bottom: 14%; padding: 12px 16px; border-radius: 12px; background: rgba(10, 12, 16, 0.55); border: 1px solid rgba(255, 255, 255, 0.14); backdrop-filter: blur(6px); color: #fff; text-align: center; }
.mock-lyrics .ovl .o { font-size: 14px; font-weight: 700; }
.mock-lyrics .ovl .t { font-size: 12.5px; color: rgba(232,232,234,.8); margin-top: 2px; }
.mock-lyrics .line { animation: lyric 9s infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes fadeUp { 0%, 8% { opacity: 0; transform: translateY(6px); } 14%, 80% { opacity: 1; transform: none; } 92%, 100% { opacity: 0; } }
@keyframes lyric { 0%, 3% { opacity: 0; } 8%, 30% { opacity: 1; } 33%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {html:not(.motion-on) .mock *{ animation: none !important; }html:not(.motion-on) .mock-lyrics .line:first-child{ opacity: 1; }
}

/* ── Concierge (問小流) ───────────────────────────────── */
.ask {
  position: fixed; z-index: 40; right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  appearance: none; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 999px; cursor: pointer;
  height: 48px; padding: 0 18px 0 8px; display: inline-flex; align-items: center; gap: 10px; box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.ask:hover { transform: translateY(-2px); }
.ask .face { width: 34px; height: 34px; border-radius: 50%; background: var(--paper); position: relative; flex-shrink: 0; }
.ask .face::before, .ask .face::after { content: ""; position: absolute; top: 12px; width: 5px; height: 8px; border-radius: 3px; background: var(--ink); }
.ask .face::before { left: 10px; } .ask .face::after { right: 10px; }
.ask .face i { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); border-left-color: transparent; border-bottom-color: transparent; animation: orbit 3s linear infinite; }
.ask b { font-size: 14px; font-weight: 700; }
.ask .st { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.ask .st.up { background: var(--ok); }
@keyframes orbit { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {html:not(.motion-on) .ask .face i{ animation: none; } }

.concierge {
  position: fixed; z-index: 45; right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100svh - 120px)); display: flex; flex-direction: column;
  background: var(--card); color: var(--ink); border: 1px solid var(--rule-2); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
  animation: sheetIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cg-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--rule); }
.cg-title { flex: 1; min-width: 0; }
.cg-title b { display: block; font-size: 15px; }
.cg-title span { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--ink-3); }
.cg-title span i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.cg-title span i.up { background: var(--ok); }
.cg-title span i.off { background: var(--off); }
.cg-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.msg { max-width: 88%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.65; }
.msg.bot { align-self: flex-start; background: var(--paper); border: 1px solid var(--rule); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; }
.msg.err { border-color: var(--off); }
.msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.msg .src { display: block; margin-top: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; color: var(--ink-3); }
.goto { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 6px 10px; border-radius: 10px; border: 1px dashed var(--accent); background: var(--accent-soft); cursor: pointer; color: var(--ink); }
.goto .mono { font-size: 10px; color: var(--accent-ink); }
.dots { display: inline-flex; gap: 4px; padding: 5px 0; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; } .dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 80%, 100% { opacity: 0.3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.cg-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.cg-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--rule); }
.cg-form textarea {
  flex: 1; resize: none; min-height: 42px; max-height: 120px; font: inherit; font-size: 15px; line-height: 1.5; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule-2); border-radius: 12px; padding: 9px 12px;
}
.cg-form textarea:focus { outline: none; border-color: var(--accent); }
.send { appearance: none; width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); cursor: pointer; display: grid; place-items: center; }
.send:disabled { opacity: 0.35; cursor: default; }
.cg-foot { padding: 0 14px 10px; font-size: 11px; color: var(--ink-3); }
.lead-card { align-self: stretch; display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--rule-2); background: var(--paper); }
.lead-card b { font-size: 13.5px; }
.lead-card input, .lead-card textarea { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--rule-2); border-radius: 9px; padding: 7px 10px; }
.lead-card textarea { min-height: 70px; resize: vertical; }
@media (max-width: 560px) {
  .concierge { left: 8px; right: 8px; width: auto; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); height: min(56svh, 520px); }
  .ask b { display: none; }
  .ask { padding: 0 12px 0 7px; }
}
#ts-box { position: fixed; right: 12px; bottom: 140px; z-index: 50; }

/* 等待也是一段流動：不用轉圈圈，用照呼吸速度（約 5 秒一個循環）明暗的光 */
.breath { display: inline-block; width: 46px; height: 10px; border-radius: 999px; background: radial-gradient(closest-side, rgba(232, 232, 234, 0.85), rgba(232, 232, 234, 0)); animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {html:not(.motion-on) .breath{ animation: none; opacity: 0.6; } }

/* ── 遊樂場：橫式展示（guide.html?landscape=1，由 landscape.js 加上 island-mode） ── */
.isle-back { display: none; }
html.island-mode, html.island-mode body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.island-mode .site-nav,
html.island-mode .skip,
html.island-mode main > :not(.isle),
html.island-mode body > footer { display: none !important; }
html.island-mode .isle {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: block;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: var(--paper);
}
html.island-mode .isle-stage { position: absolute; inset: 0; margin: 0; min-height: 0; height: auto; touch-action: none; }
html.island-mode .isle-masthead { position: absolute; left: 16px; top: calc(52px + env(safe-area-inset-top, 0px)); max-width: 46%; }
html.island-mode .isle-masthead .isle-kicker { margin-bottom: 4px; font-size: 10px; }
html.island-mode .isle-name { font-size: clamp(18px, 3.4vw, 34px); }
html.island-mode .isle-name small { margin-top: 4px; font-size: 10px; letter-spacing: 0.3em; }
html.island-mode .isle-role,
html.island-mode .isle-tagline,
html.island-mode .board,
html.island-mode .isle-index { display: none; }
html.island-mode .isle-hint { position: absolute; right: 16px; bottom: 14px; display: block; }
html.island-mode .spec { position: absolute; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: min(320px, 44%); }
html.island-mode .isle-back {
  display: inline-flex;
  position: absolute;
  z-index: 3;
  left: 14px;
  top: calc(12px + env(safe-area-inset-top, 0px));
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--rule-2);
  background: rgba(18, 18, 24, 0.55);
  color: var(--ink-2);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-decoration: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html.island-mode .isle-back:hover { color: var(--ink); }
/* 矮的橫式畫面（手機橫拿）：說明卡收小 */
@media (max-height: 520px) {
  html.island-mode .spec-body { padding: 8px 12px 2px; }
  html.island-mode .spec-head { padding: 6px 12px; }
  html.island-mode .spec-title { font-size: 16px; }
  html.island-mode .spec-title small { font-size: 11px; }
  html.island-mode .spec-desc { font-size: 12px; line-height: 1.5; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  html.island-mode .spec-foot { padding: 6px 12px 10px; }
  html.island-mode .spec-cta { padding: 6px 12px; font-size: 12px; }
  html.island-mode .isle-hint { display: none; }
}
/* 直拿但方向鎖不了：整座島轉 90 度 */
html.isle-rotated .isle {
  inset: auto;
  top: 0;
  left: var(--vw, 100vw);
  width: var(--vh, 100vh);
  height: var(--vw, 100vw);
  transform-origin: 0 0;
  transform: rotate(90deg);
}
html.isle-rotated .spec-body { padding: 8px 12px 2px; }
html.isle-rotated .spec-title { font-size: 16px; }
html.isle-rotated .spec-desc { font-size: 12px; line-height: 1.5; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html.isle-rotated .isle-hint { display: none; }

/* 進島前的提示 */
.land-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 5, 7, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.35s ease;
}
.land-gate.gone { opacity: 0; pointer-events: none; }
.land-card { text-align: center; display: grid; justify-items: center; gap: 14px; }
.land-k { margin: 0; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-3); }
.land-icon { width: 54px; height: 54px; color: var(--ink-2); animation: landTurn 2.8s ease-in-out infinite; }
@keyframes landTurn { 0%, 30% { transform: rotate(0); } 55%, 85% { transform: rotate(90deg); } 100% { transform: rotate(0); } }
.land-t { margin: 0; font-size: 15px; letter-spacing: 0.04em; color: var(--ink); }
.land-btn {
  appearance: none;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(232, 232, 234, 0.14);
  background: rgba(232, 232, 234, 0.06);
  color: rgba(232, 232, 234, 0.9);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.land-skip { font-size: 11px; letter-spacing: 0.1em; color: var(--ink-3); text-decoration: none; }
@media (prefers-reduced-motion: reduce) {html:not(.motion-on) .land-icon{ animation: none; } }
/* 島轉 90 度時，右下角的「問小流」沒有跟著轉，先收起來（燈塔那棟建築一樣可以打開 AI 客服） */
html.isle-rotated .ask { display: none; }
