/* Parts shared by every page of meiroku.com (2026-11-15), with site-shared.js.
   1. copy buttons (D5)   2. the logo menu (D3)
   Colours follow the surface the part sits on (currentColor), so the same part works on the paper of the policies,
   on the white of the EC page and on the night of the portfolio. */

/* 0. Focus rings for keyboard users only (owner 2026-11-16: 「フォーカスの線がデザイン壊す」; site-shared.js sets
   <html data-input>). After a tap or a click nothing focused draws a ring, Web Awesome's parts included (their rings are
   var(--wa-focus-ring)); the form fields keep their own focus look (border and fill). Elements only scripts focus
   (headings, panels, dialogs, popovers: tabindex="-1") never draw one. !important: the rings are set in many files,
   some loaded after this one, with stronger selectors. Keyboard rings stay as each part defines them. */
html[data-input="pointer"] {
  --wa-focus-ring: none;
}
html[data-input="pointer"] :focus {
  outline: none !important;
}
[tabindex="-1"]:focus,
dialog:focus,
[popover]:focus {
  outline: none !important;
}

/* 1. Copy buttons: the button's own words turn into 「コピーしました」. Both labels share one grid cell, so the
   button keeps its width; the first label stays in the accessible name and the change is announced by site-shared.js
   (Modern Web Guidance: copy-button). */
.copy-button {
  display: inline-grid;
  place-items: center;
  block-size: auto;
  min-block-size: 30px;
  min-inline-size: 24px;
  margin: 0;
  padding: 0 0.95em;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font:
    500 12px/1 "Hiragino Sans",
    "Hiragino Kaku Gothic ProN",
    "Noto Sans JP",
    sans-serif;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: 0.08em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.copy-button > span {
  grid-area: 1 / 1;
  transition: opacity 0.2s ease;
}
.copy-button .copy-done {
  opacity: 0;
}
.copy-button:is([data-copied], [data-failed]) .copy-idle {
  opacity: 0;
}
.copy-button:is([data-copied], [data-failed]) .copy-done {
  opacity: 1;
}
.copy-button[data-copied] {
  border-color: currentColor;
}
@media (hover: hover) {
  .copy-button:hover {
    background: color-mix(in srgb, currentColor 8%, transparent);
  }
}
.copy-button:active {
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.copy-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
@media print {
  .copy-button {
    display: none;
  }
}

/* 2. The logo menu: a small frosted card at the pointer, in the colours of the site's header */
.logo-menu {
  position: fixed;
  z-index: 1000;
  min-inline-size: 236px;
  padding: 6px;
  border: 1px solid #ffffffb3;
  border-radius: 16px;
  color: #1d2b2f;
  background: linear-gradient(140deg, #f8faf6f0, #eef2ecdf);
  -webkit-backdrop-filter: blur(24px) saturate(1.1);
  backdrop-filter: blur(24px) saturate(1.1);
  box-shadow:
    0 18px 50px #0a1d2a33,
    0 2px 6px #0a1d2a14;
  font:
    13px/1.4 "Hiragino Sans",
    "Hiragino Kaku Gothic ProN",
    "Noto Sans JP",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
.logo-menu[hidden] {
  display: none;
}
.logo-menu:focus {
  outline: none;
}
.logo-menu-title {
  margin: 4px 10px 6px;
  color: #5b6a6a;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.logo-menu [role="menuitem"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  inline-size: 100%;
  min-block-size: 36px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.logo-menu .tag {
  color: #6a7777;
  font-size: 10px;
  letter-spacing: 0.06em;
}
.logo-menu [role="menuitem"]:focus {
  outline: none;
  background: #213b3b14;
}
.logo-menu [role="menuitem"]:focus-visible {
  outline: 2px solid #213b3b;
  outline-offset: -2px;
}
.logo-menu hr {
  margin: 5px 8px;
  border: 0;
  border-top: 1px solid #213b3b1f;
}
.logo-menu-note {
  margin: 6px 10px 4px;
  color: #6a7777;
  font-size: 10.5px;
}
@media (prefers-reduced-transparency: reduce) {
  .logo-menu {
    background: #f7f8f5;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .logo-menu {
    border-color: CanvasText;
  }
}

/* 3. Photographs come out of their own colours (S10). [data-ph] carries a 24px blurred copy of its photograph
   (--ph, written into the page), drawn under the photograph: while it travels, the colours are already there, and
   if it never arrives, the colours stay and no broken-image mark shows. Photographs that load later (lazy) clear
   up from it (site-shared.js); the first view is not delayed. */
[data-ph] {
  background-image: var(--ph);
  background-size: cover;
  background-position: var(--ph-at, var(--focus, 50% 50%));
  background-repeat: no-repeat;
}
[data-ph] img.ph-wait,
[data-ph] img.ph-fail {
  opacity: 0;
}
[data-ph] img.ph-in {
  opacity: 1;
  transition: opacity 0.4s ease;
}
@media (prefers-reduced-motion: reduce) {
  [data-ph] img.ph-in {
    transition: none;
  }
}

/* Language switch (2026-11-16; the owner chose ④ 「フロストの二択」 from the 8 options). Both languages side by side,
   the current one filled. Made like the EC pages' floating ECサイト／AIクリエイティブ switch (ec-shared.css,
   nav.page-switch): a 3px track, a pill (the thumb) behind the current word, one size smaller (28px items, the tap
   area stretched to 44px) because it sits beside 相談する／お問い合わせ. On a light header the pill is black; over a
   photograph (the Top, the policy covers) the track is frosted and the pill white. Plain links between the page and
   its twin (hreflang, lang); the current one carries aria-current, so it is not shown by colour alone. Under 480px
   the words shorten to JA / EN on screen; screen readers still hear 日本語 and English.
   Owner, 11/16: 「ヌルッと滑らかで、早い切り替え、ここの高級感あるUXにこだわって」; 11/17: 「だいぶカクツク　もっと高速かつ
   ニュルっと滑らかに」. The pill sets off the moment it is pressed (site-shared.js), its front edge first and the back
   edge following, so it stretches a little on the way, while the other page loads; then the page cross-fades in a
   quarter second (below). The other language opens where the reader is, with its header as it was; the Top keeps its
   landscape and skips its first-load way in (site-shared.js, the inline script in each head, the stage's on the Top). */
.lang-switch {
  position: relative;
  isolation: isolate;
  display: inline-grid;
  grid-template-columns: auto auto;
  column-gap: 2px;
  flex: none;
  padding: 3px;
  border-radius: 999px;
  background: rgba(20, 21, 21, 0.06);
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui,
    sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}
.lang-switch-thumb {
  grid-row: 1;
  grid-column: 1;
  z-index: 0;
  border-radius: 999px;
  background: #141515;
}
.lang-switch[data-current="en"] .lang-switch-thumb {
  grid-column: 2;
}
/* while it slides it leaves its cell and is drawn between two edges (site-shared.js moves them); stronger than the
   English page's cell (data-current="en", grid-column 2), which otherwise held it inside the EN cell and squeezed it
   to a sliver on the way to 日本語 (owner 2026-11-17: 「EN→JAの切り替えはだいぶいびつ」) */
.lang-switch[data-going] .lang-switch-thumb.is-sliding {
  position: absolute;
  grid-area: auto;
  inset-block: 3px;
}
.lang-switch a {
  position: relative;
  z-index: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  color: rgba(29, 35, 40, 0.62);
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.lang-switch a:first-of-type {
  grid-column: 1;
}
.lang-switch a:last-of-type {
  grid-column: 2;
}
.lang-switch a::after {
  content: "";
  position: absolute;
  inset: -8px -1px;
}
.lang-switch a[aria-current="page"] {
  color: #fff;
}
.lang-switch a:not([aria-current]):active {
  background: rgba(20, 21, 21, 0.08);
  color: #141515;
}
@media (hover: hover) {
  .lang-switch a:not([aria-current]):hover {
    background: rgba(20, 21, 21, 0.06);
    color: #141515;
  }
}
.lang-switch a:focus-visible {
  outline: 2px solid #556274;
  outline-offset: 1px;
}
.lang-switch .lang-code {
  display: none;
}
.lang-switch.on-photo {
  background: linear-gradient(115deg, #ffffff40, #ffffff1f 52%, #ffffff36);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
}
.lang-switch.on-photo .lang-switch-thumb {
  background: #fff;
}
.lang-switch.on-photo a {
  color: rgba(255, 255, 255, 0.88);
}
.lang-switch.on-photo a[aria-current="page"] {
  color: #141515;
}
.lang-switch.on-photo a:not([aria-current]):active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
@media (hover: hover) {
  .lang-switch.on-photo a:not([aria-current]):hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
  }
}
.lang-switch.on-photo a:focus-visible {
  outline-color: #fff;
}
/* On the way to the other language (data-going, site-shared.js) the two words trade colours as the pill passes */
.lang-switch[data-going] a[aria-current="page"] {
  color: rgba(29, 35, 40, 0.62);
}
.lang-switch[data-going="ja"] a[hreflang="ja"],
.lang-switch[data-going="en"] a[hreflang="en"] {
  color: #fff;
}
.lang-switch.on-photo[data-going] a[aria-current="page"] {
  color: rgba(255, 255, 255, 0.88);
}
.lang-switch.on-photo[data-going="ja"] a[hreflang="ja"],
.lang-switch.on-photo[data-going="en"] a[hreflang="en"] {
  color: #141515;
}
@media (max-width: 479px) {
  .lang-switch .lang-full {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .lang-switch .lang-code {
    display: inline;
  }
  .lang-switch a {
    padding: 0 9px;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .lang-switch.on-photo {
    background: rgba(20, 21, 21, 0.55);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .lang-switch-thumb {
    background: Highlight;
  }
  .lang-switch a[aria-current="page"] {
    color: HighlightText;
  }
  .lang-switch[data-going] a[aria-current="page"] {
    color: CanvasText;
  }
  .lang-switch[data-going="ja"] a[hreflang="ja"],
  .lang-switch[data-going="en"] a[hreflang="en"] {
    color: HighlightText;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lang-switch a {
    transition: none;
  }
}
/* Going to the other language. Every page opts in to cross-document view transitions (Modern Web Guidance:
   cross-document-transitions, with less motion opted out); site-shared.js and the inline pagereveal script in each
   head let only the language switch (and, as before, the EC pages' own ECサイト／AIクリエイティブ moves) through.
   The language switch is one quick cross-fade of the whole page, nothing in the header moving on its own: Safari drew
   the parts that moved by themselves inside the frosted header as nothing for a moment (the switch's words and track
   gone, 相談する faint), which read as a judder (owner 2026-11-17: 「だいぶカクツク」). The pill has already slid on the
   page being left, so the two pages meet with it in the same place. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
  html:active-view-transition-type(lang)::view-transition-old(root),
  html:active-view-transition-type(lang)::view-transition-new(root) {
    animation-duration: 0.26s;
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
  }
}
