/* Shared components (icon chips, buttons) and the floating controls: logo, day/night switch and filter tabs. */

/* ---- Shared components: icon chips and buttons ---- */
.icon-chip:focus-visible {
  box-shadow:
    0 0 0 3px #ffffff,
    0 0 0 6px var(--ink),
    0 10px 34px 2px rgb(30 27 43/0.08);
}
.icon-chip svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.tick-anim path {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  animation: tickDraw 0.42s var(--ease-smooth) 0.05s forwards;
}
@media (prefers-reduced-motion: reduce) {
  .tick-anim path {
    animation: none;
    stroke-dashoffset: 0;
  }
}
/* about dialog: recent work as a quiet list, icon buttons */
.btn {
  gap: 8px;
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font: 500 13px var(--body);
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--line);
  text-decoration: none;
  transition:
    transform 0.2s ease,
    background-color 0.2s;
  font-size: 14px;
  font-weight: 500;
}
.btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent-text);
}
.icon-chip.copied {
  opacity: 1;
  transform: scale(1);
  width: auto;
  max-width: none;
  padding: 0 14px;
  border-radius: 18px;
  gap: 6px;
  background: #1e1b2b;
  color: #f5f4f8;
  box-shadow: 0 6px 16px rgb(30 27 43/0.35);
}
.icon-chip .copy-label {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
/* expand button: circular, top-right, appears on tile hover, own elevation on its own hover ----
   36×36px everywhere it's used, no border, plain white fill, dark icon regardless of theme */
.icon-chip {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  background: #ffffff;
  color: #1e1b2b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 10px 34px 2px rgb(30 27 43/0.08);
  transition:
    opacity 0.3s var(--ease-smooth),
    transform 0.3s var(--ease-smooth),
    box-shadow 0.25s ease,
    background-color 0.25s ease,
    color 0.25s ease;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
@media (max-width: 640px) {
  .btn {
    height: 38px;
    padding: 0 14px;
  }
}
:root[data-theme="dark"] .icon-chip.copied {
  background: var(--accent);
  color: #ffffff;
}
/* buttons: the fill or border changes on hover, not just position */
.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}
:root[data-theme="dark"] .btn-primary:hover {
  background: #7c5fe6;
  border-color: #7c5fe6;
}
/* ---- Floating controls: brand, theme switch and filter tabs ---- */
.theme-sw:focus-visible {
  box-shadow:
    0 0 0 3px #ffffff,
    0 0 0 6px var(--ink),
    0 10px 34px 2px rgb(30 27 43/0.08);
}
/* the filter menu: floats like the theme switch (same 46px height, same top line), frosted glass,
   16px labels whose colour flips to stay readable over whatever scrolls beneath it */
.tabs {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 46px;
  padding: 0 5px;
  border-radius: 999px;
  width: max-content;
  margin: 0;
  background: rgb(255 255 255/0.42);
  border: 1px solid rgb(255 255 255/0.55);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 10px 34px 2px rgb(30 27 43/0.1);
  transition:
    background-color 0.35s ease,
    border-color 0.35s ease;
}
@media (max-width: 640px) {
  .tabs {
    left: 12px;
    transform: none;
    padding: 0 4px;
  }
}
/* calmer page: seasonal meadow, its switcher and the click ripple are switched off */
/* the season scenery follows today's date; no switcher */
/* brand wordmark: pure type, top-left on desktop, bottom-left on phones */
.brand {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 30;
  height: 46px;
  display: flex;
  align-items: center;
  padding: 0 18px 0 16px;
  border-radius: 999px;
  text-decoration: none;
  color: #1e1b2b;
  /* same frosted glass as the menu and the day/night switch */
  background: rgb(255 255 255/0.42);
  border: 1px solid rgb(255 255 255/0.55);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 10px 34px 2px rgb(30 27 43/0.1);
  transition:
    background-color 0.35s ease,
    border-color 0.35s ease,
    color 0.35s ease,
    transform 0.3s var(--ease-smooth);
}
.brand:hover {
  transform: translateY(-1px);
}
.brand-word {
  font:
    600 12.5px/0.92 "Inter Tight",
    "Helvetica Neue",
    Arial,
    sans-serif;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  white-space: nowrap;
}
.brand-word > span {
  display: flex;
  align-items: baseline;
}
.brand-word em {
  font-style: normal;
  font-weight: 500;
  color: var(--accent-text);
  margin: 0 1px 0 0;
}
@media (max-width: 860px) {
  .brand-word {
    font-size: 12px;
  }
}
.brand-oni {
  position: relative;
  top: 0;
  font-size: 16px;
  width: 19px;
  height: 17px;
  margin-right: 6px;
  flex-shrink: 0;
  transition: transform 0.35s var(--ease-spring);
}
.brand:hover .brand-oni {
  transform: rotate(-10deg) translateY(-2px);
}
/* phones: no room beside the filter tabs, and floating at the bottom it covered the tiles,
   so the logo shows only over an open case study (see case-study.css) */
@media (max-width: 640px) {
  html:not(.case-open) .brand {
    display: none;
  }
}
.tlabel i {
  grid-area: 1/1;
  font-style: normal;
  white-space: nowrap;
  transition:
    opacity 0.42s ease,
    transform 0.6s var(--ease-spring);
}
.tlabel .n {
  opacity: 0;
  transform: translateY(12px);
}
@media (prefers-reduced-motion: reduce) {
  .tlabel i {
    transition-duration: 0.01ms !important;
  }
}
.theme-sw .rays line {
  transition: opacity 0.3s ease;
}
.tabs button {
  border: 0;
  background: none;
  border-radius: 999px;
  padding: 0 16px;
  height: 36px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #1e1b2b;
  cursor: var(--cur);
  transition:
    background-color 0.25s ease,
    color 0.35s ease;
}
.tabs button:not([aria-pressed="true"]):hover {
  background: var(--bg2);
  color: var(--accent);
}
.tabs button[aria-pressed="true"] {
  background: #ffffff;
  color: var(--accent-strong);
  box-shadow:
    0 0 0 1px rgb(106 75 216/0.3),
    0 2px 8px rgb(74 48 176/0.12);
}
/* over dark content (dark theme, dark tiles, case-study covers): darker glass, light labels */
.tabs.on-dark {
  background: rgb(19 17 26/0.38);
  border-color: rgb(255 255 255/0.14);
}
.tabs button.on-dark {
  color: #f4f2fa;
}
/* over dark content and in dark mode: deep violet selection, soft lavender hover */
.tabs button.on-dark:not([aria-pressed="true"]):hover {
  background: rgb(214 204 250/0.12);
  color: #c9b8ff;
}
.tabs button.on-dark[aria-pressed="true"] {
  background: #3a3060;
  color: #e4dcfb;
}
:root[data-theme="dark"] .tabs button:not([aria-pressed="true"]):hover {
  background: rgb(214 204 250/0.12);
  color: #c9b8ff;
}
:root[data-theme="dark"] .tabs button[aria-pressed="true"] {
  background: #3a3060;
  color: #e4dcfb;
}
@media (max-width: 640px) {
  .tabs button {
    padding: 0 11px;
  }
}
.brand.on-dark {
  background: rgb(19 17 26/0.38);
  border-color: rgb(255 255 255/0.14);
  color: #f4f2fa;
}
.brand.on-dark .brand-word em {
  color: #d6ccfa;
}
:root[data-theme="dark"] .brand {
  color: #f4f2fa;
  background: rgb(19 17 26/0.38);
  border-color: rgb(255 255 255/0.14);
}
:root[data-theme="dark"] .brand-word em {
  color: #d6ccfa;
}
.theme-sw.on-dark {
  background: rgb(19 17 26/0.38);
  border-color: rgb(255 255 255/0.14);
  color: #f4f2fa;
}
.theme-sw:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px 3px rgb(30 27 43/0.18);
}
.theme-sw:active {
  transform: translateY(-1px) scale(0.96);
}
.theme-sw svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.theme-sw.is-dark .tlabel .d {
  opacity: 0;
  transform: translateY(-12px);
}
.theme-sw.is-dark .tlabel .n {
  opacity: 1;
  transform: none;
}
/* sun ⇄ moon: the disc grows, a bite slides in to carve the crescent, the rays spin away */
.theme-sw .cut {
  fill: #000;
  transform: translate(9px, -9px);
  transition: transform 0.6s var(--ease-spring);
}
.theme-sw .core {
  fill: currentColor;
  transform-origin: 12px 12px;
  transition: transform 0.6s var(--ease-spring);
}
.theme-sw .rays {
  transform-origin: 12px 12px;
  transition:
    transform 0.6s var(--ease-spring),
    opacity 0.32s ease;
}
.theme-sw.is-dark .cut {
  transform: translate(4.6px, -3.6px);
}
.theme-sw.is-dark .core {
  transform: scale(1.14);
}
.theme-sw.is-dark .rays {
  transform: rotate(-70deg) scale(0.35);
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .theme-sw .cut,
  .theme-sw .core,
  .theme-sw .rays {
    transition-duration: 0.01ms !important;
  }
}
.theme-sw {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 30;
  height: 46px;
  border-radius: 999px;
  padding: 0 13px 0 17px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  gap: 11px;
  /* same frosted glass as the filter menu; text and icon flip light/dark with what is behind it */
  background: rgb(255 255 255/0.42);
  border: 1px solid rgb(255 255 255/0.55);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  color: #1e1b2b;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 34px 2px rgb(30 27 43/0.1);
  transition:
    transform 0.3s var(--ease-smooth),
    box-shadow 0.3s ease,
    background-color 0.35s ease,
    border-color 0.35s ease,
    color 0.35s ease;
}
/* both words live in the same grid cell, so the pill never resizes and they cross-fade in place */
.tlabel {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 12px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1;
  color: inherit;
}
@media (max-width: 720px) {
  .theme-sw {
    padding: 0;
    width: 46px;
    border-radius: 50%;
    gap: 0;
  }
  .tlabel {
    display: none;
  }
}
/* selected filter: a hairline keeps the white pill visible over light content */
.tabs button.on-dark[aria-pressed="true"],
:root[data-theme="dark"] .tabs button[aria-pressed="true"] {
  box-shadow: none;
}
/* the selected pill in the filter tabs and the reading switch: one shape that slides to the
   chosen option instead of jumping (the buttons themselves stay transparent) */
.seg-thumb {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 999px;
  background: #ffffff;
  box-shadow:
    0 0 0 1px rgb(106 75 216/0.3),
    0 2px 8px rgb(74 48 176/0.12);
  pointer-events: none;
  transition:
    transform 0.38s cubic-bezier(0.3, 0.8, 0.25, 1),
    width 0.38s cubic-bezier(0.3, 0.8, 0.25, 1),
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}
.seg-thumb.on-dark,
:root[data-theme="dark"] .seg-thumb {
  background: #3a3060;
  box-shadow: none;
}
