@import url("/widgets/lang.css");
@import url("/widgets/install.css");
/* The home page: a grid of picture tiles, newest first (build_index.py writes
   the tiles, widgets/home.js the search, sort and group controls). ?tv is the
   TV layout: big pictures and short titles, controls and cursor hidden. */
:root {
  color-scheme: light dark;
  --bg: #f6f3ee; --fg: #1d1b18; --muted: #5d5850; --card: #ffffff; --line: #ddd6cb;
  --accent: #1f6f78; --accent-fg: #ffffff; --ctl: #3f3a33;
  --text: var(--fg); --rule: var(--line); --tile: var(--line);   /* the names widgets/lang.css uses */
  --radius: 14px; --gutter: 16px;
  --step--1: clamp(0.8rem, 0.8rem + 0.2vw, 1rem);
  --step-0: clamp(1rem, 0.94rem + 0.3vw, 1.2rem);
  --step-1: clamp(1.2rem, 1.08rem + 0.6vw, 1.6rem);
  --step-2: clamp(1.5rem, 1.25rem + 1.2vw, 2.4rem);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #15171a; --fg: #ece8e1; --muted: #a7a196; --card: #1f2226; --line: #33373d;
    --accent: #5fb7c0; --accent-fg: #0d1214; --ctl: #3a3631; }
}
html.tv { cursor: none; --gutter: 28px; --step--1: 26px; --step-0: 28px; --step-1: 36px; --step-2: 48px; }
html.tv .detail { display: none; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  padding: max(var(--gutter), env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right))
           max(var(--gutter), env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  background: var(--bg); color: var(--fg); font: var(--step-0)/1.4 var(--font);
}
a { color: var(--accent); }
:focus-visible { outline: 4px solid var(--accent); outline-offset: 3px; }
html.tv :focus { outline: 6px solid var(--accent); outline-offset: 4px; }
main.home { max-width: 760px; margin: 0 auto; }

/* header: photo, name, tagline and links */
.who { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding-right: 5.5rem; }
.who img { width: 64px; height: 64px; border-radius: 50%; flex: none; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.who .txt { flex: 1; min-width: 0; }
.who h1 { font-size: var(--step-2); line-height: 1.15; margin: 0 0 2px; }
.who p { margin: 0; color: var(--muted); font-size: var(--step--1); }

/* controls: a picture plus one word; the full sentence is the aria-label */
.btn { display: inline-flex; align-items: center; gap: 0.45em; min-height: 44px; padding: 0.45em 0.9em;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-fg);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; }
.acts:not(:has(.btn:not([hidden]))) { display: none; }
.acts .now { color: var(--muted); font-size: var(--step--1); }
html.tv .acts { display: none; }
.find { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding: 2px 0 10px; display: flex; gap: 8px; }
.find input { flex: 1; min-width: 0; font: 16px var(--font); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); }
.find button { font: 600 15px var(--font); border: 0; border-radius: 10px; padding: 0 14px; background: var(--ctl); color: #fff; cursor: pointer; }
.filtering { color: var(--muted); font-size: var(--step--1); margin: 0 0 14px; }

/* the grid of picture tiles */
.g { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 18px 12px; }
.g a, .g button.t { min-width: 0; overflow-wrap: anywhere; display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-decoration: none; color: var(--fg); text-align: center; font: 12px/1.3 var(--font); background: none; border: 0; padding: 0; cursor: pointer; }
.g img, .g .ic { width: 64px; height: 64px; border-radius: 15px; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.g .ic { display: flex; align-items: center; justify-content: center; background: var(--ctl); color: #fff; font: 600 30px var(--font); }
.g .ic svg { width: 30px; height: 30px; }
.g button.t.on .ic { background: var(--accent); color: var(--bg); }
.g .w { color: var(--muted); font-size: 12px; white-space: nowrap; }
.g .tvt { display: none; }
h2.grp { font: 600 13px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
/* a laptop or monitor: the same grid, a size up */
@media (min-width: 900px) {
  main.home { max-width: 1000px; }
  .g { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 26px 16px; }
  .g img, .g .ic { width: 88px; height: 88px; border-radius: 20px; }
  .g .ic { font-size: 40px; } .g .ic svg { width: 40px; height: 40px; }
  .g a, .g button.t { font-size: 17px; } .g .w { font-size: 16px; }
}
@media (min-width: 1300px) { main.home { max-width: 1240px; } }
@media (min-width: 1300px) and (min-height: 1000px) {
  .who img { width: 84px; height: 84px; }
  .g { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 32px 20px; }
  .g img, .g .ic { width: 112px; height: 112px; border-radius: 26px; }
  .g .ic svg { width: 48px; height: 48px; } .g .ic { font-size: 48px; }
  .g a, .g button.t { font-size: 19px; } .g .w { font-size: 16px; }
}
/* the TVs: pictures and short titles only, big */
html.tv main.home { max-width: none; }
html.tv .who { margin-bottom: 3vh; }
html.tv .who img { width: 11vh; height: 11vh; }
html.tv .who h1 { font-size: max(40px, 6vh); margin: 0; }
html.tv .g { grid-template-columns: repeat(7, 1fr); gap: 3vh 2vw; }
html.tv .g img { width: 16vh; height: 16vh; border-radius: 3.6vh; }
html.tv .g a { font-size: max(26px, 3.4vh); line-height: 1.1; gap: 1vh; overflow-wrap: normal; }
html.tv .g .tit { display: none; } html.tv .g .tvt { display: inline; }
html.tv .g .w, html.tv .g button.t, html.tv .lang-switch, html.tv .follow-box { display: none; }

/* follow by email (widgets/follow.js), at the bottom and for dydo.co/follow */
.follow-box { margin: 2.5rem 0 1rem; padding: 1.2rem 1.3rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); font-size: 1rem; }
.follow-box h2 { font-size: 1.1rem; margin: 0 0 .3rem; }
.follow-box p { margin: 0 0 .9rem; color: var(--muted); }
.signup { display: flex; gap: .5rem; flex-wrap: wrap; }
.signup input { flex: 1 1 12rem; min-width: 0; font: 16px var(--font); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.signup button { font: 600 15px var(--font); border: 0; border-radius: 10px; padding: 10px 16px; background: var(--accent); color: var(--accent-fg); cursor: pointer; }

/* dialogs: the install box (widgets/install.css) and, off for now, Updates */
dialog.guide .said { color: var(--muted); font-size: var(--step--1); }
.choices { display: grid; gap: 8px; margin: 0 0 12px; }
.choices button { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.choices button[aria-pressed="true"] { border-color: var(--accent); outline: 2px solid var(--accent); }
.choices .pic { font-size: 1.6em; line-height: 1; }
.choices small { display: block; color: var(--muted); font-size: var(--step--1); }
/* Japanese titles break between phrases, not mid-word (Chrome; others ignore it) */
html:lang(ja) .g .tit, html:lang(ja) .g .tvt { word-break: auto-phrase; }
