/* 方格居家｜磁磚專門 */
:root {
  --red: #641F26;
  --ink: #292726;
  --panel: #2f2d2b;
  --stone: #b9b2a8;
  --paper: #f3efe8;
  --line: rgba(255, 248, 238, .38);
  --line-2: rgba(255, 248, 238, .16);
  --hw: 56px;                 /* 右側把手寬 */
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --serif: "Noto Serif TC", "Songti TC", serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); }
body {
  margin: 0; padding-right: var(--hw);
  font-family: var(--sans); font-weight: 300; color: var(--paper);
  background: var(--ink); overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }

/* ---------- 1. 24 格主視覺 ---------- */
.hero { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: #5c524a; }
.vh-probe { position: absolute; top: 0; left: 0; width: 0; height: 100vh; height: 100svh; pointer-events: none; }
.wall {
  display: grid; height: 100%;
  grid-template-columns: repeat(var(--cols, 8), var(--cell, 12.5vw));
  grid-auto-rows: var(--cell, 12.5vw);
}
.cell { position: relative; overflow: hidden; background: #8a7d70 center / cover no-repeat; }
.cell::after {                         /* 1px 半透明細線 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset -1px -1px 0 var(--line);
}
.cell--span::before {                  /* 跨格場景上照樣畫格線 */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    linear-gradient(to right, transparent calc(100% - 1px), var(--line) 0) 0 0 / calc(100% / var(--w)) 100%,
    linear-gradient(to bottom, transparent calc(100% - 1px), var(--line) 0) 0 0 / 100% calc(100% / var(--h));
}
.glass {
  position: absolute; inset: 0;
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.05);
  backdrop-filter: blur(var(--blur)) saturate(1.05);
}
.glass--fog { background: rgba(244, 240, 233, calc(.3 + var(--da))); }
.glass--red { background: rgba(100, 31, 38, calc(.5 + var(--da))); }
.cell:first-child .glass--red { background: rgba(100, 31, 38, .76); }
.glass--ink { background: rgba(41, 39, 38, calc(.36 + var(--da))); }
.glass--bottom { top: 50%; }
.glass--top { bottom: 50%; }
.glass--left { right: 50%; }
.glass--bottom, .glass--top { box-shadow: 0 0 0 0 transparent; }
.glass--bottom::before, .glass--top::before, .glass--left::before {
  content: ""; position: absolute; background: var(--line);
}
.glass--bottom::before { left: 0; right: 0; top: 0; height: 1px; }
.glass--top::before { left: 0; right: 0; bottom: 0; height: 1px; }
.glass--left::before { top: 0; bottom: 0; right: 0; width: 1px; }

/* Logo */
.logo { display: block; color: #fff; text-decoration: none; }
.logo__svg { width: 100%; height: 100%; overflow: visible; }
.logo__l { font-family: var(--serif); font-size: 15px; font-weight: 300; }
.logo__n { font-family: var(--serif); font-size: 25px; letter-spacing: 3px; font-weight: 400; }
.logo__s { font-family: var(--serif); font-size: 13px; letter-spacing: 6px; }
.logo--cell { position: absolute; inset: 12%; z-index: 1; }
.logo--badge {
  position: absolute; z-index: 3; top: 0; left: 0;
  width: clamp(96px, 9.5vw, 136px); aspect-ratio: 1;
  padding: calc(clamp(96px, 9.5vw, 136px) * .1);
  background: rgba(100, 31, 38, .9);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset -1px -1px 0 var(--line);
}

/* ---------- 引導分隔帶 ---------- */
.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap;
  padding: clamp(22px, 4vh, 40px) clamp(20px, 4vw, 64px);
  background: var(--red); color: #fff;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-2);
}
.cta__text { margin: 0; font-family: var(--serif); font-size: clamp(18px, 1.9vw, 26px); letter-spacing: .14em; font-weight: 300; }
.cta__text span { display: block; margin-top: 8px; font-family: var(--sans); font-size: 13px; letter-spacing: .12em; color: rgba(255, 255, 255, .68); }
.cta__btn {
  display: inline-flex; align-items: center; gap: 14px; padding: 14px 22px 14px 26px;
  border: 1px solid rgba(255, 255, 255, .7); color: #fff; text-decoration: none;
  font-size: 15px; letter-spacing: .2em; transition: background .25s, color .25s;
}
.cta__btn svg { width: 10px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.1; animation: nudge 1.8s ease-in-out infinite; }
.cta__btn:hover, .cta__btn:focus-visible { background: #fff; color: var(--red); }
@keyframes nudge { 50% { transform: translateY(3px); } }

/* ---------- 2. 磁磚試鋪 ---------- */
.try {
  display: grid; grid-template-columns: 65fr 35fr;
  min-height: 100vh; min-height: 100svh;
  background: var(--panel);
}
.stage { position: relative; overflow: hidden; background: #6e655c; min-height: 100%; }
.shot {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 78%;
  opacity: 0; transition: opacity .32s ease;
}
.shot.on { opacity: 1; }
.tag {
  position: absolute; z-index: 3; left: 20px; bottom: 20px; margin: 0;
  padding: 6px 12px; font-size: 13px; letter-spacing: .12em;
  color: #fff; background: rgba(41, 39, 38, .38);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line-2);
}
.tag:empty { display: none; }

.panel {
  border-left: 1px solid var(--line-2);
  padding: clamp(36px, 5vh, 56px) clamp(24px, 3vw, 48px);
  display: flex; flex-direction: column; justify-content: flex-start; gap: 32px;
}
.panel__title { margin: 0; font-size: 22px; font-weight: 300; letter-spacing: .3em; }
.panel__lead { margin: -18px 0 0; font-size: 13px; line-height: 1.8; color: rgba(243, 239, 232, .62); letter-spacing: .05em; }
.group__label {
  margin: 0 0 12px; font-size: 12px; font-weight: 400; letter-spacing: .24em; color: rgba(243, 239, 232, .7);
  display: flex; align-items: center; gap: 10px;
}
.group__label::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.opts { display: grid; gap: 10px; }
.opts--scene { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opts--mat { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.opt {
  position: relative; padding: 0; background: none; border: 0; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; text-align: left;
}
.opt__img { position: relative; display: block; overflow: hidden; outline: 1px solid var(--line-2); outline-offset: 0; }
.opt--scene .opt__img { aspect-ratio: 6 / 5; }
.opt--mat .opt__img { aspect-ratio: 1; }
.opt__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.opt--scene .opt__img img { object-position: 50% 80%; }
.opt:hover .opt__img img { transform: scale(1.04); }
.opt__name { font-size: 13px; letter-spacing: .12em; color: rgba(243, 239, 232, .72); }
.opt--mat .opt__name { font-size: 12px; letter-spacing: 0; line-height: 1.35; text-align: center; word-break: keep-all; }
.opt { min-width: 0; }
.opt[aria-pressed="true"] .opt__img { outline: 1px solid #fff; outline-offset: 3px; }
.opt[aria-pressed="true"] .opt__name { color: #fff; }
.tick {
  position: absolute; top: 5px; right: 5px; width: 18px; height: 18px; padding: 3px;
  background: var(--red); border: 1px solid rgba(255, 255, 255, .7);
  fill: none; stroke: #fff; stroke-width: 1.3;
  opacity: 0; transform: scale(.6); transition: opacity .2s, transform .2s;
}
.opt[aria-pressed="true"] .tick { opacity: 1; transform: none; }
.opt:focus-visible { outline: none; }
.opt:focus-visible .opt__img { outline: 1px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 5px rgba(255, 255, 255, .22); }
.spec { margin: 14px 0 0; font-size: 12px; color: rgba(243, 239, 232, .55); letter-spacing: .06em; }

/* ---------- 3. 頁尾 ---------- */
.foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 40px;
  padding: 28px clamp(20px, 3vw, 40px); background: var(--ink);
  border-top: 1px solid var(--line-2); font-size: 13px; letter-spacing: .08em;
}
.foot__brand { font-family: var(--serif); font-size: 18px; letter-spacing: .2em; }
.foot__brand span { margin-left: 12px; font-size: 12px; color: rgba(243, 239, 232, .6); }
.foot__nav { display: flex; gap: 28px; margin-left: auto; }
.foot__nav a { text-decoration: none; color: rgba(243, 239, 232, .8); }
.foot__nav a:hover { color: #fff; }
.foot__note { flex-basis: 100%; margin: 0; font-size: 11px; color: rgba(243, 239, 232, .4); }

/* ---------- 右側把手與選單 ---------- */
.handle {
  position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: var(--hw);
  background: var(--red); border-left: 1px solid var(--line-2);
}
.burger {
  display: grid; place-content: center; gap: 7px;
  width: var(--hw); height: 72px; padding: 0; border: 0; background: none; cursor: pointer;
}
.burger span {
  display: block; width: 22px; height: 1px; background: #fff;
  transition: transform .3s ease, opacity .2s;
}
.menu-open .burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; }
.menu-open .burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.burger:focus-visible { outline-offset: -8px; }

.scrim {
  position: fixed; z-index: 30; inset: 0; background: rgba(20, 18, 17, .42);
  opacity: 0; transition: opacity .3s ease;
}
.scrim.on { opacity: 1; }
.drawer {
  position: fixed; z-index: 35; top: 0; bottom: 0; right: var(--hw);
  width: min(340px, calc(100vw - var(--hw) - 48px));
  background: rgba(41, 39, 38, .9);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-left: 1px solid var(--line-2);
  transform: translateX(calc(100% + var(--hw))); visibility: hidden;
  transition: transform .4s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .4s;
  padding: 96px 36px 40px;
}
.menu-open .drawer { transform: none; visibility: visible; transition: transform .4s cubic-bezier(.2, .7, .2, 1), visibility 0s; }
.drawer ol { list-style: none; margin: 0; padding: 0; }
.drawer li { border-top: 1px solid var(--line-2); }
.drawer li:last-child { border-bottom: 1px solid var(--line-2); }
.drawer a {
  display: flex; align-items: baseline; gap: 18px; padding: 22px 4px;
  font-size: 20px; letter-spacing: .24em; text-decoration: none; color: #fff;
}
.drawer small { font-size: 11px; letter-spacing: .1em; color: rgba(243, 239, 232, .5); }
.drawer a:hover small, .drawer a:focus-visible small { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* ---------- 手機 ---------- */
@media (max-width: 760px) {
  :root { --hw: 44px; }
  .logo--cell { inset: 9%; }
  .try { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
  .stage { flex: 0 0 auto; height: clamp(76vw, calc(100svh - 300px), 104vw); width: 100%; }
  .panel { flex: 1 1 auto; }
  .logo--badge { width: 76px; padding: 7px; }
  .tag { left: 10px; bottom: 10px; font-size: 12px; padding: 4px 9px; }
  .panel { border-left: 0; border-top: 1px solid var(--line-2); padding: 16px 14px 22px; gap: 14px; justify-content: flex-start; }
  .panel__title { font-size: 16px; }
  .panel__lead { display: none; }
  .cta { padding: 20px 16px; }
  .cta__btn { width: 100%; justify-content: center; padding: 13px 16px; }
  .group__label { margin-bottom: 8px; font-size: 11px; }
  .opts--scene { gap: 8px; }
  .opts--scene .opt { flex-direction: row; align-items: center; gap: 6px; }
  .opt--scene .opt__img { width: 44%; aspect-ratio: 1; flex: none; }
  .opts--mat { gap: 6px; }
  .opt { gap: 5px; }
  .opt__name { font-size: 12px; }
  .opt--mat .opt__name { font-size: 11px; letter-spacing: 0; text-align: center; }
  .tick { width: 15px; height: 15px; top: 3px; right: 3px; padding: 2px; }
  .spec { margin-top: 8px; font-size: 11px; }
  .burger { height: 56px; }
  .foot__nav { margin-left: 0; }
  .drawer { padding-top: 72px; }
}
