@font-face {
  font-family: "Onest";
  src: url("/assets/fonts/Onest-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* Interpolate shared palette colors without changing component motion. */
@property --page-background {
  syntax: "<color>";
  inherits: true;
  initial-value: #171716;
}

@property --surface {
  syntax: "<color>";
  inherits: true;
  initial-value: #242321;
}

@property --surface-raised {
  syntax: "<color>";
  inherits: true;
  initial-value: #2e2c29;
}

@property --text {
  syntax: "<color>";
  inherits: true;
  initial-value: #faf9f8;
}

@property --gray {
  syntax: "<color>";
  inherits: true;
  initial-value: #aaa7a3;
}

@property --line {
  syntax: "<color>";
  inherits: true;
  initial-value: #3d3a36;
}

@property --hover-fill {
  syntax: "<color>";
  inherits: true;
  initial-value: #2a2825;
}

@property --green {
  syntax: "<color>";
  inherits: true;
  initial-value: #99c6a6;
}

@property --focus {
  syntax: "<color>";
  inherits: true;
  initial-value: #dec5a2;
}

@property --body-text {
  syntax: "<color>";
  inherits: true;
  initial-value: #c3bfba;
}

@property --control-hover {
  syntax: "<color>";
  inherits: true;
  initial-value: #ffffff0d;
}

@property --control-hover-stroke {
  syntax: "<color>";
  inherits: true;
  initial-value: #ffffff12;
}

@property --control-active {
  syntax: "<color>";
  inherits: true;
  initial-value: #45413c;
}

@property --subtle-fill {
  syntax: "<color>";
  inherits: true;
  initial-value: #ffffff12;
}

@property --arrow-border {
  syntax: "<color>";
  inherits: true;
  initial-value: #ffffff26;
}

@property --close-background {
  syntax: "<color>";
  inherits: true;
  initial-value: #2e2c29e6;
}

@property --loader-low {
  syntax: "<color>";
  inherits: true;
  initial-value: #272522;
}

@property --loader-high {
  syntax: "<color>";
  inherits: true;
  initial-value: #34312c;
}

@property --error-text {
  syntax: "<color>";
  inherits: true;
  initial-value: #ff9a8f;
}

@property --segment-fill {
  syntax: "<color>";
  inherits: true;
  initial-value: #2b2926;
}

@property --segment-selected-fill {
  syntax: "<color>";
  inherits: true;
  initial-value: #4b4843;
}

@property --segment-text {
  syntax: "<color>";
  inherits: true;
  initial-value: #b7b3ad;
}

@property --segment-selected-text {
  syntax: "<color>";
  inherits: true;
  initial-value: #faf9f8;
}

@property --segment-hover {
  syntax: "<color>";
  inherits: true;
  initial-value: #ffffff08;
}

:root {
  --font-sans: "Onest", Helvetica, Arial, sans-serif;
  font-family: var(--font-sans);
  color-scheme: dark;
  --page-background: #171716;
  --surface: #242321;
  --surface-raised: #2e2c29;
  --text: #faf9f8;
  --gray: #aaa7a3;
  --line: #3d3a36;
  --hover-fill: #2a2825;
  --green: #99c6a6;
  --focus: #dec5a2;
  --body-text: #c3bfba;
  --control-hover: #ffffff0d;
  --control-hover-stroke: #ffffff12;
  --control-active: #45413c;
  --subtle-fill: #ffffff12;
  --arrow-border: #ffffff26;
  --close-background: #2e2c29e6;
  --loader-low: #272522;
  --loader-high: #34312c;
  --error-text: #ff9a8f;
  --segment-fill: #2b2926;
  --segment-selected-fill: #4b4843;
  --segment-text: #b7b3ad;
  --segment-selected-text: #faf9f8;
  --segment-hover: #ffffff08;
  --segment-shadow: 0 1px 3px #00000026;
  --control-dark-fill: linear-gradient(180deg, #45413c, #37342f);
  --control-dark-stroke: linear-gradient(180deg, #635e56, #45413b);
  --control-dark-shadow: 0 0 0 1px #121211, 0 2px 4px #0003;
  --control-dark-pressed-shadow: inset 0 1px 3px #0005;
  --control-light-fill: linear-gradient(180deg, #2e2b27, #25231f);
  --control-light-pressed-fill: linear-gradient(180deg, #24221e, #2c2925);
  --control-light-stroke: linear-gradient(180deg, #45413a, #35312c);
  --control-light-shadow: 0 0 0 1px #111110, 0 2px 4px #0003;
  --control-light-pressed-shadow: inset 0 1px 3px #0005;
  --control-switcher-fill: linear-gradient(180deg, #252320, #252320);
  color: var(--text);
  background: var(--page-background);
}

:root[data-theme="light"] {
  color-scheme: light;
  --page-background: #ffffff;
  --surface: #f3f2ef;
  --surface-raised: #eae8e4;
  --text: #171716;
  --gray: #686560;
  --line: #dcd9d3;
  --hover-fill: #f2f0ec;
  --green: #087a3e;
  --focus: #8a4b00;
  --body-text: #4d4b46;
  --control-hover: #0000000a;
  --control-hover-stroke: #00000014;
  --control-active: #eae8e4;
  --subtle-fill: #0000000a;
  --arrow-border: #00000026;
  --close-background: #ffffffe6;
  --loader-low: #eeeeee;
  --loader-high: #f7f7f7;
  --error-text: #b42318;
  --segment-fill: #efeeeb;
  --segment-selected-fill: #ffffff;
  --segment-text: #6f6b65;
  --segment-selected-text: #25231f;
  --segment-hover: #00000005;
  --segment-shadow: 0 1px 3px #00000014, 0 0 0 1px #00000004;
  --control-dark-fill: linear-gradient(180deg, #201e25, #323137);
  --control-dark-stroke: linear-gradient(180deg, #4b4951, #313036);
  --control-dark-shadow: 0 0 0 1px #0d0d0d, 0 2px 4px #0000001a;
  --control-dark-pressed-shadow: inset 0 1px 2px #0000004d;
  --control-light-fill: linear-gradient(180deg, #f3f3f3, #e8e8e8);
  --control-light-pressed-fill: linear-gradient(180deg, #e7e7e7, #ececec);
  --control-light-stroke: linear-gradient(180deg, #ffffff, #ffffff00);
  --control-light-shadow: 0 0 0 1px #0000001a, 0 2px 4px #0000001a;
  --control-light-pressed-shadow: inset 0 1px 2px #0000001f;
  --control-switcher-fill: linear-gradient(180deg, #ffffff, #ffffff);
}

:root[data-theme-ready="true"] {
  transition:
    --page-background 360ms ease,
    --surface 360ms ease,
    --surface-raised 360ms ease,
    --text 360ms ease,
    --gray 360ms ease,
    --line 360ms ease,
    --hover-fill 360ms ease,
    --green 360ms ease,
    --focus 360ms ease,
    --body-text 360ms ease,
    --control-hover 360ms ease,
    --control-hover-stroke 360ms ease,
    --control-active 360ms ease,
    --subtle-fill 360ms ease,
    --arrow-border 360ms ease,
    --close-background 360ms ease,
    --loader-low 360ms ease,
    --loader-high 360ms ease,
    --error-text 360ms ease,
    --segment-fill 360ms ease,
    --segment-selected-fill 360ms ease,
    --segment-text 360ms ease,
    --segment-selected-text 360ms ease,
    --segment-hover 360ms ease;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  animation: language-fade-in 240ms ease both;
  mix-blend-mode: normal;
}

@keyframes language-fade-in {
  from { opacity: 0; }
}

.theme-switcher {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 999px;
  background:
    var(--control-switcher-fill) padding-box,
    var(--control-light-stroke) border-box;
  box-shadow: var(--control-light-shadow);
  font: 400 12px/1 var(--font-sans, Helvetica, Arial, sans-serif);
}

.theme-switcher button {
  appearance: none;
  display: inline-flex;
  width: var(--control-height, 28px);
  height: var(--control-height, 28px);
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--gray);
  cursor: pointer;
  font: inherit;
}

.theme-switcher svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  pointer-events: none;
}

.theme-switcher button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .theme-switcher {
    --control-height: 34px;
  }
}

.case-page-header {
  flex-wrap: wrap;
  gap: 16px 24px;
}

html,
body,
.home-loader,
.project-sheet {
  background: var(--page-background);
  color: var(--text);
}

::selection {
  color: #171716;
}

.pill-link,
.language-switcher button,
.project-view-toggle,
.is-grid .gallery-card {
  color: var(--text);
}

:root:not([data-theme="light"]) .pill-link.is-accent.is-download {
  background: var(--text);
  color: var(--page-background);
  box-shadow: 0 1px 3px #00000026;
}

@media (hover: hover) and (pointer: fine) {
  :root:not([data-theme="light"]) .pill-link.is-accent.is-download:hover {
    box-shadow: 0 0 0 3px var(--subtle-fill), 0 2px 4px #00000026;
  }
}

:root:not([data-theme="light"]) .pill-link.is-accent.is-download:not([aria-disabled="true"]):active {
  background: var(--body-text);
  box-shadow: inset 0 1px 2px #00000026;
}

.pill-link:focus-visible,
.language-switcher button:focus-visible,
.project-view-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  .language-switcher button:not([aria-pressed="true"]):hover,
  .project-view-toggle:not([aria-pressed="true"]):hover {
    background: var(--control-hover);
    box-shadow: inset 0 0 0 1px var(--control-hover-stroke);
  }
}

/* Flat segmented controls share one quiet selected state in both palettes. */
.language-switcher,
.project-view-switcher,
.theme-switcher {
  border-radius: 10px;
  background: var(--segment-fill);
  box-shadow: none;
  backdrop-filter: none;
}

:is(.language-switcher, .project-view-switcher, .theme-switcher) button {
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  color: var(--segment-text);
}

:is(.language-switcher, .project-view-switcher, .theme-switcher) button:not([aria-pressed="true"]):is(:hover, :active) {
  background: var(--segment-hover);
  box-shadow: none;
  color: var(--text);
}

:is(.language-switcher, .project-view-switcher, .theme-switcher) button:is([aria-pressed="true"], .is-active),
:is(.language-switcher, .project-view-switcher, .theme-switcher) button:is([aria-pressed="true"], .is-active):is(:hover, :active),
.pill-link:not(.is-accent),
.pill-link:not(.is-accent):not([aria-disabled="true"]):is(:hover, :active) {
  background: var(--segment-selected-fill);
  box-shadow: var(--segment-shadow);
  color: var(--segment-selected-text);
}

:root[data-theme="light"] .pill-link:not(.is-accent) {
  border-color: var(--line);
}

a.project-row.work-row:is(:hover, :focus-visible, :active, .is-project-hovered) .project-link-chevron {
  color: var(--text);
}

.gallery-cover,
.home-loader-work-row,
.recommendation-card,
.case-screen-stage,
.drawer-cover :is(img, video) {
  background: var(--surface);
}

.gallery-arrow {
  border-color: var(--arrow-border);
}

.is-grid a.gallery-card:is(:hover, :focus-visible) .gallery-arrow,
.case-external-link {
  border-color: var(--text);
  background: var(--text);
  color: var(--page-background);
}

.case-external-link:hover {
  background: transparent;
  color: var(--text);
}

.project-close {
  border-color: var(--line);
  background: var(--close-background);
  color: var(--text);
}

.project-close:hover {
  background: var(--text);
  color: var(--page-background);
}

.case-block--text p,
.case-column p {
  color: var(--body-text);
}

.case-media-caption {
  color: var(--gray);
}

a.recommendation-card:hover {
  background: var(--surface-raised);
  color: var(--text);
}

a.recommendation-card:hover .recommendation-product,
a.recommendation-card:hover .recommendation-status {
  color: var(--gray);
}

.loader-shimmer {
  background: linear-gradient(90deg, var(--loader-low), var(--loader-high) 48%, var(--loader-low));
  background-size: 220% 100%;
}

/* Direct case URLs use the same palette as cases opened over the gallery. */
.case-page-header,
.case-external,
.case-more {
  border-color: var(--line);
}

.case-eyebrow,
.case-soon {
  color: var(--gray);
}

.portfolio-screen-stage,
.portfolio-case-cover :is(img, video) {
  background: var(--surface);
}

/* Review tools share the portfolio's selected palette. */
.portfolio-comments-ui,
.portfolio-comment-card > p {
  color: var(--text);
}

.portfolio-comment-launcher,
.portfolio-comment-card,
.portfolio-comment-composer,
.portfolio-comment-hint,
.portfolio-comment-mode-hint,
.portfolio-comment-toast:not(.is-error) {
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--text);
}

.portfolio-comment-launcher:is(:hover, .is-active) {
  border-color: var(--gray);
  background: var(--control-active);
  color: var(--text);
}

.portfolio-comment-hint::before {
  background: var(--surface-raised);
}

.portfolio-comment-count,
.portfolio-comment-launcher.is-active .portfolio-comment-count,
.portfolio-comment-surface,
.portfolio-comment-card-close:hover {
  background: var(--subtle-fill);
  color: var(--text);
}

.portfolio-comment-card time,
.portfolio-comment-card-close,
.portfolio-comment-hint-close,
.portfolio-comment-mode-hint span {
  color: var(--gray);
}

.portfolio-comment-composer textarea,
.portfolio-comment-cancel {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.portfolio-comment-composer textarea::placeholder {
  color: var(--gray);
}

.portfolio-comment-submit,
.portfolio-comment-hint-action {
  border-color: var(--text);
  background: var(--text);
  color: var(--page-background);
}

.portfolio-comment-composer textarea[aria-invalid="true"] {
  border-color: var(--error-text);
}

.portfolio-comment-form-error {
  color: var(--error-text);
}

.portfolio-comments-ui :is(button, textarea):focus-visible {
  outline-color: var(--focus);
}

@media (prefers-reduced-motion: reduce) {
  :root[data-theme-ready="true"] {
    transition: none;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }

  .loader-shimmer {
    background: var(--loader-low) !important;
  }
}
