/* ha.boreale.dev (site/README.md): what is this site's own, over boreale-site's
   page chrome (chrome.css, chrome.js: the tokens, the header and its sky, the
   buttons, the sections' rhythm, the cards, the footer; boreale.css before
   it has the brand's colours and fonts, the language menu and the menu of
   Boréale's sites). Here: the wordmark's gradient, the hero and the
   Home Assistant dashboard drawn beside it, the install steps, the promise
   and the other pages (the legal notice, the page not found). */

/* A long word (German's, Russian's) hyphenated where the browser can, else
   broken rather than wider than a phone. */
h1, h2, h3 { hyphens: auto; overflow-wrap: break-word; }
code { overflow-wrap: anywhere; font: 0.875em var(--mono); background: rgb(232 238 247 / 0.07); border: 1px solid rgb(232 238 247 / 0.08); padding: 0.1em 0.38em; border-radius: 6px; }

/* The header's name: Boréale <b>for HA</b>, the end of it in the aurora's gradient. */
.brand { white-space: nowrap; }
.brand b { font-weight: 600; background: var(--aurora-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Line breaks as each script wants them (chrome.css has the rest): Japanese
   between phrases, never inside a word (headings and short lines; a phrase
   wider than a phone may then break anywhere). */
:lang(ja) :is(h1, h2, h3, .eyebrow, .lede, .section-head p, .button, .card p, .steps p, .band p, .promise p, .lost p, .tile-label) { word-break: auto-phrase; overflow-wrap: anywhere; }

/* ---- The home page's hero: the text, and what the integration gives
   beside it (under it on a phone). Its sides are the header's edge
   (chrome.css). */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center;
  padding-top: clamp(32px, 6vw, 80px); padding-bottom: clamp(48px, 7vw, 88px);
}
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); letter-spacing: -0.035em; line-height: 1.08; margin: 0 0 18px; }
.hero h1 em { font-style: normal; background: var(--aurora-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { margin: 0; color: var(--mist); font-size: clamp(1.0625rem, 1.6vw, 1.15rem); max-width: 54ch; }

/* A console's card on a Home Assistant dashboard, drawn: tiles on the
   night, the time left in a ring of aurora, extra time in chips, the week
   in bars. Pictures only (role="img", its label says what it shows). */
.panel {
  position: relative; isolation: isolate; padding: 16px; border-radius: 22px;
  background: linear-gradient(160deg, #15264a 0%, #0f1b35 55%, #0b1529 100%);
  box-shadow: inset 0 1px 0 rgb(232 238 247 / 0.12), 0 0 0 1px #22324f,
              0 50px 90px -40px rgb(0 0 0 / 0.9), 0 0 140px -40px rgb(51 187 255 / 0.4);
}
.panel::after {
  content: ""; position: absolute; z-index: -1; left: 10%; right: 10%; bottom: -12%; height: 30%;
  background: radial-gradient(closest-side, rgb(51 187 255 / 0.36), rgb(138 92 255 / 0.16) 60%, transparent); filter: blur(28px);
}
.panel-bar { display: flex; align-items: center; gap: 10px; padding: 2px 4px 14px; }
.panel-bar img { width: 24px; height: 24px; border-radius: 6px; }
.panel-title { font: 600 16px var(--display); letter-spacing: -0.01em; }
.panel-online { margin-left: auto; width: 10px; height: 10px; border-radius: 50%; background: var(--aurora); box-shadow: 0 0 0 4px rgb(0 255 204 / 0.15), 0 0 14px rgb(0 255 204 / 0.7); }
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; padding: 14px 16px;
  border-radius: 14px; background: rgb(11 20 36 / 0.65); border: 1px solid rgb(34 50 79 / 0.9);
}
.tile-wide { grid-column: 1 / -1; }
.tile-label { color: var(--mist); font-size: 13.5px; line-height: 1.3; }
.tile strong { font: 600 22px/1.15 var(--display); letter-spacing: -0.02em; color: var(--snow); }
.tile-sub { color: var(--dusk); font-size: 13px; }
/* The time left: a ring of aurora, what is played of the day's limit. */
.tile-ring { position: relative; align-items: center; padding: 12px; }
.ring { display: block; width: min(100%, 132px); height: auto; }
.ring circle { fill: none; stroke-width: 10; }
.ring-track { stroke: rgb(232 238 247 / 0.08); }
.ring-value { stroke: url(#ring-colour); stroke-linecap: round; filter: drop-shadow(0 0 6px rgb(0 255 204 / 0.45)); }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
.ring-text strong { font-size: 20px; }
.ring-text span { color: var(--mist); font-size: 12px; max-width: 11ch; line-height: 1.25; }
.meter { display: block; height: 6px; margin: 8px 0 4px; border-radius: 3px; background: rgb(232 238 247 / 0.08); overflow: hidden; }
.meter span { display: block; width: 79%; height: 100%; border-radius: inherit; background: var(--aurora-grad); }
/* The game being played: its cover, made up, and who plays it. */
.tile-game { flex-direction: row; align-items: center; gap: 14px; }
.game-art {
  flex: none; width: 44px; height: 44px; border-radius: 10px;
  background: radial-gradient(circle at 70% 30%, #ffe08a 0 12%, transparent 13%),
              radial-gradient(120% 90% at 20% 110%, #2f9e6f 0 45%, transparent 46%),
              linear-gradient(160deg, #3b2a7a, #1b4d8c);
  box-shadow: inset 0 0 0 1px rgb(232 238 247 / 0.15);
}
.tile-text { display: grid; gap: 2px; min-width: 0; }
.tile-text strong { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who { margin-left: auto; padding: 3px 10px; border-radius: 999px; font: 500 12px var(--mono); color: var(--ice); border: 1px solid rgb(51 187 255 / 0.4); background: rgb(51 187 255 / 0.08); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chips span {
  flex: 1 1 0; min-width: max-content; padding: 8px 10px; border-radius: 10px; text-align: center;
  font: 600 14px var(--body); color: var(--snow); background: rgb(51 187 255 / 0.1); border: 1px solid rgb(51 187 255 / 0.35);
}
.chips span:first-child { color: var(--abyss); background: var(--aurora-grad); border-color: transparent; }
.tile-icon { width: 22px; height: 22px; fill: rgb(138 92 255 / 0.25); stroke: #b39dff; stroke-width: 1.8; stroke-linejoin: round; }
.tile-week { justify-content: space-between; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 46px; margin-top: 8px; }
.bars i { flex: 1; border-radius: 4px 4px 2px 2px; background: linear-gradient(to top, rgb(51 187 255 / 0.35), rgb(51 187 255 / 0.8)); }
.bars i:nth-child(1) { height: 40%; }
.bars i:nth-child(2) { height: 72%; }
.bars i:nth-child(3) { height: 30%; }
.bars i:nth-child(4) { height: 58%; }
.bars i:nth-child(5) { height: 88%; }
.bars i:nth-child(6) { height: 100%; }
.bars i:nth-child(7) { height: 64%; background: var(--aurora-grad); }

/* ---- The features' cards (chrome.css has the card). In a row, the icons,
   titles and texts start at the same height, where the browser has subgrid.
   Four cards: four in a row on a wide screen, two and two below, one under
   the other on a phone. */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 861px) {
    .cards > .card { grid-row: span 3; grid-template-rows: subgrid; row-gap: 10px; }
  }
}
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 601px) and (max-width: 1099px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- The install: its text beside the steps, the buttons under them (the
   first step's "the button below"). */
.columns { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 0 56px; align-items: start; }
.columns .actions { margin-top: 32px; padding-left: 50px; }
/* Numbered steps, each number in the aurora's gradient, joined by a line. */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 22px; }
.steps > li { counter-increment: step; position: relative; padding-left: 50px; min-width: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font: 600 14px var(--display); color: var(--abyss); background: var(--aurora-grad);
  box-shadow: 0 0 0 4px rgb(0 255 204 / 0.1), 0 0 20px -2px rgb(0 255 204 / 0.5);
}
.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 15px; top: 38px; bottom: -18px; width: 2px; border-radius: 2px;
  background: linear-gradient(to bottom, rgb(0 255 204 / 0.5), rgb(138 92 255 / 0.25));
}
.steps h3 { margin: 0 0 4px; font-size: 18px; }
.steps p { margin: 0; color: var(--mist); }
.steps em { font-style: normal; color: var(--snow); }

/* The move from the PlayGuard integration: its button keeps its size. */
.band .button { flex: none; }

/* Free, local, without an account: the last word, before the footer. */
.promise { display: flex; align-items: flex-start; gap: 18px; padding: clamp(22px, 4vw, 32px); border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgb(14 26 51 / 0.7), rgb(14 26 51 / 0.2)); }
.promise .icon {
  flex: none; display: block; box-sizing: border-box; width: 44px; height: 44px; padding: 10px; border-radius: 12px;
  fill: none; stroke: var(--aurora); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  background: linear-gradient(135deg, rgb(0 255 204 / 0.16), rgb(138 92 255 / 0.14)); box-shadow: inset 0 0 0 1px rgb(0 255 204 / 0.22);
}
.promise h2 { font-size: clamp(1.375rem, 3vw, 1.75rem); margin: 0 0 8px; }
.promise p { margin: 0; color: var(--mist); max-width: 70ch; }

/* ---- The other pages: the legal notice, one column of readable lines;
   the page not found under the sky. */
.prose { padding-top: clamp(40px, 7vw, 80px); padding-bottom: 0; }
.prose > * { max-width: 68ch; }
.prose h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.03em; margin: 0; }
.prose .lede { color: var(--mist); font-size: 1.125rem; margin: 14px 0 0; }
.prose .translation { font-size: 0.9375rem; margin: 10px 0 0; }
.prose section { padding-top: 36px; }
.prose h2 { font-size: 1.5rem; margin: 0 0 12px; }
.prose p, .prose dd { color: var(--mist); }
.prose dl { margin: 0; display: grid; gap: 4px; }
.prose dt { font-weight: 600; margin-top: 10px; }
.prose dd { margin: 0; }
.lost { padding-top: clamp(56px, 10vw, 120px); padding-bottom: 48px; }
.lost h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); letter-spacing: -0.03em; margin: 0 0 14px; }
.lost p { color: var(--mist); max-width: 50ch; margin: 0 0 24px; }

/* ---- Narrower screens. */
@media (max-width: 860px) {
  /* The hero: the text, then the dashboard, the buttons a finger's width. */
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 24px; padding-bottom: 48px; }
  .actions .button { flex: 1 1 100%; }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .columns .actions { padding-left: 0; }
}
@media (max-width: 600px) {
  .panel { padding: 12px; border-radius: 18px; }
  .panel-grid { gap: 8px; }
  .tile { padding: 12px; }
  .tile strong { font-size: 19px; }
  .promise { flex-direction: column; }
}
@media print {
  .panel { display: none !important; }
}
