/* Minimal monochrome layout with the requested liquid-glass material. */
:root {
  color-scheme: dark;
  --bg: #111111;
  --surface: #ffffff;
  --text: #111111;
  --border: #cfcfcf;
  --glass-rgb: 215, 235, 255;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[data-period="dawn"], [data-period="dusk"] { --glass-rgb: 246, 225, 204; }
body { margin: 0; background: var(--bg); isolation: isolate; }
.site-header { position: absolute; top: 24px; left: 32px; z-index: 5; }
.brand { display: inline-flex; align-items: center; min-height: 44px; gap: 12px; color: #fafafa; font-size: 20px; font-weight: 600; letter-spacing: -.035em; text-decoration: none; }
.brand-logo { display: block; width: 33px; height: 30px; filter: invert(1); }
.brand:hover { opacity: .72; }
.brand:focus-visible { outline: 2px solid #ffffff; outline-offset: 6px; }

main { min-height: calc(100svh - 148px); display: grid; place-items: start center; overflow: hidden; }
.scene {
  position: relative;
  width: 100%;
  --box-top: max(420px, 66.6667svh);
  height: calc(100svh - 148px);
  min-height: calc(var(--box-top) + 100px);
  isolation: isolate;
  --bubble-size: 9vw;
}
.box-area { position: absolute; left: 50%; top: var(--box-top); transform: translate(-50%, -50%); }
.box-area::before { content: ''; position: absolute; width: 240px; height: 55px; left: 30px; bottom: -7px; border-radius: 50%; background: radial-gradient(ellipse, rgba(var(--glass-rgb), .065), transparent 70%); pointer-events: none; }
.box-trigger {
  position: relative;
  display: grid;
  place-items: center;
  width: 300px;
  height: 224px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  perspective: 850px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.cube-float {
  display: block;
  width: 220px;
  height: 112px;
  transform-style: preserve-3d;
  pointer-events: none;
  animation: float 8s cubic-bezier(.45,0,.55,1) infinite;
  will-change: transform;
}
.cube {
  position: relative;
  display: block;
  width: 220px;
  height: 112px;
  transform-style: preserve-3d;
  transform: rotateX(-16deg);
}
.cube-face {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(235,245,255,.27);
  border-radius: 7px;
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
  background: rgba(var(--glass-rgb),.025);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.36), inset -2px -2px 3px rgba(var(--glass-rgb),.10), inset 0 0 12px rgba(var(--glass-rgb),.03);
}
.cube-face::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(120deg,rgba(255,255,255,.14),transparent 27%,transparent 60%,rgba(var(--glass-rgb),.055) 70%,transparent 82%);
  /* Static highlights retain glass depth without per-frame backdrop sampling. */
}
.cube-front {
  display: grid;
  place-items: center;
  transform: translateZ(56px);
  background: radial-gradient(ellipse at 25% -20%,rgba(255,255,255,.17),transparent 58%),linear-gradient(155deg,rgba(var(--glass-rgb),.065),rgba(12,20,30,.10) 55%,rgba(var(--glass-rgb),.065));
  border-top-color: rgba(255,255,255,.65);
  border-left-color: rgba(255,255,255,.42);
  border-bottom-color: rgba(var(--glass-rgb),.32);
  box-shadow: inset 2px 2px 1px rgba(255,255,255,.18), inset -2px -3px 3px rgba(var(--glass-rgb),.17), inset 0 -9px 14px -12px rgba(255,255,255,.8);
}
.cube-front::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255,255,255,.055);
  border-bottom-color: rgba(var(--glass-rgb),.18);
  border-radius: 4px;
  pointer-events: none;
}
.cube-right {
  width: 112px;
  left: 54px;
  right: auto;
  transform: rotateY(90deg) translateZ(110px);
  background: linear-gradient(112deg,rgba(255,255,255,.015),rgba(255,255,255,.10) 72%,rgba(255,255,255,.19));
  border-color: rgba(255,255,255,.3);
}
.cube-right::before { background: linear-gradient(92deg,rgba(255,255,255,.025) 55%,rgba(255,255,255,.12)); }
.lid-hinge {
  position: absolute;
  display: block;
  top: 0;
  left: 0;
  width: 220px;
  height: 0;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  transform: translateZ(-56px) rotateX(0deg);
  will-change: transform;
}
/* A shallow rigid lid and raised carrying handle rotate together at the rear hinge. */
.lid-panel {
  position: absolute;
  display: block;
  left: 0;
  width: 220px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 6px;
  backface-visibility: visible;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.35), inset -2px -2px 3px rgba(var(--glass-rgb),.12);
}
.lid-top, .lid-under {
  height: 112px;
  transform-origin: 50% 0;
  transform: rotateX(90deg);
}
.lid-top {
  top: -24px;
  background: linear-gradient(120deg,rgba(var(--glass-rgb),.20),rgba(22,30,42,.24) 40%,rgba(var(--glass-rgb),.065) 72%,rgba(255,255,255,.16));
}
.lid-top::after, .lid-under::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255,255,255,.10);
  border-bottom-color: rgba(var(--glass-rgb),.24);
  border-radius: 4px;
}
.lid-under {
  top: 0;
  background: radial-gradient(ellipse at 80% 0,rgba(var(--glass-rgb),.10),transparent 65%),linear-gradient(155deg,rgba(var(--glass-rgb),.09),rgba(9,16,26,.36) 60%,rgba(var(--glass-rgb),.09));
}
.lid-front, .lid-back {
  top: -24px;
  height: 24px;
  background: linear-gradient(170deg,rgba(255,255,255,.24),rgba(255,255,255,.07));
}
.lid-front { transform: translateZ(112px); border-bottom: 2px solid rgba(255,255,255,.42); }
.lid-back { transform: translateZ(0); }
.lid-side {
  top: -24px;
  height: 24px;
  width: 112px;
  transform-origin: 0 0;
  transform: rotateY(-90deg);
  background: linear-gradient(110deg,rgba(255,255,255,.16),rgba(255,255,255,.07));
}
.lid-left { left: 0; }
.lid-right { left: 220px; }
.toolbox-handle {
  position: absolute;
  top: -54px;
  left: 70px;
  width: 80px;
  height: 36px;
  border: 7px solid #6b6b6b;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  transform: translateZ(56px);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.65), 1px -1px 0 rgba(255,255,255,.55);
}
.toolbox-handle::before, .toolbox-handle::after {
  content: "";
  position: absolute;
  bottom: -2px;
  width: 16px;
  height: 5px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 2px;
  background: #5b5b5b;
}
.toolbox-handle::before { left: -11px; }
.toolbox-handle::after { right: -11px; }
.handle-grip {
  position: absolute;
  top: -8px;
  left: 10px;
  width: 46px;
  height: 10px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 3px;
  background: repeating-linear-gradient(90deg,#383838 0 3px,#484848 3px 4px);
}
.cube-back {
  transform: rotateY(180deg) translateZ(56px);
  background: linear-gradient(150deg,rgba(var(--glass-rgb),.075),rgba(7,13,22,.10) 70%);
  border-top: 2px solid rgba(255,255,255,.32);
}
.cube-left {
  width: 112px;
  left: 54px;
  right: auto;
  transform: rotateY(-90deg) translateZ(110px);
  background: linear-gradient(135deg,rgba(255,255,255,.13),rgba(255,255,255,.025));
  border-top: 2px solid rgba(255,255,255,.36);
}
.cube-bottom {
  transform: rotateX(90deg) translateZ(-56px);
  background: radial-gradient(ellipse at 50% 100%,rgba(var(--glass-rgb),.2),transparent 65%),linear-gradient(135deg,rgba(var(--glass-rgb),.05),rgba(9,16,26,.22));
  border: 1px solid rgba(255,255,255,.28);
}
.cube-bottom::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 2px;
}
.cube-back::before, .cube-left::before, .cube-bottom::before { background: none; }
.toolbox-clasp {
  position: absolute;
  z-index: 2;
  top: -10px;
  width: 19px;
  height: 31px;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 3px;
  background: linear-gradient(100deg,#686868,#353535 60%,#505050);
  box-shadow: 0 2px 3px rgba(0,0,0,.4), inset 1px 0 0 rgba(255,255,255,.25);
}
.clasp-left { left: 28px; }
.clasp-right { right: 28px; }
.toolbox-clasp::after {
  content: "";
  position: absolute;
  inset: 11px 4px 5px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 1px;
  background: rgba(0,0,0,.2);
}
.corner-guard {
  position: absolute;
  bottom: -1px;
  width: 23px;
  height: 19px;
  border-bottom: 4px solid rgba(255,255,255,.3);
}
.guard-left { left: -1px; border-left: 4px solid rgba(255,255,255,.3); border-radius: 0 0 0 4px; }
.guard-right { right: -1px; border-right: 4px solid rgba(255,255,255,.3); border-radius: 0 0 4px 0; }
.face-logo { display: block; position: relative; z-index: 1; width: 55px; height: 50px; filter: invert(1); opacity: .86; transform: translateY(7px); }
.tools { position: absolute; left: 50%; top: var(--box-top); width: 0; height: 0; z-index: 2; }
.tool-bubble {
  position: absolute;
  left: calc(var(--bubble-size) / -2);
  top: calc(var(--bubble-size) / -2);
  width: var(--bubble-size);
  height: var(--bubble-size);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--bubble-size) * .09);
  border: 1px solid rgba(255,255,255,.23);
  /* Round link and motion preserve the explicitly requested bubble interaction. */
  border-radius: 50%;
  color: #fafafa;
  background: radial-gradient(ellipse at 27% 5%,rgba(255,255,255,.18),transparent 47%),linear-gradient(145deg,rgba(var(--glass-rgb),.075),rgba(8,16,26,.32) 62%,rgba(var(--glass-rgb),.07));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.48),inset 0 -2px 3px rgba(var(--glass-rgb),.21),inset 2px 0 4px rgba(255,255,255,.06),0 10px 24px -14px rgba(0,0,0,.65);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0,-32px,0) scale(.55);
  /* Drift is separate from the browser-driven entrance transform. */
  animation: bubble-drift var(--drift-duration, 6s) ease-in-out var(--drift-delay, 0s) infinite;
  animation-play-state: paused;
  pointer-events: none;
  will-change: transform, opacity;
  -webkit-tap-highlight-color: transparent;
}
.tool-bubble::before { content: ''; position: absolute; inset: 4px; border-radius: inherit; border: 1px solid transparent; border-top-color: rgba(255,255,255,.15); border-bottom-color: rgba(var(--glass-rgb),.12); pointer-events: none; }
.tool-bubble::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(ellipse at 80% 95%,rgba(var(--glass-rgb),.11),transparent 43%); pointer-events: none; }
.tool-icon { width: calc(var(--bubble-size) * .28); height: calc(var(--bubble-size) * .28); }
.tool-name { font-size: calc(var(--bubble-size) * .13); font-weight: 650; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.tool-bubble:nth-child(2) { --drift-duration: 6.8s; --drift-delay: -2.4s; }
.tool-bubble:nth-child(3) { --drift-duration: 5.7s; --drift-delay: -4.1s; }
.tool-bubble:nth-child(4) { --drift-duration: 7.2s; --drift-delay: -1.3s; }
.tool-bubble:nth-child(5) { --drift-duration: 6.3s; --drift-delay: -3.6s; }
.tool-bubble:nth-child(6) { --drift-duration: 7s; --drift-delay: -5.2s; }
.tool-bubble:nth-child(7) { --drift-duration: 5.9s; --drift-delay: -2.8s; }
.tool-bubble:nth-child(8) { --drift-duration: 6.6s; --drift-delay: -4.5s; }
.tool-bubble:nth-child(9) { --drift-duration: 6.4s; --drift-delay: -1.9s; }
.tool-bubble:nth-child(10) { --drift-duration: 7.1s; --drift-delay: -3.1s; }
.scene.is-open .tool-bubble { pointer-events: auto; animation-play-state: running; }
.scene.is-open .tool-bubble:is(:hover, :focus-visible) { animation-play-state: paused; }
.tool-bubble:hover { border-color: rgba(255,255,255,.52); }
.box-trigger:focus-visible, .tool-bubble:focus-visible { outline: 2px solid #ffffff; outline-offset: 8px; }
@keyframes float {
  0%, 100% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(0,-8px,0); }
}
@keyframes bubble-drift {
  0%, 100% { translate: -2px 3px; }
  50% { translate: 2px -4px; }
}
@media (max-width: 1240px), (max-height: 560px) {
  .site-header { top: 16px; left: 20px; }
  .brand { font-size: 18px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Small, local highlights preserve the glass surfaces and their 3D depth. */
.pointer-light {
  position: fixed;
  top: 0;
  left: 0;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle,rgba(var(--glass-rgb),.055),rgba(var(--glass-rgb),.018) 30%,transparent 68%);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.glass-light {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
  background: radial-gradient(75px 50px at var(--light-x,50%) var(--light-y,50%),rgba(255,255,255,.17),rgba(var(--glass-rgb),.035) 55%,transparent 100%);
  box-shadow: inset var(--rim-x,0px) var(--rim-y,0px) 3px rgba(var(--glass-rgb),.32);
}
.tool-bubble .glass-light {
  background: radial-gradient(42px 34px at var(--light-x,50%) var(--light-y,50%),rgba(255,255,255,.24),transparent 100%),radial-gradient(90px 65px at var(--echo-x,50%) var(--echo-y,50%),rgba(var(--glass-rgb),.09),transparent 80%);
}
.glass-light::after { content: ''; position: absolute; inset: -1px; padding: 1px; border-radius: inherit; background: conic-gradient(from var(--rim-angle,0deg),rgba(255,255,255,.8),rgba(var(--glass-rgb),.08) 65deg,transparent 140deg,rgba(var(--glass-rgb),.18) 210deg,transparent 280deg,rgba(255,255,255,.8)); -webkit-mask: linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0); mask-composite: exclude; }
.tool-icon, .tool-name { position: relative; z-index: 1; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tool-bubble { background-color: rgba(12,20,30,.65); }
}
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .pointer-light, .glass-light { display: none; }
}

/* Keep the clock and weather outside the toolbox's interaction area. */
.ambient-footer { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 148px; padding: 12px 32px 20px; }
.ambient-clock {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  color: #ededed;
  pointer-events: none;
}
.clock-date { color: #a3a3a3; font-size: 21.6px; letter-spacing: .06em; }
.clock-time { font-size: 50.4px; font-weight: 300; line-height: 1.3; letter-spacing: .035em; font-variant-numeric: tabular-nums; }
.clock-zone { color: #aeb4bc; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }
.ambient-weather { max-width: 340px; color: #e8ebef; text-align: right; }
.weather-main { display: flex; align-items: center; justify-content: flex-end; gap: 12px; font-size: 32px; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1.3; }
#weather-symbol { width: 30px; height: 30px; }
.weather-condition { font-size: 13px; margin: 6px 0 0; color: #c7cbd1; }
.weather-meta { margin: 0; color: #aeb4bc; font-size: 11px; }
.weather-meta a { display: inline-flex; min-height: 44px; align-items: center; color: inherit; text-underline-offset: 3px; }
.weather-meta a:focus-visible { outline: 2px solid white; outline-offset: 3px; }
@media (max-width: 1160px) {
  .ambient-footer { padding-left: 20px; padding-right: 20px; }
  .clock-time { font-size: 45px; }
}
@media (max-width: 620px) {
  .ambient-footer { align-items: flex-start; flex-direction: column; gap: 24px; }
  .ambient-weather { text-align: left; }
  .weather-main { justify-content: flex-start; font-size: 26px; }
}

/* Warm morning palette. Tint the individual glass faces, never the 3D parents. */
:root[data-theme="light"] { color-scheme: light; --bg: #f8f4ec; --glass-rgb: 255, 247, 231; }
[data-theme="light"] .brand, [data-theme="light"] .ambient-clock,
[data-theme="light"] .ambient-weather, [data-theme="light"] .tool-bubble { color: #302f2c; }
[data-theme="light"] .clock-date, [data-theme="light"] .weather-condition { color: #56534e; }
[data-theme="light"] .clock-zone, [data-theme="light"] .weather-meta { color: #69635b; }
[data-theme="light"] .brand-logo, [data-theme="light"] .face-logo { filter: none; }
[data-theme="light"] .brand:focus-visible, [data-theme="light"] .box-trigger:focus-visible,
[data-theme="light"] .tool-bubble:focus-visible, [data-theme="light"] .weather-meta a:focus-visible { outline-color: #51483b; }
[data-theme="light"] .tool-name { text-shadow: none; }
[data-theme="light"] .tool-bubble {
  border-color: rgba(97,88,74,.25);
  background: radial-gradient(ellipse at 27% 5%,rgba(255,255,255,.85),transparent 47%),linear-gradient(145deg,rgba(255,255,255,.33),rgba(255,250,240,.12) 62%,rgba(183,168,146,.13));
  box-shadow: inset 0 1px 1px #fff,inset 0 -2px 3px rgba(116,102,80,.12),inset 2px 0 4px rgba(255,255,255,.5),0 10px 24px -14px rgba(101,80,51,.24);
}
[data-theme="light"] .tool-bubble::before { border-top-color: rgba(255,255,255,.9); border-bottom-color: rgba(102,90,73,.10); }
[data-theme="light"] .tool-bubble:hover { border-color: rgba(89,75,53,.52); }
[data-theme="light"] .cube-face, [data-theme="light"] .lid-panel {
  border-color: rgba(111,99,82,.34);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.9),inset -2px -2px 3px rgba(105,91,70,.10);
}
[data-theme="light"] .cube-front {
  background: radial-gradient(ellipse at 25% -20%,rgba(255,255,255,.75),transparent 58%),linear-gradient(155deg,rgba(255,255,255,.25),rgba(139,127,109,.08) 55%,rgba(255,255,255,.35));
}
[data-theme="light"] .cube-back { background: linear-gradient(150deg,rgba(255,255,255,.30),rgba(139,127,109,.09)); }
[data-theme="light"] .cube-bottom { background: linear-gradient(135deg,rgba(255,255,255,.35),rgba(139,127,109,.16)); }
[data-theme="light"] .lid-top { background: linear-gradient(120deg,rgba(255,255,255,.6),rgba(155,140,118,.12) 40%,rgba(255,255,255,.35)); }
[data-theme="light"] .lid-under { background: linear-gradient(155deg,rgba(255,255,255,.4),rgba(140,125,104,.15) 60%,rgba(255,255,255,.35)); }
[data-theme="light"] .cube-front::after, [data-theme="light"] .cube-bottom::after,
[data-theme="light"] .lid-top::after, [data-theme="light"] .lid-under::after { border-color: rgba(108,94,74,.12); }
[data-theme="light"] .box-area::before { background: radial-gradient(ellipse,rgba(133,112,80,.10),transparent 70%); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  [data-theme="light"] .tool-bubble { background-color: rgba(250,245,235,.90); }
}
