/* Daikin Local Platform: project site. Cool, airy paper with the plugin's Daikin blue (branding/README.md);
   warm orange appears only when the hero demo is heating. */
:root {
  color-scheme: light dark;
  --paper: #f2f7fa;
  --sheet: #ffffff;
  --ink: #0e2230;
  --muted: #587082;
  --rule: #d6e3ec;
  --wash: #e6eff5;
  --brand: #0097e0;
  --deep: #003f63;
  --link: #006fa8;
  --cool: #0097e0;
  --heat: #e8702a;
  --on-color: #ffffff;
  --room: #e8eef2;
  --room-cool: #d9eefa;
  --room-heat: #fbe6d6;
  --shadow: 0 22px 50px -20px rgba(14, 34, 48, .32), 0 2px 6px rgba(14, 34, 48, .06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang TC", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans TC", "Noto Sans JP", "Microsoft JhengHei UI", "Yu Gothic UI", "Meiryo", sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang TC", "Hiragino Sans", "Noto Sans TC", "Noto Sans JP", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1a24;
    --sheet: #142632;
    --ink: #e4eef5;
    --muted: #93abbc;
    --rule: #22394a;
    --wash: #1b3141;
    --brand: #36b4f0;
    --deep: #9fd9f7;
    --link: #6cc8f5;
    --cool: #36b4f0;
    --heat: #ff9a55;
    --on-color: #0d1a24;
    --room: #13222e;
    --room-cool: #0e2d42;
    --room-heat: #36220f;
    --shadow: 0 22px 50px -20px rgba(0, 0, 0, .65), 0 2px 6px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 720; text-wrap: balance; }
h3 { font-size: 18px; font-weight: 680; letter-spacing: -0.01em; }
p { margin: 0; }
:lang(zh-Hant-TW) h1, :lang(zh-Hant-TW) h2, :lang(ja) h1, :lang(ja) h2 { letter-spacing: 0; line-height: 1.3; }
/* Japanese has no spaces: break at phrase boundaries, not in the middle of a word (Chrome 119+; others ignore it) */
:lang(ja) :is(h1, h2, h3, p, dt, dd, small, span) { word-break: auto-phrase; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- Header ---------- */
.masthead { display: flex; align-items: center; gap: 12px 16px; padding-block: 18px; }
.wordmark { display: flex; white-space: nowrap; align-items: center; gap: 10px; margin-right: auto; color: inherit; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 17px; }
.wordmark img { width: 30px; height: 30px; }
.masthead > a:not(.wordmark, .tip) { color: var(--muted); text-decoration: none; font-size: 15px; }
.masthead > a:not(.wordmark, .tip):hover { color: var(--ink); }

.lang { position: relative; font-size: 15px; }
.lang summary {
  display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; white-space: nowrap;
  padding: 4px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); color: var(--ink);
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary svg { flex: none; }
.lang ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 150px;
  margin: 0; padding: 6px; list-style: none;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow);
}
.lang li a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.lang li a:hover { background: var(--wash); }
.lang li a[aria-current] { font-weight: 700; }

/* ---------- Hero: copy on the left, a room on the right whose air follows the chosen mode ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 500px); gap: 56px; align-items: center; padding-top: 40px; }
.hero-copy h1 { font-size: clamp(42px, 6vw, 70px); font-weight: 760; letter-spacing: -0.035em; line-height: 1.04; text-wrap: balance; }
:lang(zh-Hant-TW) .hero-copy h1, :lang(ja) .hero-copy h1 { font-size: clamp(32px, 4.6vw, 52px); letter-spacing: 0; line-height: 1.25; }
.hero-copy .lede { margin-top: 22px; font-size: 20px; color: var(--muted); max-width: 30em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 22px;
  border-radius: 12px; background: var(--ink); color: var(--paper);
  font-weight: 650; text-decoration: none;
}
.btn:hover { opacity: .9; }
.btn img { width: 22px; height: 22px; border-radius: 5px; }
.fine { margin-top: 18px; font-size: 14.5px; color: var(--muted); }

/* The room: a neutral wall, with cool and warm light layered on top. Auto shows both, cool fading into warm. */
.room {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; justify-items: center; gap: 4px;
  padding: 36px 32px 26px; border-radius: 28px; background: var(--room);
}
.room::before, .room::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .7s ease, -webkit-mask-position .7s ease, mask-position .7s ease; }
.room::before { background: var(--room-cool); }
.room::after {
  background: var(--room-heat);
  -webkit-mask: linear-gradient(100deg, transparent 0 40%, #000 60% 100%) 0 0 / 300% 100% no-repeat;
  mask: linear-gradient(100deg, transparent 0 40%, #000 60% 100%) 0 0 / 300% 100% no-repeat;
}
.room[data-mode="cool"]::before, .room[data-mode="auto"]::before { opacity: 1; }
.room[data-mode="heat"]::after { opacity: 1; -webkit-mask-position: 100% 0; mask-position: 100% 0; }
.room[data-mode="auto"]::after { opacity: 1; -webkit-mask-position: 50% 0; mask-position: 50% 0; }

.unit { width: 100%; max-width: 420px; height: auto; overflow: visible; }
.unit-body { fill: var(--sheet); stroke: var(--rule); stroke-width: 1.5; filter: drop-shadow(0 6px 10px rgba(14, 34, 48, .10)); }
.unit-vent { fill: var(--deep); opacity: .22; }
.unit-led { fill: var(--rule); transition: fill .4s; }
.air path { fill: none; stroke-width: 13; stroke-linecap: round; stroke: var(--cool); opacity: 0; transform-box: fill-box; transition: stroke .5s, opacity .4s; }
.room[data-mode="cool"] .unit-led { fill: var(--cool); }
.room[data-mode="heat"] .unit-led { fill: var(--heat); }
.room[data-mode="heat"] .air path { stroke: var(--heat); }
.room[data-mode="auto"] .unit-led { fill: var(--cool); }
.room[data-mode="auto"] .air path:nth-child(2) { stroke: var(--heat); }
.room:not([data-mode="off"]) .air path { animation: blow 2.6s ease-in-out infinite; }
.air path:nth-child(2) { animation-delay: .35s !important; }
.air path:nth-child(3) { animation-delay: .7s !important; }
@keyframes blow {
  0% { opacity: 0; transform: translateY(-8px); }
  35% { opacity: .95; }
  100% { opacity: 0; transform: translateY(12px); }
}

/* The Home app's climate tile, reduced to what the plugin provides */
.tile {
  width: 100%; max-width: 360px; margin-top: -8px; padding: 18px 18px 16px;
  border-radius: 22px; background: var(--sheet); box-shadow: var(--shadow);
}
.tile-head { display: flex; align-items: center; gap: 12px; }
.tile-icon {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--wash); color: var(--muted); transition: background .4s, color .4s;
}
.tile-icon svg { width: 22px; height: 22px; }
.room[data-mode="cool"] .tile-icon { background: var(--cool); color: var(--on-color); }
.room[data-mode="heat"] .tile-icon { background: var(--heat); color: var(--on-color); }
.room[data-mode="auto"] .tile-icon { background: linear-gradient(135deg, var(--cool) 30%, var(--heat) 70%); color: var(--on-color); }
.tile-name { flex: 1; min-width: 0; line-height: 1.3; }
.tile-name strong { display: block; font-weight: 650; }
.tile-name span { display: block; font-size: 14px; color: var(--muted); }
.tile-now { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.dial { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 16px; }
.target { font: 300 64px/1 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; transition: opacity .3s; }
.room[data-mode="off"] .target { opacity: .35; }
.step {
  display: grid; place-items: center; width: 46px; height: 46px; padding: 0 0 3px;
  border: 1px solid var(--rule); border-radius: 50%; background: var(--paper); color: var(--ink);
  font: 400 26px/1 var(--font); cursor: pointer;
}
.step:hover:not(:disabled) { border-color: var(--muted); }
.step:disabled { opacity: .35; cursor: default; }

.seg { display: flex; margin: 0; padding: 3px; border: 0; border-radius: 11px; background: var(--wash); }
.seg legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.seg label { position: relative; flex: 1; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 6px 4px; border-radius: 8px; text-align: center; font-size: 14px; color: var(--muted); white-space: nowrap; transition: background .2s, color .2s; }
.seg input:hover + span { color: var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
.seg input:checked + span { background: var(--sheet); color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgba(14, 34, 48, .14); }
.seg input[value="cool"]:checked + span { background: var(--cool); color: var(--on-color); }
.seg input[value="heat"]:checked + span { background: var(--heat); color: var(--on-color); }
.seg input[value="auto"]:checked + span { background: linear-gradient(100deg, var(--cool), var(--heat)); color: var(--on-color); }
.hint { margin-top: 14px; font-size: 14px; color: var(--muted); text-align: center; }

/* ---------- Sections ---------- */
section.band { padding-top: 112px; }
.intro { max-width: 40em; }
.intro p { margin-top: 16px; font-size: 19px; color: var(--muted); }
.intro p + p { margin-top: 12px; }

/* Local control: Home app, Homebridge and the unit, joined by what carries the traffic */
.flow { display: flex; align-items: flex-start; margin: 48px 0 0; padding: 0; list-style: none; }
.node { flex: 0 0 180px; display: grid; justify-items: center; gap: 2px; text-align: center; }
.node-icon {
  display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 10px;
  border-radius: 18px; background: var(--sheet); border: 1px solid var(--rule); color: var(--brand);
}
.node-icon svg { width: 28px; height: 28px; }
.node strong { font-weight: 650; }
.node small { font-size: 14px; color: var(--muted); line-height: 1.4; }
.link { flex: 1; position: relative; min-width: 80px; height: 60px; }
.link::before { content: ""; position: absolute; left: 4px; right: 4px; top: 30px; border-top: 2px dashed var(--brand); opacity: .55; }
.link span {
  position: absolute; left: 50%; top: 30px; transform: translate(-50%, -50%);
  padding: 2px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--rule);
  font-size: 13.5px; color: var(--muted); white-space: nowrap;
}

/* What you get: plain pairs under a rule, no boxes */
.feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 40px; margin: 44px 0 0; padding: 0; list-style: none; }
.feats li { padding-top: 16px; border-top: 1px solid var(--rule); }
.feats p { margin-top: 6px; color: var(--muted); font-size: 16px; }

/* Matter: the reason on the left, the migration (a real sequence, so numbered) on the right */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.chip {
  display: inline-block; vertical-align: 0.35em; margin-left: 4px; padding: 2px 10px;
  border: 1px solid var(--brand); border-radius: 999px; color: var(--link);
  font: 600 13px/1.4 var(--font); letter-spacing: 0;
}
.move { padding: 32px 34px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 18px; }
.move-p { margin-top: 8px; color: var(--muted); font-size: 16px; }
.moves { display: grid; gap: 18px; margin: 24px 0 0; padding: 0; list-style: none; counter-reset: move; }
.moves li { counter-increment: move; position: relative; padding-left: 44px; }
.moves li::before {
  content: counter(move); position: absolute; left: 0; top: -2px;
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: var(--on-color); font: 700 15px/1 var(--display);
}
.moves h3 { font-size: 16.5px; }
.moves p { margin-top: 4px; color: var(--muted); font-size: 15.5px; }
.back { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 15.5px; }

/* Supported adapters */
.devs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 44px 0 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: 18px; overflow: hidden; }
.devs div { padding: 24px 28px; }
.devs div:nth-child(n+3) { border-top: 1px solid var(--rule); }
.devs div:nth-child(even) { border-left: 1px solid var(--rule); }
.devs dt { font-weight: 680; }
.devs dd { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.cloud { margin-top: 20px; padding: 22px 28px; border: 1.5px dashed var(--rule); border-radius: 18px; }
.cloud h3 { font-size: 16.5px; }
.cloud p { margin-top: 6px; color: var(--muted); font-size: 15.5px; max-width: 60em; }

/* Getting started */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 40px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px;
  border-radius: 50%; border: 2px solid var(--ink); font: 700 18px/1 var(--display);
}
.steps p { margin-top: 6px; color: var(--muted); }
.steps + .fine { margin-top: 32px; }

/* ---------- Support ---------- */
.tip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 16px;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--sheet);
  color: var(--ink); font-weight: 600; text-decoration: none;
}
.tip:hover { border-color: var(--muted); }
.tip img { flex: none; width: 24px; height: 24px; margin-left: -4px; border-radius: 6px; }
.head-tip { min-height: 34px; padding: 4px 12px; font-size: 15px; }
.tipjar {
  display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 36px; align-items: center;
  padding: 40px 44px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 18px;
}
.tipjar > img { width: 120px; height: 120px; border-radius: 30px; }
.tipjar p { max-width: 38em; margin-top: 12px; color: var(--muted); font-size: 18px; }
.tipjar .actions { margin-top: 24px; }
.tipjar .fine { margin-top: 12px; font-size: 14.5px; }

/* ---------- Footer ---------- */
footer { margin-top: 120px; padding-block: 40px 56px; border-top: 1px solid var(--rule); font-size: 15px; color: var(--muted); }
.foot { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; }
.foot ul { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 12px 0 0; padding: 0; list-style: none; }
.foot .langs { justify-content: flex-end; }
.foot .langs a { color: var(--muted); text-decoration: none; }
.foot .langs a:hover, .foot .langs a[aria-current] { color: var(--ink); }
.tm { margin-top: 28px; font-size: 13.5px; }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 16px; }
  .room { padding: 28px 18px 20px; }
  .split, .foot { grid-template-columns: 1fr; }
  .feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr; }
  .tipjar { grid-template-columns: 1fr; gap: 20px; padding: 28px 24px; }
  .tipjar > img { width: 88px; height: 88px; border-radius: 22px; }
  .foot .langs { justify-content: flex-start; }
  section.band { padding-top: 84px; }
  .flow { flex-direction: column; align-items: flex-start; }
  .node { flex: none; grid-template-columns: 60px auto; grid-template-rows: auto auto; justify-items: start; column-gap: 16px; text-align: left; }
  .node-icon { grid-row: span 2; margin: 0; }
  .node strong { align-self: end; }
  .node small { align-self: start; }
  .link { flex: none; width: 60px; height: 64px; min-width: 0; }
  .link::before { left: 29px; right: auto; top: 4px; bottom: 4px; border-top: 0; border-left: 2px dashed var(--brand); }
  .link span { left: 76px; top: 32px; transform: translateY(-50%); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .feats, .devs { grid-template-columns: 1fr; }
  .devs div:nth-child(n+2) { border-top: 1px solid var(--rule); }
  .devs div:nth-child(even) { border-left: 0; }
  .move { padding: 24px 22px; }
  .masthead > a:not(.wordmark, .head-tip) { display: none; }
  .wordmark { font-size: 15px; }
  .head-tip span { display: none; }
  .head-tip { padding: 4px 8px; }
  .head-tip img { margin: 0; }
  .target { font-size: 56px; }
}
@media (max-width: 400px) {
  .lang summary span { display: none; }
  .lang summary { padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .room:not([data-mode="off"]) .air path { opacity: .95; }
  .room:not([data-mode="off"]) .air path:nth-child(2) { opacity: .7; }
  .room:not([data-mode="off"]) .air path:nth-child(3) { opacity: .45; }
}
