/* =========================================================
   折りたたみデバイスのイラスト（CSS 3D）
   実寸比：開いた時 164.6 × 117.8 mm ／ 閉じた時 84.1 × 117.8 mm
   製品写真は使わず、オリジナルの図解として描画する
   ========================================================= */

.fold {
  --w: min(680px, 88vw);
  --h: calc(var(--w) * 117.8 / 164.6);
  --r: calc(var(--w) * 0.05);
  --bezel: calc(var(--w) * 0.012);
  --rh: calc(var(--r) * 0.3);
  --frame: linear-gradient(145deg, #3a3d4c, #23252f 55%, #3a3d4c);
  --frame-edge: #4b4f60;
  --wall-a: #3b2fbf;
  --wall-b: #8c5cff;
  --wall-c: #ff8ac8;
  --wall-d: #0b0d2a;
  position: relative;
  width: var(--w);
  margin: 0 auto;
}
.fold--sm {
  --w: min(300px, 70vw);
}
.fold[data-color="star"] {
  --frame: linear-gradient(145deg, #f2efe8, #d9d4c9 55%, #f2efe8);
  --frame-edge: #c9c3b6;
  --wall-a: #ffd2a8;
  --wall-b: #ffb3c7;
  --wall-c: #b9c8ff;
  --wall-d: #fff4ea;
}

.fold__stage {
  position: relative;
  width: var(--w);
  height: var(--h);
  perspective: calc(var(--w) * 3.6);
}

.fold__device {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 1.3s cubic-bezier(0.65, 0, 0.35, 1);
}
.fold.is-closed .fold__device {
  transform: translateX(25%);
}

.fold__half {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
}
.fold__half--left {
  left: 0;
  transform: translateZ(-1px);
}
.fold__half--right {
  left: 50%;
  transform-origin: left center;
  transition: transform 1.3s cubic-bezier(0.65, 0, 0.35, 1);
}
.fold.is-closed .fold__half--right {
  transform: rotateY(-180deg) translateZ(-2px);
}

.fold__face {
  position: absolute;
  inset: 0;
  padding: var(--bezel);
  background: var(--frame);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  box-shadow: inset 0 0 0 1px var(--frame-edge);
}
.fold__half--left .fold__face {
  border-radius: var(--r) var(--rh) var(--rh) var(--r);
}
.fold__half--right .fold__face--front {
  border-radius: var(--rh) var(--r) var(--r) var(--rh);
}
.fold__face--back {
  transform: rotateY(180deg);
  border-radius: var(--r) var(--rh) var(--rh) var(--r);
}

.fold__screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(60% 70% at 18% 20%, var(--wall-b) 0%, transparent 60%),
    radial-gradient(55% 65% at 85% 85%, var(--wall-c) 0%, transparent 62%),
    radial-gradient(80% 90% at 60% 30%, var(--wall-a) 0%, transparent 70%),
    var(--wall-d);
  background-size: 200% 100%;
}
.fold__half--left .fold__screen {
  border-radius: calc(var(--r) - var(--bezel)) 0 0 calc(var(--r) - var(--bezel));
  background-position: 0 0;
}
.fold__half--right .fold__face--front .fold__screen {
  border-radius: 0 calc(var(--r) - var(--bezel)) calc(var(--r) - var(--bezel)) 0;
  background-position: 100% 0;
}

/* 折り目：見えにくいが、角度によっては見える */
.fold__half--left .fold__screen::after,
.fold__half--right .fold__face--front .fold__screen::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6%;
  pointer-events: none;
}
.fold__half--left .fold__screen::after {
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09));
}
.fold__half--right .fold__face--front .fold__screen::after {
  left: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.12), transparent);
}

/* 内側：ウィジェット風の抽象UI */
.fold__widgets {
  position: absolute;
  inset: 9% 8%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: calc(var(--w) * 0.018);
}
.fold__widget {
  border-radius: calc(var(--w) * 0.03);
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.fold[data-color="star"] .fold__widget {
  background: rgba(255, 255, 255, 0.4);
}
.fold__widget--wide {
  grid-column: span 2;
}
.fold__time-inner {
  position: absolute;
  left: 10%;
  top: 9%;
  color: rgba(255, 255, 255, 0.92);
  font-size: calc(var(--w) * 0.075);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.fold[data-color="star"] .fold__time-inner,
.fold[data-color="star"] .fold__time,
.fold[data-color="star"] .fold__date {
  color: rgba(40, 32, 60, 0.85);
}

/* 内側画面下カメラ（ごく小さな点） */
.fold__udc {
  position: absolute;
  top: 4%;
  right: 50%;
  width: calc(var(--w) * 0.008);
  height: calc(var(--w) * 0.008);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
}

/* 外側ディスプレイ */
.fold__face--back .fold__screen {
  border-radius: calc(var(--r) - var(--bezel));
  background-size: 120% 120%;
  background-position: 30% 40%;
}
.fold__island {
  position: absolute;
  top: 3.6%;
  left: 50%;
  width: 30%;
  height: 4.2%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #000;
}
.fold__date {
  position: absolute;
  top: 15%;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: calc(var(--w) * 0.024);
  font-weight: 600;
}
.fold__time {
  position: absolute;
  top: 19%;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.95);
  font-size: calc(var(--w) * 0.12);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* 影 */
.fold__shadow {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: calc(var(--h) * -0.12);
  height: calc(var(--h) * 0.12);
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), transparent);
  filter: blur(6px);
  transition:
    left 1.3s cubic-bezier(0.65, 0, 0.35, 1),
    right 1.3s cubic-bezier(0.65, 0, 0.35, 1);
}
.theme-light .fold__shadow,
.theme-alt .fold__shadow {
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.22), transparent);
}
.fold.is-closed .fold__shadow {
  left: 28%;
  right: 28%;
}

/* コントロール */
.fold-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px 32px;
  margin-top: 64px;
}
.pill-switch {
  display: inline-flex;
  padding: 4px;
  border-radius: 980px;
  background: rgba(127, 127, 127, 0.18);
}
.pill-switch button {
  min-height: 36px;
  padding: 6px 18px;
  border: 0;
  border-radius: 980px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  transition:
    background 0.3s var(--ease),
    color 0.3s var(--ease);
}
.pill-switch button[aria-pressed="true"] {
  background: #f5f5f7;
  color: #1d1d1f;
}
.swatches {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.swatch[aria-pressed="true"] {
  outline: 2px solid #f5f5f7;
  outline-offset: 3px;
}
.swatch--night {
  background: linear-gradient(145deg, #4a4e63, #23252f);
}
.swatch--star {
  background: linear-gradient(145deg, #faf8f3, #d9d4c9);
}
.swatch-label {
  min-width: 7em;
  font-size: 14px;
  color: var(--dark-fg-2);
}

/* ---------- 小さなアイコン類（ハイライトカード用） ---------- */

.ill-chip {
  position: relative;
  width: 168px;
  height: 168px;
  border-radius: 28px;
  background: linear-gradient(145deg, #2a2a2e, #111113);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.08),
    0 0 60px rgba(142, 156, 255, 0.35);
  display: grid;
  place-items: center;
  text-align: center;
}
.ill-chip::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 36px;
  border: 1px dashed rgba(142, 156, 255, 0.5);
}
.ill-chip b {
  display: block;
  font-size: 44px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ill-chip span {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #a7a3ff;
}

.ill-big {
  font-size: clamp(72px, 12vw, 120px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  text-align: center;
}
.ill-big small {
  display: block;
  margin-top: 8px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--dark-fg-2);
}

.ill-lens {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: 40px;
  background: linear-gradient(145deg, #3a3d4c, #1b1c23);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.ill-lens i {
  display: block;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    #1b2a6b 0 18%,
    #05060c 30% 52%,
    #2b2d38 54% 62%,
    #0b0c12 64%
  );
  box-shadow: 0 0 0 4px #4b4f60;
}

.ill-thin {
  width: 80%;
  display: grid;
  gap: 26px;
}
.ill-thin__row {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--dark-fg-2);
}
.ill-thin__bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #4a4e63, #8e9cff);
}

.ill-icon {
  width: 132px;
  height: 132px;
  color: #a7a3ff;
}
.ill-icon--home {
  color: #ff8a65;
}

/* ---------- スマートホームハブ（報道をもとにしたイメージ図） ---------- */

.hub {
  --s: min(300px, 64vw);
  position: relative;
  width: var(--s);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hub--lg {
  --s: min(380px, 72vw);
}
.hub__screen {
  position: relative;
  z-index: 2;
  width: var(--s);
  height: var(--s);
  padding: calc(var(--s) * 0.035);
  border-radius: calc(var(--s) * 0.09);
  background: linear-gradient(145deg, #f4f4f6, #cfd0d6);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.hub__ui {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--s) * 0.065);
  background:
    radial-gradient(70% 70% at 15% 15%, #ffb37a 0%, transparent 60%),
    radial-gradient(70% 70% at 90% 90%, #b77cff 0%, transparent 62%),
    radial-gradient(90% 90% at 70% 20%, #ff6f91 0%, transparent 70%), #2a1630;
}
.hub__time {
  position: absolute;
  left: 9%;
  top: 8%;
  color: rgba(255, 255, 255, 0.95);
  font-size: calc(var(--s) * 0.15);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.hub__sub {
  position: absolute;
  left: 9%;
  top: 27%;
  color: rgba(255, 255, 255, 0.8);
  font-size: calc(var(--s) * 0.045);
  font-weight: 600;
}
.hub__tiles {
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 9%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: calc(var(--s) * 0.03);
}
.hub__tiles i {
  display: block;
  aspect-ratio: 1;
  border-radius: 28%;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.hub__tiles i:first-child {
  background: rgba(255, 255, 255, 0.85);
}
.hub__neck {
  width: calc(var(--s) * 0.08);
  height: calc(var(--s) * 0.12);
  margin-top: calc(var(--s) * -0.02);
  background: linear-gradient(90deg, #b9bac1, #f1f1f4 50%, #b9bac1);
}
.hub__base {
  width: calc(var(--s) * 0.56);
  height: calc(var(--s) * 0.2);
  border-radius: 50% 50% 18% 18% / 70% 70% 30% 30%;
  background:
    radial-gradient(circle, rgba(0, 0, 0, 0.18) 1px, transparent 1.6px) 0 0 /
      7px 7px,
    linear-gradient(180deg, #f4f4f6, #c9cad0);
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.28);
}
.figure-note {
  margin-top: 22px;
  font-size: 12px;
  color: var(--dark-fg-2);
  text-align: center;
}
.theme-light .figure-note,
.theme-alt .figure-note {
  color: var(--light-fg-2);
}

/* 初期表示の切り替えではアニメーションさせない */
.fold.is-instant .fold__device,
.fold.is-instant .fold__half--right,
.fold.is-instant .fold__shadow {
  transition: none !important;
}
