/* One button system for the whole site. Two kinds share one hover:
   - solid: the lime calls to action (page choices, the way back to the office);
   - outline: controls (theme, language, office light, motion, print choices,
     the easter-egg return).
   Hover and keyboard focus draw a thin ring with a soft glow and one light
   sweep across the face. Paused or reduced motion keeps the ring, not the sweep.
   The period browsers and the dial-up screen keep their own era chrome. */

:root,
:root[data-theme="dark"] {
  --btn-solid-bg: var(--lime);
  --btn-solid-fg: #121413;
  --btn-bg: #18221bd9;
  --btn-fg: #e6e9de;
  --btn-border: #4b5945;
  --btn-active-bg: var(--lime);
  --btn-active-fg: #121413;
  --btn-ring: var(--lime);
  --btn-glow: #d5ef7880;
  --btn-sweep: #ffffffa6;
}
:root[data-theme="light"] {
  --btn-bg: #f6f3eae6;
  --btn-fg: #1c251b;
  --btn-border: #b9c2a8;
  /* A lime ring vanishes on paper; charcoal with a deeper lime glow reads. */
  --btn-ring: #1c251b;
  --btn-glow: #7d9c2366;
  --btn-sweep: #ffffffcc;
}

/* The print balloon is part of the scene and stays light in both themes,
   so its choices always use the light set. */
.print-choices {
  --btn-bg: #f6f3eae6;
  --btn-fg: #1c251b;
  --btn-border: #b9c2a8;
  --btn-ring: #1c251b;
  --btn-glow: #7d9c2366;
  --btn-sweep: #ffffffcc;
}

/* ---- Solid ------------------------------------------------------------- */
:is(.page-choices button, #back-office, [data-snapshot-id="back-office"]) {
  border: 0;
  border-radius: 3px;
  background: var(--btn-solid-bg);
  color: var(--btn-solid-fg);
  box-shadow: 0 5px 18px #12141333;
  font-family: inherit;
  font-weight: 700;
  line-height: 1.25;
}
:is(#back-office, [data-snapshot-id="back-office"]) {
  min-height: 54px;
  padding: 12px 28px;
  font-size: 18px;
}

/* ---- Outline ----------------------------------------------------------- */
:is(
    .theme-toggle,
    .office-light,
    .office-playground .office-stage .scene-foot .motion-button,
    .print-choices button,
    .easter-egg-return,
    .language-switch
  ) {
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
}
.language-switch button {
  color: var(--btn-fg);
}
/* On: paused motion, the chosen language. */
.office-playground .office-stage .scene-foot .motion-button[aria-pressed="true"],
.language-switch button[aria-pressed="true"] {
  background: var(--btn-active-bg);
  border-color: var(--btn-active-bg);
  color: var(--btn-active-fg);
}
.language-switch button[aria-pressed="true"] {
  background: none;
}

/* ---- Shared hover ------------------------------------------------------ */
/* The sweep needs a positioned button. The easter-egg return is already
   absolutely placed at the bottom of its scene, so it keeps that. */
:is(
    .page-choices button,
    #back-office,
    .theme-toggle,
    .office-light,
    .office-playground .office-stage .scene-foot .motion-button,
    .print-choices button,
    .language-switch
  ) {
  position: relative;
}
:is(
    .page-choices button,
    #back-office,
    .theme-toggle,
    .office-light,
    .office-playground .office-stage .scene-foot .motion-button,
    .print-choices button,
    .easter-egg-return,
    .language-switch
  ) {
  overflow: hidden;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    scale 0.18s ease,
    box-shadow 0.2s ease;
}
:is(
    .page-choices button,
    #back-office,
    .theme-toggle,
    .office-light,
    .office-playground .office-stage .scene-foot .motion-button,
    .print-choices button,
    .easter-egg-return,
    .language-switch
  )::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(105deg, transparent 35%, var(--btn-sweep) 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}
:is(
    .page-choices button,
    #back-office,
    .theme-toggle,
    .office-light,
    .office-playground .office-stage .scene-foot .motion-button,
    .print-choices button,
    .easter-egg-return
  ):is(:hover, :focus-visible),
.language-switch:is(:hover, :focus-within) {
  box-shadow:
    0 0 0 1px var(--bg),
    0 0 0 2.5px var(--btn-ring),
    0 0 20px var(--btn-glow);
  outline: none;
}
:is(
    .page-choices button,
    #back-office,
    .theme-toggle,
    .office-light,
    .office-playground .office-stage .scene-foot .motion-button,
    .print-choices button,
    .easter-egg-return
  ):is(:hover, :focus-visible)::after,
.language-switch:is(:hover, :focus-within)::after {
  transform: translateX(120%);
  transition: transform 0.6s ease;
}
/* Outline controls fill with lime on hover, like the solid ones. */
:is(
    .theme-toggle,
    .office-light,
    .office-playground .office-stage .scene-foot .motion-button,
    .print-choices button,
    .easter-egg-return
  ):is(:hover, :focus-visible) {
  background: var(--btn-solid-bg);
  border-color: var(--btn-solid-bg);
  color: var(--btn-solid-fg);
}
.office-light:is(:hover, :focus-visible) .scene-weather {
  color: var(--btn-solid-fg);
}
:is(.page-choices button, #back-office):is(:hover, :focus-visible) {
  background: #e3ffa0;
}
.language-switch button[aria-pressed="false"]:is(:hover, :focus-visible) {
  color: var(--text);
  outline: none;
}

.motion-paused :is(
    .page-choices button,
    #back-office,
    .theme-toggle,
    .office-light,
    .office-playground .office-stage .scene-foot .motion-button,
    .print-choices button,
    .easter-egg-return,
    .language-switch
  )::after {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  :is(
      .page-choices button,
      #back-office,
      .theme-toggle,
      .office-light,
      .office-playground .office-stage .scene-foot .motion-button,
      .print-choices button,
      .easter-egg-return,
      .language-switch
    )::after {
    display: none;
  }
}
